10-251 B1-5查询客户的订单情况

分数 20

全屏浏览题目

切换布局

作者 柯海丰

单位 浙大城市学院

查找客户的订单情况,显示为:顾客编号(CustomerID) ,公司名称(CompanyName)订单编号(OrderID),员工编号(EmployeeID)

提示:请使用SELECT语句作答。

表结构:

orders表:

列名数据类型长度主码说明
OrderIDint11订单编号
CustomerIDvarchar5顾客编号
EmployeeIDint11员工编号
OrderDatedatetime,订购日期
RequiredDatedatetime,预计到达日期
ShippedDatedatetime,发货日期
ShipViaint11运货商
Freightdecimal10,4运费
ShipNamevarchar40货主姓名
ShipAddressvarchar60货主地址
ShipCityvarchar15所在城市
ShipRegionvarchar15区域
ShipPostalCodevarchar10邮政编码
ShipCountryvarchar15所在国家

customers表:

列名数据类型长度主码说明
CustomerIDvarchar5顾客编号
CompanyNamevarchar40公司名称
ContactNamevarchar30联系姓名
ContactTitlevarchar30联系头衔
Addressvarchar60地址
Cityvarchar15城市
Regionvarchar15区域
PostalCodevarchar10邮政编码
Countryvarchar15国家
Phonevarchar24电话
Faxvarchar24传真

表样例

orders表:

OrderIDCustomerIDEmployeeIDOrderDateRequiredDateShippedDateShipViaFreightShipNameShipAddressShipCityShipRegionShipPostalCodeShipCountry
10248VINET51996/7/4 00:00:001996/8/1 00:00:001996/7/16 00:00:00332.3800Vins et alcools Chevalier59 rue de l-AbbayeReims51100France
10249TOMSP61996/7/5 00:00:001996/8/16 00:00:001996/7/10 00:00:00111.6100Toms SpezialittenLuisenstr. 48Mnster44087Germany
10250HANAR41996/7/8 00:00:001996/8/5 00:00:001996/7/12 00:00:00265.8300Hanari CarnesRua do Pao, 67Rio de JaneiroRJ05454-876Brazil
10251VICTE31996/7/8 00:00:001996/8/5 00:00:001996/7/15 00:00:00141.3400Victuailles en stock2, rue du CommerceLyon69004France
10252SUPRD41996/7/9 00:00:001996/8/6 00:00:001996/7/11 00:00:00251.3000Suprmes dlicesBoulevard Tirou, 255CharleroiB-6000Belgium
10253HANAR31996/7/10 00:00:001996/7/24 00:00:001996/7/16 00:00:00258.1700Hanari CarnesRua do Pao, 67Rio de JaneiroRJ05454-876Brazil
10254CHOPS51996/7/11 00:00:001996/8/8 00:00:001996/7/23 00:00:00222.9800Chop-suey ChineseHauptstr. 31Bern3012Switzerland
10255RICSU91996/7/12 00:00:001996/8/9 00:00:001996/7/15 00:00:003148.3300Richter SupermarktStarenweg 5Genve1204Switzerland
10256WELLI31996/7/15 00:00:001996/8/12 00:00:001996/7/17 00:00:00213.9700Wellington ImportadoraRua do Mercado, 12ResendeSP08737-363Brazil
10265BLONP21996/7/25 00:00:001996/8/22 00:00:001996/8/12 00:00:00155.2800Blondel pre et fils24, place KlberStrasbourg67000France

customers表:

CustomerIDCompanyNameContactNameContactTitleAddressCityRegionPostalCodeCountryPhoneFax
ALFKIAlfreds FutterkisteMaria AndersSales RepresentativeObere Str. 57Berlin12209Germany030-0074321030-0076545
ANATRAna Trujillo Emparedados y heladosAna TrujilloOwnerAvda. de la Constitucin 2222Mxico D.F.05021Mexico(5) 555-4729(5) 555-3745
ANTONAntonio Moreno TaqueraAntonio MorenoOwnerMataderos 2312Mxico D.F.05023Mexico(5) 555-3932
AROUTAround the HornThomas HardySales Representative120 Hanover Sq.LondonWA1 1DPUK(171) 555-7788(171) 555-6750
BERGSBerglunds snabbkpChristina BerglundOrder AdministratorBerguvsvgen 8LuleS-958 22Sweden0921-12 34 650921-12 34 67
BLAUSBlauer See DelikatessenHanna MoosSales RepresentativeForsterstr. 57Mannheim68306Germany0621-084600621-08924
BLONPBlondesddsl pre et filsFrdrique CiteauxMarketing Manager24, place KlberStrasbourg67000France88.60.15.3188.60.15.32
BOLIDBlido Comidas preparadasMartn SommerOwnerC/ Araquil, 67Madrid28023Spain(91) 555 22 82(91) 555 91 99
BONAPBon app'Laurence LebihanOwner12, rue des BouchersMarseille13008France91.24.45.4091.24.45.41
BOTTMBottom-Dollar MarketsElizabeth LincolnAccounting Manager23 Tsawassen Blvd.TsawassenBCT2F 8M4Canada(604) 555-4729(604) 555-3745

输出样例:

CustomerIDCompanyNameOrderIDEmployeeID
BLONPBlondesddsl pre et fils102652
select DISTINCT orders.CustomerID,customers.CompanyName,orders.OrderID,orders.EmployeeID
from orders join customers on orders.CustomerID=customers.CustomerID

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

@pon

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值