Download presentation
Presentation is loading. Please wait.
Published byAustin Snow Modified over 9 years ago
1
Week 10 Quiz 9 Answers Group 28 Christine Hallstrom Deena Phadnis
2
1. Which type of join should be used to include no- matching tuples from both tables in the result? Correct Answer: D Inner join returns only matching tuples Left/Right outer join returns matching tuples + no-matching tuples from the left/right table Full outer join returns matching tuples + no- matching tuples from both tables
3
2. Which clauses the SELECT statement can have nested queries: Correct Answer: D Nested queries typically appear in the WHERE or HAVING clauses, but can also be used in the FROM clause (see p. 325 in the text).
4
3. Which relational operation is very difficult to represent in SQL without nested queries: Correct Answer: C To perform an outer join in SQL, one simply needs to use the FULL/LEFT/RIGHT JOIN keyword To perform the Cartesian product on 2 tables in SQL, one simply uses the cross product notation to select the desired column(s) from both tables without any WHERE clause
5
4. Type II nested queries are not used for join problems because Correct Answer: A Type II nested queries are typically used for difference problems, not joins. – However, they are technically capable of representing a join operation.
6
5. How many rows are there in the “student” table, if “select count(name) from student where gpa > 3” returns the number M and “select count(*) from student where gpa <= 3” returns the number N: Correct Answer: B There are the students with GPA > 3 (M), plus the students with GPA <= 3 (N), plus any students that do not have a GPA (i.e., GPA is null). We are assuming that no rows in the student table have null’s for name (every student has a name, right?), and that there is exactly one row for every student.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.