Verified Commit e5086838 authored by Kiryuu Sakuya's avatar Kiryuu Sakuya 🎵
Browse files

No update

parent dceb752d
......@@ -54,14 +54,18 @@ CREATE TABLE S (
### 1. 用SQL查询收件人姓名为 “李四” 的包裹物流号、配送员姓名和配送时间
> 在 C 表里有快递员编号,D 表里也有快递员编号;P 表里有物流号,D 表里也有物流号。
```mysql
SELECT P.Pno AS "包裹物流号", C.Cname AS "快递员姓名", D.Dtime AS "配送时间" FROM P, C, D WHERE P.Preceiver = "李四";
SELECT P.Pno AS "包裹物流号", C.Cname AS "快递员姓名", D.Dtime AS "配送时间" FROM P, C, D WHERE C.Cno = D.Cno AND D.Pno = P.Pno AND P.Preceiver = "李四";
```
### 2. 查询2017-4-1至2017-5-1(包括2017-4-1和2017-5-1这两天)配送包裹数量至少为100个的快递员的姓名、年龄和底薪
>
```mysql
SELECT Cname, Cage, Csalary FROM C, D WHERE D.Dtime >= '2017-04-01' AND D.Dtime <= '2017-54-01' HAVING COUNT(D.Cno)>100;
SELECT C.Cname, C.Cage, C.Csalary FROM C, D WHERE D.Dtime >= '2017-04-01' AND D.Dtime <= '2017-05-01' HAVING COUNT(D.Cno)>1;
```
### 3. 对所有年龄低于40的快递员,若底薪小于2500,则增加400工资,若大于等于2500,则增加200工资
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment