Tutorial 7 - Questions
Tutorial 7 - Questions
Q2. How many rows are returned by this query if there are NO rows in the MOVIE table?
SELECT COUNT(*)
FROM MOVIE
Q3. How many rows would you expect are returned by this query?
SELECT GENDER, COUNT(*)
FROM ACTOR
GROUP BY GENDER
Q5. This statement will execute perfectly. Why is this statement next to useless?
SELECT COUNT(*)
FROM ACTOR
GROUP BY BIRTHCOUNTRY
Q7. Provide a couple of example rows for the result set produced by this statement.
SELECT BIRTHCOUNTRY, GENDER, COUNT(*)
FROM ACTOR
Q10. Write a single SQL statement that counts the total number of students
Q11. Write a single SQL statement that counts the total number of students that are female
Q12. Write a single SQL statement that counts the total number of students of each gender Hint:
Use a group by clause
Q13. Write a single SQL statement that counts the total number of students of each degree Hint:
Use a group by clause
Q14. Write a single SQL statement that counts the total number of students of each degree.
Does not list any total values less than 2
Hint: Use a Having clause
Q15. Write a single SQL statement that calculates the average number of subjects passed by each
Degree.
Only include Female students (ignore all males)
Does not list any total values less than 3
Hint: Use a Where, Group By and Having clause
Q16. Consider the following ERD
EmpNo TaskNo
EmployeeName Description
HouseNo
BuilderCode
SuburbName StreetName
BuilderName
DateBuilt
Population
built by
SUBURB has HOUSE BUILDER