study Exam Questions and Correct answers
Guaranteed Success 2024/2025
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
Foreign
Primary
Compound
Composite - correct answer Foreign
Which command creates a database only if it does not already exist
IF NOT EXISTS db_name ;
CREATE DATABASE IF NEW db_name ;
CREATE DATABASE IF NOT EXISTS db_name ;
IF NOT EXISTS CREATE DATABASE db_name ; - 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
WHERE PRODCOST=20;
AND PRODCOST=20;
WHERE PRODCOST>=20;
AND PRODCOST>=20; - correct answer WHERE PRODCOST=20;
What does WHERE identify in a basic SQL SELECT statement
The associative entity
The rows to be included
A table's intersection data
A range of included columns - 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
WHERE EMPNUM = 1000+;
WHERE EMPNUM > 1000;
WHERE EMPNUM => 1000;
WHERE EMPNUM >= 1000; - correct answer WHERE EMPNUM >= 1000;
Refer to the given SQL statement.
, SELECT PRODNUM, SUM(QUANTITY)
FROM SALESPERSON
Which line, when added to the end of the statement, returns the total number of each
kind of product by product number
SUM PRODNUM;
COUNT PRODNUM;
ORDER BY PRODNUM;
GROUP BY PRODNUM; - correct answer GROUP BY PRODNUM;
Which data definition language statement affects databases or objects in them
SELECT
INSERT
ALTER
NULL - correct answer ALTER
What does the DELETE statement do
It removes views.
It removes rows from a table.
It removes columns from a table.
It removes columns not named in the column list. - correct answer It removes rows
from a table.
Which condition must be in effect to use the INSERT INTO ... VALUES syntax for an
INSERT statement