Deck 6: Advanced SQL
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/95
Play
Full screen (f)
Deck 6: Advanced SQL
1
A type of join between three tables is called a(n):
A) ternary join.
B) self-join.
C) unnatural join.
D) pinned join.
A) ternary join.
B) self-join.
C) unnatural join.
D) pinned join.
A
2
The following code would include:
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T. CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T. CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
only rows that match both Customer_T and Order_T Tables.
3
The most commonly used form of join operation is the:
A) outer join.
B) union join.
C) equi-join.
D) natural join.
A) outer join.
B) union join.
C) equi-join.
D) natural join.
D
4
A join operation:
A) brings together data from two different fields.
B) causes two tables with a common domain to be combined into a single table or view.
C) causes two disparate tables to be combined into a single table or view.
D) is used to combine indexing operations.
A) brings together data from two different fields.
B) causes two tables with a common domain to be combined into a single table or view.
C) causes two disparate tables to be combined into a single table or view.
D) is used to combine indexing operations.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
5
The following code would include:
SELECT Customer_T.CustomerID,CustomerName, OrderID
FROM Customer_T LEFT OUTER JOIN Order_T ON
Customer_T.CustomerID = Order_T.CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
SELECT Customer_T.CustomerID,CustomerName, OrderID
FROM Customer_T LEFT OUTER JOIN Order_T ON
Customer_T.CustomerID = Order_T.CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
6
A join in which the joining condition is based on equality between values in the common columns is called a(n):
A) equi-join.
B) unilateral join.
C) natural join.
D) both A and C.
A) equi-join.
B) unilateral join.
C) natural join.
D) both A and C.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
7
One major advantage of the outer join is that:
A) information is easily accessible.
B) information is not lost.
C) the query is easier to write.
D) information's data type changes.
A) information is easily accessible.
B) information is not lost.
C) the query is easier to write.
D) information's data type changes.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
8
The UNION clause is used to:
A) combine the output from multiple queries into a single result table.
B) join two tables together to form one table.
C) find all rows that do not match in two tables.
D) find all rows that are in one table, but not the other.
A) combine the output from multiple queries into a single result table.
B) join two tables together to form one table.
C) find all rows that do not match in two tables.
D) find all rows that are in one table, but not the other.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
9
A join in which rows that do not have matching values in common columns are still included in the result table is called a(n):
A) natural join.
B) equi-join.
C) outer join.
D) union join.
A) natural join.
B) equi-join.
C) outer join.
D) union join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
10
A ________ is a temporary table used in the FROM clause of an SQL query.
A) correlated subquery
B) derived table
C) view table
D) trigger
A) correlated subquery
B) derived table
C) view table
D) trigger
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
11
The ________ operator is used to combine the output from multiple queries into a single result table.
A) INTERSECT
B) DIVIDE
C) COLLATE
D) UNION
A) INTERSECT
B) DIVIDE
C) COLLATE
D) UNION
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
12
All of the following are guidelines for better query design EXCEPT:
A) understand how indexes are used in query processing.
B) use a lot of self-joins.
C) write simple queries.
D) retrieve only the data that you need.
A) understand how indexes are used in query processing.
B) use a lot of self-joins.
C) write simple queries.
D) retrieve only the data that you need.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
13
In which of the following situations would one have to use an outer join in order to obtain the desired results?
A) A report is desired that lists all customers who placed an order.
B) A report is desired that lists all customers and the total of their orders.
C) A report is desired that lists all customers and the total of their orders during the most recent month, and includes customers who did not place an order during the month (their total will be zero).
D) There is never a situation that requires only an outer join.
A) A report is desired that lists all customers who placed an order.
B) A report is desired that lists all customers and the total of their orders.
C) A report is desired that lists all customers and the total of their orders during the most recent month, and includes customers who did not place an order during the month (their total will be zero).
D) There is never a situation that requires only an outer join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
14
Establishing IF-THEN-ELSE logical processing within an SQL statement can be accomplished by:
A) using the if-then-else construct.
B) using the immediate if statement.
C) using the CASE key word in a statement.
D) using a subquery.
A) using the if-then-else construct.
B) using the immediate if statement.
C) using the CASE key word in a statement.
D) using a subquery.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
15
The outer join syntax does not apply easily to a join condition of more than ________ tables.
A) two
B) three
C) four
D) five
A) two
B) three
C) four
D) five
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
16
In order for two queries to be UNION-compatible, they must:
A) both have the same number of lines in their SQL statements.
B) both output compatible data types for each column and return the same number of rows.
C) both return at least one row.
D) both return exactly one row.
A) both have the same number of lines in their SQL statements.
B) both output compatible data types for each column and return the same number of rows.
C) both return at least one row.
D) both return exactly one row.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
17
The following code would include:
SELECT Customer_T.CustomerID,CustomerName, OrderID
FROM Customer_T RIGHT OUTER JOIN Order_T ON
Customer_T.CustomerID = Order_T.CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
SELECT Customer_T.CustomerID,CustomerName, OrderID
FROM Customer_T RIGHT OUTER JOIN Order_T ON
Customer_T.CustomerID = Order_T.CustomerID;
A) all rows of the Order_T Table regardless of matches with the Customer_T Table.
B) all rows of the Customer_T Table regardless of matches with the Order_T Table.
C) only rows that match both Customer_T and Order_T Tables.
D) only rows that don't match both Customer_T and Order_T Tables.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
18
The following code is an example of a(n):
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T.CustomerID;
A) equi-join.
B) subquery.
C) Full Outer JOIN.
D) Right Outer JOIN.
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T.CustomerID;
A) equi-join.
B) subquery.
C) Full Outer JOIN.
D) Right Outer JOIN.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
19
An operation to join a table to itself is called a(n):
A) sufficient-join.
B) inner join.
C) outer join.
D) self-join.
A) sufficient-join.
B) inner join.
C) outer join.
D) self-join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
20
A join that is based upon equality between values in two common columns with the same name and where one duplicate column has been removed is called a(n):
A) equi-join.
B) natural join.
C) multivariate join.
D) inner join.
A) equi-join.
B) natural join.
C) multivariate join.
D) inner join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
21
________ takes a value of TRUE if a subquery returns an intermediate results table which contains one or more rows.
A) In
B) Having
C) Exists
D) Extents
A) In
B) Having
C) Exists
D) Extents
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
22
In SQL, a(n) ________ subquery is a type of subquery in which processing the inner query depends on data from the outer query.
A) correlated
B) paired
C) natural
D) inner
A) correlated
B) paired
C) natural
D) inner
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
23
SQL provides the ________ technique, which involves placing an inner query within the WHERE or HAVING clause of an outer query.
A) grouping
B) joining
C) subquery
D) union
A) grouping
B) joining
C) subquery
D) union
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
24
User-defined data types:
A) are not allowed in any DBMS.
B) are only allowed in Oracle.
C) can have defined functions and methods.
D) can be used once in a system.
A) are not allowed in any DBMS.
B) are only allowed in Oracle.
C) can have defined functions and methods.
D) can be used once in a system.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
25
What would the following view contain for values?
Create view CustomerOrders as
Select CustID, Count(*) as TotOrders, Sum(ordertotal) as Value
From customer inner join sale on customer.customer_id = sale.customer_id;
A) A listing of all customers in the customer table
B) A listing of the customer ID as well as the total number of orders and the total amount spent by the customer
C) A listing of the customer ID as well as the total orders
D) An error message
Create view CustomerOrders as
Select CustID, Count(*) as TotOrders, Sum(ordertotal) as Value
From customer inner join sale on customer.customer_id = sale.customer_id;
A) A listing of all customers in the customer table
B) A listing of the customer ID as well as the total number of orders and the total amount spent by the customer
C) A listing of the customer ID as well as the total orders
D) An error message
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
26
A procedure is:
A) stored outside the database.
B) given a reserved SQL name.
C) called by name.
D) unable to be modified.
A) stored outside the database.
B) given a reserved SQL name.
C) called by name.
D) unable to be modified.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
27
________ use the result of the inner query to determine the processing of the outer query.
A) Correlated subqueries
B) Outer subqueries
C) Inner subqueries
D) Subqueries
A) Correlated subqueries
B) Outer subqueries
C) Inner subqueries
D) Subqueries
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
28
The ________ DBA view shows information about all users of the database in Oracle.
A) DBA_USERS
B) USERS
C) DBA_VIEWS
D) DBA_INDEXES
A) DBA_USERS
B) USERS
C) DBA_VIEWS
D) DBA_INDEXES
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
29
A type of query that is placed within a WHERE or HAVING clause of another query is called a:
A) master query.
B) subquery.
C) superquery.
D) multi-query.
A) master query.
B) subquery.
C) superquery.
D) multi-query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
30
A materialized view is/are:
A) a virtual table created dynamically on request by a user.
B) an in-line query.
C) copies or replica of data based on queries.
D) always an exact copy of the source table.
A) a virtual table created dynamically on request by a user.
B) an in-line query.
C) copies or replica of data based on queries.
D) always an exact copy of the source table.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
31
The MERGE command:
A) allows one to combine the INSERT and UPDATE operations.
B) allows one to combine the INSERT and DELETE operations.
C) joins 2 tables together.
D) is always a single table operation.
A) allows one to combine the INSERT and UPDATE operations.
B) allows one to combine the INSERT and DELETE operations.
C) joins 2 tables together.
D) is always a single table operation.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
32
A new set of analytical functions added in SQL:2008 is referred to as:
A) OLAF functions.
B) MOLAP functions.
C) average functions.
D) OLAP functions.
A) OLAF functions.
B) MOLAP functions.
C) average functions.
D) OLAP functions.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
33
While triggers run automatically, ________ do not and have to be called.
A) trapdoors
B) routines
C) selects
D) updates
A) trapdoors
B) routines
C) selects
D) updates
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
34
When a user creates a virtual table it is called a(n):
A) materialized view.
B) virtual table.
C) inline view.
D) dynamic view.
A) materialized view.
B) virtual table.
C) inline view.
D) dynamic view.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
35
EXISTS will take a value of ________ if the subquery returns an intermediate results table which contains one or more rows.
A) false
B) 1
C) true
D) undefined
A) false
B) 1
C) true
D) undefined
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
36
A named set of SQL statements that are considered when a data modification occurs are called:
A) stored procedures.
B) treatments.
C) triggers.
D) trapdoors.
A) stored procedures.
B) treatments.
C) triggers.
D) trapdoors.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
37
SQL-invoked routines can be:
A) part of a DDL statement.
B) functions or procedures.
C) part of a DCL statement.
D) contained within a CREATE statement.
A) part of a DDL statement.
B) functions or procedures.
C) part of a DCL statement.
D) contained within a CREATE statement.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
38
The following code is an example of a:
SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState,
CustomerPostalCode
FROM Customer_T
WHERE Customer_T.CustomerID =
(SELECT Order_T.CustomerID
FROM Order_T
WHERE OrderID = 1008);
A) correlated subquery.
B) subquery.
C) join.
D) FULL OUTER JOIN.
SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState,
CustomerPostalCode
FROM Customer_T
WHERE Customer_T.CustomerID =
(SELECT Order_T.CustomerID
FROM Order_T
WHERE OrderID = 1008);
A) correlated subquery.
B) subquery.
C) join.
D) FULL OUTER JOIN.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
39
All of the following are part of the coding structure for triggers EXCEPT:
A) event.
B) condition.
C) selection.
D) action.
A) event.
B) condition.
C) selection.
D) action.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
40
All of the following are advantages of SQL-invoked routines EXCEPT:
A) flexibility.
B) efficiency.
C) sharability.
D) security.
A) flexibility.
B) efficiency.
C) sharability.
D) security.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
41
The following code is an example of a Subquery.
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T. CustomerID;
SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T. CustomerID;
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
42
The following statement is an example of:
CREATE TABLE Customer_t (
CustNmbr number(11,0),
CreditLimit number(6,2),
CustStart date,
CustEnd date,
PERIOD for Custperiod(CustStart,CustEnd));
A) a materialized view.
B) an application time period table.
C) a system-versioned table.
D) a dynamic view.
CREATE TABLE Customer_t (
CustNmbr number(11,0),
CreditLimit number(6,2),
CustStart date,
CustEnd date,
PERIOD for Custperiod(CustStart,CustEnd));
A) a materialized view.
B) an application time period table.
C) a system-versioned table.
D) a dynamic view.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
43
If the DBA wishes to describe all tables in the database, which data dictionary view should be accessed in Oracle?
A) DBA_TAB_PRIVS
B) DBA_TAB_COMMENTS
C) DBA_TABLE_LABEL
D) DBA_TABLES
A) DBA_TAB_PRIVS
B) DBA_TAB_COMMENTS
C) DBA_TABLE_LABEL
D) DBA_TABLES
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
44
The following queries produce the same results.
SELECT DISTINCT Customer_Name, Customer_City
FROM Customer, Salesman
WHERE Customer.Salesman_ID = Salesman.Salesman_ID
and Salesman.Lname = 'SMITH';
SELECT Customer_Name, Customer_City
FROM Customer
WHERE Customer.Salesman_ID =
(SELECT Salesman_ID
FROM Salesman
WHERE Lname = 'SMITH');
SELECT DISTINCT Customer_Name, Customer_City
FROM Customer, Salesman
WHERE Customer.Salesman_ID = Salesman.Salesman_ID
and Salesman.Lname = 'SMITH';
SELECT Customer_Name, Customer_City
FROM Customer
WHERE Customer.Salesman_ID =
(SELECT Salesman_ID
FROM Salesman
WHERE Lname = 'SMITH');
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
45
An SQL query that implements an outer join will return rows that do not have matching values in common columns.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
46
A natural join is the same as an equi-join, except that it is performed over matching columns that have been defined with the same name, and one of the duplicate columns is eliminated.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
47
Specifying the attribute names in the SELECT statement will make it easier to find errors in queries and also correct for problems that may occur in the base system.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
48
There is a special operation in SQL to join a table to itself.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
49
Figuring out what attributes you want in your query before you write the query will help with query writing.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
50
A join in which the joining condition is based on equality between values in the common column is called an equi-join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
51
Joining tables or using a subquery may produce the same result.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
52
IF-THEN-ELSE logical processing cannot be accomplished within an SQL statement.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
53
One major disadvantage of the outer join is that information is easily lost.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
54
An equi-join is a join in which one of the duplicate columns is eliminated in the result table.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
55
The UNION clause is used to combine the output from multiple queries into a single result table.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
56
Using an outer join produces this information: rows that do not have matching values in common columns are not included in the result table.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
57
It is better not to have a result set identified before writing GROUP BY and HAVING clauses for a query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
58
The natural join is very rarely used.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
59
Combining a table with itself results in a faster query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
60
The joining condition of an equi-join is based upon an equality.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
61
Correlated subqueries are less efficient than queries that do not use nesting.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
62
The following query will execute without errors.
SELECT Customer.Customer_Name, Salesman.Sales_Quota
FROM Customer
WHERE Customer.Salesman_ID =
(SELECT Salesman_ID
WHERE Lname = 'SMITH');
SELECT Customer.Customer_Name, Salesman.Sales_Quota
FROM Customer
WHERE Customer.Salesman_ID =
(SELECT Salesman_ID
WHERE Lname = 'SMITH');
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
63
A dynamic query is created by the user.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
64
Subqueries can only be used in the WHERE clause.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
65
The following code is an example of a correlated subquery.
SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState,
CustomerPostalCode
FROM Customer_T
WHERE Customer_T.CustomerID =
(SELECT Order_T.CustomerID
FROM Order_T
WHERE OrderID = 1008);
SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState,
CustomerPostalCode
FROM Customer_T
WHERE Customer_T.CustomerID =
(SELECT Order_T.CustomerID
FROM Order_T
WHERE OrderID = 1008);
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
66
The following SQL statement is an example of a correlated subquery.
SELECT First_Name, Last_Name, Total_Sales
FROM Salesman s1
WHERE Total_Sales > all
(SELECT Total_Sales FROM Salesman s2
WHERE s1.Salesman_ID != s2.Salesman_ID);
SELECT First_Name, Last_Name, Total_Sales
FROM Salesman s1
WHERE Total_Sales > all
(SELECT Total_Sales FROM Salesman s2
WHERE s1.Salesman_ID != s2.Salesman_ID);
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
67
A base table is the underlying table that is used to create views.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
68
Triggers have three parts: the event, the condition, and the action.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
69
A subquery in which processing the inner query depends on data from the outer query is called a codependent query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
70
EXISTS takes a value of false if the subquery returns an intermediate result set.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
71
A function has only input parameters but can return multiple values.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
72
In order to find out what customers have not placed an order for a particular item, one might use the NOT qualifier along with the IN qualifier.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
73
A correlated subquery is executed once for each iteration through the outer loop.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
74
A routine is a named set of SQL statements that are considered when a data modification occurs.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
75
A materialized view is not persistent.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
76
When a subquery is used in the FROM clause, it is called a denied table.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
77
When EXISTS or NOT EXISTS is used in a subquery, the select list of the subquery will usually just select all columns as a placeholder because it doesn't matter which columns are returned.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
78
The advantages of SQL-invoked routines are flexibility, efficiency, sharability, and applicability.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
79
Constraints are a special case of triggers.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
80
Triggers can be used to ensure referential integrity, enforce business rules, create audit trails, and replicate tables, but cannot call other triggers.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck