Refer to Figure II Write the SQL statement for the following: Write a SQL query
ID: 658867 • Letter: R
Question
Refer to Figure II
Write the SQL statement for the following:
Write a SQL query to find the number of female enrollments in each department. The same woman signing up for two different courses in the same department counts as two separate enrollments. The query should show the name of each department and its number of female enrollments, and it should be sorted from largest to smallest number of enrollments, largest first.
Explanation / Answer
SELECT COURSES.DEPARTMENT, STUDENTS.SEX
FROM COURSES, STUDENTS
WHERE STUDENTS.SEX="F"
GROUP BY COURSES.DEPARTMENT,
ORDER BY STUDENTS.SEX DESC;