SQL- Join, Group by, having

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Shailaja M
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following SQL statements will retrieve only the records where there is a match between the Customers and Orders tables?
SELECT * FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID;
SELECT * FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID;
SELECT * FROM Customers RIGHT JOIN Orders ON Customers.CustomerID = Orders.CustomerID;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following query return?
sql?
SELECT Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.Country
FROM Orders
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
Orders that do not have any associated customers.
All customers and the details of their orders
All orders along with the customer details for the orders
Customers that do not have any orders.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following SQL query, which table's data will be included in the result set even if there is no match in the other table?SELECT Customers.CustomerName, Orders.OrderID FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID;
Customers
Orders
Both tables
Neither Table
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you modify the following query to display the total number of orders placed by each customer?
SELECT Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.Country
FROM Orders
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
Add a GROUP BY clause to group by CustomerName
Add a DISTINCT function and GROUP BY OrderID
Add a COUNT function and GROUP BY OrderDate
Add a COUNT function and GROUP BY CustomerName
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which SQL clause is used to group rows that have the same values in specified columns?
ORDER BY
GROUP BY
HAVING
DISTINCT
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following query return?
SELECT Shippers.ShipperName, COUNT(Orders.OrderID) AS NumberOfOrders FROM Orders LEFT JOIN Shippers ON Orders.ShipperID = Shippers.ShipperID GROUP BY ShipperName;
The total number of orders delivered by each shipper
The total number of orders placed by each customer
The total number of orders with their shipper names
he total number of customers who placed orders
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to filter the grouped rows in the result set based on a condition?
WHERE
GROUP BY
DISTINCT
HAVING
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Structured Query Language (SQL)

Quiz
•
12th Grade
10 questions
Follow Up LAP Quiz

Quiz
•
9th - 12th Grade
10 questions
Database Concepts-IGCSE Chap-9

Quiz
•
9th Grade
11 questions
Understanding Workplace Technology Knowledge Check!

Quiz
•
10th Grade
11 questions
1.1.4.4. WJEC GCSE DigiTech - Changing relationships

Quiz
•
9th - 10th Grade
15 questions
Cambridge Technicals Unit 2 LO3 [3.2 - 3.5]

Quiz
•
12th Grade
10 questions
Go Beyond the Sales LAP Quiz

Quiz
•
9th - 12th Grade
10 questions
OS Essentials - Chapter 14 (The IT Professional)

Quiz
•
KG - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade