Final Exam: - Bring Your Own Scantron Sheet, Pencil, Eraser
Final Exam: - Bring Your Own Scantron Sheet, Pencil, Eraser
BEST OF LUCK!
11/19/21 08:10 PM 1
SAMPLE FINAL QUESTIONS
11/19/21 08:10 PM 2
True or False
• Applications can be moved from one machine to another when each
machine uses SQL. T
• The asterisk (*) wildcard designator can be used to select all fields from a
table. T
11/19/21 08:10 PM 3
True or False
11/19/21 08:10 PM 4
True or False
11/19/21 08:10 PM 5
True or False
• The following query totals sales in state = 'MA' for each salesperson.
• The OR Boolean operator joins two or more conditions and returns results only when all
conditions are true. F
11/19/21 08:10 PM 6
True or False
11/19/21 08:10 PM 7
True or False
• The keyword DECS is used after the field name to display the field in
descending order. T
• In the following query, first the CustomerName is selected from Customer_T and
then the corresponding CustomerID is matched with the CustomerID in the
Order_T F
SELECT CustomerName FROM Customer_T
WHERE CustomerID IN
11/19/21 08:10 PM 10
True or False
• Using an outer join produces this information: rows that do not have matching
values in common columns are also included in the result table. T
WHERE CustomerID IN
11/19/21 08:10 PM 11
True or False
• The subquery is placed in the FROM clause when the result of the
subquery is required to be displayed. T
• The table that provides the data for the elements of the Cube
in OLAP is called a Fact Table. T
11/19/21 08:10 PM 14
True or False
The following queries produce the same results. T
SELECT CustomerName FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T.CustomerID;
WHERE CustomerID IN
A join in which the joining condition is based on equality between values in the common columns
is called a(n):
A) Inner join. C) Left Outer join.
B) Right Outer join. D) Full join.
Answer: A
11/19/21 08:10 PM 16
Multiple Choice
Any create command may be reversed by using a ________ command.
A) remove C) delete
B) drop D) unpack
Answer: B
A join operation:
A) brings together data from two different fields.
B) causes two tables with a common domain to be combined into a single table or view.
C) causes two disparate tables to be combined into a single table or view.
D) is used to combine indexing operations.
Answer: B
11/19/21 08:10 PM 17
Multiple Choice
What does the following SQL statement do?
A) Alters the Customer_T table to accept Type 2 Varchars Alter Table Customer_T
B) Alters the Customer_T table to be a Type 2 Varchar Add (Type varchar (2));
C) Alters the Customer_T table, and adds a field called "Type"
D) Alters the Customer_T table by adding a 2-byte field called “varchar"
Answer: C
What does the following SQL statement do?
11/19/21 08:10 PM 18
Multiple Choice
What does the following SQL statement do?
11/19/21 08:10 PM 19
Multiple Choice
What result will the following SQL statement produce?
Select Avg(ProductStandardPrice) as Average from Product_T;
A) Displays the average number of all products in Product_T
B) Displays the average of product standard price of all products in Product_T
C) Displays the average price of each product
D) None of the above
Answer: B
11/19/21 08:10 PM 20
Multiple Choice
11/19/21 08:10 PM 21
Multiple Choice
Suppliers_T
What should be the result of the following query?
SNUM
(PK) SNAME STATUS CITY
S1 Smith 20 London SELECT DISTINCT CITY
S2 Jones 10 Paris FROM Suppliers_T GROUP BY CITY
S3 Blake 30 Paris
HAVING SUM(STATUS) > 35;
S4 Clark 20 London
S5 Adams 30 Athens
A) London C) Paris
B) London and Paris D) Athens
Answer: B
11/19/21 08:10 PM 22
Multiple Choice
SELECT PNAME
PNUM (PK) PNAME COLOR WEIGHT
FROM Parts_T
P1 Nut Red 12
WHERE PNUM IN P2 Bolt Green 17
(SELECT PNUM FROM Parts_T P3 Screw Blue 17
WHERE WEIGHT>15 P4 Screw Red 14
AND COLOR=‘Red’); P5 Cam Blue 12
P6 Cog Red 19
Which PNAME(s) will appear in the result?
A. Only “Cog” will appear
B. Only “Bolt” will appear
C. Only “Nut” will appear
D. Both “Cog” and “Screw” will appear
E. Both “Cog” and “Bolt” will appear
Answer: A
11/19/21 08:10 PM 24
Multiple Choice
What will result from the following SQL Select statement?
Select min(ProductDescription) from Product_T;
A) The minimum value of ProductDescription will be displayed.
B) An error message will be generated.
C) The first product description alphabetically in Product_T will be shown.
D) None of the above.
Answer: C
11/19/21 08:10 PM 25
Multiple Choice
Which of the following statement is used to rename a column?
A) LIKE C) =
B) AS D) Both options A) and B)
Answer: B
________ takes a value of true if a subquery returns an intermediate results table which contains
one or more rows.
A) IN C) EXISTS
B) HAVING D) NOT EXISTS
Answer: C
11/19/21 08:10 PM 26
Multiple Choice
A join in which rows that do not have matching values in common columns are still included in
the result table is called a(n):
A) Inner join. C) outer join
B) equi-join. D) union join.
Answer: C
11/19/21 08:10 PM 27
Multiple Choice
• Which of the following WHERE clause is used to join the three tables?
TABLE3(PK3, other attributes, FK3) TABLE2(PK2, other attributes, FK2) TABLE1(PK1, other attributes)
11/19/21 08:10 PM 28
Multiple Choice
What will result from the following SQL statement?
SELECT CustomerName
FROM CUSTOMER_T
WHERE CustomerState = (‘FL’, ‘TX’, ‘CA’);
A) Name of customers from states FL or TX or CA are displayed.
B) Name of customers from states FL and TX and CA are displayed.
C) Name of customers not belonging to states FL or TX or CA are displayed.
D) An error message will be generated.
Answer: D
11/19/21 08:10 PM 30
Multiple Choice
What is true about the following Order By clause?
11/19/21 08:10 PM 31
Multiple Choice
What is true about the following Order By clause?
11/19/21 08:10 PM 32
Multiple Choice
A ________ is a temporary table used in the FROM clause of an SQL query.
A) correlated subquery C) view table
B) derived table D) none of the above
Answer: B
Going from a summary view to progressively lower levels of detail is called data:
A) cubing. C) dicing
B) drill-down. D) pivoting
Answer: B
11/19/21 08:10 PM 33