Hi
I am stuck on 1) and not sure about 2) and 3)
Attachment 9926
1) Display all the columns in Library for those libraries that do not have any associated internships.
2) Display all the columns in Student for those that have more than the average number of placements.
3) Display all the columns in Student for those that have at least one Placement assigned
where the Faculty that is associated with the Placement’s Internship is not the same as the Student’s Faculty advisor.
***My attempts***
1)
2) SELECT Student.*
FROM Student
WHERE (SELECT COUNT(*) FROM Placement
WHERE Placement.s_id= Student.id)>
(SELECT placements/student AS avg_Stud
FROM (SELECT COUNT(i_code) AS placements FROM Placement) AS table1,
(SELECT COUNT(id) AS student
FROM Student)AS table2);
3) SELECT *
FROM Student
WHERE id IN(SELECT i_code FROM Placement
WHERE i_code IN(SELECT id FROM Faculty
WHERE Internship.f_id<>Faculty.id));