Exam 2 Prep Flashcards
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