Preface
 
    I've got a db design job about meeting room booking system last week.There're many suitable tools which can be used to handle this kind of job such as power designer,ERwin,HeidiSQL,dbschema,etc.Today,I'm gonna demonstrate the last one —— dbschema.This is the official website:https://www.dbschema.com
 
Introduce
 
    dbschema is a rather simply used tool even you're a novice in designing db system.The dbschema which is downloaded on official website only free for 15 days,then you have to pay for license for later useage but there's no limit in function at all.It provide two modes in designing layout of your system.One is offline mode and the other one is connecting to db servers.You can easily synchronize tables of database with your designed tables as soon as possible by refreshing them from time to time.It also supports almost all popular rdbms such as oracle,db2,MySQL,postgreSQL.There're many key features which you can found in the homepage of official website.I'm not going to describe each one of them.

 
Procedure
 
    The meeting room booking system(I'll call it "mrbs" .) I  contains four tables:employee,department,conference_room,room_reservation.The detail of tables shows below.
 
employee table
 id             自增id                int()
user_id 工号 int()
user_name 用户名称 varchar()
user_phone 用户手机号 bigint
user_email 用户邮箱 varchar()
user_dept_id 用户所在部门id int()
user_status 在职、离职等 tinyint()
create_time 用户创建时间 datetime
update_time 用户信息修改时间 datetime
department table
 id              自增id                 int()
dept_id 部门id int()
dept_name 部门名称 varchar()
parent_id 父级id tinyint()
tlevel 层级id tinyint()
create_time 部门创建时间 datetime
update_time 部门信息修改时间 datetime
conference_room table
 id                 自增id                int()
room_id 会议室id int()
room_building_id 楼号 int()
room_num 房间号 int()
room_max_num 最大容纳人数 int()
room_status 会议室状态 tinyint()
create_time 会议室创建时间 datetime
update_time 会议室信息修改时间 datetime
room_reservation table
 会议室预定表(room_reservation)
id 自增id int()
book_id 预定工单id int()
book_room_id 预定会议室id int()
book_start_time 预定开始时间 datetime
book_stop_time 预定结束时间 datetime
book_user_id 预定人id int()
book_usage 预定用途 varchar()
book_status 预定工单状态 tinyint()
create_time 预定工单创建时间 datetime
update_time 预定工单修改时间 datetime

Configure the database connection.

Use mouse to create target tables in dbschema.

 
Check the primary key & unique key(even other keys but I'm not creating them ye).

Check the foreign key.

After you click ok button,the table will be created in "mrbs" database.

Check the tables in "mrbys".
 root@localhost:mysql3306.sock [mrbs]>show tables;
+------------------+
| Tables_in_mrbs |
+------------------+
| conference_room |
| department |
| employee |
| room_reservation |
+------------------+
rows in set (0.01 sec) root@localhost:mysql3306.sock [mrbs]>show create table employee\G
*************************** . row ***************************
Table: employee
Create Table: CREATE TABLE `employee` (
`id` int() unsigned NOT NULL AUTO_INCREMENT,
`user_id` int() unsigned NOT NULL COMMENT '工号',
`user_name` varchar() NOT NULL COMMENT '用户名称',
`user_phone` bigint() unsigned NOT NULL COMMENT '用户手机号',
`user_email` varchar() DEFAULT NULL COMMENT '用户邮箱',
`user_dept_id` int() unsigned NOT NULL COMMENT '用户所在部门id',
`user_status` tinyint() unsigned NOT NULL COMMENT '是否在职',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '用户创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '用户信息修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表'
row in set (0.00 sec) root@localhost:mysql3306.sock [mrbs]>show create table department\G
*************************** . row ***************************
Table: department
Create Table: CREATE TABLE `department` (
`id` int() unsigned NOT NULL AUTO_INCREMENT,
`dept_id` int() unsigned NOT NULL COMMENT '部门id',
`dept_name` varchar() NOT NULL COMMENT '部门名称',
`parent_id` tinyint() unsigned NOT NULL,
`tlevel` tinyint() unsigned NOT NULL COMMENT '层级',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '部门创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '部门信息修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_dept_id` (`dept_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='部门表'
row in set (0.00 sec) root@localhost:mysql3306.sock [mrbs]>show create table conference_room\G
*************************** . row ***************************
Table: conference_room
Create Table: CREATE TABLE `conference_room` (
`id` int() unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`room_id` int() unsigned NOT NULL COMMENT '会议室id',
`room_building_id` int() unsigned NOT NULL COMMENT '楼号',
`room_num` int() unsigned NOT NULL COMMENT '房间号',
`room_max_num` int() unsigned NOT NULL COMMENT '最大容纳人数',
`room_status` tinyint() unsigned NOT NULL COMMENT '会议室状态',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '会议室创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '会议室信息修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_room_id` (`room_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会议室表'
row in set (0.00 sec) root@localhost:mysql3306.sock [mrbs]>show create table room_reservation\G
*************************** . row ***************************
Table: room_reservation
Create Table: CREATE TABLE `room_reservation` (
`id` int() unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`book_id` int() unsigned NOT NULL COMMENT '预定工单id',
`book_room_id` int() unsigned NOT NULL COMMENT '预定会议室id',
`book_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '预定开始时间',
`book_stop_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '预定结束时间',
`book_user_id` int() unsigned NOT NULL COMMENT '预定人id',
`book_usage` varchar() NOT NULL COMMENT '预定用途',
`book_status` tinyint() unsigned NOT NULL COMMENT '预定工单状态',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '预定工单创建时间',
`update_time` date DEFAULT NULL COMMENT '预定工单修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_book_id` (`book_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会议室预定表'
row in set (0.00 sec)

DB设计工具——dbschema的更多相关文章

  1. axure快速原型设计工具

    Axure RP是美国Axure Software Solution公司旗舰产品,是一个专业的快速原型设计工具,让负责定义需求和规格.设计功能和界面的专家能够快速创建应用软件或Web网站的线框图.流程 ...

  2. 快速原型设计工具-Axure RP的介绍及简单使用(生产初期向客户展示设计产品的原型-也就是展示产品)

    啧啧~~ 给大家介绍一款超棒的原型设计工具--美国Axure Software Solution公司旗舰产品Axure RP 这款工具通俗的说呢,就是在项目整体需求考察后对整体设计一个简要性概括!设计 ...

  3. [转]常用的快速Web原型图设计工具

    转自大神: http://www.cnblogs.com/lhb25/archive/2009/04/25/1443254.html 做产品原型是非常重要的一个环节,做产品原型就会用使用各式各样的工具 ...

  4. 移动APP开发使用什么样的原型设计工具比较合适?

    原型设计工具有Axure,Balsamiq Mockups,JustinMind,iClap原型工具,等其他原型工具.其中JustinMind比较适合APP开发使用. JustinMind可以输出Ht ...

  5. .net走向设计2—设计工具

    1.思维导图 2.项目管理工具 3.常用UML工具 4.数据库设计工具

  6. FROONT – 超棒的可视化响应式网页设计工具

    FROONT 是一个基于 Web 的设计工具,在浏览器中运行,使得各类可视化设计的人员都能进行响应式的网页设计,即使是那些没有任何编码技能的设计师.FROONT 使得响应式网页设计能够可视化操作,能够 ...

  7. 15款优秀移动APP产品原型设计工具

    一新来小盆友问:“移动产品原型设计都用啥工具?” 答:“@#¥……&%*” 又问:“能详细说下各个工具吗?我比较一下” “……” 好吧,谁让我那么的爱分享而你又是小美女呢 ———————正文开 ...

  8. 21个免费的UI设计工具和资源网站,不管是web,js,android都

    本帖最后由 hua631150873 于 2014-9-12 18:26 编辑 Lumzy 官方地址:http://www.lumzy.com/ Lumzy是一个网站应用和原型界面制作工具.使用Lum ...

  9. 两两组合覆盖测试用例设计工具:PICT

    两两组合覆盖测试用例设计工具:PICT 2016-08-31 目录 1 成对测试简介2 PICT使用  2.1 安装 PICT  2.2 使用PICT3 PICT算法  3.1 准备阶段  3.2 产 ...

随机推荐

  1. pat05-图2. Saving James Bond - Easy Version (25)

    05-图2. Saving James Bond - Easy Version (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作 ...

  2. HDU 4081—— Qin Shi Huang's National Road System——————【次小生成树、prim】

    Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/3 ...

  3. 【蓝牙】蓝牙,调试 hcitool与gatttool实例

    Bluez协议栈在安装完以后,会提供两个命令行调试工具,hcitool与gattool,我们可以根据提供的工具来轻松的调试我们的蓝牙设备,调试BLE设备时,需要获取root权限. 蓝牙设备的开启与关闭 ...

  4. Devexpress GridControl使用

    //不显示内置的导航条.            gc1.UseEmbeddedNavigator = false;             //不显示分组的面板            gv1.Opti ...

  5. input type="image" 提交表单

    提到<input type="image"  />,说起来有些惭愧.之前的工作基本每周都要制作两到三个注册用户的网页.其中就用它提交表单. 那个时候我想当然的以为这是用 ...

  6. 在CentOS上配置Tomcat服务脚本

    #!/bin/bash # chkconfig: - 85 15 # description: Tomcat Server basic start/shutdown script # processn ...

  7. thinkphp 创建数据对象之data方法

    创建数据对象:data()方法 1.功能:给模型对象$data赋值,将模型对象转化为数据对象 tip:模型对象与数据对象之间就差一个赋过值的$data; 2.方法:data()其源码如下: tip:源 ...

  8. The fourteenth day

    A man is not old as long as he is seeking something. A man is not old until regrets take the place o ...

  9. Yesterday is history, tomorrow is a mystery, but today is a gift.

    Yesterday is history, tomorrow is a mystery, but today is a gift.昨天已成历史,明天太过神秘,而今天是一份礼物.

  10. C++ Knowledge series Layering

    Programming has its own methodology. Layering is everywhere in real life,this why the pruchase and s ...