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);
版权声明:本文为博主原创文章,未经博主允许不得转载。

OCP-1Z0-051-题目解析-第8题

8. View the Exhibit and examine the structure of the CUSTOMERS table. Which two tasks would requir...
  • wjx515628
  • wjx515628
  • 2014年06月27日 15:29
  • 1228

OCP-1Z0-051 补充题库 第15题 子查询和join

一、原题 The COMMISSION column shows the monthly commission earned by the employee. Which two tasks wo...
  • hollo_hhy
  • hollo_hhy
  • 2014年06月20日 09:48
  • 1983

Redis学习笔记五——启动警告问题的解决

如果启动前不对linux内核做任何更改,那么redis启动会报出警告,共三个:如下图所示 第一个警告:The TCP backlog setting of 511 cannot be enforc...
  • a491857321
  • a491857321
  • 2016年07月23日 20:48
  • 10600

60.View the Exhibit and examine the structure of CUSTOMERS table.

60.View the Exhibit and examine the structure of CUSTOMERS table.
  • dwj19830118
  • dwj19830118
  • 2016年02月29日 17:17
  • 661

What Microsoft, Oracle, IBM, And SAP Don't Tell Customers

Share The four big software vendors -- Microsoft, Oracle, IBM, and SAP -- have hidden...
  • watson243671
  • watson243671
  • 2011年11月22日 16:16
  • 719

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...
  • hellominix
  • hellominix
  • 2013年04月04日 09:28
  • 314

Mining the Network Value of Customers

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

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...
  • u012994307
  • u012994307
  • 2013年12月25日 09:16
  • 534

Your Customers Do Not Mean What They Say

Your Customers Do Not Mean What They SayNate JacksonI’VE NEVER MET A CUSTOMER YET that wasn’t all to...
  • wangzi11322
  • wangzi11322
  • 2015年07月16日 09:11
  • 937

Toyota Taps Salesforce CRM Technology to Link Customers to Their Cars

http://www.managingautomation.com/maonline/exclusive/read/Toyota_Taps_Salesforce_CRM_Technology_to_L...
  • lybra
  • lybra
  • 2011年05月25日 20:56
  • 832
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:183. Customers Who Never Order
举报原因:
原因补充:

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