in SQL could someone explain why this wouldn't work and how to correct it Let us consider the following relational database. - Students(stuID, lastName, firstName, major, credits) - Faculty(facID, name, deptName, rank) - Classes(classNumber, facID, schedule, room) - Enrolls(stuID, classNumber, grade) The primary keys are underlined. The referential integrity constraints are as follows: - the column facID of relation Classes that references table Faculty, - the column stuID of relation Enrolls that references table Students, and - the column classNumber of relation Enrolls that references table Classes. The following query is intended to retrieve the number of departments that have faculty in them. However, this query does not work properly. Briefly explain why: and show the corrected SQL query SELECT COUNT (DISTINCT deptName) FROM Faculty;.
in SQL could someone explain why this wouldn't work and how to correct it Let us consider the following relational database. - Students(stuID, lastName, firstName, major, credits) - Faculty(facID, name, deptName, rank) - Classes(classNumber, facID, schedule, room) - Enrolls(stuID, classNumber, grade) The primary keys are underlined. The referential integrity constraints are as follows: - the column facID of relation Classes that references table Faculty, - the column stuID of relation Enrolls that references table Students, and - the column classNumber of relation Enrolls that references table Classes. The following query is intended to retrieve the number of departments that have faculty in them. However, this query does not work properly. Briefly explain why: and show the corrected SQL query SELECT COUNT (DISTINCT deptName) FROM Faculty;.