已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt 人力资源管理系统数据库设计与实现人力资源管理系统数据库设计与实现 所完成的工作 所完成的工作 数据库整体结构设计 需求分析 ER 图绘制 完成数据库的物理设计 语句编写和上机检验 系统名称 系统名称 人力资源管理系统 一 系统需求分析一 系统需求分析 1 该 人力资源管理系统 只是对数据库应用技术的一个样本数据库的实例 重在对数 据库一些方法的熟悉与掌握 其中包括从数据库的概念模型到 ER 图的绘制 再到数 据库模式的建立 即为数据神农百草膏第三代神农百草膏第三代库及其基本表的建立 而后数据的录 入 最后完成一些简单的关系运算表达式的表达和相关的 Select 查询语句的使用 2 系统结构简述 本系统包括 6 个实体 总经理 经理 员工 部门 指标 工资 实体之间的关系转换为 5 个表 职务表 部门表 员工表 考核表 工资表 其中 实体部分有 3 个表 员工表 部门表 工资表 员工与指标间多对多关系转换为考核表 注 各个基本表中关键字已在关系模式中说明 3 实现的功能 1 通过表的创建过程进行数据的关联和约束 创建多个约束 规则 默认值对数据进行安全性管理 详见物理设计 创建检查约束 用到 case when 语句分情况 检验员工编号的合理性 即通过 编号可以体现他的部门 A 为总经理 B 为经理 C 为员工 2 插入 修改 删除功能 本系统有 5 个表 员工表 部门表 职务表 考核表 工资表 其中员工表 部 门表 职务表是基本表 数据直接 完全输入 考核表 工资表与员工表有外键 联系 且有计算列 需要创建存储过程来插入数据 建立 2 个存储过程 进行考核表 工资表的插入 建立一个存储过程 考虑外键联系 删除某员工的全部信息 建立触发器 当添加 删除数据时会显示 3 查询功能 使用 select 语句实现简单查询和复杂查询 并创建存储过程进行查询 创建视图 通过视图来查询 eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt 二 二 ER 图图 注 总经理与经理的属性 ER 图与员工相同 员工的职务属性通过员工编号体现 规则见 职务表 总经理 领导 经理 分管 部门 1n11 员工 领导属于 1 n 1 n 工 资 指 标 考核 领导 获得 办公电话 部门名称 经理编号 部门编号 员工编号 本月考核 本月业绩 本月出勤次 出勤次业 绩 n m 影响 n 1 员工编号 基本工资 基本奖金 计算工资 本月实发工资 所得税 1 1 员 工 员工编号 年龄 学历 性别 部门编号 入职日期 计算工资 出生日期 电话 职务 员工姓名 eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt 三 关系模式三 关系模式 系统中的实体有 总经理 经理 员工 部门 指标 工资 为简化关系模式 将总经理 经理 员工的信息集中到一个表 关系模式如下 职务表 职务名称 职务编号 基本工资 基本奖金 部门表 部门编号 部门名称 经理编号 办公电话 员工表 员工编号 员工姓名 部白兔牌暗疮膏白兔牌暗疮膏门编号 职务 出生日期 年龄 入 职日期 性别 学历 电话 考核表 员工编号 本月出勤次 本月业绩 本月考核 工资表 员工编号 基本工资 基本奖金 计算工资 所得税 本月实发工资 四 物理设计四 物理设计 职务表结构职务表结构 属性名属性名数据类型数据类型说明说明 职务名称char 6 主键 职务编号char 2 not null 基本工资int 基本奖金int 说明说明 职务表为基本表 直接输入数据 其中 职务编号 A B C 分别为总经理 经理 员工的员工编号的首字母 如 经理 B01 员工 C03 部门表结构部门表结构 属性名属性名数据类型数据类型说明说明 部门编号char 2 主键 部门名称char 6 not null 经理编号char 4 经理电话char 12 说明说明 部门表为基本表 直接输入数据 员工表结构员工表结构 属性名属性名数据类型数据类型说明说明 员工编号char 4 主键 检查约束 员工姓名char 6 not null 部门编号char 2 外键 职务char 6 职务规则 性别char 2 not null 性别规则 出生日期datetimenot null 年龄int 入职日期datetimenot null 学历char 4 学历规则 默认约束 电话char 12 说明说明 1 员工表与部门表有外键联系 部门编号是部门表的主键 直接输入数据 2 员工编号是主键 并有检查约束 确认输入的员工编号合理 具体是员工编 号的首字母与职务对应的编号一致 如 总经理编号为 AXX 经理 BXX 员工 CXX eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt 3 职务与规则 职务 rule 绑定 取值范围 总经理 经理 员工 4 公式 年龄 year getdate year 出生日期 5 性别与规则 性别 rule 绑定 取值范围 男 女 6 学历与规则 学历 rule 绑定 取值范围 博士 硕士 学士 默 认值学士 考核表结构考核表结构 属性名属性名数据类型数据类型说明说明 员工编号char 4 主键 外键 本月出勤次intnot null 默认值 本月业绩intnot null 本月考核int主键 说明说明 1 考核表与员工表有外键联系 用表约束定义联合主键 2 本月考核为计算列 公式本月考核 本月业绩 本月出勤次 创建存储过程 insert 考核表 实现输入数据 3 本月出勤次与默认 default 本月出勤次 绑定 默认值为 30 工资表结构工资表结构 属性名属性名数据类型数据类型说明说明 员工编号char 4 主键 外键 基本工资intnot null 基本奖金intnot null 计算工资int 所得税int 本月实发工资int主键 说明说明 1 考核表与员工表有外键联系 用表约束定义联合主键 2 后三列为计算列 公式 计算工资 基本工资 本月考核 基本奖金 50 所得税 计算工资 0 05 本月实发工资 计算工资 所得税 其中 本月考核是考核表中该员工对应的考核 创建存储过程 insert 工资表 实现输入数据 五 系统实现五 系统实现 创建数据库 人力资源管理系统DB create database 人力资源管理系统DB on name 人力资源管理系统DB dat filename e 人力资源管理系统DB dat mdf size 5120kb maxsize kb filegrowth 1024kb eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt log on name 人力资源管理系统DB log filename e 人力资源管理系统DB log ldf size 1024kb maxsize kb filegrowth 1024kb use 人力资源管理系统DB 创建表 create table 职务表 职务名称 char 6 not null primary key 职务编号 char 2 not null 基本工资 int 基本奖金 int create table 部门表 部门编号 char 2 not null primary key 部门名称 char 6 not null 经理编号 char 4 经理电话 char 12 create table 员工表 员工编号 char 4 not null primary key 员工姓名 char 6 not null 部门编号 char 2 职务 char 6 性别 char 2 not null 出生日期 datetime not null 年龄 int 入职日期 datetime not null 学历 char 4 电话 char 12 constraint fk 员工表 部门表 key foreign key 部门编号 references 部门表 部门编号 constraint fk 员工表 职务表 key foreign key 职务 references 职务表 职务名称 create table 考核表 员工编号 char 4 not null eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt 本月出勤次 int not null 本月业绩 int not null 本月考核 int constraint pk 考核表 key primary key 员工编号 本月考核 constraint fk 员工表 考核表 key foreign key 员工编号 references 员工表 员工编号 create table 工资表 员工编号 char 4 not null 基本工资 int not null 基本奖金 int not null 计算工资 int 所得税 int 本月实发工资 int constraint pk 工资表 key primary key 员工编号 本月实发工资 constraint fk 员工表 工资表 key foreign key 员工编号 references 员工表 员工编号 为员工表建立检查约束 保证输入的员工编号合理 alter table 员工表 with nocheck add constraint ck 员工编号 check substring 员工编号 1 1 case when 职务 总经理 then A when 职务 经理 then B when 职务 员工 then C end go 建立职务规则 学历规则 性别规则 并与员工表绑定 create rule 职务 rule AS 职务 in 总经理 经理 员工 go exec sp bindrule 职务 rule 员工表 职务 go create rule 学历 rule AS 学历 in 博士 硕士 学士 大专 go exec sp bindrule 学历 rule 员工表 学历 go create rule 性别 rule AS 性别 in 男 女 go exec sp bindrule 性别 rule 员工表 性别 eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt go 建立学历默认值约束 与员工表对应列绑定 create default 学历 defa AS 学士 go exec sp bindefault 学历 defa 员工表 学历 go 建立本月缺勤次默认值约束 与考核表对影列绑定 create default 本月出勤次 defa AS 31 go exec sp bindefault 本月出勤次 defa 考核表 本月出勤次 go 输入员工表 职务表 部门表数据 insert 职务表 values 总经理 A 50000 5000 insert 职务表 values 经理 B 10000 5000 insert 职务表 values 员工 C 3000 1000 insert 部门表 values D1 销售部 B01 insert 部门表 values D2 采购部 B02 insert 部门表 values D3 人事部 B03 insert 部门表 values D 总经理 A01 insert 员工表 values A01 D 总经理 女 硕士 insert 员工表 values B01 D1 经理 女 博士 insert 员工表 values B02 D2 经理 女 19 硕士 insert 员工表 values B03 赵某 D3 经理 男 21 博士 insert 员工表 values C01 钱某 D1 员工 女 22 学士 insert 员工表 values C02 孙某 D1 员工 男 21 硕士 insert 员工表 values C03 李某 D1 员工 男 24 学士 insert 员工表 values C04 周某 D1 员工 男 26 大专 insert 员工表 values C05 吴某 D2 员工 女 19 学士 insert 员工表 values C06 郑某 D2 员工 男 20 硕士 insert 员工表 values C07 王某 D2 员工 男 25 博士 5 insert 员工表 values C08 冯某 D3 员工 女 29 博士 eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt insert 员工表 values C09 陈某 D3 员工 女 20 硕士 查看员工表 职务表 部门表数据 select from 员工表 select from 职务表 select from 部门表 go 创建存储过程 用于输入考核表 工资表的数据 create procedure insert考核表 员工编号 char 4 本月出勤次 int 本月业绩 int as insert 考核表 values 员工编号 本月出勤次 本月业绩 本月业绩 5 本月出勤次 go create procedure insert工资表 员工编号 char 4 基本工资 int 基本奖金 int as begin declare 本月考核 int set 本月考核 select 本月考核 from 考核表 where 员工编号 员工编号 insert 工资表 values 员工编号 基本工资 基本奖金 基本工资 本月考核 基本奖金 50 基本工资 本月考核 基本奖金 50 0 05 基本工资 本月考核 基本奖金 50 0 95 end go 输入考核表 工资表数据 exec insert考核表 A01 31 95 exec insert考核表 B01 31 95 exec insert考核表 B02 30 80 exec insert考核表 B03 31 55 exec insert考核表 C01 31 100 exec insert考核表 C02 27 95 exec insert考核表 C03 31 95 exec insert考核表 C04 31 85 exec insert考核表 C05 29 75 exec insert考核表 C06 31 95 exec insert考核表 C07 28 80 exec insert考核表 C08 31 30 exec insert考核表 C09 29 70 eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtotheseverityofthehazardfilledinbyunittroubleshooting registrationform seeatt exec insert工资表 A01 50000 5000 exec insert工资表 B01 10000 5000 exec insert工资表 B02 10000 5000 exec insert工资表 B03 10000 5000 exec insert工资表 C01 3000 1000 exec insert工资表 C02 3000 1000 exec insert工资表 C03 3000 1000 exec insert工资表 C04 3000 1000 exec insert工资表 C05 3000 1000 exec insert工资表 C06 3000 1000 exec insert工资表 C07 3000 1000 exec insert工资表 C08 3000 1000 exec insert工资表 C09 3000 1000 查看考核表 工资表数据 select from 考核表 select from 工资表 go 创建存储函数删除某一员工的信息 create procedure 删除员工 员工编号 char 4 as begin delete 考核表 where 员工编号 员工编号 delete 工资表 where 员工编号 员工编号 delete 员工表 where 员工编号 员工编号 end go 创建触发器 create trigger tr delete on 员工表 for delete as declare num varchar 50 select num str rowcount 个学生被删除 select num return go create trigger tr insert on 员工表 for insert as declare num varchar 50 select num str rowcount 个学生被添加 select num eaintheaccidentinvestigation managementandreporting eachpostshouldbedevelopedunderthissystemspecialistscheck cleartheexaminations time cyclesandotherrelevantregulations Strengtheningsitesupervisionandexamination todetectandinvestigateillegalcommand illegaloperationsandviolationsofoperatingrules Secondsafetyreferstotheproductionsite technologymanagement equipment facilities andsooncanleadtoaccidentsrisksexist 1 accordingtotheextentofthesecurityrisks solvingisdividedintoa b andclevelsofdifficulty A level difficult miningdifficulties shallbereportedtothecompany sproblems B class difficulttoresolvedif ficulties shallconsistofminingorganizationstosolveproblems C class fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment 2 open pitmineunsafetypesinclude electrical transport blasting fire andotherslope 3 accordingtothes
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 化工添加剂生产工班组管理竞赛考核试卷含答案
- 焊接专机装配工操作安全考核试卷含答案
- 环氧乙烷(乙二醇)装置操作工岗前评优竞赛考核试卷含答案
- 汽车发动机再制造装调工安全规程评优考核试卷含答案
- 吹奏乐器制作工岗前理论知识考核试卷含答案
- 护理给药基础授课幻灯片
- 妇科健康教育
- 莫西沙星对血管内皮细胞iNOS表达与NO产生的调控机制及影响研究
- 药物经济学:优化医药卫生决策的关键驱动力
- 荧光定量PCR解析Linc00324在白血病患者白细胞中的表达及临床价值
- 修建祠堂合同模板
- 《交通监控系统》课件
- 2024年04月国家艺术基金管理中心应届毕业生招考聘用笔试历年典型考题及考点研判与答案解析
- 2024河北出版传媒集团招聘91人公开引进高层次人才和急需紧缺人才笔试参考题库(共500题)答案详解版
- 小升初英语词汇表(含1600个必备单词)+英语冲刺专项训练.情景对话+155个必考短语(必背)
- 等静压石墨行业分析
- 27.2.2相似三角形的性质教学设计人教版九年级数学下册
- 《商务馈赠礼仪》课件
- 生活中的趣味化学
- QC活动之降低投诉率
- 数据结构课程教案-20170330
评论
0/150
提交评论