Skip to the content

News to Denver

Problem

The store is mailing a flyer to Denver, and the owner doesn't want to fill it with things Denver already knows. The flyer is for what's new there: the products no Denver customer has ever ordered. A product nobody has ordered, in any city, is new to Denver too.

Every order counts, including the one dated the 20th: mistyped date or not, whoever placed it already knows the product.

Show two columns for those products, the name and then the price.

What it has to return

These rows, in any order

nameprice
Laptop899
Tablet320
Headphones59.9
Speaker74

This is what comes out with the data in the practice database this challenge uses. The column names don’t count, so name yours however you like: what counts is how many there are and the order they come in. Besides this one, the challenge has hidden tests with other data that are revealed when you submit your solution.

You start with this

SQL

SELECT p.name, p.price
FROM products p
JOIN orders o
  ON o.product_id = p.id;
Solve this challenge

It opens in your browser, with the editor and the tests. This challenge is part of the full plan; the O(1) and O(log n) ones are free.

More O(n log n) challenges

See all challenges →