oracle建表语句

--创建Student表
Create Table Student (
    sno char(10) primary key ,
    sname varchar(20)  not null,
    ssex char(2),
    sage smallint,
    sdept varchar(20)
)
--创建Course表
Create Table Course (
    cno char(10),
    primary key (cno),
    cname varchar(20),
    cpno char(10),
    ccredit smallint,
    snumber int
)
--创建SC表
Create Table SC(
    sno char(10),
    cno char(10),
    grade smallint,
    primary key (sno, cno)
)

--2.向三张数据库表添加数据
--添加Student表数据
Insert Into Student
    Values ('001','啵啵','M',20,'English');
Insert Into Student
    Values ('002','西西','M',18,'English');
Insert Into Student
    Values ('003','灿烈','M',21,'English');
Insert Into Student
    Values ('004','伯贤','M',20,'Chinese');
Insert Into Student
    Values ('005','朴朴','F',21,'Chinese');
Insert Into Student
    Values ('006','边边','F',21,'Chinese');
Insert Into Student
    Values ('007','白熙','F',22,'Math');
Insert Into Student
    Values ('008','世珠','F',22,'Math');
Insert Into Student
    Values ('009','泡泡','M',19,'Music');
Insert Into Student
    Values ('010','菜菜','M',19,'Music');

--添加Course表数据
Insert Into Course(cno,cname,cpno,ccredit,snumber)
    Values ('1801','Chinese','01',5,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1802' , 'English', '02',5,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1803' , 'Math', '03',5,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1804' , 'PE', '04',3,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1805' , 'Computer', '05',4,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1806' , 'Physics', '06',4,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1807' , 'Chemistry', '07',4,10);
Insert Into Course( cno , cname, cpno,ccredit,snumber)
    Values ( '1808' , 'Biology', '08',4,10);
    

--添加SC表数据
Insert Into SC
    Values ('001','1801',96);
Insert Into SC
    Values ('001','1802',91);
Insert Into SC
    Values ('001','1803',61);
Insert Into SC
    Values ('001','1804',72);
Insert Into SC
    Values ('002','1801',56);
Insert Into SC
    Values ('002','1802',98);
Insert Into SC
    Values ('003','1805',48);
Insert Into SC
    Values ('003','1806',92);
Insert Into SC
    Values ('003','1807',58);
Insert Into SC
    Values ('003','1808',74);
Insert Into SC
    Values ('004','1807',45);
Insert Into SC
    Values ('004','1808',76);
Insert Into SC
    Values ('005','1803',47);
Insert Into SC
    Values ('005','1804',100);
Insert Into SC
    Values ('006','1801',90);
Insert Into SC
    Values ('006','1802',88);
Insert Into SC
    Values ('006','1805',86);
Insert Into SC
    Values ('006','1806',57);
Insert Into SC
    Values ('008','1807',92);
Insert Into SC
    Values ('008','1808',82);
Insert Into SC
    Values ('009','1801',67);
Insert Into SC
    Values ('009','1803',69);
Insert Into SC
    Values ('009','1804',94);
Insert Into SC
    Values ('009','1805',89);
Insert Into SC
    Values ('009','1806',77);
Insert Into SC
    Values ('010','1802',95);
Insert Into SC
    Values ('010','1804',16);
Insert Into SC
    Values ('010','1805',49);
Insert Into SC
    Values ('010','1807',97);
Insert Into SC
    Values ('010','1808',82);

  • 10
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值