Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Scalar subquery. A query in brackets inside another query is a subquery. It runs first and hands its result to the outer query. When it returns exactly one value (one row, one column), you can use it anywhere a number fits, such as a WHERE comparison. The value is worked out on every run, so it stays right when the data changes.
select order_id, customer_id, order_date from orders where order_date = (select max(order_date) from orders)
Purchasing is reviewing the premium end of the catalogue and wants every product that lists above the average list price.
Return product_name and list_price for every product whose list_price is above the average list_price of all products. Work the average out inside the query, don't type it in.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe