Exam 2 Prep Flashcards
(43 cards)
An atomic attribute ____.
a. cannot exist in a relational table
b. cannot be further subdivided
c. displays multiplicity
d. is always chosen to be a foreign key
b. cannot be further subdivided
A table that has all key attributes defined, has no repeating groups, and all its attributes are dependent on the primary key, is said to be in ____.
1NF
2NF
3NF
4NF
1NF
A table that is in 1NF and includes no partial dependencies is said to be in ____.
BCNF
2NF
3NF
4NF
2NF
A table that is in 2NF and contains no transitive dependencies is said to be in ____.
1NF
2NF
3NF
4NF
3NF
A relational table must not contain a(n) ____.
entity
attribute
relationship
repeating group (i.e., multi-valued attributes)
repeating group (i.e., multi-valued attributes)
To list all the contents of the PRODUCT table, you would use ____.
LIST * FROM PRODUCT;
SELECT * FROM PRODUCT;
DISPLAY * FROM PRODUCT;
SELECT ALL FROM PRODUCT;
SELECT * FROM PRODUCT;
The SQL command that lets you select attributes from rows in one or more tables is ____.
INSERT
SELECT
COMMIT
UPDATE
SELECT
The SQL command that modifies an attribute’s values in one or more table’s rows is ____.
INSERT
SELECT
COMMIT
UPDATE
UPDATE
SQL character data format(s) is(are) ____.
CHAR and VARCHAR
VARCHAR only
Alphanumeric
CHAR only
CHAR and VARCHAR
The SQL command that lets you insert rows into a table is ____.
INSERT
SELECT
COMMIT
UPDATE
INSERT
When you issue the DELETE FROM tablename command without specifying a WHERE condition, ____.
no rows will be deleted
the first row will be deleted
the last row will be deleted
all rows will be deleted
all rows will be deleted
A(n) ____ is a query that is embedded (or nested) inside another query.
alias
operator
subquery
view
subquery
An example of a command you would use when making changes to a PRODUCT table is ____.
CHANGE PRODUCT
SET P_INDATE = ‘18-JAN-2004’
WHERE P_CODE = ‘13-Q2/P2’;
ROLLBACK PRODUCT
SET P_INDATE = ‘18-JAN-2004’
WHERE P_CODE = ‘13-Q2/P2’;
EDIT PRODUCT
SET P_INDATE = ‘18-JAN-2004’
WHERE P_CODE = ‘13-Q2/P2’;
UPDATE PRODUCT
SET P_INDATE = ‘18-JAN-2004’
WHERE P_CODE = ‘13-Q2/P2’;
UPDATE PRODUCT
SET P_INDATE = ‘18-JAN-2004’
WHERE P_CODE = ‘13-Q2/P2’;
The ____ command would be used to delete the table row where the P_CODE is ‘BRT-345’.
DELETE FROM PRODUCT
WHERE P_CODE = ‘BRT-345’;
REMOVE FROM PRODUCT
WHERE P_CODE = ‘BRT-345’;
ERASE FROM PRODUCT
WHERE P_CODE = ‘BRT-345’;
ROLLBACK FROM PRODUCT
WHERE P_CODE = ‘BRT-345’;
DELETE FROM PRODUCT
WHERE P_CODE = ‘BRT-345’;
UPDATE tablename
*****
[WHERE conditionlist];
The ____ command replaces the ***** in the syntax of the UPDATE command, shown above.
SET columnname = expression
columnname = expression
expression = columnname
LET columnname = expression
SET columnname = expression
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
15
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;
cross join
relational set operator
“old-style” join
outer join
“old-style” join
When using a(n) ____ join, only rows that match the given criteria are returned.
full
inner
outer
set
inner
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
17
“Union-compatible” means that the ____.
names of the relation attributes can be different, but the data types must be identical
names of the relation attributes must be the same, but the data types can be different
number of attributes must be the same, and their data types must be compatible
number of attributes must be the same, but the names and data types can be different
number of attributes must be the same, and their data types must be compatible
The ____ operator could be used in place of INTERSECT if the RDBMS does not support it.
IN
OF
AND
UNION
IN
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.
UNION
UNION ALL
INTERSECT
MINUS
MINUS
The ____ operator could be used in place of MINUS if the RDBMS does not support it.
IN
NOT IN
AND
UNION
NOT IN
The statement SELECT * FROM T1, T2 produces a(n) ____ join.
cross
natural
equi-
full
cross