?? 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 + -