23,407
社区成员
发帖
与我相关
我的任务
分享
请大家帮帮我,谢谢,耽误你们点时间,帮我指导指导,我做了2天都没有做出来,明天就要交作业了,请大家帮帮我。 create table move_booking
(
id number(5,0),
area varchar(30),
cartype varchar(30),
movedate date,
contact varchar(30),
phone varchar(12),
status varchar(1) default '0' check(status in('0', '1', '2')),
constraints pk_move primary key (id)
);
comment on table move_booking is '搬家预约登记表';
comment on column move_booking.id is '编号';
comment on column move_booking.area is '起始地区';
comment on column move_booking.cartype is '所用车型';
comment on column move_booking.movedate is '搬家日期';
comment on column move_booking.contact is '联系人';
comment on column move_booking.phone is '联系电话';
comment on column move_booking.status is '订单状态';
create sequence move_booking_sn minvalue 1 maxvalue 99999 increment by 1 start with 1 nocache noorder nocycle;
create or replace
trigger tr_move_booking
before insert on move_booking for each row
begin
select move_booking_sn.nextval into :new.id from dual;
end;