Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
196 lines (165 sloc) 6.94 KB
/*
Navicat Oracle Data Transfer
Oracle Client Version : 10.2.0.5.0
Source Server : oracle
Source Server Version : 110200
Source Host : 115.159.203.74:49161
Source Schema : SYSTEM
Target Server Type : ORACLE
Target Server Version : 110200
File Encoding : 65001
Date: 2017-12-14 23:10:29
*/
-- ----------------------------
-- Table structure for Course
-- ----------------------------
DROP TABLE "SYSTEM"."Course";
CREATE TABLE "SYSTEM"."Course" (
"cno" CHAR(5 BYTE) NOT NULL ,
"cname" VARCHAR2(20 BYTE) NOT NULL ,
"tno" CHAR(3 BYTE) NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Records of Course
-- ----------------------------
INSERT INTO "SYSTEM"."Course" VALUES ('3-105', '计算机导论', '825');
INSERT INTO "SYSTEM"."Course" VALUES ('3-245', '操作系统', '804');
INSERT INTO "SYSTEM"."Course" VALUES ('6-166', '数字电路', '856');
INSERT INTO "SYSTEM"."Course" VALUES ('9-888', '高等数学', '825');
-- ----------------------------
-- Table structure for Score
-- ----------------------------
DROP TABLE "SYSTEM"."Score";
CREATE TABLE "SYSTEM"."Score" (
"sno" CHAR(3 BYTE) NOT NULL ,
"cno" CHAR(5 BYTE) NOT NULL ,
"degree" NUMBER NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Records of Score
-- ----------------------------
INSERT INTO "SYSTEM"."Score" VALUES ('109', '3-245', '68');
INSERT INTO "SYSTEM"."Score" VALUES ('105', '3-245', '75');
INSERT INTO "SYSTEM"."Score" VALUES ('103', '3-245', '86');
INSERT INTO "SYSTEM"."Score" VALUES ('103', '3-105', '92');
INSERT INTO "SYSTEM"."Score" VALUES ('105', '3-105', '88');
INSERT INTO "SYSTEM"."Score" VALUES ('109', '3-105', '76');
INSERT INTO "SYSTEM"."Score" VALUES ('101', '3-105', '64');
INSERT INTO "SYSTEM"."Score" VALUES ('107', '3-105', '91');
INSERT INTO "SYSTEM"."Score" VALUES ('108', '3-105', '78');
INSERT INTO "SYSTEM"."Score" VALUES ('101', '6-166', '85');
INSERT INTO "SYSTEM"."Score" VALUES ('107', '6-166', '79');
INSERT INTO "SYSTEM"."Score" VALUES ('108', '6-166', '81');
-- ----------------------------
-- Table structure for Student
-- ----------------------------
DROP TABLE "SYSTEM"."Student";
CREATE TABLE "SYSTEM"."Student" (
"sno" CHAR(3 BYTE) NOT NULL ,
"sname" CHAR(8 BYTE) NOT NULL ,
"sex" CHAR(4 BYTE) NULL ,
"birthday" DATE NULL ,
"class" CHAR(5 BYTE) NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Records of Student
-- ----------------------------
INSERT INTO "SYSTEM"."Student" VALUES ('108', '曾华 ', '', TO_DATE('1977-09-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95033');
INSERT INTO "SYSTEM"."Student" VALUES ('105', '匡明 ', '', TO_DATE('1975-10-02 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95031');
INSERT INTO "SYSTEM"."Student" VALUES ('107', '王丽 ', '', TO_DATE('1976-01-23 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95033');
INSERT INTO "SYSTEM"."Student" VALUES ('101', '李军 ', '', TO_DATE('1976-02-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95033');
INSERT INTO "SYSTEM"."Student" VALUES ('109', '王芳 ', '', TO_DATE('1975-02-10 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95031');
INSERT INTO "SYSTEM"."Student" VALUES ('103', '陆军 ', '', TO_DATE('1974-06-03 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '95031');
-- ----------------------------
-- Table structure for Teacher
-- ----------------------------
DROP TABLE "SYSTEM"."Teacher";
CREATE TABLE "SYSTEM"."Teacher" (
"tno" CHAR(3 BYTE) NOT NULL ,
"tname" CHAR(8 BYTE) NOT NULL ,
"sex" CHAR(4 BYTE) NULL ,
"birthday" DATE NULL ,
"prof" CHAR(12 BYTE) NULL ,
"depart" VARCHAR2(20 BYTE) NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Records of Teacher
-- ----------------------------
INSERT INTO "SYSTEM"."Teacher" VALUES ('804', '李诚 ', '', TO_DATE('1958-12-02 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '副教授 ', '计算机系');
INSERT INTO "SYSTEM"."Teacher" VALUES ('856', '李旭 ', '', TO_DATE('1969-03-12 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '讲师 ', '电子工程系');
INSERT INTO "SYSTEM"."Teacher" VALUES ('825', '王萍 ', '', TO_DATE('1972-05-05 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '助教 ', '计算机系');
INSERT INTO "SYSTEM"."Teacher" VALUES ('831', '刘冰 ', '', TO_DATE('1977-08-14 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), '助教 ', '电子工程系');
-- ----------------------------
-- Indexes structure for table Course
-- ----------------------------
-- ----------------------------
-- Checks structure for table Course
-- ----------------------------
ALTER TABLE "SYSTEM"."Course" ADD CHECK ("cno" IS NOT NULL);
ALTER TABLE "SYSTEM"."Course" ADD CHECK ("cname" IS NOT NULL);
ALTER TABLE "SYSTEM"."Course" ADD CHECK ("tno" IS NOT NULL);
-- ----------------------------
-- Primary Key structure for table Course
-- ----------------------------
ALTER TABLE "SYSTEM"."Course" ADD PRIMARY KEY ("cno");
-- ----------------------------
-- Indexes structure for table Score
-- ----------------------------
-- ----------------------------
-- Checks structure for table Score
-- ----------------------------
ALTER TABLE "SYSTEM"."Score" ADD CHECK ("sno" IS NOT NULL);
ALTER TABLE "SYSTEM"."Score" ADD CHECK ("cno" IS NOT NULL);
-- ----------------------------
-- Primary Key structure for table Score
-- ----------------------------
ALTER TABLE "SYSTEM"."Score" ADD PRIMARY KEY ("sno", "cno");
-- ----------------------------
-- Indexes structure for table Student
-- ----------------------------
-- ----------------------------
-- Checks structure for table Student
-- ----------------------------
ALTER TABLE "SYSTEM"."Student" ADD CHECK ("sno" IS NOT NULL);
ALTER TABLE "SYSTEM"."Student" ADD CHECK ("sname" IS NOT NULL);
-- ----------------------------
-- Primary Key structure for table Student
-- ----------------------------
ALTER TABLE "SYSTEM"."Student" ADD PRIMARY KEY ("sno");
-- ----------------------------
-- Indexes structure for table Teacher
-- ----------------------------
-- ----------------------------
-- Checks structure for table Teacher
-- ----------------------------
ALTER TABLE "SYSTEM"."Teacher" ADD CHECK ("tno" IS NOT NULL);
ALTER TABLE "SYSTEM"."Teacher" ADD CHECK ("tname" IS NOT NULL);
-- ----------------------------
-- Primary Key structure for table Teacher
-- ----------------------------
ALTER TABLE "SYSTEM"."Teacher" ADD PRIMARY KEY ("tno");
-- ----------------------------
-- Foreign Key structure for table "SYSTEM"."Course"
-- ----------------------------
ALTER TABLE "SYSTEM"."Course" ADD FOREIGN KEY ("tno") REFERENCES "SYSTEM"."Teacher" ("tno");
-- ----------------------------
-- Foreign Key structure for table "SYSTEM"."Score"
-- ----------------------------
ALTER TABLE "SYSTEM"."Score" ADD FOREIGN KEY ("cno") REFERENCES "SYSTEM"."Course" ("cno");
ALTER TABLE "SYSTEM"."Score" ADD FOREIGN KEY ("sno") REFERENCES "SYSTEM"."Student" ("sno");