SQL chapter 4 As you do the exercises, unless it is stated otherwise, you will b
ID: 3905946 • Letter: S
Question
SQL chapter 4
As you do the exercises, unless it is stated otherwise, you will be using the tables from our standard Student- Course database. Also, as you do the exercises, it will be a good idea to copy/paste your query as well as your query result into a word processor.
4-1. Display the COUNT of rows in each of the tables: Grade_report, Student, and Section. How many rows would you expect in the Cartesian product of all three tables? Display the COUNT (not the resulting rows) of the Cartesian product of all three and verify your result. Use SELECT COUNT(*) ...
Explanation / Answer
1. SELECT COUNT(*) FROM Grade_report;
2. SELECT COUNT(*) FROM Student;
3. SELECT COUNT(*) FROM Section;
4. SELECT COUNT(*) FROM Grade_report CROSS JOIN Student CROSS JOIN Section;
Suppose the queries 1, 2 and 3 return a, b and c, respectively. Then, query 4 will return a * b * c.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.