餐馆订餐系统表的初步设计思路

来源:互联网 发布:蓝月英雄翅膀升级数据 编辑:程序博客网 时间:2024/05/16 10:25

/*
Navicat MySQL Data Transfer

Source Server : ntqn_96
Source Server Version : 50556
Source Host : localhost:3306
Source Database : ntqn_96

Target Server Type : MYSQL
Target Server Version : 50556
File Encoding : 65001

Date: 2017-10-20 15:12:45
*/

SET FOREIGN_KEY_CHECKS=0;


– Table structure for t_menu


DROP TABLE IF EXISTS `t_menu`;CREATE TABLE `t_menu` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `name` varchar(100) DEFAULT NULL,  `description` varchar(255) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

– Records of t_menu


INSERT INTO `t_menu` VALUES ('1', '脱骨鸡', '中餐');INSERT INTO `t_menu` VALUES ('2', '清水白菜', '中餐');INSERT INTO `t_menu` VALUES ('3', '天妇罗', '日料');INSERT INTO `t_menu` VALUES ('4', '寿司拼盘', '日料');INSERT INTO `t_menu` VALUES ('5', '黑椒小牛排', '西餐');INSERT INTO `t_menu` VALUES ('6', '什锦沙拉', '西餐');INSERT INTO `t_menu` VALUES ('7', '罗宋汤', '东南亚菜系');INSERT INTO `t_menu` VALUES ('8', '香茅柠檬鱼', '东南亚菜系');

– Table structure for t_order


DROP TABLE IF EXISTS `t_order`;CREATE TABLE `t_order` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `restaurant_id` int(11) NOT NULL,  `detail_id` int(11) NOT NULL,  `table_number` int(11) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

– Records of t_order


INSERT INTO `t_order` VALUES ('1', '1', '1', '1', '5');INSERT INTO `t_order` VALUES ('2', '2', '4', '4', '7');INSERT INTO `t_order` VALUES ('3', '2', '3', '2', '9');

– Table structure for t_order_detail


DROP TABLE IF EXISTS `t_order_detail`;CREATE TABLE `t_order_detail` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `restaurant_menu_id` int(11) NOT NULL,  `date` date DEFAULT NULL,  `price` decimal(4,1) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

– Records of t_order_detail


INSERT INTO `t_order_detail` VALUES ('1', '1', '2017-10-07', '30.5');INSERT INTO `t_order_detail` VALUES ('2', '3', '2017-10-07', '32.5');INSERT INTO `t_order_detail` VALUES ('3', '5', '2017-10-18', '46.5');INSERT INTO `t_order_detail` VALUES ('4', '8', '2017-10-17', '42.0');

– Table structure for t_restarant_menu


DROP TABLE IF EXISTS `t_restarant_menu`;CREATE TABLE `t_restarant_menu` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `menu_id` int(11) NOT NULL,  `restaurant_id` int(11) NOT NULL,  `price` decimal(4,1) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

– Records of t_restarant_menu


INSERT INTO `t_restarant_menu` VALUES ('1', '1', '1', '30.5');INSERT INTO `t_restarant_menu` VALUES ('2', '2', '1', '90.2');INSERT INTO `t_restarant_menu` VALUES ('3', '3', '2', '32.5');INSERT INTO `t_restarant_menu` VALUES ('4', '4', '2', '17.5');INSERT INTO `t_restarant_menu` VALUES ('5', '5', '3', '46.5');INSERT INTO `t_restarant_menu` VALUES ('6', '6', '3', '37.5');INSERT INTO `t_restarant_menu` VALUES ('7', '7', '4', '51.0');INSERT INTO `t_restarant_menu` VALUES ('8', '8', '4', '42.0');

– Table structure for t_restaurant


DROP TABLE IF EXISTS `t_restaurant`;CREATE TABLE `t_restaurant` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `name` varchar(255) DEFAULT NULL,  `telephone` varchar(11) DEFAULT NULL,  `address` varchar(255) DEFAULT NULL,  `state` varchar(20) DEFAULT NULL,  PRIMARY KEY (`id`),  UNIQUE KEY `telephone` (`telephone`)) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

– Records of t_restaurant


INSERT INTO `t_restaurant` VALUES ('1', '桃园餐厅', '1223333333', '崇川区', '正常');INSERT INTO `t_restaurant` VALUES ('2', '京都料理', '12333333333', '崇川区', '正常');INSERT INTO `t_restaurant` VALUES ('3', '托尔斯', '11222222222', '开发区', '正常');INSERT INTO `t_restaurant` VALUES ('4', '芭提雅餐厅', '11199999999', '开发区', '正常');

– Table structure for t_user


DROP TABLE IF EXISTS `t_user`;CREATE TABLE `t_user` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `name` varchar(50) DEFAULT NULL,  `telephone` varchar(11) DEFAULT NULL,  `address` varchar(255) DEFAULT NULL,  `state` varchar(20) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

– Records of t_user


INSERT INTO `t_user` VALUES ('1', '张三', '12333333333', '南通', '正常');INSERT INTO `t_user` VALUES ('2', '李四', '13222222222', '如东', '正常');INSERT INTO `t_user` VALUES ('3', '王五', '14222222222', '如皋', '正常');INSERT INTO `t_user` VALUES ('4', '陈六', '15222222222', '启东', '正常');
原创粉丝点击