数据库SQL语言实习 联系客服

发布时间 : 星期三 文章数据库SQL语言实习更新完毕开始阅读4dd651cc5122aaea998fcc22bcd126fff7055d27

insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091001598','王海涛','M',20,14); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091003085','袁恒','M',18,14); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091000863','孟飞','M',17,14); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091000934','罗振俊','M',19,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091000961','曾雪君','F',18,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091000983','巴翔','M',19,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091001175','周雷','M',18,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091001261','马欢','M',17,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091001384','陈亮','M',20,8); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20081003492','易家新','M',19,5); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20081001197','李子聪','M',17,5); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20081001266','蔡景学','F',19,5); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20081001888','赵林云','F',20,5); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20091000481','姜北','M',17,5); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000199','孙中孝','M',18,11); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000424','杨光','M',17,11); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000481','张永强','M',16,11); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000619','陈博','M',20,11); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000705','汤文盼','M',18,11); insert into Student(Sno, Sname, Ssex, Sage, Dno) values('20101000802','苏海恩','M',17,11);

运行结果为:

3. 分别采用 UI 界面和 SQL 语言为 University 的 Course 表输入下列数据

输入SQL语言代码为:

/*课程信息表 Course (Cno, Cname, Cpno, Ccredit)*/ create table Course(

Cno number(10) primary key , Cname varchar2 (50), Cpno number(10) , CCredit number(10),

foreign key(Cpno) references Course(Cno) );

insert into Course(Cno, Cname, Ccredit) values(2,'高等数学',8); insert into Course(Cno, Cname, Ccredit) values(6,'C语言程序设计',4); insert into Course(Cno, Cname, Ccredit) values(7,'大学物理',8); insert into Course(Cno, Cname, Ccredit) values(8,'大学化学',3); insert into Course(Cno, Cname, Ccredit) values(10,'软件工程',2); insert into Course(Cno, Cname, Ccredit) values(12,'美国简史',2); insert into Course(Cno, Cname, Ccredit) values(13,'中国通史',6); insert into Course(Cno, Cname, Ccredit) values(14,'大学语文',3); insert into Course(Cno, Cname, Cpno, Ccredit) values(5,'数据结构',6,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(4,'操作系统',5,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(1,'数据库原理',5,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(3,'信息系统',1,2); insert into Course(Cno, Cname, Cpno, Ccredit) values(9,'汇编语言',6,2); insert into Course(Cno, Cname, Cpno, Ccredit) values(11,'空间数据库',1,3

运行结果为:

4.分别采用 UI 界面和 SQL 语言为 University 的 Teacher 表输入下列数据:

输入SQL语言代码为:

/*课程信息表 Course (Cno, Cname, Cpno, Ccredit)*/ create table Course(

Cno number(10) primary key , Cname varchar2 (50), Cpno number(10) , CCredit number(10),

foreign key(Cpno) references Course(Cno) );

insert into Course(Cno, Cname, Ccredit) values(2,'高等数学',8); insert into Course(Cno, Cname, Ccredit) values(6,'C语言程序设计',4); insert into Course(Cno, Cname, Ccredit) values(7,'大学物理',8); insert into Course(Cno, Cname, Ccredit) values(8,'大学化学',3); insert into Course(Cno, Cname, Ccredit) values(10,'软件工程',2); insert into Course(Cno, Cname, Ccredit) values(12,'美国简史',2); insert into Course(Cno, Cname, Ccredit) values(13,'中国通史',6); insert into Course(Cno, Cname, Ccredit) values(14,'大学语文',3); insert into Course(Cno, Cname, Cpno, Ccredit) values(5,'数据结构',6,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(4,'操作系统',5,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(1,'数据库原理',5,4); insert into Course(Cno, Cname, Cpno, Ccredit) values(3,'信息系统',1,2); insert into Course(Cno, Cname, Cpno, Ccredit) values(9,'汇编语言',6,2);