資料庫.建立表
阿新 • • 發佈:2019-01-09
1)建立以上幾張表,並給表中輸入資料。
學生表1 T_STUDENT
create table T_student(
stuno varchar2(16) primary key,
stuname varchar2(16),
stusex varchar2(6),
stubir date
)
課程資訊表2 T_COURSE
create table T_course(
courseno varchar2(16) primary key,
coursename varchar2(16),
teano varchar2(16),
foreign key(teano) references T_teacher(teano)
)
教師資訊表 3 T_TEACHER
create table T_teacher(
teano varchar2(16) primary key,
teaname varchar2(16),
teatitle varchar2(16)
)
考試成績表 4 T_SCORE
create table T_score(
stuno varchar2(16),
courseno varchar2(16),
type varchar2(16),
socre float,
primary key(stuno,courseno,type),
foreign key (courseno) references T_course(courseno)
)