A composite primary key can be defined using the CONSTRAINT phrase in which SQL command?
A -
MODIFY TABLE.
B -
CHANGE TABLE.
C -
CREATE TABLE.
D -
BUILD TABLE
2-
When the primary key of one relation is placed into a second relation, it is called a:
A -
referential integrity.
B -
foreign key.
C -
candidate key.
D -
relocated key.
3-
The industry standard supported by all major DBMS that allows tables to be joined together is called
A -
Structured Query Language
B -
Sequential Query Language
C -
All of these answers.
D -
None of these answers.
4-
Given the relational schema consisting of Supplier(Snumber,Sname,City), Part(Pnumber,Pname,Color)
and Supplies(Snumber,Pnumber,Qty), which SQL query retrieves the Pnumber and the total quantity of that
part supplied?
A -
Select Pnumber,sum(Qty) From Supplies Group By Pnumber;
B -
Select Pnumber,Qty From Supplies;
C -
Select sum(Qty) From Supplies;
D -
Select Sname, Pnumber, sum(Qty) From Part, Supplies Where Part.Pnumber = Supplies.Pnumber Group by Sname,Pnumber;
5-
What will be returned when the following SQL statement is executed? Select driver_no, count(*) as num_deliveries
from deliveries
where state = MA
group by driver_no;
A -
A listing of all drivers who made deliveries to state = MA, sorted by driver number.
B -
A listing of each driver who made deliveries to state = MA as well as the number of deliveries that each driver has made to that state.
C -
A count of all of the deliveries made to state = MA by all drivers.
D -
None of the above.
6-
Which of the following is the wildcard operator in SQL statements?
A -
<>
B -
*
C -
=
D -
&
7-
What results will be produced by the following SQL query? Select sum(standard_price) as total_price
from product_v
where product_type = WOOD;
A -
The total price of all products that are of type wood
B -
The total price of all products
C -
The standard_price of the first wood product in the table
D -
The standard_price of any wood product in the table
8-
To get all the customers from Hawaii sorted together, which of the following would be used?
A -
Order By
B -
Group By
C -
Having
D -
Sort
9-
What will be returned when the following SQL query is executed?
Select driver_no, count(*) as num_deliveries
from deliveries
group by driver_no
having count(*) > 2;
A -
A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries
B -
A listing of all drivers
C -
A listing of the number of deliveries greater than 2
D -
A listing of all drivers who made more than 2 deliveries
10-
Given a table with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the
following is not a valid ANSI SQL command?
A -
SELECT * FROM EMPLOYEE WHERE Name LIKE Ja%;
B -
SELECT HireDate, COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;
C -
SELECT COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;
D -
SELECT HireDate, COUNT(*) FROM EMPLOYEE GROUP BY HireDate;