实验用数据库内容
2018-06-18 01:24:00来源:未知 阅读 ()
1 create table student(sno char(9) primary key,sname char(20) unique,ssex char(2),sage smallint, sdept char(20)); 2 create table course(cno char(4) primary key,cname char(40) not null,cpno char(4),ccredit smallint,foreign key(cpno) references course(cno)); 3 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)); 4 5 insert into course values('1','数据库','5','4.0'); 6 insert into course values('2','高等数学','NULL','2.0'); 7 insert into course values('3','信息系统','1','4.0'); 8 insert into course values('4','操作系统','6','3.0'); 9 insert into course values('5','数据结构','7','4.0'); 10 insert into course values('6','数据处理','NULL','2.0'); 11 insert into course values('7','C语言','6','4.0'); 12 13 insert into sc values('95001','1','92.0'); 14 insert into sc values('95001','2','85.0'); 15 insert into sc values('95001','3','88.0'); 16 insert into sc values('95002','2','90.0'); 17 insert into sc values('95002','3','80.0'); 18 insert into sc values('95004','2','65.0'); 19 insert into sc values('95004','3',NULL); 20 insert into sc values('95004','4',NULL); 21 insert into sc values('95005','2','84.0'); 22 insert into sc values('95005','4',NULL); 23 insert into sc values('96001','1','87.0'); 24 insert into sc values('96001','2','80.0'); 25 insert into sc values('96001','3','90.0'); 26 insert into sc values('96001','4','95.0'); 27 insert into sc values('96001','5',NULL); 28 insert into sc values('96001','6',NULL); 29 insert into sc values('96001','7','86.0'); 30 insert into sc values('97001','4',NULL); 31 insert into sc values('97001','5',NULL); 32 33 create table dept(deptno numeric(2) primary key,dname varchar(14) not null,loc varchar(13)); 34 35 insert into dept values(10,'ACCOUNTING','NEWYORK'); 36 insert into dept values(20,'RESEARCH','DALLAS'); 37 insert into dept values(30,'SALES','CHICAGO'); 38 insert into dept values(40,'OPERATIONS','BOSTON'); 39 (^['0-9]{2,}[^;]+) 40 41 create table emp(empno numeric(4) primary key,ename varchar(10) not null,job varchar(9), 42 mgr numeric(4),hiredate date,sal numeric(7,2) check (sal>500 and sal<100000),comm numeric(7,2), 43 deptno numeric(2),foreign key(mgr) references emp(empno),foreign key(deptno) references dept(deptno)); 44 45 insert into emp values(7369,'SMITH','CLERK',7902,'1980-12-17',800,null,20); 46 insert into emp values(7499,'ALLEN','SALESMAN',7698,'1981-02-20',1600,300,30); 47 insert into emp values(7521,'WARD','SALESMAN',7698,'1981-02-22',1250,500,30); 48 insert into emp values(7566,'JONES','MANAGER',7839,'1981-04-02',2975,null,20); 49 insert into emp values(7654,'MARTIN','SALESMAN',7698,'1981-09-28',1250,1400,30); 50 insert into emp values(7698,'BLAKE','MANAGER',7839,'1981-05-01',2850,null,30); 51 insert into emp values(7782,'CLARK','MANAGER',7839,'1981-06-09',2450,null,10); 52 insert into emp values(7788,'SCOTT','ANALYST',7566,'1987-04-19',3000,null,20); 53 insert into emp values(7839,'KING','PRESIDENT',null,'1981-11-17',5000,null,10); 54 insert into emp values(7844,'TURNER','SALESMAN',7698,'1981-09-08',1500,0,30); 55 insert into emp values(7876,'ADAMS','CLERK',7788,'1987-05-23',1100,null,20); 56 insert into emp values(7900,'JAMES','CLERK',7698,'1981-12-03',950,null,30); 57 58 create table salgrade(grade numeric,losal numeric,hisal numeric); 59 60 insert into salgrade values(1,700,1200); 61 insert into salgrade values(2,1201,1400); 62 insert into salgrade values(3,1401,2000); 63 insert into salgrade values(4,2001,3000); 64 insert into salgrade values(5,3001,9999); 65 insert into salgrade values(6,10000,100000);
2018-04-30 21:34:29
1 create table persons(id_p int(2) primary key, lastname varchar(20) not null,firstname varchar(20) not null,address varchar(30),city varchar(20)); 2 insert into persons values(1,'Adams','John','Oxford Street','London'); 3 insert into persons values(2,'Bush','George','Fifth Avenue','New York'); 4 insert into persons values(3,'Carter','Thomas','Changan Street','Beijing'); 5 6 create table orders(id_o int(2) primary key, orderNo varchar(10),id_p int (2), foreign key(id_p) references persons(id_p)); 7 insert into orders values(1,'77895',3); 8 insert into orders values(2,'44678',3); 9 insert into orders values(3,'22456',1); 10 insert into orders values(4,'24562',1); 11 insert into orders values(5,'34764',65);
2018-05-05 18:41:35
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- MySQL性能优化的20条经验 2019-09-23
- 一份非常完整的MySQL规范 2019-09-17
- 数据库读写分离提高性能详解,原理是什么 2019-08-26
- 我们日常使用的数据库的数据都储存在哪里呢? 2019-08-23
- MySQL在并发场景下的问题及解决思路 2019-08-23
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash