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. C语言实现通用链表初步(三)----单元测试

    前两节,我们已经完成了链表的一些操作,快来测试一下吧. 这里使用的单元测试工具名字叫"check". START_TEST(my_slist_1) { struct student ...

  2. C++ 虚函数、纯虚函数、虚继承

    1)C++利用虚函数来实现多态. 程序执行时的多态性通过虚函数体现,实现运行时多态性的机制称爲动态绑定:与编译时的多态性(通过函数重载.运算符重载体现,称爲静态绑定)相对应. 在成员函数的声明前加上v ...

  3. hdu 3586 最小代价切断根与叶子联系

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3586 http://blog.csdn.net/woshi250hua/article/details ...

  4. Servlet细节整合

    最近在复习Servlet,发现其中有很多细节方面的东西都没有接触到,只是学了大概 1.请求转发和请求重定向的区别 2.输入参数为中文时候的乱码问题 3.Web工程中的目录写法 下面分别阐述 1.请求转 ...

  5. div的浮动(float)

    什么是浮动 浮动,故名思议,就是移动位置. 之所以不叫移动,而叫浮动,那是因为给元素设置浮动后,元素会浮到文档上面来,术语叫脱离文档流. 例子 下面我们看例子 <html> <hea ...

  6. css清除浮动的原理

    最近学习css发现了高度塌陷时候要清除浮动,为了理解清楚浮动原理,网上找了不少资料,发现都写的不是很清楚,而且都是一模一样的内容,我在里分享一下我对清楚浮动原理的理解, 如果你已经很了解什么是浮动和浮 ...

  7. JS在与lua的交互心得

    最近在写一个项目,前端技术使用的是Vue,在与lua的交互过程,是通过一个公共JS,前端调用公共js的方法给lua发送命令,lua接到命令,去执行一些方法,然后又通过回调返回到了前端,由于是第一次写这 ...

  8. ArcGIS创建要素类

    在使用ARCGIS软件进行工作时,免不了要建立地理数据库和要素类之类的.一下是我创建文件地理数据库并在数据库中创建要素类写相关步骤: 1.启动软件,可以使用ARCCatalog直接进行创建也可以使用A ...

  9. CSS 笔记之 CSS 选择器

    /*先设置背景再设置前景*/ pre{ background-color: #f8f8f8; border: solid 1px #ccc; border-radius: 3px; overflow: ...

  10. Unity3d开发集成Google Admob广告增加收入

    在Unity游戏中植入广告是Unity 游戏产品增加收入的一种重要方式,常用的广告有谷歌Admob,百度ssp,腾讯广点通,unity公司的unityads等等,而使用的最多的应该属于谷歌Admob, ...