ITeye博客

数据库设计

rfv1116 · 2011-09-13 22:21 · 数据库 · 数据库 · Markdown

/==============================================================/ /* DBMS name: MySQL 5.0 / / Created on: 2011-9-16 14:38:02 / /==============================================================*/

drop table if exists appointment;

drop table if exists card_info;

drop table if exists customer_info;

drop table if exists tb_record;

/==============================================================/ /* Table: appointment / /==============================================================*/ create table appointment ( id int not null auto_increment, app_time timestamp, ca_id int comment '卡号', name varchar(50), parents varchar(50), phone varchar(50), primary key (id) );

/==============================================================/ /* Table: card_info / /==============================================================*/ create table card_info ( ca_id int not null auto_increment, ca_num varchar(50), cid int not null, ca_type varchar(50), comments varchar(200), primary key (ca_id) );

/==============================================================/ /* Table: customer_info / /==============================================================*/ create table customer_info ( cid int not null auto_increment, create_date timestamp, baby_name varchar(50) not null, nickname varchar(50), parents_name varchar(50), phone varchar(50), primary key (cid, baby_name) );

alter table customer_info comment '客户信息表';

/==============================================================/ /* Table: tb_record / /==============================================================*/ create table tb_record ( rid int not null auto_increment, rec_date timestamp, consumer_type int comment '消费类型 0体验价 1刷卡', cid int comment '客户id', ca_id int comment 'card id', swim_time timestamp, swim_division varchar(50) comment '游泳师', primary key (rid) );

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。