Skip to content
Programmingoneonone
Programmingoneonone
  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone

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 solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Programing Practice

  • C Programs
  • java Programs

HackerRank Solutions

  • C
  • C++
  • Java
  • Python
  • Algorithm

Other

  • Leetcode Solutions
  • Interview Preparation

Programming Tutorials

  • DSA
  • C

CS Subjects

  • Digital Communication
  • Human Values
  • Internet Of Things
  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes