ALTER TABLE Person ADD Prefix Varchar (4) NOT Null
ALTER TABLE Person ADD Prefix Varchar (4) NOT Null
Question 2
B
SELECT * FROM students
WHERE enrollment_date >= ‘2020-06-01’ AND
academic_status = ‘Graduated’ AND
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date ASC
C
SELECT * FROM students
WHERE enrollment_date >= ‘2020-06-01’ OR
academic_status = ‘Graduated’ AND
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date DESC
D
SELECT * FROM students
WHERE enrollment_date >= ‘2020-06-01’ OR
academic_status = ‘Graduated’ OR
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date DESC
Question 3
SELECT *
FROM Cars c
WHERE c.Origin <> ‘USA’ AND c.Color <> ‘Black’
a. 4
b. 5
c. 6
d. 7
Question 4
A
UPDATE CustomerID
FROM Customer
DELETE *
WHERE CustomerID = 12345
B
DELETE CustomerID
FROM Customer
WHERE CustomerID = 12345
C
UPDATE Customer
DELETE *
WHERE CustomerID = 12345
D
DELETE FROM Customer
WHERE CustomerID = 12345
Question 5
A
SELECT EmployeeName FROM Employee
WHERE EmployeeName = ‘Jack Smith’;
B
SELECT * INTO Employee FROM NewHires
C
INSERT INTO Employee
VALUES (‘Jack Smith’);
D
ALTER TABLE Employee
ADD EmployeeName Varchar
Question 6
A
SELECT ItemName, Price
FROM Products
WHERE ItemDescription = ‘chocolate’;
B
SELECT ItemName, Price
FROM Products
WHERE ItemDescription IN ‘%chocolate%’;
C
SELECT ItemName, Price
FROM Products
WHERE ItemDescription LIKE ‘chocolate’;
D
SELECT ItemName, Price
FROM Products
WHERE ItemDescription LIKE ‘%chocolate%’;
Question 7
A
CREATE TABLE Order
(OrderID INTEGER,
OrderItemID INTEGER,
PRIMARY KEY (OrderID, OrderItemID))
B
CREATE TABLE Order
(OrderID INTEGER,
OrderItemID INTEGER,
PRIMARY KEY OrderID,
PRIMARY KEY OrderItemID))
C
CREATE TABLE Order
(OrderID INTEGER,
OrderItemID INTEGER,
PRIMARY KEY)
D
CREATE TABLE Order
(OrderID INTEGER PRIMARY KEY,
OrderItemID INTEGER PRIMARY KEY)
Question 8
Question 9
You work at a coffee shop. They ask you to set up a website that
stores charges on purchases.
a. Decimal
b. Bit
c. Binary
d. Varchar
Question 10
A
INSERT INTO LoanedBooks
SET Books = 0
WHERE ID = 4
B
UPDATE LoanedBooks
SET Books = 0
WHERE (NAME = ‘Harry’ or City = ‘San
Francisco’)
C
UPDATE LoanedBooks
SET Books = 0
WHERE (NAME In ‘Harry’, ‘San Francisco’)
D
UPDATE LoanedBooks
SET Books = 0
WHERE (NAME = ‘Harry’ AND City = ‘San
Francisco’)
Question 11
EmployeeID
EmployeeName
A
SELECT SUM(*)
FROM Employee
B
SELECT *
FROM Employee
C
SELECT COUNT(rows)
FROM Employee
D
SELECT COUNT(*)
FROM Employee
Question 12
You need to display the total number of points per player on the
team whose ID is 1.
Move the appropriate code segments from the list on the left to the
correct locations on the right. You may use each code segment
once, more than once, or not at all.
You need to ensure that each record in the Sales table has a valid
associated salesperson record in the SalesPerson table.
A. nonclustered index
B. Foreign key
C. Clustered index
D. Primary key
Question 14
Drag the code segments from the list on the left to the correct
locations on the right. You may use each code segment once, more
than once, or not at all.
Code Segments
Answer Segments
CREATE VIEW [dbo].[NorthAmericanMammals_View]
Question 15
You have a table name Product. You create a view that includes
all the products from the Product table that are in the
Furniture category.
After you execute the statement, the result set of the view is:
a. Unchanged
b. Deleted
c. Archived
d. Empty
Question 16
a. UNION
b. INTERSECT
c. ALL
d. JOIN
Question 17
Question 18
Question 19
a. Full join
b. Complete join
c. Partial join
d. Inner join
Question 20
StudentName VARCHAR
GradeLevel INT
DaysAbsent DECIMAL
Question 22
You have a table named Product. The Product table has columns
for ProductDescription and ProductCategory. You
need to change the ProductCategory value for all the spoons in
the Product table to 43.
A
UPDATE Product
SET ProductCategory = 43
WHERE ProductDescription = ‘spoon’
B
UPDATE Product
WHERE ProductDescription = ‘spoon’
SET ProductCategory = 43
C
SET Product
WHERE ProductDescription = ‘spoon’
TO ProductCategory = 43
D
SET Product
TO ProductCategory = 43
WHERE ProductDescription = ‘spoon’
Question 23
ProductID ProductCategory
32 books
25 books
67 movies
89 movies
a. deterministic
b. relationally dependent
c. cohort
d. compositional
e. functionality dependent
Question 24
a. outer join
b. equi-join
c. intersection
d. cartesian product
Question 25
A
CREATE TABLE Employee
(EmployeeID INTEGER PRIMARY KEY)
B
CREATE TABLE Employee
(EmployeeID INTEGER INDEX)
C
CREATE TABLE Employee
(EmployeeID INTEGER NULL)
D
CREATE TABLE Employee
(EmployeeID INTEGER DISTINCT)
Question 26
A. PRIMARY KEY
B. CONSTRAINT
C. INSERT INTO
D. ORDER BY
Question 27
ID GivenName DateOfBirth
1 Tia 1976-05-30
2 Susana 1952-11-04
3 Joey 1963-02-17
Question 29
Complete the code by selecting the correct option from each drop-
down list.
Note: You will receive partial credit for each correct selection.
ORDER BY
LastName;
Question 30
A
SELECT SUM(ID), AVG(LineItemTotal),
MAX(LineItemTotal), SUM(LineItemTotal)
FROM ItemsOnOrder
B
SELECT COUNT(ID), AVG(LineItemTotal),
MAX(LineItemTotal), SUM(LineItemTotal)
FROM ItemsOnOrder
HAVING ItemNumber, Quantity, UnitPrice
C
SELECT COUNT(ID), AVG(UnitPrice+Quantity),
MAX(UnitPrice+Quantity),
SUM(UnitPrice+Quantity)
FROM ItemsOnOrder
GROUP BY ItemNumber, LineItemTotal
D
SELECT COUNT(ID), AVG(LineItemTotal),
MAX(LineItemTotal), SUM(LineItemTotal)
FROM ItemsOnOrder
Question 31
A
COPY * INTO Employee
SELECT *
FROM Employee
B
SELECT *
INTO EmployeeCopy
SELECT *
FROM Employee
C
INSERT INTO EmployeeCopy
SELECT *
FROM Employee
D
INSERT *
FROM Employee
INTO EmployeeCopy
Question 32
Question 33
A
SELECT COUNT(OrderID), Country
FROM Orders
HAVING COUNT(orderID) < 50
GROUP BY Country
B
SELECT COUNT(OrderID), Country
FROM Orders
GROUP BY Country
HAVING COUNT(orderID) < 50
C
SELECT Country, orderID
FROM Orders
GROUP BY Country
WHERE COUNT(orderID) < 50
D
SELECT Country, orderID
FROM Orders
HAVING COUNT(orderID) < 50
GROUP BY Country
Question 34
RoadID Distance
1234 22
1384 34
a. domino delete
b. cascade delete
c. functional delete
d. waterfall delete
e. inherited delete
Question 36
A
SET Price = Price * 1.06
FROM Products
WHERE ItemNumber = 1;
B
UPDATE Products
SET Price = Price * 1.06
WHERE ItemNumber = 1;
C
ALTER Products
SET Price = Price * 1.06
WHERE ItemNumber = 1;
D
USE Products
SET Price = Price * 1.06
WHERE ItemNumber = 1;
Question 37
Question 38
A
DELETE FROM Employee
WHERE Phone = NULL
B
DELETE FROM Employee
WHERE Phone = NULLABLE
C
DELETE FROM Employee
WHERE Phone IS NULL
D
DELETE FROM Employee
WHERE Phone IS NOT NULL
Question 39
Which query correctly returns a result set for all orders where the
ship_state excludes Texas (TX) and Arizona (AZ)?
A
SELECT * FROM Orders WHERE NOT ship_state =
‘TX’ AND NOT ship_state = ‘AZ’
B
SELECT * FROM Orders WHERE NOT ship_state =
‘TX’ OR NOT ship_state = ‘AZ’
C
SELECT * FROM Orders WHERE ship_state NOT =
‘TX’ OR ship_state NOT = ‘AZ’
D
SELECT * FROM Orders WHERE ship_state NOT =
‘TX’ AND ship_state NOT = ‘AZ’
Question 40
What changes are needed to the query above so that if removes the
SSN column from the Customers table?
A
ALTER TABLE Customers
DELETE COLUMN SSN;
B
ALTER TABLE Customers
DROP COLUMN SSN;
C
ALTER TABLE Customers
DROP SSN;
D
ALTER TABLE Customers
DELETE SSN;
Question 41
SELECT Title
FROM Movie
WHERE Title = ‘Sample Movie’
ORDER BY Title
GROUP BY Title
HAVING COUNT(*) = 1
You need to modify the query to run without error and return
accurate results.
Question 42
a. DELETE EmployeeView
b. DROP VIEW EmployeeView
c. DROP EmployeeView
d. DELETE VIEW EmployeeView
Question 43
Question 44
a. An index
b. A foreign key
c. A data type
d. A primary key
e. A unique constraint
Question 45
You have a table named Product that contains one million rows.
You need to search for product information using the following
query:
Question 46
a. BETWEEN
b. IN
c. FETCH
d. LIKE
Question 47
The stored procedure returns all null value. You verify that there is
data in the Person table.
Chapter table
Language Table
You need to select columns from the Chapter and Language tables
to create a composite primary key for the ChapterLanguage
table.
A. City
B. Country
C. LanguageName
D. Region
E. ChapterID
F. LanguageID
Question 49
a. An attribute
b. A primary key
c. A constraint
d. An index
Question 50
You create a table names Games that contains the review scores of
recently released video games.
Question 51
B. REVOKE User1
FROM Customer
C. REMOVE User1
FROM Customer
ID Name Age
1 Rene 18
2 Tia 22
3 Oliver 25
A. CREATE Student (
ID INT,
Name VARCHAR (100),
Age INT)
B. CREATE (
TABLE Student
ID INT,
Name VARCHAR (100),
Age INT)
D. CREATE TABLE (
ID INT,
Name VARCHAR (100),
Age INT)
Question 53
You need to display the flight numbers of all flights that arrive at
LaGuardia Airport (LGA) later today. The results should be sorted
by the most recent arrival time.
Which query should you use? Complete the code by selecting the
correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.
Answer Area:
Note: You will receive partial credit for each correct selection.
A clustered index improves the performance of queries that Return large results sets