Context: CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR, grade INTEGER)
Question: Show the names of students who have a grade higher than 5 and have at least 2 friends.
Answer: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING COUNT(*) >= 2