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. ZK使用

    1. 关注问题 1. zookeeper集群如何保证请求的均匀分布? 由client建立连接时会随机取server保证均匀分布, 2.已布置完成的ZK集群如何扩容? 修改配置后逐台重启即可 2. ZK ...

  2. 几个CSS的黑科技

    这里的黑科技其实就是一些CSS中不怎么为人所知但在解决某些问题的时候很溜的属性. border-radius 很多开发者估计都没有正确认识这个border-radius,因为基本上很多人都是这么用的: ...

  3. Quartz使用(2) - Quartz核心接口Scheduler、Job

    quartz的核心接口如下: 接口 含义 Scheduler scheduler的主要API接口 Job 任务实现接口,期望调度器能够执行 JobDetail 用于定义Job实例 Trigger 调度 ...

  4. .NET面试题6

    常见面试题目: 1. 所有类型都继承System.Object吗? 2. 解释virtual.sealed.override和abstract的区别 3. 接口和类有什么异同? 4. 抽象类和接口有什 ...

  5. js报错

    1.如果出现找不到js方法,感觉写的js都正确就是调试报错,可能原因是js文件重复引用 2.在用ajax异步提交时千万别用 submit 控件,submit控件是表单提交控件,提交表单的同时不会执行异 ...

  6. db2-表处于暂挂状态

    有时当对表数据进行操作时,表锁了,处于暂挂状态,网上搜的大部分不能解决的话可以尝试用以下语句进行解锁 call sysproc.admin_cmd('reorg table 表名')

  7. php数组的定义

    数组的主要作用就是存储数据,修改数据. 数组:就是把多个数据放在一起管理. 数组可以存入多个不同类型的数据,是一个复合数据类型.   在PHP中,有两种方式定义数组 //$array = array( ...

  8. display详细说明

    display:block,inline,inline-block区别 display:block就是将元素显示为块级元素. block元素的特点是: 总是在新行上开始: 高度,行高以及顶和底边距都可 ...

  9. 《ArcGIS Runtime SDK for Android开发笔记》——(9)、空间数据的容器-地图MapView

    1.前言 在上一篇内容里介绍了 关于ArcGIS Android开发的未来(“Quartz”版Beta)相关内容,期间也提到了关于API接口的重构,开发思路的调整,根据2015UC资料也可以知道新版预 ...

  10. Java中的字符集

    Java中的字符集 1.字符集概述 字符集是各国家文字与字符编码对照表.字符可以看成是计算机中展示的图案效果,每个字符集都对每一种图案进行编码,有着一对一的对应关系.因此进行字符输出时,都需要指定使用 ...