SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
What is the average grade of students who have friends?
SELECT avg ( grade ) FROM Highschooler WHERE id IN ( SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id )
select avg ( grade ) from highschooler where id in ( select t1 . student_id from friend as t1 join highschooler as t2 on t1 . student_id = t2 . id )
What is the average grade of students who have friends ?