@gzm1997
2018-04-30T14:21:51.000000Z
字数 2323
阅读 1030
系统分析与设计
郭柱明 15331094
a. 阅读 Asg_RH 文档,按用例构建领域模型。

b. 数据库建模(E-R 模型)
- 按 Task 3 要求,给出系统的 E-R 模型(数据逻辑模型)
- 导出 Mysql 物理数据库的脚本
- 简单叙说 数据库逻辑模型 与 领域模型 的异同

代码如下
/*==============================================================*//* DBMS name: Sybase SQL Anywhere 12 *//* Created on: 2018/4/30 22:19:34 *//*==============================================================*/if exists(select 1 from sys.sysforeignkey where role='FK_USER_REFERENCE_RESERVAT') thenalter table "user"delete foreign key FK_USER_REFERENCE_RESERVATend if;drop table if exists busket;drop table if exists hotal;drop table if exists reservation;drop table if exists room;drop table if exists "user";/*==============================================================*//* Table: busket *//*==============================================================*/create table busket(toltal_price integer not null,constraint PK_BUSKET primary key clustered (toltal_price));/*==============================================================*//* Table: hotal *//*==============================================================*/create table hotal(id integer not null,position varchar(60) not null,constraint PK_HOTAL primary key clustered (id));/*==============================================================*//* Table: reservation *//*==============================================================*/create table reservation(id integer not null,check_in_date date not null,check_out_date date not null,person_num integer not null,star integer null,toltal_price integer not null,constraint PK_RESERVATION primary key clustered (id));/*==============================================================*//* Table: room *//*==============================================================*/create table room(room_type varchar(30) not null,availability smallint not null,price integer not null,constraint PK_ROOM primary key clustered (room_type));/*==============================================================*//* Table: "user" *//*==============================================================*/create table "user"(name varchar(20) not null,password varchar(20) not null,email varchar(40) not null,id integer not null,constraint PK_USER primary key clustered (id));alter table "user"add constraint FK_USER_REFERENCE_RESERVAT foreign key (id)references reservation (id)on update restricton delete restrict;