简化客户会员
parent
d5d573f4a9
commit
e6fcc7a462
|
@ -92,20 +92,6 @@ left join tb_emp_post ep on e.emp_id = ep.emp_id
|
|||
left join tb_post p on ep.post_id = p.post_id;
|
||||
|
||||
|
||||
-- 会员表
|
||||
drop table if exists tb_vip;
|
||||
create table tb_vip(
|
||||
vip_id int(11) comment '会员编号' primary key auto_increment,
|
||||
vip_name varchar(20) comment '会员姓名',
|
||||
vip_age int(2) comment '会员年龄',
|
||||
vip_gender int(11) comment '员工性别:1-男 2-女',
|
||||
vip_tel long comment '会员联系方式',
|
||||
vip_grade varchar(1) comment '会员等级',
|
||||
reg_date datetime comment '注册日期'
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='会员表';
|
||||
insert into tb_vip (vip_name, vip_age, vip_gender, vip_tel, vip_grade, reg_date) values ('张三',20,1,'17373105689',3,'2020-1-1 10:00');
|
||||
select vip_id, vip_name, vip_age, vip_gender, vip_tel, vip_grade, reg_date from tb_vip;
|
||||
|
||||
-- 客户表
|
||||
drop table if exists tb_customer;
|
||||
create table tb_customer(
|
||||
|
@ -114,10 +100,12 @@ create table tb_customer(
|
|||
customer_age varchar(20) comment '客户年龄',
|
||||
customer_gender int(11) comment '客户性别:1-男 2-女',
|
||||
customer_address varchar(20) comment '客户住址',
|
||||
customer_tel varchar(20) comment '客户联系方式'
|
||||
customer_tel varchar(20) comment '客户联系方式',
|
||||
vip_grade int(11) default 0 comment '会员等级',
|
||||
reg_date datetime comment '会员注册日期'
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='客户表';
|
||||
insert into tb_customer (customer_name, customer_age, customer_gender, customer_address, customer_tel) values ('张三',20,1,'北京市大兴区XXX路XX号','17373105689');
|
||||
select customer_id, customer_name, customer_age, customer_gender, customer_address, customer_tel from tb_customer;
|
||||
select customer_id, customer_name, customer_age, customer_gender, customer_address, customer_tel,vip_grade,reg_date from tb_customer;
|
||||
|
||||
|
||||
-- 商品表
|
||||
|
@ -139,6 +127,16 @@ insert into tb_merch (merch_name, merch_type, merch_price, bar_code, sales_pro_p
|
|||
values ('青芒','生鲜水果',30,'asfdghj',20,'001','0011','2023-11-30',500);
|
||||
select merch_id, merch_name, merch_type, merch_price, bar_code, sales_pro_price, factory_id, provide_id, merch_dead_time, merch_num, merch_sta from tb_merch;
|
||||
|
||||
-- 商品类型表
|
||||
drop table if exists tb_type;
|
||||
create table tb_type(
|
||||
type_id int(11) comment '类型Id' primary key auto_increment,
|
||||
type_name varchar(55) comment '类型名称',
|
||||
category_id int(11) comment '父级Id'
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='商品类型表';
|
||||
insert into tb_type (type_name, category_id) values ('生鲜水果',0);
|
||||
select type_id, type_name, category_id from tb_type;
|
||||
|
||||
-- 进货表
|
||||
drop table if exists tb_import;
|
||||
create table tb_import(
|
||||
|
|
Loading…
Reference in New Issue