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!