作业:订餐系统

/*
Navicat MySQL Data Transfer

Source Server : localhost_3306
Source Server Version : 50558
Source Host : localhost:3306
Source Database : 订餐数据库

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

Date: 2017-10-22 19:42:01
*/

SET FOREIGN_KEY_CHECKS=0;


– Table structure for cost-dining


DROP TABLE IF EXISTS cost-dining;
CREATE TABLE cost-dining (
id varchar(255) NOT NULL,
costomer_id varchar(255) NOT NULL,
dining_id varchar(255) NOT NULL,
KEY fk-06 (costomer_id),
KEY fk-07 (dining_id),
CONSTRAINT fk-07 FOREIGN KEY (dining_id) REFERENCES dining (id),
CONSTRAINT fk-06 FOREIGN KEY (costomer_id) REFERENCES costomer (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


– Records of cost-dining


INSERT INTO cost-dining VALUES (‘D1’, ‘A1’, ‘A4’);
INSERT INTO cost-dining VALUES (‘D2’, ‘A2’, ‘A3’);
INSERT INTO cost-dining VALUES (‘D3’, ‘A3’, ‘A2’);
INSERT INTO cost-dining VALUES (‘D4’, ‘A4’, ‘A1’);


– Table structure for costomer


DROP TABLE IF EXISTS costomer;
CREATE TABLE costomer (
id varchar(255) NOT NULL,
name varchar(255) NOT NULL,
phone varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


– Records of costomer


INSERT INTO costomer VALUES (‘A1’, ‘小明’, ‘123321’);
INSERT INTO costomer VALUES (‘A2’, ‘小何’, ‘231321’);
INSERT INTO costomer VALUES (‘A3’, ‘小聪’, ‘123123’);
INSERT INTO costomer VALUES (‘A4’, ‘小丫’, ‘232112’);


– Table structure for cost_meau


DROP TABLE IF EXISTS cost_meau;
CREATE TABLE cost_meau (
id varchar(255) NOT NULL,
cost_id varchar(255) NOT NULL,
meau_id varchar(100) NOT NULL,
price int(11) NOT NULL,
KEY fk-05 (cost_id),
KEY fk-04 (meau_id) USING BTREE,
CONSTRAINT fk-04 FOREIGN KEY (meau_id) REFERENCES meau (id),
CONSTRAINT fk-05 FOREIGN KEY (cost_id) REFERENCES costomer (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;


– Records of cost_meau


INSERT INTO cost_meau VALUES (‘F1’, ‘A1’, ‘C1’, ‘110’);
INSERT INTO cost_meau VALUES (‘F2’, ‘A1’, ‘C2’, ‘222’);
INSERT INTO cost_meau VALUES (‘F3’, ‘A1’, ‘C3’, ‘123’);
INSERT INTO cost_meau VALUES (‘F4’, ‘A2’, ‘C4’, ‘121’);
INSERT INTO cost_meau VALUES (‘F5’, ‘A2’, ‘C5’, ‘213’);
INSERT INTO cost_meau VALUES (‘F6’, ‘A2’, ‘C6’, ‘213’);
INSERT INTO cost_meau VALUES (‘F7’, ‘A3’, ‘C7’, ‘213’);
INSERT INTO cost_meau VALUES (‘F8’, ‘A3’, ‘C8’, ‘421’);
INSERT INTO cost_meau VALUES (‘F9’, ‘A3’, ‘C9’, ‘123’);
INSERT INTO cost_meau VALUES (‘F10’, ‘A4’, ‘C10’, ‘124’);
INSERT INTO cost_meau VALUES (‘F11’, ‘A4’, ‘C11’, ‘123’);
INSERT INTO cost_meau VALUES (‘F12’, ‘A4’, ‘C12’, ‘100’);


– Table structure for dining


DROP TABLE IF EXISTS dining;
CREATE TABLE dining (
id varchar(255) NOT NULL,
name varchar(255) NOT NULL,
place varchar(255) NOT NULL,
KEY fk-01 (id),
CONSTRAINT fk-01 FOREIGN KEY (id) REFERENCES costomer (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


– Records of dining


INSERT INTO dining VALUES (‘A1’, ‘小聪餐厅’, ‘崇川区’);
INSERT INTO dining VALUES (‘A2’, ‘小华餐厅’, ‘开发区’);
INSERT INTO dining VALUES (‘A3’, ‘小明餐厅’, ‘港闸区’);
INSERT INTO dining VALUES (‘A4’, ‘小永餐厅’, ‘通州区’);


– Table structure for list


DROP TABLE IF EXISTS list;
CREATE TABLE list (
id int(11) NOT NULL,
ac varchar(255) NOT NULL,
ab varchar(255) NOT NULL,
time datetime NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


– Records of list


INSERT INTO list VALUES (‘1’, ‘D1’, ‘F1’, ‘2017-10-22 18:52:04’);
INSERT INTO list VALUES (‘2’, ‘D1’, ‘F2’, ‘2017-10-22 18:52:26’);
INSERT INTO list VALUES (‘3’, ‘D1’, ‘F3’, ‘2017-10-22 18:52:35’);
INSERT INTO list VALUES (‘4’, ‘D2’, ‘F4’, ‘2017-10-20 18:52:48’);
INSERT INTO list VALUES (‘5’, ‘D2’, ‘F5’, ‘2017-10-20 18:53:02’);
INSERT INTO list VALUES (‘6’, ‘D2’, ‘F6’, ‘2017-10-20 18:53:14’);
INSERT INTO list VALUES (‘7’, ‘D3’, ‘F7’, ‘2017-10-21 18:53:29’);
INSERT INTO list VALUES (‘8’, ‘D3’, ‘F8’, ‘2017-10-21 18:53:42’);
INSERT INTO list VALUES (‘9’, ‘D3’, ‘F9’, ‘2017-10-21 18:54:04’);
INSERT INTO list VALUES (‘10’, ‘D4’, ‘F10’, ‘2017-10-23 18:54:19’);
INSERT INTO list VALUES (‘11’, ‘D4’, ‘F11’, ‘2017-10-30 18:54:31’);
INSERT INTO list VALUES (‘12’, ‘D4’, ‘F12’, ‘2017-10-30 18:54:45’);


– Table structure for meau


DROP TABLE IF EXISTS meau;
CREATE TABLE meau (
id varchar(100) NOT NULL,
name varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


– Records of meau


INSERT INTO meau VALUES (‘C1’, ‘红烧土豆’);
INSERT INTO meau VALUES (‘C10’, ‘韭菜炒蛋’);
INSERT INTO meau VALUES (‘C11’, ‘红烧排骨’);
INSERT INTO meau VALUES (‘C12’, ‘凤爪’);
INSERT INTO meau VALUES (‘C2’, ‘红烧鱼’);
INSERT INTO meau VALUES (‘C3’, ‘红烧肉’);
INSERT INTO meau VALUES (‘C4’, ‘红烧猪蹄’);
INSERT INTO meau VALUES (‘C5’, ‘红烧鸡’);
INSERT INTO meau VALUES (‘C6’, ‘红烧猪肉’);
INSERT INTO meau VALUES (‘C7’, ‘清蒸鱼’);
INSERT INTO meau VALUES (‘C8’, ‘清蒸鸽子’);
INSERT INTO meau VALUES (‘C9’, ‘番茄炒蛋’);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值