Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Resolve Tasks
13. Task 8

Instruction

Great! Thanks for your help. Terry now knows what to do to expand his company. There is only one task left. Show Terry the most expensive car part in his store and the most expensive service provided in his workshop.

Exercise

Select the name and the price of the most expensive car part in the store and the name and price of the most expensive service.

The column names sould be name and price and the result table should look like this:

name price
part name part price
service name service price

Stuck? Here's a hint!

Use the UNION operator between the two queries that select the name and the price of a car part (in the first query) and the name and the price of the service (in the second query).

In the two queries, use WHERE to compare the price (use the = operator) to the value returned by a subquery that selects the max price among car parts and a subquery that selects the max price among services.

Find out more about UNION in the course SQL Basics or comparison with subqueries.