# Chapter 8 Real Ting Set

## Unlock all answers in this set

question
____ is a relational set operator. a. MINUS b. PLUS c. ALL d. EXISTS
minus
question
What is meant by "union-compatible"? a. the names of the relation attributes can be different but the data types must be alike b. the names of the relation attributes must be the same but the data types can be different c. the names of the relation attributes must be the same and their data types must be alike d. the number of attributes must be the same but the names and data types can be different
c. the names of the relation attributes must be the same and their data types must be alike
question
Which data type is considered compatible with VARCHAR(35)? a. DATE b. INT c. TINYINT d. CHAR(15)
d. CHAR(15)
question
Which data type is compatible with NUMBER? a. VARCHAR(15) b. SMALLINT c. DATE d. CHAR(10)
SMALLINT
question
The ____ statement combines rows from two or more queries without including duplicate rows. a. UNION b. UNION ALL c. INTERSECT d. MINUS
UNION
question
What is the syntax for the UNION statement? a. query + query b. UNION(query, query) c. UNION: query query d. query UNION query
d. query UNION query
question
Assume you are using the UNION statement to combine the results from two identical tables CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains seven rows. There are two customers included in both tables. How many records are returned when using the UNION statement? a. 7 b. 10 c. 15 d. 17
15
question
Assume you are using the UNION ALL statement to combine the results from two identical tables CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains seven rows. There are two customers included in both tables. How many records are returned when using the UNION ALL statement? a. 7 b. 10 c. 15 d. 17
17
question
A(n) ____ query can be used to produce a relation that retains duplicate rows. a. UNION b. UNION ALL c. INTERSECT d. MINUS
b. UNION ALL
question
The ____ statement can be used to combine rows from two queries, returning only the rows that appear in both sets. a. UNION b. UNION ALL c. INTERSECT d. MINUS
INTERSECT
question
The ____ statement in SQL combines rows from two queries and returns only the rows that appear in the first set but not in the second. a. UNION b. UNION ALL c. INTERSECT d. MINUS
MINUS
question
What type of subquery could be used in place of INTERSECT if the RDBMS does not support it? a. IN b. OF c. AND d. UNION
IN
question
What type of subquery could be used in place of MINUS if the RDBMS does not support it? a. IN b. NOT IN c. AND d. UNION
b. NOT IN
question
The following SQL statement uses a(n) ____. SELECT P_CODE, P_DESCRIPT, P_PRICE, V_NAME FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; a. set operator b. natural join c. "old-style" join d. procedural statement
d. "old-style" join
question
The ____ join is the traditional join in which only rows that meet a given criteria are selected. a. full b. inner c. outer d. set
inner
question
The statement SELECT * FROM T1, T2 produces a(n) ____ join. a. cross b. natural c. equi- d. full
cross
question
A ____ join of two tables returns rows with matching values and includes all rows from both tables with unmatched values. a. natural b. cross c. full outer d. left outer
c. full outer
question
How many different types of outer joins exist? a. 1 b. 2 c. 3 d. 4
3
question
How many rows would be returned from a cross join of tables A and B if A contains 10 rows and B contains 20? a. 10 b. 20 c. 30 d. 200
200
question
A(n) ____ join will select only the rows with common values in the common column(s), excluding rows with unmatched values and duplicate columns. a. natural b. cross c. full d. outer
natural
question
Complete the following inner join: SELECT * FROM T1 JOIN T2 ____ (C1) a. OF b. USING c. HAS d. JOIN ON
OF
question
If you wish to create an inner join but the two tables do not have a commonly named attribute, you can use a(n) ____ clause. a. OF b. USING c. HAS d. JOIN ON
b. JOIN ON
question
What type of inner join requires the use of a table qualifier? a. USING b. NATURAL c. EQUI- d. JOIN ON
b. JOIN ON
question
A(n) ____ join returns not only the rows matching the join condition but also the rows with unmatched values. a. outer b. inner c. equi- d. cross
outer
question
What is the syntax for a left outer join? a. SELECT column-list FROM table1 OUTER JOIN table2 LEFT WHERE join-condition b. SELECT column-list FROM table1 LEFT [OUTER] JOIN table2 ON join-condition c. SELECT column-list WHERE LEFT table1 = table 2 d. SELECT column-list FROM table1 LEFT table2 [JOIN] WHERE join-condition
SELECT column-list FROM table1 LEFT [OUTER] JOIN table2 ON join-condition
question
A ____ is a query inside a query. a. subquery b. basequery c. join d. set query
subquery
question
In subquery terminology, the first query in the SQL statement is known as the ____ query. a. outer b. left c. inner d. base
outer
question
28. In a subquery, which query is executed first? a. leftmost b. rightmost c. innermost d. outermost
innermost
question
29. INSERT INTO PRODUCT SELECT * FROM P; is an example of a ____. a. join b. subquery c. set operator d. stored procedure
subquery
question
The most common type of subquery uses an inner SELECT subquery on the right side of a(n) ____ comparison expression. a. WHERE b. JOIN c. UNION d. EXISTS
WHERE
question
When using an equality (=) or inequality (<, >, etc.) operator for a subquery, what type of value must the subquery return? a. single value b. list of values c. no value d. virtual table
a. single value
question
In order to compare one value to a list of values returned by a subquery, you must use a(n) ____ operand. a. = b. MINUS c. ON d. IN
IN
question
In addition to a WHERE clause, a subquery can be used with a(n) ____ clause. a. ON b. HAVING c. GROUP BY d. MINUS
HAVING
question
Which operator(s) is/are used with subqueries that use inequality operators on a list of values? a. IN b. ANY and ALL c. ON d. ONLY
a. ANY and ALL
question
In a SELECT query, the attribute list can include a subquery expression, known as a(n) ____ subquery. a. having b. correlated c. inline d. nested
inline
question
A subquery that executes once for each row in the outer query is a(n) ____ subquery. a. nested b. correlated c. inline d. grouped
correlated
question
The ____ function returns the number of the day in MS Access/SQLServer. a. TO_DATE() b. SYSDATE() c. DATE()
DATE
question
In Oracle, the ____ function converts a date to a character string. a. CONVERT b. TO_DATE c. TO_CHAR d. TO_STRIN
TO_CHAR
question
When using the Oracle TO_DATE function, the code ____ represents a three letter month name. a. MON b. MM c. MONTH d. M
MON
question
The Oracle ____ function returns the current date. a. DATE b. SYSDATE c. CURRENT_DATE d. TO_DATE
SYSDATE
question
The Oracle string concatenation function is ____. a. CONCAT b. + c. || d. &&
c. ||
question
When using the Oracle TO_NUMBER function to convert a character string into a number, the ____ format character displays a digit. a. 0 b. 9 c. \$ d. #
a. 9
question
The Oracle ____ function returns the number of characters in a string value. a. LEN b. LENGTH c. SUM d. ASCII
LENGTH
question
The Oracle ____ function compares an attribute or expression with a series of values and returns an associated value or a default value if no match is found. a. NVL b. TO_CHAR c. DECODE d. CONVERT
DECODE
question
The Oracle equivalent to a MS Access AutoNumber is a(n) ____. a. AutoNumber b. sequence c. TO_NUMBER function d. trigger