QQ网名大全

数据库原理题,设有一个关系数据库,有三个基本表,表的结构如下;高手帮答下!

1

2 create table student(

学号 char[10] primary key,

姓名 char[10],

年龄 int,

性别 char[2] defaut '男',

系名 char[10]

)

3 create table SC(

学号 char[10],

课程号 char[10],

成绩 int,

primary key (学号,课程号),

foreignkey(学号) references STUDENT(学号),

 foreign key(课程号) references COURSE(课程号)

)

4 delete from  SC where 成绩 is null

5 insert into  STUDENT values('@@','王进', 18,'男','自动控制')

6

select distinct C.*

from  STUDENT S, COURSE C, SC

where C.任课教师 ='李平' and  S.系名='计算机' and S.学号=SC.学号 and C.课程号=SC.课程号

7

select S.学号,姓名,任课教师

from  STUDENT S, COURSE C, SC

where C.课程名 ='计算机原理' and  成绩>60 and 成绩<85 and S.学号=SC.学号 and C.课程号=SC.课程号

8

delete from SC where 学号 in (select 学号 from STUDENT where 姓名='王林')

9

create view view1

as

select *

from STUDENT

where 年龄<22 and 系名='通信' and 性别='女'

佚名
2024-05-29 16:41:40
最佳回答
类似问题(10)