Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

Leetcode Customers Who Never Order problem solution

YASH PAL, 31 July 2024

In this Leetcode Customers Who Never Order problem solution Suppose that a website contains two tables, the Customers table, and the Orders table. Write a SQL query to find all customers who never order anything.

Leetcode Customers Who Never Order problem solution

Problem solution in Oracle.

select Name as "Customers"
from Customers Left Join Orders 
ON Customers.Id = Orders.CustomerId
where Orders.CustomerId is null;

Problem solution in Mysql.

SELECT A.Name As Customers
FROM Customers A
WHERE NOT EXISTS
(SELECT B.CustomerId FROM Orders B WHERE B.CustomerId = A.Id)

Problem solution in TSQL.

SELECT A.Name AS Customers
FROM Customers AS A 
LEFT JOIN Orders AS B 
ON A.Id = B.CustomerID
WHERE B.CustomerID IS NULL

coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes