Question: Show name of all students who have some friends and also are liked by someone else.
Schema: create table highschooler (name varchar, id varchar, PRIMARY KEY (name)); create table likes (student_id varchar, liked_id varchar, PRIMARY KEY (student_id)); create table friend (student_id varchar, liked_id varchar, PRIMARY KEY (student_id))
SQL: select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id intersect select t2.name from likes as t1 join highschooler as t2 on t1.liked_id = t2.id