Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kiryuu Sakuya
Database-test
Commits
e5086838
Verified
Commit
e5086838
authored
Dec 11, 2019
by
Kiryuu Sakuya
🎵
Browse files
No update
parent
dceb752d
Changes
1
Hide whitespace changes
Inline
Side-by-side
01. 某物流公司数据库.md
View file @
e5086838
...
...
@@ -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-5
4
-01' HAVING COUNT(D.Cno)>1
00
;
SELECT
C.
Cname,
C.
Cage,
C.
Csalary FROM C, D WHERE D.Dtime >= '2017-04-01' AND D.Dtime <= '2017-
0
5-01' HAVING COUNT(D.Cno)>1;
```
### 3. 对所有年龄低于40的快递员,若底薪小于2500,则增加400工资,若大于等于2500,则增加200工资
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment