Wireless ordering for Android projects (1)--Ordering system Database design

Source: Internet
Author: User

(1) using the database MySQL, the scripting language is as follows:

/* User table */create table ' usertbl ' (' id ' int (one) not NULL auto_increment, ' username ' varchar () DEFAULT NULL, ' password ')  varchar () default NULL, ' permission ' int (one) default NULL, PRIMARY KEY (' id ')) Default charset=gbk;/* table */create table ' Tabletbl ' (' id ' int (one) ' Not NULL auto_increment, ' flag ' int (all) ' DEFAULT ' 0 ' COMMENT ' 1: Indicates someone 0: empty ', PRIMARY KEY (' I d ')) DEFAULT charset=gbk;/* menu Classification Table */create table ' menutypetbl ' (' id ' int (one) not NULL auto_increment, ' name ' varchar (20) Default NULL, PRIMARY KEY (' id ')) Default charset=gbk;/* menu table */create table ' menutbl ' (' id ' int (one) ' Not NULL auto_incremen T, ' tid ' int (one) default null, ' name ' varchar (default null), ' price ' int (one) default null, ' description ' varchar (20 Default NULL, PRIMARY KEY (' id ')) Default charset=gbk;/* order table */create ' Ordertbl ' (' id ' int (one) ' Not NULL AUTO_INCR Ement, ' ctime ' varchar () default NULL, ' UID ' int (one) default null, ' tid ' int (one) default null, ' description ' varchar () DEFAULT NULL, ' perSonnum ' int (one) default NULL, ' Ispay ' int (one) default ' 0 ' COMMENT ' 0: Not settled 1: settlement ', PRIMARY KEY (' id ')) default CHARSET=GBK; /* Order Detail Sheet */create table ' orderdetailtbl ' (' id ' int (one) not null auto_increment, ' oid ' int (one) DEFAULT NULL, ' mid ' int (1 1) default NULL, ' num ' int (one) default null, ' description ' varchar () default NULL, PRIMARY KEY (' id ')) default CHARSET =gbk;insert into ' usertbl ' (' id ', ' username ', ' password ', ' permission ') VALUES (1, ' admin ', ' 123 ', NULL), (2, ' Tom ', ' 456 ', N ULL); Commit;insert into ' menutypetbl ' (' id ', ' name ') VALUES (1, ' hot Dishes '), (2, ' cold Dishes '), (3, ' wine '); Commit;insert into ' menutbl ' (' IDs ', ' tid ', ' name ', ' price ', ' description ') VALUES (1, 1, ' boiled fish ', 30,null), (2,1, ' ground delicacies ', 15,nu LL), (3,2, ' fish fragrant shredded pork ', 15,null), (4,2, ' Northeast Stew ', 30,null); Commit;insert into ' tabletbl ' (' id ', ' flag ') VALUES (1,0), (2,0), (3,0), (4,0), (5,0), (6,0); COMMIT;

(2) The database of wiping and mixing shears in the command line:-->create datbase Wiressorder; -->charset GBK; (You need to save the scripting language as Db.sql to be stored in the C-drive directory for use)


Database created successfully!



Wireless ordering for Android projects (1)--Ordering system Database design

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.