標籤:android項目之無線點餐1--點餐系
(1)使用資料庫mysql,指令碼語言如下:
/* 使用者表*/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;/*餐桌表*/CREATE TABLE `tabletbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, `flag` int(11) DEFAULT '0' COMMENT '1:表示有人 0:表示空位', PRIMARY KEY (`id`)) DEFAULT CHARSET=gbk;/*菜單分類表*/CREATE TABLE `menutypetbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`))DEFAULT CHARSET=gbk;/*菜單表*/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;/* 訂單表*/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, `isPay` int(11) DEFAULT '0' COMMENT '0:未結算 1: 結算', PRIMARY KEY (`id`))DEFAULT CHARSET=gbk;/* 訂單詳細表*/CREATE TABLE `orderdetailtbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, `oid` int(11) DEFAULT NULL, `mid` 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','123',NULL), (2,'tom','456',NULL);COMMIT;INSERT INTO `menutypetbl` (`id`, `name`) VALUES (1,'熱菜'), (2,'涼菜'), (3,'酒品');COMMIT;INSERT INTO `menutbl` (`id`, `tid`, `name`, `price`, `description`) VALUES (1,1,'水煮魚',30,NULL), (2,1,'地三鮮',15,NULL), (3,2,'魚香肉絲',15,NULL), (4,2,'東北亂燉',30,NULL);COMMIT;INSERT INTO `tabletbl` (`id`, `flag`) VALUES (1,0), (2,0), (3,0), (4,0), (5,0), (6,0);COMMIT;
(2)命令列中擦混剪資料庫:-->create datbase wiressorder; -->charset gbk;(需要將指令碼語言儲存為db.sql存放在C盤目錄下等待使用)
資料庫建立成功!
Android項目之無線點餐(1)--點餐系統資料庫設計