第四届CCSP 第三题 SQL查询

TimeLimit:10000MS  MemoryLimit:1024MB
64-bit integer IO format:%lld
Special Judge
未提交 | 登录后收藏
Problem Description

AZ8~H[)8LL5%$VIINW~P15T.png$B3_(]{K}5{_~G5U{FK5IB9.png%K8ZA1RM(LL]G9UDI]0U]EL.png@GKG~~]4%G9CAE35DN`UR~X.pngAO{DJ)WI]`3L}MGKE1}62RX.png4}]9@~J7OUZ703FG$0[(~P3.png

Input

3

2019001 law 19

2019002 info 20

2019003 info 19

2

20190001 math

20190002 English

2

2019101 info 49

2019102 info 38

2

2019002 20190001 100

2019003 20190002 0

1

20190001 2019102

4

SELECT * FROM Student

SELECT Student . dept FROM Student

SELECT Student.sid,Grade.sid,dept,score FROM Student,Grade

SELECT * FROM Student, Grade WHERE Grade .sid=Student. sid


Output

2019001 law 19

2019002 info 20

2019003 info 19

law

info

info

2019001 2019002 law 100

2019001 2019003 law 0

2019002 2019002 info 100

2019002 2019003 info 0

2019003 2019002 info 100

2019003 2019003 info 0

2019002 info 20 2019002 20190001 100

2019003 info 19 2019003 20190002 0


SampleInput
4
2019000001 law 19
2019000003 info 20
2019000002 info 19
2019010 math 28
4
2019010 math
2019011 math
2019012 Course
2019013 SELECT
4
2019010 math 0
2019000002 info 19
2019000001 math 100
2019000000 ABC 38
2
2019000001 2019010 90
2019010 2019010 99
1
2019013 2019000000
7
SELECT * FROM Grade
SELECT cid FROM Grade
SELECT cid,cid,Grade.cid, sid FROM   Grade
SELECT * FROM Grade, Student
SELECT * FROM Grade, Student WHERE dept="info" AND Student.age < 100 AND score> 90
SELECT Student.sid, dept, score FROM Grade,Student WHERE Student.sid = Grade.sid
SELECT Student.sid, dept, score FROM Grade,Student WHERE Student.sid = Grade.sid AND cid = "2019"

SampleOutput
2019000001 2019010 90
2019010 2019010 99
2019010
2019010
2019010 2019010 2019010 2019000001
2019010 2019010 2019010 2019010
2019000001 2019010 90 2019000001 law 19
2019000001 2019010 90 2019000003 info 20
2019000001 2019010 90 2019000002 info 19
2019000001 2019010 90 2019010 math 28
2019010 2019010 99 2019000001 law 19
2019010 2019010 99 2019000003 info 20
2019010 2019010 99 2019000002 info 19
2019010 2019010 99 2019010 math 28
2019010 2019010 99 2019000003 info 20
2019010 2019010 99 2019000002 info 19
2019000001 law 90
2019010 math 99
Submit
题目统计信息详细
总AC数4
通过人数3
尝试人数3
总提交量6
AC率50.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
作者
小薛小薛

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: