Chapter 8 Flashcards
____ is a relational set operator.
-MINUS
PLUS
ALL
EXISTS
The ____ query combines rows from two queries and excludes duplicates.
-UNION
UNION ALL
INTERSECT
MINUS
The syntax for the UNION query is ____.
query + query
UNION (query, query)
UNION: query query
-query UNION query
Assume you are 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 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 operator?
7
10
-15
17
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?
7
10
15
-17
The PL/SQL block starts with the ____ clause.
IS
OPEN
DECLARE
-BEGIN
A stored function uses the ____ statement to return a value.
EXIT
END
-RETURN
PROCESS
UNION, INTERSECT, and MINUS work properly only if relations are union-compatible, which means that the names of the relation attributes and their data types must be different.
false
SQL supports the conditional execution of procedures (if…then…else statements) that are typically supported by a programming language.
false
Procedural code is executed on the database client machine.
false
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;
set operator
natural join
-“old-style” join
procedural statement
When using a(n) ____ join, only rows that meet the given criteria are returned.
full
-inner
outer
set
How many rows would be returned from a cross join of tables A and B, if A contains 8 rows and B contains 18?
8
18
26
-144
A(n) ____ join will select only the rows with matching values in the common attribute(s).
-natural
cross
full
outer
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.
OF
USING
HAS
-JOIN ON
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.
-outer
inner
equi-
cross
The syntax for a left outer join is ____.
SELECT column-list
FROM table1 OUTER JOIN table2 LEFT
WHERE join-condition
-SELECT column-list
FROM table1 LEFT [OUTER] JOIN table2
ON join-condition
SELECT column-list
WHERE LEFT table1 = table 2
SELECT column-list
FROM table1 LEFT table2 [JOIN]
WHERE join-condition
A ____ join returns rows with matching values and includes all rows from both tables (T1 and T2) with unmatched values.
natural
cross
-full outer
left outer
In subquery terminology, the first query in the SQL statement is known as the ____ query.
outer
left
-inner
base
Improving ____ leads to more flexible queries.
-atomicity
normalization
denormalization
derived attributes
The most likely data type for a surrogate key is ____.
Character
Date
Logical
-Numeric
From a system functionality point of view, ____ attribute values can be calculated when they are needed to write reports or invoices.
-derived
atomic
granular
historical
For most business transactional databases, we should normalize relations into ____.
1NF
2NF
-3NF
6NF
A table where every determinant is a candidate key is said to be in ____.
-BCNF
2NF
3NF
4NF
Most designers consider the BCNF as a special case of the ____.
1NF
2NF
-3NF
4NF
A table is in 4NF if it is in 3NF and ____.
all attributes must be dependent on the primary key, and must be dependent on each other
all attributes are unrelated
-has no multivalued dependencies
no column contains the same values
Normalization represents a micro view of the ____ within the ERD.
-entities
attributes
relationships
forms
The conflicts between design efficiency, information requirements, and processing speed are often resolved through ____.
conversion from 1NF to 2NF
conversion from 2NF to 3NF
-compromises that include denormalization
conversion from 3NF to 4NF