Middle+
table student id PK name faculty_id table faculty id PK name SELECT f.name FROM faculty f JOIN student s ON s.faculty_id = f.id GROUP BY f.id, f.name ORDER BY COUNT(s.id) DESC LIMIT 1;
sobes.tech AI
Answer from AI
This SQL query selects the name of the faculty with the maximum number of students. It performs an INNER JOIN of the faculty and student tables on faculty_id, groups the result by faculty, sorts by the number of students in descending order, and then limits the result to one — the faculty with the largest number of students.
Example of the result: if the "Informatics" faculty has 50 students, and "Mathematics" has 30, the query will return "Informatics".
Such a query is useful for identifying the most popular faculty by student count.