教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 求职职场 >

oracle SQL数据库实训报告(2)

来源:网络收集 时间:2026-09-15
导读: 1. 数据表的建立 (1)Table 专业表 *==============================================================*/ /* Table: ZhuanYe */ /*==============================================================*/ create tabl

1. 数据表的建立

(1)Table 专业表

*==============================================================*/ /* Table: ZhuanYe */

/*==============================================================*/ create table ZhuanYe (

ZhuanYe_ID numeric(4) not null, ZhuanYe_Name char(20) null, ZY_CC char(1) null, constraint PK_ZHUANYE primary key (ZhuanYe_ID) );

/*==============================================================*/ /* Index: ZhuanYe_PK */

/*==============================================================*/ create unique index ZhuanYe_PK on ZhuanYe ( ZhuanYe_ID ASC );

(2)Table 奖惩表

/*==============================================================*/ /* Table: JiangCheng */

/*==============================================================*/ create table JiangCheng (

JC_ID numeric(4) not null, JC_Name char(20) null, JC_Type smallint null, JC_XZ char(20) null, JC_DJ char(20) null, constraint PK_JIANGCHENG primary key (JC_ID) );

/*==============================================================*/ /* Index: JiangCheng_PK */

/*==============================================================*/ create unique index JiangCheng_PK on JiangCheng (

JC_ID ASC );

(3)Table 学生

/*==============================================================*/ /* Table: Stu_Info */

/*==============================================================*/ create table Stu_Info (

S_ID numeric(4) not null, BJ_ID numeric(4) null, ZW_ID numeric(4) null, S_Name char(20) null, S_Sex smallint null, S_BanJi numeric(4) null, S_MingZu char(20) null, S_ChuSheng date null, S_HuKo char(8) null, S_JiGuan char(20) null, S_ZhengZhi char(10) null, S_DianHua char(20) null, S_ShengFen char(20) null, S_JiaZhi char(50) null, S_YouBian char(10) null, S_QQ char(20) null, S_JiaFu_N char(20) null, S_JiaFu_T char(20) null, S_JiaMu_N char(20) null, S_JiaMu_T char(20) null, S_QingShi char(20) null, RZ_Date char(10) null, RZ_DaoQi char(10) null, constraint PK_STU_INFO primary key (S_ID) );

/*==============================================================*/ /* Index: 学生_PK */ /*==============================================================*/ create unique index 学生_PK on Stu_Info ( S_ID ASC );

/*==============================================================*/ /* Index: RenZhi_FK */

/*==============================================================*/ create index RenZhi_FK on Stu_Info ( ZW_ID ASC );

/*==============================================================*/ /* Index: Relationship_5_FK */

/*==============================================================*/ create index Relationship_5_FK on Stu_Info ( BJ_ID ASC );

alter table Stu_Info

add constraint FK_STU_INFO_RELATIONS_BANJI foreign key (BJ_ID) references BanJi (BJ_ID) on update restrict on delete restrict;

alter table Stu_Info

add constraint FK_STU_INFO_RENZHI_ZHIWU foreign key (ZW_ID) references ZhiWu (ZW_ID) on update restrict on delete restrict;

(4)Table 年级表

/*==============================================================*/ /* Table: NianJi */

/*==============================================================*/ create table NianJi (

NianJi_ID numeric(4) not null, BJ_ID numeric(4) null, NianJi char(10) null, ZuZhang numeric(4) null, BJ_BiYe smallint null, constraint PK_NIANJI primary key (NianJi_ID) );

/*==============================================================*/ /* Index: NianJi_PK */

/*==============================================================*/ create unique index NianJi_PK on NianJi ( NianJi_ID ASC );

/*==============================================================*/ /* Index: Relationship_3_FK */

/*==============================================================*/ create index Relationship_3_FK on NianJi ( BJ_ID ASC );

alter table NianJi

add constraint FK_NIANJI_RELATIONS_BANJI foreign key (BJ_ID) references BanJi (BJ_ID) on update restrict on delete restrict;

(5)Table 成绩表

/*============================ …… 此处隐藏:3247字,全部文档内容请下载后查看。喜欢就下载吧 ……

oracle SQL数据库实训报告(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/122131.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)