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. VB.NET中的模块

    在C#中有“静态类”的概念,自然里边全部的方法都是静态的.这意味着你可以直接通过"类名.方法名"去调用(例如System的Math类就是典型).在VB.NET中,没有“静态类”的概 ...

  2. 实例化php类的时候如何传参

    当我们实例化一个php类的时候,要怎么传递参数呢?这取决于该类的构造方法. 例: person.class.php <?php class person{ var $name; var $col ...

  3. JDK一键安装,配置环境

    人懒,就得“多干活”!  正常安装JDK 的话,它会修改系统的path 变量,加入自己的调用路径(jre) 这样,我们刚安装好后,就可直接调用java –verbose 查看jre 安装的目录了. ( ...

  4. C#中事件的一些总结

    事件中  sender和e  事件中不同的对象 object  sender  是事件的对象 eventages e   是事件对象传递过来的参数对象 如 private button_click(O ...

  5. c#获取目录2

    // 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnostics.Process.G ...

  6. HTML三种样式引入方式

    HTML三种样式引入方式   HTML有三种样式引入方式:行内样式(inline Styles).嵌入式样式表(Embedded Style Sheets).外部样式表(External Style ...

  7. 在Git上创建新分支(实用性高!!!)

    在github上创建仓库: Create a new repository on the command line touch README.md git init git add README.md ...

  8. ndk制作so库,ndk-build不是内部或外部命令。。。的错误

    想了想大概就需要下面这几步: 1.下载ndk 2.配置ndk的环境变量 3.在android studio添加一些ndk的配置 4.编写c文件 5.生成so库 6.调用so库 上面提到的大部分问题你都 ...

  9. c#数据类型和表达式

    一.数据类型 值类型: 1.整数(没有小数) Byte:字节0~255 Char:一个字符 Int 2.有小数 范围大的:double双 小范围:float单 最精确的:十进制decimal 3.bo ...

  10. oop编程思想

    oop的编程思想:抽象.封装.继承.多态. 1.抽象: 数据抽象:类描述的对象的属性或状态 行为抽象:类描述的对象的行为或功能 举例: 时钟:Class 数据:int Hour,Minute,Seco ...