Oracle 12c: SQL - Chapter 12

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A group function cannot be included in the SELECT clause of a single-row subquery.

False

A multiple-column subquery cannot be nested in a WHERE clause.

False

A subquery can only be nested in the WHERE or HAVING clause of the outer query.

False

A subquery is required when the condition for the *inner* query is based upon an unknown.

False

A subquery nested in a WHERE clause can only be on the *left* side of the comparison operator.

False

A(n) *uncorrelated* subquery is when the outer query is executed first, then the inner query is executed.

False

Single-row operators can be used with multiple-row subqueries that return only one column of results.

False

The greater than operator, >, is a valid operator for *multiple-row* subqueries.

False

Valid *multiple-row* operators include =, >, =, <=.

False

A correlated subquery is a subquery that is executed once for each row in the outer query.

True

A correlated subquery references one or more columns in the outer query, and the EXISTS operator is used to test whether the relationship or link is present.

True

A group function can be used in a(n) *inline view*.

True

A multiple-row subquery can be nested in a HAVING clause.

True

A subquery is required when the condition for the outer query is based upon an unknown.

True

A subquery nested in a SELECT clause cannot contain an ORDER BY clause.

True

A(n) *correlated* subquery references one or more columns from the outer query.

True

A(n) *outer* query is also referred to as a parent query.

True

If a subquery is nested in a HAVING clause, the subquery must be on the right side of the comparison operator.

True

In Oracle12c, a MERGE statement compares data between two tables and can perform a series of DML actions to assist in synchronizing the data of the two tables.

True

Multiple-row subqueries are nested queries that can return more than one row of results to the parent query.

True

The *=ANY* operator yields the same results as using the IN multiple-row operator.

True

The <ALL operator indicates that for a value to be included in the results, it must be less than the lowest value returned by the subquery.

True

The equal sign, =, is a valid single-row operator.

True

When the subquery is executed first and the value is passed back as input to the outer query, the subquery is known as an uncorrelated subquery.

True

When used with a multiple-row subquery, the IN operator indicates that the records processed by the outer query must match one of the values returned by the subquery.

True

A complete query nested inside another query is called a(n) ____

subquery

Which operator will instruct Oracle12c to list all records with a value that is more than the highest value returned by the subquery?

​>ALL

Which clause is used when the group results of a subquery need to be restricted, based on some condition?

​HAVING

If it is possible for a subquery to return a NULL value to the outer query for comparison, the ____ function should be used to substitute an actual value for the NULL.

​NVL

Based on the contents of the CUSTOMERS table, which of the following SQL statements will display the customer# of all customers who were referred by the same individual that referred customer# 1003?

​SELECT customer# FROM customers WHERE NVL(referred, 0) = (SELECT NVL(referred,0) FROM customers WHERE customer# = 1003);

Based on the contents of the CUSTOMERS table, which SQL statement will display the customers residing in the same state as customer#1013?

​SELECT customer# FROM customers WHERE state = (SELECT state FROM customers WHERE customer#=1013);

Based upon the contents of the CUSTOMERS table, which of the following would be the most appropriate use of a subquery?

​When searching for all customers who live in the same state as customer# 1007. >

Any type of subquery can be used in the ____ clause of a SELECT statement.

​all of the above

Which of the following can be used in a WHERE clause?

​all of the above

A subquery must include a(n) ____ clause.

​both a and b

Which of the following terms refers to a type of subquery that is processed, or executed, once for each row in the outer query?

​correlated subquery

A temporary table that is created when a multiple-column subquery is used in the FROM clause of an outer query is called a(n) ____.​

​inline view

(SELECT category, AVG(retail) cataverage FROM books GROUP BY category);

​multiple-column

A(n) ____ subquery is one that can return several rows of results.

​multiple-row

The following SQL statement contains which type of subquery? SELECT title, retail, category FROM books WHERE retail IN (SELECT MAX(retail) FROM books GROUP BY category);

​multiple-row

Based on the contents of the BOOKS table, which line of the following SQL statement contains an error?

​none of the above

Based on the contents of the BOOKS table, which of the following SQL statements will display the title of all books published by the publisher of SHORTEST POEMS?

​none of the above

The results of a subquery are passed back as input to the ____ query.

​outer

An outer query is also referred to as a(n) ____ query.

​parent query

The <> operator is referred to as a(n) ____ operator.

​single-row

The = operator is referred to as a(n) ____ operator.

​single-row

The > operator is referred to as a(n) ____ operator.

​single-row

The following SQL statement contains what type of subqueries? SELECT isbn, title FROM books WHERE pubid = (SELECT pubid FROM books WHERE title = 'SHORTEST POEMS') AND retail-cost > (SELECT AVG(retail-cost) FROM books);

​single-row

The following SQL statement contains which type of subquery? SELECT title, retail, (SELECT AVG(retail) FROM books) FROM books;

​single-row


Kaugnay na mga set ng pag-aaral

what is a group?, Group cohesion, and types of groups

View Set

Lecture 21: Gut and Oral Microbiome

View Set

Work and Energy Physics Final Exam

View Set

ABEKA 7TH GRADE SCIENCE READING QUIZ H

View Set

Human Growth and Development Chapter 7

View Set

Nursing Management: Patients With Musculoskeletal Trauma

View Set

Chapter 9: Social and Emotional Development

View Set

Periodic Table: First 30 Elements

View Set

Theories of Learning, Chapter 1 What is learning?

View Set