Question: Assume you have been asked to write and execute a query to retrieve the list of ALL departments and the number of sections offered in
Assume you have been asked to write and execute a query to retrieve the list of ALL departments and the number of sections offered in a university semester for each department. If a department has not offered any section this semester, the department should appear in the list with the number
For each of the following SQL statements, state "Yes" if it retrieves the information requested and No if otherwise.
SELECT DCode,DName, COUNTsSectId as Sections FROM Department d JOIN Course c on dDCode cDepartment
JOIN Section s on cCoCode sCourse WHERE sSemester OR sSemester is NULL
GROUP BY DCode;
SELECT DCode,DName, COUNTsSectId as Sections FROM Department d LEFT JOIN Course c on dDCode cDepartment
LEFT JOIN Section s on cCoCode sCourse WHERE sSemester OR sSemester is NULL
GROUP BY DCode;
SELECT DCode,DName, COUNTsSectId as Sections FROM Department d LEFT JOIN Course c on dDCode cDepartment
LEFT JOIN Section s on cCoCode sCourse WHERE sSemester
GROUP BY DCode;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
