抑字是什么结构:几道SQL的题,急用,请各位达人解答

来源:百度文库 编辑:高考问答 时间:2024/05/01 09:37:20
student表
id ····name
1···· tom
2···· john
3···· bob
4···· helen

score表
id····score
1·····80
2·····88
3·····77

2.找出姓名为Tom的学生的成绩
3.找出最高分的姓名
4.前3名的成绩和姓名
5.输出所有学生的成绩(如下表),其中Helen没有参加考试,在score表中没有记录;
Tom···· 80
John····88
Bob····77
Helen····null

6.将Tom的成绩修改为80
7.在student表中增加字段score并将其值全部替换为score表中的对应score值
例如:
student表
id····name
10····tom
20····john
30····helen

score表
id····score
10····90
30····70

修改后student表应该为
id····name····score
10····tom···· 90
20····john····null
30····helen····70

删除Tom的成绩
删除最高分的成绩
将所有大于80分的人的id,name,score生成到新表student_score中
不用全都做出来,能有一道也好,我真的急用

2。select name,score from student,score where student.id=score.id,student.name=\'tom\';

3。select student.name from student,score where student.id=score.id and score.score = (select max(score) from score);

4。select top 3 name,score from student,score where student.id=score.id order by score;

5。select name,score from student left join score on (student.id=score.id);

6。update score set score=80 where id = (select id from student where name=\'tom\');

7。

2.select a.name,b.score
from student a,score b
where a.id=b.id
and a.name='tom'

3.select a.name from student a,score b
where a.id=b.id
and b.score=(select max(score) from score)

4.