NYC Certified IT Administrator (Database) Exam
Practice Verified Questions And Correct Answers
(Verified Answers) Plus Rationales 2026/2027 Q&A |
Instant Download Pdf
A quality control specialist wants to see an orderID after
inputting an orderdetailID. Using drag and drop, create the
stored procedure necessary to fulfill this request. Not
every step will be used.
just try to put it in order
WHERE orderdetailid = @orderdetailid
SELECT @orderid = orderid from orderdetails
CREATE PROCEDURE uspGetOrderID
@orderdetailID int, @orderID int OUTPUT
RETURN @orderID
,2|Page
AS BEGIN
END - Answer-CREATE PROCEDURE uspGetOrderID
@orderdetailID int, @orderID int OUTPUT
AS BEGIN
SELECT @orderid = orderid from orderdetails
WHERE orderdetailid = @orderdetailid
END
You have created a list of students who are helping at a
Science Fair. The list is contained in a database table
named Students that has the following columns and
rows:Id FirstName1 Shannon2 Juan3 Benjamin4
TiffanyYou have learned that Benjamin will not be
attending the Science Fair and Kayden will be replacing
him. What SQL query will replace Benjamin with Kayden in
the table?Instructions: To answer, drag the appropriate
,3|Page
SQL statement from the column on the left to its place in
the SQL query on the right. Each data type may be used
once, more than once, or not at all.
FROM Students
SET FirstName = 'Kayden'
UPDATE FirstName =
WHERE FirstName = 'Benjamin'
SET Students
TO FirstName =
UPDATE Students - Answer-UPDATE Students
SET FirstName =
'Kayden'
WHERE FirstName = 'Benjamin'
A database designer wants to ensure that locations in a
sales territory table exist in a related locations table. The
designer writes the following SQL statement to adjust the
sales territory table:
, 4|Page
ALTER TABLE salesterritory
ADD CONSTRAINT fk_location
FOREIGN KEY (locationID) REFERENCES
locations(locationID)
What is being enforced using this SQL statement?
Referential integrity
Primary key
Foreign key
Compound key - Answer-Referential integrity
(which is the assurance that a value exists in a parent of a
table relationship before a child value is allowed, is being
enforced)
A database of students contains more than one record
containing the lastname "Smith" and firstname "David". If
these records are not duplicates, how are they
differentiated within the database?
oooo
Schema
Foreign key