-- Select wordpairs, here for transcription orthography 2
-- and definition orthography 2 (finnish)
-- 
-- Other transcription and definition orthographies exist

SELECT DISTINCT *
FROM `ilmentyma`
LEFT JOIN `lekseemi`
ON (
    `ilmentyma`.lekseemi_id = `lekseemi`.id
)
LEFT JOIN `merkitys`
ON (
    `lekseemi`.id = `merkitys`.lekseemi_id
)
WHERE (
    `ilmentyma`.`ortognro` = 2 AND
    `merkitys`.`ortognro` = 2
) ; 

-- Looking at output, it seems like there are some mismatches; sometimes 
-- some Uralic transcription shows up in ilmentyma with ortognro 2, and
-- some english shows up in merkitys with ortognro 2. However, 
-- these seem to be accompanied by `merkitys`.aakk = True, and ID
-- `ilmentyma`.id greater than 100000

-- Why does aakk have true sometimes, and an integer otherwise? Foreign key to
-- something?  Other things, `ilmentyma`.varmennettu 1 seems to result in
-- cleaner data, though 0 appears to have valid word pairs. Maybe we'll need to
-- get database dumps periodically from KOTUS as they update things.

