Q9

pdf

School

Georgia Gwinnett College *

*We aren’t endorsed by this school

Course

4200

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

6

Uploaded by jam_1415

Report
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College Quiz Submissions - QUIZ BOWL CHAPTER 9 X Jamaima Endres (username: jendres) Attempt 6 Written: Nov 4, 2020 4:57 PM - Nov 4, 2020 4:58 PM Submission View Your quiz has been submitted successfully. Question 1 1/ 1 point Which comparison operator(s) can be used with multiple-row subqueries (select all that apply): v |IN v > v (PANY v |ALL W Hide Feedback > may not be used since multiple values are returned. How can something be greater than a set of values? It doesn't make sense. Question 2 1/ 1 point When will the subquery be executed in the following statement: SELECT o.customer _id, o.customer Name FROM customers o WHERE o.credit_limit > (SELECT AVG(i.credit_limit) FROM customers i WHERE o.category = i.category); It will be executed prior to the main query It will be executed after the main query https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d21?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&romQB=0&ou... 1/6
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College It will be executed concurrently with the main query v It will be executed once for every candidate row in the main query W Hide Feedback Because the subquery references a column in the main, or outer query, it is called a correlated subquery. It will be executed once for every candidate row in the main query. Question 3 1/1 point What is the purpose of the following query? SELECT title FROM books WHERE (pub_id, category) IN (SELECT pub_id, category FROM books WHERE title LIKE '%ORACLE%"); ) It determines which publisher published a book belonging to the ORACLE category and then lists all other books published by that same publisher. It lists all publishers and categories containing the value ORACLE. v It lists the title of all books having the same publisher and category as any book with the word ORACLE in the title. It will return an error, since the query contains a multiple-row operator, and because the subquery returns only one value. Question 4 1/ 1 point Which one of the following operators is considered a single-row operation? > ALL https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d21?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&fromQB=0&ou... 2/6
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College W Hide Feedback The only single-row operator would be not equal (<>). Question 5 1/ 1 point A subquery that includes references back to the parent (or main) query, and thus cannot execute as a standalone query is a ____ subquery. scalar v correlated multi-row multi-column D View Feedback Question 6 1/ 1 point A subquery must be placed in the outer query's HAVING clause if: The inner query needs to reference the value returned to the outer query. v The value returned by the inner query is to be compared to grouped data in the outer guery. The subquery returns more than one value to the outer query. None of the choices. Subqueries can't be used in the outer query's HAVING clause. Question 7 1/ 1 point What operator would you choose to prevent this Oracle error message: ORA-01427: single-row subquery returns more than one row https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d2I?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&fromQB=0&ou... 3/6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College <= Vv IN <> Question 8 1/ 1 point Which query identifies customer(s) living in the same state as the customer named LISA SMITH? SELECT customer# FROM customers WHERE state = (SELECT state FROM customers WHERE lastname = 'SMITH'); SELECT customer# FROM customers WHERE state IN (SELECT state FROM customers WHERE firstname = 'LISA' OR lastname = 'SMITH' ORDER BY customer#); SELECT customer# FROM customers WHERE state = (SELECT state FROM ustomers WHERE firstname = 'LISA' AND lastname = 'SMITH'); v ) SELECT customer# FROM customers WHERE state IN (SELECT state FROM customers WHERE firsthame = 'LISA' AND lastname = 'SMITH' ); Hide Feedback The query must specify the firstname AND lastname. The subquery cannot contain an ORDER BY. Question 9 1/ 1 point https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d21?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&fromQB=0&ou... 4/6
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College Which type of subquery will execute once for each value in the result set of the outer (main) query? single-row subquery mulitple-row subquery Vv correlated subquery O'Leary subquery Question 10 1/ 1 point What is wrong with the following statement: SELECT last_name, employee_id FROM employees WHERE salary = (SELECT salary FROM employees); Nothing, it will run without any errors. . The statement will fail because the subquery in the SELECT list references a table that is not in the FROM clause on the main query v The statement will fail if the subquery returns more than one value. The statement will run but will be extremely inefficient because of the need to run the second subqguery once for every candidate row in the employees table. W Hide Feedback The equality operator requires a single-row subquery, and the second subquery could possibly return many rows. Attempt Score: 10/ 10-100 % Overall Grade (highest attempt): 10/ 10- 100 % https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d21?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&fromQB=0&ou... 5/6
1/15/2021 : Quiz Submissions - QUIZ BOWL CHAPTER 9 - Advanced Databases Section 01 Fall 2020 CO - Georgia Gwinnett College Done https://ggc.view.usg.edu/d2l/Ims/quizzing/user/quiz_submissions_attempt.d21?isprv=&qi=2643435&ai=33490959&isInPopup=0&cfql=0&fromQB=0&ou... 6/6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help