1 / 7

Advanced Query Formulation with SQL

Advanced Query Formulation with SQL. Week 10 Quiz Jaymond Huynh Tim Nguyen. Question 1. Which type of join should be used to include no-matching tuples from both tables in the results? Answer: D. A Full-Outer Join should be used to include no-matching tuples from both tables. . Question 2.

maja
Download Presentation

Advanced Query Formulation with SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Query Formulation with SQL Week 10 Quiz Jaymond Huynh Tim Nguyen

  2. Question 1 Which type of join should be used to include no-matching tuples from both tables in the results? Answer: D. A Full-Outer Join should be used to include no-matching tuples from both tables.

  3. Question 2 Which clauses the SELECT statement can have nested queries: Answer: D. All of the above Nested queries can appear in FROM, WHERE, and HAVING clauses. A nested query typically appears as part of a condition in the WHERE and HAVING clauses. However, nested queries can also be used in the FROM clause.

  4. Question 3 Which relational operation is very difficult to represent in SQL without nested queries Answer: C. Division Sql has no direct relational division operator. The only way to get around this is the have nested queries.

  5. Question 4 Type II nested queries are not used for join problems because: Answer: A. Repeated executions make them inefficient for this purpose A Type II nested query executes one time for each row in the outer query.

  6. Question 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: Answer: B. >=M+N gpa > 3 will return the exclusive gpa”s without 3 and eh gpa <=3 will include 3 and all other gpas lower than 3. However, count(name) will only includes values that are not NULL. Not including NULL values will not show the number of rows, but the number of rows that are not NULL.

  7. Question 6 Explain a situation when a full outer join is useful A full outer join can be useful to see relations between all entities. For instance, using a full outer join on two table allows the DBA to see relations between the two tables.

More Related