SQL Interview Questions – Sellers With No Sales

Spread the love

Problem Description –

Write an SQL query to report the names of all sellers who did not make any sales in 2020.

Return the result table ordered by seller_name in ascending order.

The query result format is in the following example.

Problem Link – Sellers With No Sales

Difficulty Level – Easy

Solution –

SELECT
    seller_name
FROM Seller
WHERE seller_id NOT IN (SELECT seller_id FROM orders WHERE YEAR(sale_date) = '2020')
ORDER BY 1

Rating: 1 out of 5.

Leave a Reply