Sobes.tech
Intern — Middle

SQL queries: finding couriers with undelivered orders

livecode

Task condition

Write a query that outputs all couriers working in the city of Saint Petersburg, and who have at least one order with the status NOT_DELIVERED.

CREATE TABLE orders (
    id INT,
    courier_id INT,
    status VARCHAR(20)
);

CREATE TABLE couriers (
    id INT,
    city VARCHAR(100)
);