机房管理系统数据库设计

  • 格式:doc
  • 大小:195.00 KB
  • 文档页数:14

下载文档原格式

  / 14
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

学院机房管理系统

数据库设计说明书

设计人:

学号:

班级:

学院:

目录

一、需求分析

1.业务流程图

2.数据流图

3.数据字典

二、概念设计

1、实体属性图

2、全局E-R图

三、逻辑设计

1、表间关系图

2、关系模式

四、数据库实现

1、创建数据库

2、创建表

2、创建存储过程和触发器

一、需求分析

针对一般高校机房管理系统的需求分析、通过对学生上机过程、教学班上机过程、注册过程、充值过程、的内容的数据流程分析一现设计如下数据项和数据结构

(1)机房基本信息:包括机房号、机房名、计算机数目、管理人等

(2)计算机基本信息:包括计算机IP地址、编号、机房号、品牌、备注等

(3)学生基本信息:包括学号、姓名、性名、行政班等

(4)用户基本信息:包括用户名、学号、密码、余额等

(5)学生充值基本信息:包括用户名、充值时间、金额、办理人等

(6)机房收费标准基本信息:包括机房号、金额等

(7)学生上机过程登记基本信息:包括计算机IP地址、日期、上机时间、下机时间、学号、上机类型等

(8)机房费用统计基本信息:包括计算机IP地址、日期、统计时间、费用等

1.业务流程图

2.数据流图

3.数据字典

room(机房表)

字段名数据类型能否为空是否为主键说明

rno int否是机房号

rname char(10)否否机房名number smallint能否计算机数目manager char(10)否否管理人

computer(计算机表)

字段名数据类型能否为空是否为主键说明

IP char(20)否是计算机IP地址cno smallint否否编号

rno int否否机房号

Student(学生表)

Usertable(用户表)

Prepaid(充值表)

Standard(收费标准表)

Record(上机过程登记表)

statistik (机房费用统计表)

二、概念设计

1、实体属性图

图一 机房实体E-R 图 图二 学生实体E-R 图

计算机

计算机ID

编号机房号品牌备注

2、全局E-R 图

机房 机器数目 机房号 机房名

管理人 学生

行政班

学号 姓名 性别

三、逻辑设计

1、表间关系图

2、关系模式机房(机房号,机房名,机器数目,管理人)学生(学号,姓名,性别,行政班)

计算机(编号,机房号,品牌,备注)

用户(用户名,学号,密码,余额)

四、数据库实现

1、创建数据库

1、创建数据库

create database room

on

( name='room_data',

filename='E:\room\data\room_data',

size=5MB,

maxsize=10MB,

filegrowth=1MB

)

log on

(

name='room_log',

filename='E:\room\log\room_log',

size=5MB,

maxsize=10MB,

filegrowth=1MB

)

2、创建表2、room(机房表)的创建

create table room

(

rno int not null primary key,

rname char(10) not null,

number smallint null,

manager char(10) not null

)

3、computer(计算机表)的创建

create table computer

(

IP char(20) not null primary key, cno smallint not null ,

rno int not null,

brand char(20) null,

note varchar(50) null

)

4、student(学生表)的创建

create table student

(

sno int not null primary key,

sname char(10) not null,

sex char(2) null,

class char(20) not null

)

6、User(用户表)的创建

create table usertable

(

uname char(20) not null primary key, sno int not null,

pword char(20) not null,

moneys money null,

)

7、prepaid(充值表)的创建

create table prepaid

(

uname char(20) not null,

ptime datetime not null,

pmoney smallmoney not null,

trans char(10) not null,

constraint p_primary primary key(uname,ptime) )

8、standard(收费标准表)的创建

create table standard

(

rno int not null,

stime char(20) not null,

smoney smallmoney not null,

constraint c_primary primary key(rno,stime) )

11、record(上机过程登记表)的创建

create table record

(

IP char(20) not null,

sno int not null,

begintime datetime not null,

endtime datetime null,