(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