Ch 4 Practice Exam

25 July 2022
4.7 (114 reviews)
51 test answers

Unlock all answers in this set

Unlock answers (47)
question
An inequality condition is also known as a natural join and an equality condition is also called a theta join.
answer
false
question
When using a(n) _____ join, only rows that meet the given criteria are returned.
answer
inner
question
The statement SELECT * FROM T1, T2 produces a(n) _____ join.
answer
cross
question
A(n) _____ join will select only the rows with matching values in the common attribute(s).
answer
natural
question
If a designer wishes to create an inner join, but the two tables do not have a commonly named attribute, he can use a(n) _____ clause.
answer
JOIN ON
question
The ANSI standard defines _____ type(s) of outer join(s).
answer
three
question
A(n) _____ join returns not only the rows matching the join condition (that is, rows with matching values in the common columns) but also the rows with unmatched values.
answer
outer
question
The syntax for a left outer join is _____.
answer
SELECT column-list FROM table1 LEFT OUTER JOIN table2 ON join-condition
question
A _____ join returns rows with matching values and includes all rows from both tables (T1 and T2) with unmatched values.
answer
full outer
question
All join conditions are connected through a(n) _____ logical operator.
answer
AND
question
An alternate syntax for a join is: SELECT column-list FROM table1 JOIN table2 _____ (common-column).
answer
USING
question
The ______ determines the common attribute or attributes by looking for identically named attributes and compatible data types.
answer
natural join
question
How many rows would be returned from a cross join of tables A and B, if A contains 8 rows and B contains 18?
answer
144
question
_____ is a query inside a query.
answer
subquery
question
In subquery terminology, the first query in the SQL statement is known as the _____ query.
answer
outer
question
What is a feature of a correlated subquery?
answer
The outer subquery initiates the process of execution in a subquery.
question
When using a subquery, the output of an _____ query is used as the input for the outer query.
answer
inner
question
The ____ clause is used to restrict the output of a GROUP BY query by applying a conditional criteria to the grouped rows.
answer
HAVING
question
The IN subquery uses an ____ operator.
answer
equality
question
The use of the ____ operator allows you to compare a single value with a list of values returned by the first subquery (sqA) using a comparison operator other than EQUALS.
answer
ALL
question
A ____ subquery is a subquery that executes once for each row in the outer query.
answer
correlated
question
In the context of SELECT subquery types, a _____ is returned when an UPDATE subquery is used.
answer
single value
question
When using the Oracle TO_DATE function, the code _____ represents a three-letter month name.
answer
MON
question
The Oracle _____ function returns the current date.
answer
SYSDATE
question
In Oracle, the _____ function converts a date to a character string.
answer
TO_CHAR()
question
The Oracle string concatenation operator is _____.
answer
||
question
____ is a string function that returns the number of characters in a string value.
answer
LENGTH
question
When using the Oracle TO_NUMBER function to convert a character string into a number, _____ represents a digit.
answer
9
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.
answer
DECODE
question
Oracle uses the ____ function to extract the various parts of a date.
answer
TO_CHAR
question
____ functions extract a value of a given data type and convert it to the equivalent value in another data type.
answer
Conversion
question
____ is a relational set operator.
answer
MINUS
question
"Union compatible" means that the _____.
answer
names of the relation attributes can be different, but the data types must be alike
question
The _____ data type is compatible with NUMBER.
answer
SMALLINT
question
The _____ statement combines rows from two queries and excludes duplicates.
answer
UNION
question
The syntax for the UNION query is _____.
answer
query UNION query
question
Assume a designer is using the UNION operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7 rows. Customers Jenna and Howard are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How many records are returned when using the UNION operator?
answer
15
question
Assume you are using the UNION ALL operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7 rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How many records are returned when using the UNION ALL operator?
answer
17
question
Assume you are using the INTERSECT operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7 rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How many records are returned when using the INTERSECT operator?
answer
2
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.
answer
MINUS
question
Assume you are using the MINUS operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7 rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How many records are returned when using the MINUS operator?
answer
8
question
The _____ operator could be used in place of INTERSECT if the DBMS does not support it.
answer
IN
question
The _______ operator could be used in place of MINUS if the DBMS does not support it.
answer
NOT IN
question
The ____ statement combines the output of two SELECT queries and returns all results common to both queries.
answer
INTERSECT
question
An ____ query can be used to produce a relation that retains the duplicate rows.
answer
UNION ALL
question
The ____ statement can be used to combine rows from two queries, returning only the rows that appear in both sets.
answer
INTERSECT
question
The syntax of the MINUS statement in Oracle is ____.
answer
query MINUS query
question
If the DBMS does not support the INTERSECT statement, one can use an ____ subquery to achieve the same result.
answer
IN
question
UNION, INTERSECT, and MINUS work properly only if relations are intersect-compatible, which means that the names of the relation attributes and their data types must be different.
answer
false
question
An ____ view is a view that can be used to update attributes in the base tables that are used in the view.
answer
updatable
question
A _____ routine pools multiple transactions into a single batch to update a master table field in a single operation.
answer
batch update