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. Integer代码分析

    我们都知道Integer是int的封装类,提供了一些类型转换等工具方法,有一个-128-127的缓存,而且是final的. ----------------------------- 干货: Inte ...

  2. CSS选择器笔记,element element和element > element 的区别

    看官方解释 element element  例子: div p 官方解释:div内部所有的p元素 就是说 只要p在div内部.如果 p在span内部,span在div内部,p也算在div内部 < ...

  3. Android下常见的内存泄露 经典

    转自:http://www.linuxidc.com/Linux/2011-10/44785.htm 因为Android使用Java作为开发语言,很多人在使用会不注意内存的问题. 于是有时遇到程序运行 ...

  4. AngularJS directive 不执行

    检查下directive的命名,是不是含有特殊符号和大写,全部改为小写就ok: 原因:html不支持骆驼峰命名,只支持小写:

  5. Android 程序结构介绍

    创建好Android开发环境后,创建一个Android Project, 截图如下:

  6. C#数字图像处理算法学习笔记(二)--点运算与直方图

    C#数字图像处理算法学习笔记(二)--点运算与直方图 在数字图像处理中,点运算是一种简单而重要的技术.点运算只是根据对象的像素的输入灰度值来决定像素的输出灰度值的图像处理运算.它有时也被称为对比度增强 ...

  7. case when then[转]

    Case具有两种格式.简单Case函数和Case搜索函数. --简单Case函数 CASE sex WHEN '1' THEN '男' WHEN '2' THEN '女' ELSE '其他' END ...

  8. js动态控制导航栏样式

    导航栏一般做为母版页,为了使增加用户体验,往往在用户进入某个页面给予导航栏相应的样式,这里可以用js动态添加 <div class="box_left fl"> < ...

  9. 网站架构:消息队列 Java后端架构

    2017-01-13  一.消息队列概述 消息队列中间件是分布式系统中重要的组件,主要解决应用耦合,异步消息,流量削锋等问题.实现高性能,高可用,可伸缩和最终一致性架构.是大型分布式系统不可缺少的中间 ...

  10. 升级jdk注意事项

    最好使用和编译的jdk相同版本的jre去执行.class程序. 今天在本地模拟部署项目到tomcat6就遇到了个坑. 我们项目使用的jdk1.7开发的,编译打war包放到webapps后,启动报错Ex ...