zoukankan      html  css  js  c++  java
  • 【SQL】183. Customers Who Never Order

    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          |
    +----+------------+
    1 # Write your MySQL query statement below
    2 select Name Customers
    3 from Customers
    4 where Id not in (select CustomerId
    5                  from Orders);
  • 相关阅读:
    第一个C#程序
    定位网页元素
    盒子模型
    浮动
    css3美化网页元素
    html css3
    java表单基础
    表单
    html5基础
    java程序题目解析
  • 原文地址:https://www.cnblogs.com/fcyworld/p/6495975.html
Copyright © 2011-2022 走看看