Course Content
Intermediate SQL
Intermediate SQL
Combining Table Results
In this chapter, we'll practice with the UNION
clause. We'll be working with these two tables:
employees
:
contractors
:
Task
For practice, your task will be to combine the employees
and contractors
tables using the UNION
clause.
After that, from the resulting table, you should retrieve only those IDs that are multiples of 2. Also, you need to retrieve the first_name
and last_name
columns. Use the syntax WHERE id % 2 = 0
. For this task, you need to use subqueries in the FROM
section just as shown in the example.
Good luck!
Note
As a result, you should have 3 columns:
id
(an alias for the ID from both tables),first_name
,last_name
.
Thanks for your feedback!
Combining Table Results
In this chapter, we'll practice with the UNION
clause. We'll be working with these two tables:
employees
:
contractors
:
Task
For practice, your task will be to combine the employees
and contractors
tables using the UNION
clause.
After that, from the resulting table, you should retrieve only those IDs that are multiples of 2. Also, you need to retrieve the first_name
and last_name
columns. Use the syntax WHERE id % 2 = 0
. For this task, you need to use subqueries in the FROM
section just as shown in the example.
Good luck!
Note
As a result, you should have 3 columns:
id
(an alias for the ID from both tables),first_name
,last_name
.
Thanks for your feedback!
Combining Table Results
In this chapter, we'll practice with the UNION
clause. We'll be working with these two tables:
employees
:
contractors
:
Task
For practice, your task will be to combine the employees
and contractors
tables using the UNION
clause.
After that, from the resulting table, you should retrieve only those IDs that are multiples of 2. Also, you need to retrieve the first_name
and last_name
columns. Use the syntax WHERE id % 2 = 0
. For this task, you need to use subqueries in the FROM
section just as shown in the example.
Good luck!
Note
As a result, you should have 3 columns:
id
(an alias for the ID from both tables),first_name
,last_name
.
Thanks for your feedback!
In this chapter, we'll practice with the UNION
clause. We'll be working with these two tables:
employees
:
contractors
:
Task
For practice, your task will be to combine the employees
and contractors
tables using the UNION
clause.
After that, from the resulting table, you should retrieve only those IDs that are multiples of 2. Also, you need to retrieve the first_name
and last_name
columns. Use the syntax WHERE id % 2 = 0
. For this task, you need to use subqueries in the FROM
section just as shown in the example.
Good luck!
Note
As a result, you should have 3 columns:
id
(an alias for the ID from both tables),first_name
,last_name
.