183. Customers Who Never Order

原创 2016年08月30日 09:17:27

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.

Table: Customers.

+----+-------+
| Id | Name  |
+----+-------+
| 1  | Joe   |
| 2  | Henry |
| 3  | Sam   |
| 4  | Max   |
+----+-------+

Table: Orders.

+----+------------+
| Id | CustomerId |
+----+------------+
| 1  | 3          |
| 2  | 1          |
+----+------------+

Using the above tables as example, return the following:

+-----------+
| Customers |
+-----------+
| Henry     |
| Max       |
+-----------+


SELECT c.Name AS Customers

FROM Customers c
WHERE c.Id
NOT IN
(SELECT CustomerId FROM Orders);
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Your Customers Do not Mean What They Say

I've never met a customer yet that wasn't all too happy to tell me what they wanted — usually in gre...

Trump Never Give Up

  • 2008-09-24 09:07
  • 3.15MB
  • 下载

Mining the Network Value of Customers

挖掘用户的网络价值 传统的大规模营销模式是毫无区分的对每个用户进行产品推销,而直销营销首先做的是选择那些可能有力的用户进行推销。而数据挖掘正好在这一步起着关键性作用。通过用户的历史购买欣慰和人口统计...

Tim Cook tells employees Apple has ‘big plans’ for 2014 that ‘customers are going to love’

以下是苹果CEO的员工邮件,分享下。 Team, This holiday season, tens of millions of people around the world, fro...

the_theory_that_never_die

  • 2017-06-05 20:30
  • 2.34MB
  • 下载

SGU 183 Painting the balls (DP优化)

183. Painting the balls time limit per test: 0.25 sec.  memory limit per test: 4096 KB inpu...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)