SQL- Join, Group by, having

SQL- Join, Group by, having

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Entity Relationship Diagram

Entity Relationship Diagram

11th Grade

10 Qs

Network layers

Network layers

9th - 10th Grade

14 Qs

BÀI TẬP

BÀI TẬP

12th Grade

15 Qs

TCP/IP & other protocols [A Level]

TCP/IP & other protocols [A Level]

12th Grade

14 Qs

NHTW Programming

NHTW Programming

9th Grade

10 Qs

Networks - Introduction

Networks - Introduction

10th Grade

13 Qs

What is a computer?

What is a computer?

7th - 9th Grade

10 Qs

Chapter 8 by PD

Chapter 8 by PD

10th Grade

15 Qs

SQL- Join, Group by, having

SQL- Join, Group by, having

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Shailaja M

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?