user表
create table user
(
user_id int AUTO_INCREMENT primary key,
user_pass varchar(15) not null,
user_name varchar(15) not null,
user_gender char(2) check(user_gender in ('女','男')),
user_email varchar(15) not null,
user_card varchar(20) not null,
user_phone varchar(15) not null
isSeller smallint not null check(isSeller in (0,1)),
user_money double precision not null,
credit int not null check (credit >= 0 and credit <= 5)
)
goodtype表
create table goodtype
(
type_id smallint AUTO_INCREMENT primary key,
type_name varchar(20) not null
)
good表
create table good
(
good_id int AUTO_INCREMENT primary key,
good_name varchar(20) not null,
type_id smallint not null,
good_money double precision not null check(good_money > 0.0),
good_image_address varchar(100),
good_description varchar(200),
user_id int not null,
good_sell int not null check (good_sell >= 0),
good_time date not null,
foreign key(type_id) references goodtype(type_id),
foreign key(user_id) references user(user_id)
)
purchaseorder表
create table purchaseorder
(
order_id int AUTO_INCREMENT primary key,
good_id int not null,
good_number smallint not null check (good_number > 0),
seller_id int not null,
buyer_id int not null,
order_state smallint not null,
order_time date not null,
foreign key(good_id) references good(good_id),
foreign key(seller_id) references user(user_id),
foreign key(buyer_id) references user(user_id)
)
message 表
create table message
(
message_id int AUTO_INCREMENT primary key,
message_from int not null,
message_to int not null,
message_content varchar(200),
message_time date not null,
foreign key(message_from) references user(user_id),
foreign key(message_to) references user(user_id)
)
administer表
create table administrator
(
adm_id int AUTO_INCREMENT primary key,
adm_name varchar(15) not null,
adm_gender char(2) check (adm_gender in ('男''女')),
adm_pass varchar(20) not null
)
advertisement表
create table advertisement
(
ad_id int AUTO_INCREMENT primary key,
ad_picture varchar(50),
ad_swf varchar(50),
ad_name varchar(15),
ad_location smallint not null check(ad_location >0)
)
broadcast表
create table broadcast
(
broadcast_id int AUTO_INCREMENT primary key,
broadcast_content varchar(100) not null,
adm_id int not null,
broadcast_time date not null,
foreign key(adm_id) references administrator(adm_id)
)
address表
create table address
(
address_id int AUTO_INCREMENT primary key,
address_picture varchar(50),
address_name varchar(15) not null,
address_content varchar(100) not null
)
基于mvc的网络购物中心网站
需积分: 9 72 浏览量
2011-12-26
19:45:26
上传
评论
收藏 1.6MB 7Z 举报
zxogj
- 粉丝: 11
- 资源: 26
最新资源
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- Docker在Ubuntu16.04上安装和部署Apache Storm
- test_kong.zip
- springboot权限验证学习-下
- SeetaFace6人脸质量评估C++代码实现Demo
- OCAuxiliaryTools
- 制药公司QC顶岗实习专题报告
- Rust 全面指南:从基础到高级,一网打尽 Rust 的编程知识
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈