码迷,mamicode.com
首页 > 数据库 > 详细

NorthWind 数据库

时间:2014-09-07 13:32:45      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:sql   northwind   

NorthWind 数据库

bubuko.com,布布扣
  • Categories:产品类别;
  • Customers:客户;
  • Employees:雇员
  • Employees Territories:员工涉及领域
  • Order Details:订单明细
  • Orders:订单
  • Products:产品
  • Region:地区
  • Shippers:运货商
  • Suppliers:供应商
  • Territories:地域
        在NorthWind数据库中创建关系图:
bubuko.com,布布扣
        下面进行几次查询了解数据内容:
select productid,productname,unitprice from Products
where UnitPrice>49
查询结果:
bubuko.com,布布扣
select productid,productname,UnitsInStock,UnitsOnOrder
 from Products where UnitsInStock<UnitsOnOrder
查询结果:
bubuko.com,布布扣
select * from Products
where ProductName='Aniseed Syrup' or ProductName='Ipoh Coffee'
select * from Products
where ProductName in('Aniseed Syrup','Ipoh Coffee')
查询结果:
bubuko.com,布布扣
select * from Products
where SupplierID=CategoryID
查询结果:
bubuko.com,布布扣
select SupplierID,CompanyName,Phone,Fax from Suppliers
where Phone is not null and fax is null
bubuko.com,布布扣
select * from Suppliers
order by City  desc
bubuko.com,布布扣
select SupplierID,CompanyName,Country from Suppliers
where Country in('USA','UK','Germany')
bubuko.com,布布扣
select SupplierID,CompanyName,ContactTitle,Phone 
from Suppliers
where  ContactTitle='Marketing Manager' and Phone is not null
bubuko.com,布布扣
select distinct ShipVia from Orders
bubuko.com,布布扣
select distinct ShipCity from Orders
bubuko.com,布布扣
select OrderID,ShippedDate,RequiredDate from Orders
where ShippedDate>RequiredDate
bubuko.com,布布扣
select OrderID,CustomerID,Freight from Orders
where Freight<55
bubuko.com,布布扣
select * from Categories
where CategoryName like '_e%'
bubuko.com,布布扣
select * from Categories
where Description like '%sweet%'
bubuko.com,布布扣

NorthWind 数据库

标签:sql   northwind   

原文地址:http://blog.csdn.net/crazygolf/article/details/39119143

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!