📄 project.sql
字号:
--会员卡表
drop table vip_card;
create table vip_card(
card_id number(5),--卡号
vip_id number(8),--会员号
vip_pwd varchar(10),--会员卡密码
regist_date date,--注册时间
vip_level varchar(4),--会员级别
rest_money number(5,1),--余额
vip_point number(5),--会员卡积分
card_state varchar(4),--会员卡状态
constraint vip_card_primary_key primary key(card_id)
);
--客户信息表
drop table vip;
create table vip(
vip_id number(8),--会员号
vip_name varchar(10),--客户姓名
vip_sex varchar(2),--客户性别
vip_birthday date,--生日
vip_phone varchar(13),--手机
vip_address varchar(50),--地址
constraint vip_primary_key primary key(vip_id)
);
--会员级别表
drop table vip_card_level;
create table vip_card_level(
vip_level varchar(4),--会员级别
vip_discount number(3,1),--会员折扣
point_lower number(4),--积分下限
point_upper number(4),--积分上限
constraint vip_card_level_primary_key primary key(vip_level)
);
--会员卡充值记录表
drop table vip_charge;
create table vip_charge(
vip_id number(8),--会员卡号
charge_date date,--充值日期
charge_amount number(5,1),--充值金额
receive_amount number(5,1),--实收金额
operator_name varchar(8)--操作员姓名
);
--会员卡消费记录表
drop table vip_consume;
create table vip_consume(
order_id number(11),--订单号
vip_id number(8),--会员卡号
consume_date date ,--消费日期
needed_amount number(5,1),--应收金额
received_amount number(5,1),--实收金额
reduced_amount number(5,1),--优惠金额
constraint vip_consume_primary_key primary key(order_id)
);
--用于存储衣服附加信息中的衣服品牌
drop table clothes_brand_set;
create table clothes_brand_set(
clothes_brand varchar(10),--衣服品牌
constraint clothes_brand_set_primary_key primary key(clothes_brand)
);
--用于存储衣服附加信息中的衣服附件
drop table clothes_accessory_set;
create table clothes_accessory_set(
clothes_accessory varchar(10),--衣服附件
constraint clothes_acsry_set_primary_key primary key(clothes_accessory)
);
--用于存储衣服附加信息中的衣服颜色
drop table clothes_color_set;
create table clothes_color_set(
clothes_color varchar(10),--衣服颜色
constraint clothes_color_set_primary_key primary key(clothes_color)
);
--用于存储衣服附加信息中的衣服瑕疵
drop table clothes_flaw_set;
create table clothes_flaw_set(
clothes_flaw varchar(10),--衣服瑕疵
constraint clothes_flaw_set_primary_key primary key(clothes_flaw)
);
--用于表示某一类衣服对应的某一类具体的服务的价格信息设置
drop table clothes_type;
create table clothes_type(
clothes_id number(3),--衣服编号,主键
clothes_name varchar(8),--衣服名称
service_type varchar(8),--服务类型
unit_original_price number(3),--衣服单件原价
lowest_discount number(3,1), --衣服最低折扣,当为0时表示按照会员卡打折
operator_name varchar(8),--操作员姓名
add_date date,--添加日期
constraint clothes_type_primary_key primary key(clothes_id)
);
--订单项表,用来表示订单中的一个订单项
drop table order_item;
create table order_item(
clothes_id number(3),--衣服编号
clothes_brand varchar(10),--衣服品牌
clothes_accessory varchar(10),--衣服附件
clothes_color varchar(10),--衣服颜色
clothes_flaw varchar(10),--衣服瑕疵
clothes_addition_info varchar(80),--衣服备注
clothes_quantity number(2),--衣服件数
order_item_value number(4,1),--打折后,该订单项的应付金额
order_id number(11)--该订单项属于的订单的ID
);
--订单表,用来表示一次交易
drop table oneOrder;
create table oneOrder(
order_id number(11),--订单ID
vip_id number(8),--会员卡卡号
order_value number(5,1),--该次消费总额
in_date date,--收衣日期
out_date_prodicted date,--预定取衣日期
paid_or_not varchar(2),--是否付款
take_or_not varchar(2),--衣服是否拿走
operator_name varchar(8),--操作员姓名
constraint oneOrder_primary_key primary key(order_id)
);
--衣服重洗信息记录表
drop table rewash;
create table rewash(
order_id number(11),--订单ID
old_take_date date,--原定取衣日期
new_take_date date,--新定取衣日期
require_rewash_date date,--即在哪个时间确定要重洗衣服
operator_name varchar(8)--操作员姓名
--constraint rewash_primary_key primary key(order_id)
);
--衣服赔偿信息记录表
drop table refundment;
create table refundment(
order_id number(11),--订单ID
refund_date date,--退款日期
refund_amount number(5,1),--退款金额
refund_reason varchar(80),--退款原因
operator_name varchar(8),--操作员姓名
constraint refundment_primary_key primary key(order_id)
);
--操作员信息表(Operator)
drop table operator;
create table operator (
operator_id number(3), --操作员编号
operator_name varchar(8), --操作员姓名
operator_psw varchar(16), --操作员密码
operator_purview varchar(10), --所属权限
operator_phone varchar(13), --联系电话
operator_address varchar(50), --联系地址
constraint operator_primary_key primary key(operator_id)
);
--交班信息表(Duty_Exchange)
drop table duty_Exchange;
create table duty_Exchange (
last_balance number(6, 2), --前班结余
income_cash number(6, 2), --现金收入
income_card number(6, 2), --会员卡收入
turnover_up number(6, 2), --上交营业额
turnover_down number(6, 2), --下放营业额
current_balance number(6, 2), --当前结余
last_time date, --前次交班时间
present_time date, --当前交班时间
operator_off varchar(10), --交班员工
operator_on varchar(10) --接班员工
);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -