当前位置:   article > 正文

山东大学软件学院数据库系统实验一:建表、删除表、插入数据_山东大学数据库实验

山东大学数据库实验

1-1:

create table test1_student(sid char(12) not null,name varchar(10) not null , sex char(2) , age int,birthday date , dname varchar(30), class varchar(10))

1-2:

create table test1_course(cid char(6) not null,name varchar(40) not null,fcid char(6),credit numeric(4,1))

1-3:

create table test1_student_course (sid char(12) not null ,cid char(6) not null,score numeric(5,1),tid char(6),sctime date)

1-4:

先删除之前重复插入错误的数据

delete from test1_student where age = 20

然后完成sql查询

insert into test1_student values (201800020101,'王欣','女',21,to_date('19940202','yyyymmdd'),'计算机学院','2010')

insert into test1_student values (201800020102,'李华','女',20,to_date('19950303','yyyymmdd'),'软件学院','2009')

1-5:

在之前的基础上修改错误

delete from test1_course where CID = 800002 and CREDIT=2

insert into test1_course values(800002,'数据库',800001,2.5)

1-6:

在之前的基础上修改错误

delete from test1_student_course where TID = 200101

insert into test1_student_course values (201800020101,300001,91.5,200101,to_date('2009-07-15 9-9-9','yyyy-mm-dd hh24-mi-ss'))

insert into test1_student_course values (201800020101,300002,92.6,200102,to_date('2009-07-15 10-10-10','yyyy-mm-dd hh24-mi-ss'))

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/473187
推荐阅读
相关标签
  

闽ICP备14008679号