
Database Practice Test 1 Review
Authored by Susan Fudge
Information Technology (IT)
11th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which SQL statement correctly retrieves a list of customers from Utah, sorted by last name?
SELECT lastname, firstname FROM customers WHERE state = 'UT' ORDER BY lastname;
SELECT lastname, firstname FROM customers ORDER BY lastname WHERE state = 'UT';
SELECT lastname, firstname FROM customers WHERE state = 'UT' GROUP BY lastname;
SELECT lastname, firstname FROM customers ORDER BY lastname;
Answer explanation
The correct SQL statement is 'SELECT lastname, firstname FROM customers WHERE state = 'UT' ORDER BY lastname;'. It filters customers from Utah and sorts them by last name, which is the requirement.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about the GROUP BY clause are true?
Yes, No, No
No, Yes, No
Yes, Yes, No
No, No, Yes
Answer explanation
The correct choice is 'No, Yes, No' because the GROUP BY clause is used to group rows that have the same values in specified columns, and it can be used with aggregate functions. The other options do not accurately reflect this.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the issue with the following SQL statement? SELECT LastName, FirstName, COUNT(OrderID) FROM Customers GROUP BY LastName HAVING COUNT(OrderID) >= 5;
The SQL statement is missing a GROUP BY clause for FirstName.
The HAVING clause is incorrectly used instead of WHERE.
The COUNT function is used incorrectly in the SELECT clause.
The SQL statement is correct and has no issues.
Answer explanation
The SQL statement is missing a GROUP BY clause for FirstName. When using aggregate functions like COUNT, all selected non-aggregated columns must be included in the GROUP BY clause.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would cause a runtime error in the following SQL statement? sql CopyEdit UPDATE Customers SET Status = 'Gold' IF TotalAmount > 10000;
The object type needs to be specified within the UPDATE statement.
The IF clause needs to be at the beginning of the statement.
The IF clause needs to be a WHERE clause.
The statement needs semicolons.
Answer explanation
The SQL statement incorrectly uses an IF clause. In SQL, conditions for updates should be specified using a WHERE clause to filter which records to update. Thus, 'IF TotalAmount > 10000' should be 'WHERE TotalAmount > 10000'.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which SQL statement is used to insert multiple rows at once?
INSERT INTO table_name VALUES (value1, value2, value3,...);
INSERT INTO table_name SELECT (column1, column2, column3);
INSERT INTO table_name(column1, column2) VALUES (value1a, value1b), (value2a, value2b);
INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...);
Answer explanation
The correct choice is 'INSERT INTO table_name(column1, column2) VALUES (value1a, value1b), (value2a, value2b);' as it allows inserting multiple rows in a single statement using comma-separated value sets.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A quality control specialist wants to retrieve an orderID after inputting an orderdetailID. Which of the following SQL statements correctly creates the required stored procedure?
CREATE PROCEDURE uspGetOrderID @orderdetailIID int, @orderID int OUTPUT BEGIN SELECT @orderID = orderid FROM orderdetails WHERE orderdetailid = @orderdetailID END
CREATE PROCEDURE uspGetOrderID @orderdetailIID int, @orderID int OUTPUT AS BEGIN SELECT orderid FROM orderdetails WHERE orderdetailid = @orderdetailID RETURN @orderID END
CREATE PROCEDURE uspGetOrderID @orderdetailIID int AS BEGIN SELECT orderid FROM orderdetails WHERE orderdetailid = @orderdetailID END
CREATE PROCEDURE uspGetOrderID @orderdetailIID int, @orderID int OUTPUT AS BEGIN SELECT orderid FROM orderdetails WHERE orderdetailid = @orderdetailID END
Answer explanation
The correct choice initializes the OUTPUT parameter @orderID with the result of the SELECT statement, allowing the orderID to be retrieved after inputting orderdetailID. The other options either lack proper assignment or syntax.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the CREATE PROCEDURE clause do in the given SQL statement?
Initializes a stored procedure
Deletes a stored procedure
Modifies a stored procedure
Initializes the stored procedure and ensures the orderID is returned.
Answer explanation
The CREATE PROCEDURE clause initializes a stored procedure, which is a set of SQL statements that can be executed as a single unit. The correct choice also indicates that it ensures the orderID is returned, which is part of its functionality.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Quizzi bài 29 Tin học 10
Quiz
•
10th Grade - University
16 questions
Kuis Uji Pemahaman Python Variabel, Sintaks Dasar, Type Data
Quiz
•
11th Grade - University
10 questions
Online Platforms
Quiz
•
11th Grade
14 questions
Week 3-Database Quiz 1
Quiz
•
9th - 12th Grade
10 questions
0- and 1-Pixel Art Activity
Quiz
•
9th - 12th Grade
10 questions
Network Configuration Quiz
Quiz
•
9th - 12th Grade
15 questions
Research Skills Quiz
Quiz
•
11th Grade
15 questions
A1 What is the Internet
Quiz
•
11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
15 questions
Atomic Habits: Career Habits
Lesson
•
9th - 12th Grade
16 questions
ACT English - Grammar Practice #2
Quiz
•
11th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade