Subqueries & CTEs
Exercise · SQL & Querying

Predict, then run it

Predict the output

items(id, sku) = (1,A),(2,B). prices(sku, cents) = (A,100),(B,200). The robust lookup is a join on the unique sku:

SELECT i.id, p.cents AS price FROM items i JOIN prices p ON p.sku = i.sku ORDER BY i.id;

Predict the exact output.