Master SQL for Data Analysis - Union, Intersect, Except

Master SQL for Data Analysis - Union, Intersect, Except

Assessment

Interactive Video

Information Technology (IT), Architecture, Social Studies

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial covers SQL operators UNION, INTERSECT, and EXCEPT. It explains how UNION combines results from multiple tables, removing duplicates, and provides examples using customer and supplier data. The INTERSECT operator is introduced to find common rows between tables, while the EXCEPT operator is used to find distinct rows in one table that do not appear in another. The tutorial emphasizes the importance of having the same structure in SELECT queries for these operations.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary function of the UNION operator in SQL?

To find rows present in one table but not in another

To find common rows between two tables

To combine results from multiple SELECT statements into one table, removing duplicates

To sort the results of a query

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When using the UNION operator, what must be true about the SELECT queries?

They must have the same number of columns and data types

They must be from the same database

They must include a WHERE clause

They must have different column names

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the example provided, how many distinct cities were found using the UNION operator?

7

162

161

6

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the INTERSECT operator do in SQL?

Finds rows present in one table but not in another

Combines results from multiple SELECT statements into one table

Sorts the results of a query

Finds common rows between two tables

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many cities were found to exist in both the customer and supplier tables using the INTERSECT operator?

7

161

6

162

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the EXCEPT operator in SQL?

To find rows present in one table but not in another

To find common rows between two tables

To combine results from multiple SELECT statements into one table

To sort the results of a query

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the EXCEPT example, how many distinct cities were found in the customers table but not in the suppliers table?

162

161

155

6