1)掌握SQL语句的数据操纵功能
2)掌握SQL语言的数据插入,修改,删除操作
3)掌握与嵌套查询相结合的插入,删除,修改数据的SQL语句
1) 按实验内容要求完成各项操作
2) 根据题目要求给出解决方案
3) 提交实验报告
--表的建立
Create table Student
(Sno char(9) PRIMARY KEY,
Sname char(20) UNIQUE,
Sex char(2),
Age SMALLINT,
Dept char(20)
);
Create table Course
(Cno char(4) PRIMARY KEY,
Cname char(40) NOT NULL,
Cpno char(4),
Ccredit SMALLINT,
FOREIGN KEY(Cpno) REFERENCES Course(Cno)
);
Create table SC
(Sno char(9),
Cno char(4),
Grade SMALLINT,
PRIMARY KEY(Sno,Cno),
FOREIGN KEY (Sno)REFERENCES Student(Sno),
FOREIGN KEY (Cno)REFERENCES Course(Cno)
);
--表中插入数据
Insert
Into Student
Values('42101','赵君君','男',18,'CS'),
('42102','赵小花','女',17,'MA'),
('42103','赵小明','男',17,'MA'),
('42104','赵宇宇','男',18,'CS'),
('42105','赵兰兰','女',17,'IS'),
('42106','钱小君','男',18,'CS'),
('42107','钱大花','女',17,'MA'),
('42108','钱君','男',18,'CS'),
('42109','钱花','女',17,'MA'),
('42110','钱明','男',17,'MA'),
('42111','孙宇','男',18,'CS'),
('42112','孙兰','女',17,'IS'),
('42113','江君','男