Wireless ordering in Android Project (1) -- ordering system database design

Source: Internet
Author: User

Wireless ordering in Android Project (1) -- ordering system database design

(1) Use the mysql database. The script language is as follows:

/* User TABLE */create table 'usertbl' ('id' int (11) not null AUTO_INCREMENT, 'username' varchar (20) default null, 'Password' varchar (20) default null, 'permission' int (11) default null, primary key ('id') default charset = gbk; /* TABLE */create table 'tabletbl' ('id' int (11) not null AUTO_INCREMENT, 'flag' int (11) DEFAULT '0' comment' 1: 0: Indicates empty space, primary key ('id') default charset = gbk; /* menu category TABLE */create table 'menutypetbl' ('id' int (11) not null AUTO_INCREMENT, 'name' varchar (20) default null, primary key ('id') default charset = gbk;/* menu TABLE */create table 'menutbl' ('id' int (11) not null AUTO_INCREMENT, 'tid' int (11) default null, 'name' varchar (20) default null, 'price' int (11) default null, 'description' varchar (20) default null, primary key ('id') default charset = gbk;/* Order TABLE */create table 'ordertbl' ('id' int (11) not null AUTO_INCREMENT, 'ctime' varchar (20) default null, 'uid' int (11) default null, 'tid' int (11) default null, 'description' varchar (20) default null, 'personnum' int (11) default null, 'ispa' int (11) DEFAULT '0' COMMENT '0: unsettled 1: check', primary key ('id ')) default charset = gbk;/* Order details */create table 'orderdetailtbl' ('id' int (11) not null AUTO_INCREMENT, 'id' int (11) default null, 'Min' int (11) default null, 'num' int (11) default null, 'description' varchar (20) default null, primary key ('id ')) default charset = gbk; insert into 'usertbl' ('id', 'username', 'Password', 'permission') VALUES (1, 'admin', '2016 ', NULL), (2, 'Tom ', '000000', NULL); COMMIT; insert into 'menutypetbl' ('id', 'name') VALUES (1, 'Hot food'), (2, 'cold food'), (3, 'Wine product'); COMMIT; insert into 'menutbl' ('id', 'tid ', 'name', 'price', 'description') VALUES (, 'boiled fish', 30, NULL), (, 'ground three shares', 15, NULL), (, 2, 'shredded fish files', 15, NULL), (, 'northeast taobao', 30, NULL); COMMIT; insert into 'tablebl' ('id', 'flag ') VALUES (), (); COMMIT;

(2) run the "create datbase wiressorder; --> charset gbk" command in the command line. (Save the script language as db. SQL in the C directory and wait for use)


The database is created successfully!



Related Article

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.