Database design (PMD) of real-maven+ssh online mall Project

Source: Internet
Author: User

Database Physical model:650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/M02/75/BB/ Wkiol1zbl6uhw9tmaaden64jyds964.png "title=" physical model. png "alt=" Wkiol1zbl6uhw9tmaaden64jyds964.png "/>


Database sql:

Create table consignee_management (   consignee_id          int not null auto_increment,   user_id               int,   consignee_name        varchar (),    consignee_address    varchar ( (+),    consignee_code       varchar (Ten),    Consignee_phone      varchar (one),   primary key  ( consignee_id)); Create table goods_info (   goods_id              int not null auto_increment,    Goods_name           varchar (,   ) goods_price          double,   goods_url             varchar (,   goods_desc    )        varchar (,   goods_state    )       varchar  comment  ' 1  shelves   2  bottom shelf ',    primary key  (goods_id) create table order_detail (   order_ detail_id      int not null auto_increment,    order_id             int,    goods_id             int,    orde_number          int,   order_price           double,   primary key  (order_detail_id));create table  Order_management (   order_id              int not null auto_increment,   user_id               int,   consignee_id          int,   order_time            datetime,   order_total           double,   order_state           varchar (,   primary key ) (order_id); Create table user_info (    user_id              int not  null auto_increment,   user_name             varchar (,   user_sex           )   varchar (Ten),   user_phone            varchar (one),   user_pw               varchar (,   user_type       )      varchar (5)  comment  ' 1  general user   2  Administrator ',    primary key  (user_id)); alter table consignee_management add constraint  FK_Reference_1 foreign key  (user_id)       references  user_info  (user_id)  on delete restrict on update restrict;alter table  order_detail add constraint fk_reference_4 foreign key  (order_id)        references order_management  (order_id)  on delete restrict on update  Restrict;alter table order_detail add constraint fk_reference_5 foreign key   (goods_id)       references goods_info  (goods_id)  on  delete restrict on update restrict;alter table order_management add  constraint fk_reference_2 foreign key  (user_id)        references user_info  (user_id)  on delete restrict on update restrict; Alter table order_management add constraint fk_reference_3 foreign key   (consignee_id)       references consignee_management  (consignee_ ID)  on delete restrict on update restrict; 


This article is from the "Lao Niu Java" blog, please be sure to keep this source http://liuyj.blog.51cto.com/2340749/1711450

Database design (PMD) of real-maven+ssh online mall Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.