
SQL Questions
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Ruby Liang
Used 10+ times
FREE Resource
Enhance your content in a minute
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Imagine you're a data scientist, and you're on a mission to find all employees named after the letter 'J' in the vast database of 'Mystery Inc.' Which SQL statement would you use with the LIKE operator to uncover these hidden gems?
SELECT * FROM Employees WHERE Name STARTS WITH 'J';
SELECT * FROM Employees WHERE Name = 'J%';
SELECT * FROM Employees WHERE Name MATCH 'J*';
SELECT * FROM Employees WHERE Name LIKE 'J%';
Answer explanation
The correct SQL statement using the LIKE operator to find employees whose names start with 'J' is: SELECT * FROM Employees WHERE Name LIKE 'J%';
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Imagine Harry is on a quest to find unique city names in a vast database of customer information. How would he write a SQL query to select distinct city names from the Customers table?
SELECT DISTINCT City FROM Customers;
SELECT UNIQUE City FROM Customers;
SELECT City FROM Customers DISTINCT;
LIST DISTINCT Cities FROM Customers;
Answer explanation
The correct choice is 'SELECT DISTINCT City FROM Customers;' which retrieves unique city names from the Customers table.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the `JOIN` statement in SQL?
To delete records from a table
To insert new records into a table
To update records in a table
To combine rows from two or more tables, based on a related column between them
Answer explanation
The purpose of the JOIN statement in SQL is to combine rows from two or more tables based on a related column between them, allowing for data retrieval from multiple tables simultaneously.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which SQL statement correctly represents an INNER JOIN between the tables Employees and Departments where the DepartmentID matches?
SELECT * FROM Employees JOIN Departments USING DepartmentID;
SELECT * FROM Employees INNER JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID;
SELECT * FROM Employees AND Departments WHERE Employees.DepartmentID = Departments.DepartmentID;
SELECT * FROM Employees, Departments WHERE Employees.DepartmentID = Departments.DepartmentID;
Answer explanation
The correct SQL statement for INNER JOIN between Employees and Departments is SELECT * FROM Employees INNER JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID;
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which SQL statement uses a LEFT JOIN with aliases to list all employees and their orders, including those who have not placed any orders?
SELECT E.LastName FROM E Employees LEFT JOIN O Orders ON E.EmployeeID = O.EmployeeID;
SELECT E.LastName, O.OrderID FROM E Employees FULL OUTER JOIN O Orders ON E.EmployeeID = O.EmployeeID WHERE O.OrderID IS NULL;
SELECT E.LastName, O.OrderID FROM Employees E LEFT JOIN Orders O ON E.EmployeeID = O.EmployeeID;
Answer explanation
The correct SQL statement uses a LEFT JOIN to list all employees and their orders, including those who have not placed any orders, by joining the Employees table with the Orders table on the EmployeeID column.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Imagine you're an intern in the HR department! Your mission is to find out those employees in the 'HR' department who are earning more than a golden number: 50000. Which SQL statement would you use?
SELECT * FROM Employees WHERE Department == 'HR' AND Salary >> 50000;
SELECT * FROM Employees WHERE Department = 'HR' & Salary > 50000;
SELECT * FROM Employees WHERE Department = 'HR' AND Salary > 50000;
SELECT * FROM Employees WHERE Department = 'HR' THEN Salary > 50000;
Answer explanation
The correct SQL statement is 'SELECT * FROM Employees WHERE Department = 'HR' AND Salary > 50000;'. It correctly finds employees in the 'HR' department with salaries greater than 50000.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which SQL statement correctly uses an alias for a column name?
SELECT LastName AS Surname FROM Employees;
SELECT LastName NAME 'Surname' FROM Employees;
DEFINE LastName AS Surname FROM Employees;
SELECT LastName SET AS Surname FROM Employees;
Answer explanation
The correct SQL statement that uses an alias for a column name is 'SELECT LastName AS Surname FROM Employees;'.
Create a free account and access millions of resources
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
CHAPTER 1: COMPUTER SECURITY REVIEW
Quiz
•
University
10 questions
Computer Education Grade 3 Volume 4 Quiz
Quiz
•
3rd Grade - University
10 questions
CP N5 Theory Test 1
Quiz
•
University
10 questions
Perkakasan Multimedia
Quiz
•
University
10 questions
ITESA Roadmap Event 12-09-24
Quiz
•
University
10 questions
CompTIA Core 2 20221023
Quiz
•
University
13 questions
Week 2 Before Class
Quiz
•
University
17 questions
Email Lớp 6
Quiz
•
6th Grade - University
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Computers
10 questions
Identifying equations
Quiz
•
KG - University
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
HS2C2 AB QUIZIZZ
Quiz
•
1st Grade - Professio...
14 questions
Homonyms Quiz
Quiz
•
KG - University
16 questions
Parts of a Parabola
Quiz
•
8th Grade - University
10 questions
A Brief History of Geologic Time
Interactive video
•
11th Grade - University
15 questions
Black Friday/Cyber Monday
Quiz
•
9th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
