Mostrar os nomes dos alunos que têm uma nota superior a 5 e têm pelo menos 2 amigos.
CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR, grade INTEGER)
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