MySQL Build table Good example

Source: Internet
Author: User

DROP TABLE IF EXISTS ' Sys_warehouse_area ';
CREATE TABLE ' Sys_warehouse_area ' (
' ID ' bigint (a) Not NULL COMMENT ' warehouse area number ',
' Name ' varchar (not NULL) DEFAULT ' COMMENT ' warehouse zone name ',
' lang_code ' varchar ' not NULL DEFAULT ' COMMENT ' Multi-language code ',
' Status ' bit (1) not NULL DEFAULT B ' 0 ' COMMENT ' state ',
' Type ' int (one) not NULL DEFAULT ' 0 ' COMMENT ' warehouse area type, 1 large parcel area, 2 small parcel area ',
' create_user ' varchar not NULL DEFAULT ' COMMENT ' creator ',
' Create_time ' timestamp not NULL DEFAULT current_timestamp COMMENT ' creation time ',
' Update_user ' varchar () not NULL DEFAULT ' COMMENT ' update person ',
' update_time ' timestamp not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' update Time ',
' Delete_status ' bit (1) not NULL DEFAULT B ' 0 ' COMMENT ' is deleted ',
' Delete_user ' varchar () not NULL DEFAULT ' COMMENT ' delete person ',
' Delete_time ' timestamp not NULL DEFAULT current_timestamp COMMENT ' Delete Time ',
' Remarks ' varchar ($) Not NULL DEFAULT ' COMMENT ' remark ',
' pass_no ' varchar (+) not NULL DEFAULT ' COMMENT ' the ' grid number ',
PRIMARY KEY (' id ') USING BTREE
Engine=innodb DEFAULT Charset=utf8 comment= ' warehouse Area table ';

CREATE TABLE ' Testuser ' (
' id ' int (ten) unsigned not NULL auto_increment,
' username ' varchar (+) not NULL DEFAULT ' ',
' Mobile ' int (unsigned) not NULL DEFAULT ' 0 ',
' Shijian ' timestamp not NULL the DEFAULT current_timestamp on UPDATE current_timestamp,
PRIMARY KEY (' id ')
) engine=innodb auto_increment=2 DEFAULT Charset=utf8;

MySQL Build table Good example

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.