create database caocao;
use caocao
-- 外卖类别
create table category(
cateid int PRIMARY key auto_increment,
catename varchar(10)
);
-- 商家信息
create table store(
storeid int PRIMARY key auto_increment, ,
storename varchar(30) ,
address varchar(40) ,
personspending int
);
-- 外卖商品信息表
create table goods(
goodsid int PRIMARY key auto_increment,,
title varchar(50) not null,
unitprice DOUBLE not null,
discount DOUBLE default'1',
cateid int,
storeid int,
roat int default'0',
description varchar(200),
packingexpense double not null
);
-- 客户信息
create table customers(
custid int PRIMARY key ,
custname varchar(30) not null,
loginpwd varchar(64) not null,
phone varchar(20) not null,
email varchar(50) not null,
address varchar(80),
account double not null default'0'
);
-- 订单表
create table orders(
orderid int(20) Auto_INCREMENT PRIMARY key,
orderno varchar(20) not null unique,
orderprice double,
orderdate date,
custid int,
CONSTRAINT caocao_customers_custid FOREIGN KEY(custid) REFERENCES customers(custid),
custname varchar(20),
custphone varchar(20) not null,
custaddress varchar(40) not null,
zip varchar(4) not null,
invoicetitle varchar(50),
invoicecontent varchar(20),
orderstatus varchar(50) default'未付款'
);
insert into category values(CateID,'快餐');
insert into category values(CateID,'饺子');
insert into category values(CateID,'汉堡');
insert into category values(CateID,'薯条');
insert into category values(CateID,'包子');
insert into category values(CateID,'粥');
insert into store values(storeId,'快餐店','河南许昌',35);
insert into store values(storeId,'小红餐馆','河南许昌',30);
insert into store values(storeId,'小兰面馆','河南郑州',30);
insert into store values(storeId,'张三麻辣烫','河南郑州',50);
insert into store values(storeId,'李四炸鸡','河南周口',50);
insert into store values(storeId,'王佳火锅店','河南周口',60);
外卖系统
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。