Question: Find the ids of the students who participate in Canoeing and Kayaking.
Schema: create table activity (actid varchar, activity_name varchar, PRIMARY KEY (actid)); create table participates_in (stuid varchar, PRIMARY KEY (stuid))
SQL: select t1.stuid from participates_in as t1 join activity as t2 on t2.actid = t2.actid where t2.activity_name = 'canoeing' intersect select t1.stuid from participates_in as t1 join activity as t2 on t2.actid = t2.actid where t2.activity_name = 'kayaking'