Review Questions with all Answers verified for
accuracy Updated 2024/2025
In which form is this data - correct answer Second Normal Form
Two attributes in two related tables have the exact same domain of values. The attribute
is a primary key in one table.
Which kind of key is the attribute in the other table - correct answer Foreign
When a product is deleted from the product table, all corresponding rows for the product
in the pricing table are deleted automatically as well.
What is this referential integrity technique called - correct answer Cascaded delete
Refer to the given information.
CREATE TABLE 'test1' (
contact_id INT(10),
name VARCHAR(10),
event_id INT(5),
Which command should be added to the end to make the event_id attribute the primary
key within a CREATE TABLE statement - correct answer PRIMARY KEY (event_id));
What does the clause PRIMARY KEY followed by a field name in parentheses mean in
a CREATE TABLE statement - correct answer The column, in parentheses, is the
primary key for the table.
Which statement should be used so that it assigns a foreign key to the customer name -
correct answer FOREIGN KEY (customer_name) REFERENCE table_name
(customer_name)
, Which command creates a database only if it does not already exist - correct answer
CREATE DATABASE IF NOT EXISTS db_name;
Refer to the given SQL statement.
SELECT PRODNUM, PRODNAME
FROM PRODUCT
Which line should be added to the end of the statement to return the product numbers
and product names for products that cost 20 dollars - correct answer WHERE
PRODCOST=20;
What does WHERE identify in a basic SQL SELECT statement - correct answer The
rows to be included
Refer to the given SQL statement.
SELECT EMPNUM
FROM EMPLOYEE
Which line added to the end of the statement returns employee numbers of at least
1000 - correct answer WHERE EMPNUM >=1000;
Refer to the given SQL statement.
SELECT PRODNUM, SUM(QUANTITY)
FROM SALESPERSON