Chapter 8 Real Ting Set

25 July 2022
4.7 (114 reviews)
48 test answers

Unlock all answers in this set

Unlock answers (44)
question
____ is a relational set operator. a. MINUS b. PLUS c. ALL d. EXISTS
answer
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
answer
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)
answer
d. CHAR(15)
question
Which data type is compatible with NUMBER? a. VARCHAR(15) b. SMALLINT c. DATE d. CHAR(10)
answer
SMALLINT
question
The ____ statement combines rows from two or more queries without including duplicate rows. a. UNION b. UNION ALL c. INTERSECT d. MINUS
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
inner
question
The statement SELECT * FROM T1, T2 produces a(n) ____ join. a. cross b. natural c. equi- d. full
answer
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
answer
c. full outer
question
How many different types of outer joins exist? a. 1 b. 2 c. 3 d. 4
answer
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
answer
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
answer
natural
question
Complete the following inner join: SELECT * FROM T1 JOIN T2 ____ (C1) a. OF b. USING c. HAS d. JOIN ON
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
outer
question
28. In a subquery, which query is executed first? a. leftmost b. rightmost c. innermost d. outermost
answer
innermost
question
29. INSERT INTO PRODUCT SELECT * FROM P; is an example of a ____. a. join b. subquery c. set operator d. stored procedure
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
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
answer
correlated
question
The ____ function returns the number of the day in MS Access/SQLServer. a. TO_DATE() b. SYSDATE() c. DATE()
answer
DATE
question
In Oracle, the ____ function converts a date to a character string. a. CONVERT b. TO_DATE c. TO_CHAR d. TO_STRIN
answer
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
answer
MON
question
The Oracle ____ function returns the current date. a. DATE b. SYSDATE c. CURRENT_DATE d. TO_DATE
answer
SYSDATE
question
The Oracle string concatenation function is ____. a. CONCAT b. + c. || d. &&
answer
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. #
answer
a. 9
question
The Oracle ____ function returns the number of characters in a string value. a. LEN b. LENGTH c. SUM d. ASCII
answer
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
answer
DECODE
question
The Oracle equivalent to a MS Access AutoNumber is a(n) ____. a. AutoNumber b. sequence c. TO_NUMBER function d. trigger
answer
sequence
question
The ____ pseudo column is used to select the next available value from a sequence. a. CURRVAL b. NEXTVAL c. NEXT d. GET_NEXT
answer
NEXTVAL
question
A(n) ____ is a block of code (containing standard SQL statements and procedural extensions) that is stored and executed at the DBMS server. a. persistent stored module b. permanent SQL module c. SQL statement d. program manipulation command
answer
a. persistent stored module
question
____ make(s) it possible to merge SQL and traditional programming constructs such as variables, conditional processing (IF-THEN-ELSE), basic loops (FOR and WHILE loops,) and error trapping. a. Triggers b. Indexes c. Embedded SQL
answer
d. Procedural SQL