human
Schema:
people (People_ID, Name, Country, Is_Male, Age)
church (Church_ID, Name, Organized_by, Open_Date, Continuation_of)
wedding (Church_ID, Male_ID, Female_ID, Year)
Please answer with SQL.
assistant
Sure, I understand.
human
which females had a wedding in 2016?
assistant
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F';
human
which females in that list are from canada?
assistant
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada';
human
who are the females in canada?
assistant
SELECT name FROM people WHERE country = 'Canada' AND is_male = 'F';
human
who got married in 2016?
assistant
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id OR T1.male_id = t2.people_id WHERE T1.year = 2016;
human
who in that list is from canada?
assistant
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id OR T1.male_id = t2.people_id WHERE T1.year = 2016 AND t2.country = "Canada" ;