Enterprise Ordering System Database script

Source: Internet
Author: User

---restore content starts---

2018-07-26

CREATE TABLE Product_info (
product_id VARCHAR (+) not NULL,
product_name VARCHAR (+) not NULL COMMENT ' commodity name ',
Product_price DECIMAL (8, 2) not NULL COMMENT ' unit price ',
product_stock INT not NULL COMMENT ' inventory ',
product_description VARCHAR (COMMENT ' description '),
Product_icon VARCHAR (COMMENT) ' Little picture ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (product_id)
) COMMENT = ' commodity table ';
CREATE TABLE product_category (
category_id INT not NULL auto_increment,
category_name VARCHAR (+) not NULL COMMENT ' commodity name ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (category_id),
UNIQUE KEY uqe_category_type (category_type)
) COMMENT = ' class table ';
CREATE TABLE Order_master (
order_id VARCHAR (+) not NULL,
buyer_name VARCHAR (+) not NULL COMMENT ' buyer name ',
Buyer_phone VARCHAR (+) COMMENT ' buyer's phone ',
buyer_address VARCHAR (+) COMMENT ' buyer address ',
Buyer_openid VARCHAR (+) COMMENT ' buyer address ',
Order_amount DECIMAL (8, 2) not NULL COMMENT ' order total amount ',
pay_status TINYINT (3) not NULL default 0 COMMENT ' order status, default 0 new orders ',
order_status TINYINT (3) not NULL default 0 COMMENT ' order status, default 0 not paid ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (order_id),
KEY Idx_buyer_openid (Buyer_openid)
) COMMENT = ' order form ';
CREATE TABLE Order_detai (
detail_id VARCHAR (+) not NULL,
order_id VARCHAR (+),
product_name VARCHAR (+) not NULL COMMENT ' commodity name ',
Product_price DECIMAL (8, 2) not NULL COMMENT ' commodity price ',
product_quantity INT not NULL COMMENT ' quantity of goods ',
Product_icon VARCHAR (COMMENT) ' commodity little picture ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (detail_id),
KEY idx_order_id (order_id)
) COMMENT = ' Order Details table ';

---restore content ends---

Enterprise Ordering System Database script

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.