全球旧事资料 分类
sp
oclass_
o类型char8char8char2smalldatetimechar6char8char4外键外键约束主键非空
f课程类型编号理论学时实验学时开课学期课程学分
ct
olectureexperime
tsemestercredit
ti
yi
tti
yi
tti
yi
tti
yi
tti
yi
t
(3)创建stude
t_course表字段名学号上课编号学生成绩代码s_
otcidscore类型char8smalli
tti
yi
t约束主键与stude
t表中s_
o外键关联级联删除主键
4创建teacher表字段名教师编号教师姓名性别出生日期教师所在院系编号职称代码t_
ot_
amet_sext_birthdayd
otech_title类型char8char8char2smalldatetimechar6char10外键约束主键非空
5创建系部表departme
t字段名院系编号院系名称院系负责人代码d
odept_
ameheader类型char6char20char8约束主键非空
6创建专业信息表speciality字段名专业代码院系编号专业名称代码sp
od
osp
ame类型char8char6char20约束主键外键非空非空
7创建teacher_course表字段名上课编号教师编号专业代码班级编码课程编号学期学年代码tcidt_
osp
oclass_
oc
osemesterschoolyear类型smalli
tchar8char8char4char10char6char10非空外键约束主键外键外键
f8创建班级表class字段名专业代码班级编码班负责人代码sp
oclass_
oheader类型char8char4char8约束主键,与speciality表中sp
o外键关联主键
3、查看各数据表之间的关系,生成数据库关系图。
stude
t
s_
os
amesexsbirthdayd
osp
oclass_
o
departme
t
d
odept_
ameheader
stude
t_course
s_
otcidscore
speciality
sp
od
osp
ame
teacher
t_
ot_
amet_sext_birthdayd
otech_title
class
sp
oclass_
oheader
teacher_course
tcidt_
osp
oclass_
oc
osemestershcoolyear
course
c
oc
amesp
oct
olectureexperime
tsemestercredit
f4、创建各表实现代码及裁图SQL语句:查询分析器执行情况:SQL语句及执行结果截图显示
1、创建departme
t表
createtabledepartme
td
ochar6primarykey
ot
ulldept_
ameheaderchar20char8
2、创建speciality表
createtablespecialitysp
od
osp
ameco
strai
tchar8char6char20primarykey
ot
ull
ot
ull
fk_speciality_d
o
foreig
keyd
orefere
cesdepartme
td
o
3、创建class表
createtableclasssp
oclass_
oheaderchar8char4char8
co
strai
tpk_classprimarykeysp
oclass_
oco
strai
tfk_class_sp
oforeig
keysp
orefere
cesspecialitysp
o
f4、创建stude

createtablestude
ts_
os
amesexsbirthdayd
osp
oclass_
ochar8char8char2smalldatetimechar6char8char4refere
cesprimarykey
ot
ull
co
strai
tfk_stude
t_d
oforeig
keyd
odepartme
td
oco
strai
tfk_stude
t_sp
oforeig
keysp
orefere
cesspecialitysp
o
5、创建Courset表
creatr
好听全球资料 返回顶部