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

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

来源:网络收集 时间:2026-09-15
导读: /*==============================================================*/ /* Index: BanJi_PK */ /*==============================================================*/ create unique index BanJi_PK on BanJi ( BJ_

/*==============================================================*/ /* Index: BanJi_PK */

/*==============================================================*/ create unique index BanJi_PK on BanJi ( BJ_ID ASC );

/*==============================================================*/ /* Index: Relationship_2_FK */

/*==============================================================*/ create index Relationship_2_FK on BanJi ( ZhuanYe_ID ASC );

/*==============================================================*/ /* Index: Relationship_4_FK */

/*==============================================================*/

create index Relationship_4_FK on BanJi ( NianJi_ID ASC );

alter table BanJi

add constraint FK_BANJI_RELATIONS_ZHUANYE foreign key (ZhuanYe_ID) references ZhuanYe (ZhuanYe_ID) on update restrict on delete restrict;

alter table BanJi

add constraint FK_BANJI_RELATIONS_NIANJI foreign key (NianJi_ID) references NianJi (NianJi_ID) on update restrict on delete restrict;

(7)Table 职务表

/*==============================================================*/ /* Table: ZhiWu */

/*==============================================================*/ create table ZhiWu (

ZW_ID numeric(4) not null, ZW_Name char(20) null, ZW_XZ char(20) null, ZW_DJ char(20) null, constraint PK_ZHIWU primary key (ZW_ID) );

/*==============================================================*/ /* Index: 职务表_PK */ /*==============================================================*/ create unique index 职务表_PK on ZhiWu ( ZW_ID ASC );

(8)Table 表现表

/*==============================================================*/ /* Table: BiaoXian */

/*==============================================================*/ create table BiaoXian (

JC_ID numeric(4) not null, S_ID numeric(4) not null, BX_Date date null, BX_Date_End date null, BX_NR char(100) null, constraint PK_BIAOXIAN primary key clustered (JC_ID, S_ID) );

/*==============================================================*/ /* Index: BiaoXian_PK */

/*==============================================================*/ create unique clustered index BiaoXian_PK on BiaoXian ( JC_ID ASC, S_ID ASC );

/*==============================================================*/ /* Index: BiaoXian_FK */

/*==============================================================*/ create index BiaoXian_FK on BiaoXian ( JC_ID ASC );

/*==============================================================*/ /* Index: BiaoXian2_FK */

/*==============================================================*/ create index BiaoXian2_FK on BiaoXian ( S_ID ASC );

alter table BiaoXian

add constraint FK_BIAOXIAN_BIAOXIAN_JIANGCHE foreign key (JC_ID) references JiangCheng (JC_ID) on update restrict on delete restrict;

alter table BiaoXian

add constraint FK_BIAOXIAN_BIAOXIAN2_STU_INFO foreign key (S_ID) references Stu_Info (S_ID) on update restrict on delete restrict;

(9)Table 课程表

/*==============================================================*/ /* Table: KeCheng */

/*==============================================================*/ create table KeCheng (

KC_ID numeric(4) not null, KC_Name char(10) null, KC_XZ numeric(1) null, KC_Type numeric(1) null, KC_XF numeric(1) null, KC_SJ numeric(1) null );

2. 视图的建立

(1)视图专业视图的代码预览

/*==============================================================*/ /* View: "view_zy" */

/*==============================================================*/ create or replace view "view_zy" as select

"ZhuanYe"."ZhuanYe_ID", "ZhuanYe"."ZhuanYe_Name", "ZhuanYe".ZY_CC from "ZhuanYe"

(2)视图专业视图的代码预览

/*==============================================================*/ /* View: "view_zy" */

/*==============================================================*/ create or replace view "view_zy" as select

"ZhuanYe"."ZhuanYe_ID", "ZhuanYe"."ZhuanYe_Name", "ZhuanYe".ZY_CC from "ZhuanYe"

(3)视图学生视图的代码预览

/*==============================================================*/ /* View: "view_stu" */

/*==============================================================*/ create or replace view "view_stu" as select

"Stu_Info".S_ID, "Stu_Info".BJ_ID,

"Stu_Info".ZW_ID, "Stu_Info"."S_Name", "Stu_Info"."S_Sex", "Stu_Info"."S_BanJi", "Stu_Info&q …… 此处隐藏:2951字,全部文档内容请下载后查看。喜欢就下载吧 ……

oracle SQL数据库实训报告(3).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)