--Create table
create table LIVE
(
live_id NVARCHAR2(10) not null,
reserve_id NVARCHAR2(10),
customer_id NVARCHAR2(10) not null,
room_id NVARCHAR2(10) not null,
live_num NUMBER,
live_num_id NVARCHAR2(10),
live_time DATE notnull,
live_day NUMBER notnull,
staff_id NVARCHAR2(10) not null,
deposit_total_money NUMBER notnull)
tablespace SYSTEM
pctfree10pctused40initrans1maxtrans255storage
(
initial 64K
next 1M
minextents1maxextents unlimited
);--Add comments to the table
comment on table LIVEis '入住表';--Add comments to the columns
comment on column LIVE.live_idis '入住id';
comment on column LIVE.reserve_idis '预定id';
comment on column LIVE.customer_idis '顾客id';
comment on column LIVE.room_idis '房间id';
comment on column LIVE.live_numis '入住人数';
comment on column LIVE.live_num_idis '入住人数id';
comment on column LIVE.live_timeis '入住时间';
comment on column LIVE.live_dayis '入住天数';
comment on column LIVE.staff_idis '员工id';
comment on column LIVE.deposit_total_moneyis '押金总金额';-- Create/Recreate primary, unique and foreign key constraints
alter table LIVE
add constraint PK_LIVE_ID primary key (LIVE_ID)usingindex
tablespace SYSTEM
pctfree10initrans2maxtrans255storage
(
initial 64K
next 1M
minextents1maxextents unlimited
);
alter table LIVE
add constraint FK_LCUSTOMER_ID foreign key (CUSTOMER_ID)
references CUSTOMER (CUSTOMER_ID);
alter table LIVE
add constraint FK_LRESERVE_ID foreign key (RESERVE_ID)
references RESERVE (RESERVE_ID);
alter table LIVE
add constraint FK_LROOM_ID foreign key (ROOM_ID)
references ROOM (ROOM_ID);
alter table LIVE
add constraint FK_LSTAFF_ID foreign key (STAFF_ID)
references STAFF (STAFF_ID);