哪位高手帮忙写一下这个 SQL 的查询语句 有追加

来源:百度知道 编辑:UC知道 时间:2024/05/26 20:09:01
表salesperson
Name Age Salary
Abel 63 120,000
Baker 38 42,000
Jones 26 36,000
Murphy 42 50,000
Zenith 59 118,000
Kobad 27 34,000

表order
Number CustName SalespersonName Amount
100 Abernathy Construction Zenith 560
200 Abernathy Construction Jones 1800
300 Manchester Lumber Abel 480
400 Amalgamated Housing Abel 2500
500 Abernathy Construction Murphy 6000
600 Tri-city Builders Abel 700
700 Manchester Lumber Jones 150

表customer
Name City Industry Type
Abernathy Construction Willow B
Manchester Lumber Manchester F
Tri-city Builders Memphis B
Amalgamated Housing Memphis B

1.计算每一个salepeople的订单数,结果只包括订单数量在500个以上的。
2.显示和在memphis中的一个客户有订单的salespeople的年龄(使用连接查询)。
3.显示和在memphis中的所有公司的工业类型和公司所有订单的销售员的年龄。

没找到salepeople,根据单词意思我就当成Salesperson处理了。
参考如下,余问再复:
①sele SalespersonName,sum(Amount) from 表order ;
group by SalespersonName havin sum(Amount)>=500

你的表各个字段太混乱了,你整理一下,还有说清楚salepeople是什么,给我发消息,我再回答吧。

①sele SalespersonName,sum(Amount) from 表order ;
group by SalespersonName havin sum(Amount)>=500