leetcode

Leetcode submissions
git clone git://git.laack.co/leetcode.git
Log | Files | Refs | README

customers-who-never-order.sql (303B)


      1 --Write a SQL query to find the customers who do not have any
      2 --associated orders and return the names of the customers with the
      3 --heading of "Customers"
      4 
      5 --Speed: 981ms Beats: 59.87%
      6 SELECT C.name as Customers
      7 FROM Customers as C
      8 LEFT JOIN Orders as O
      9 ON O.customerId = C.id
     10 WHERE O.customerId IS NULL