createtableCOST(IDnumber(4)constraintCOST_ID_PKprimarykey,NAMEvarchar(50)notnull,BASE_DURATIONnumber(11),BASE_COSTnumber(7,2),UNIT_COSTnumber(7,4),STATUSchar(1)constraint...
create table COST(
ID number(4) constraint COST_ID_PK primary key,
NAME varchar(50) not null,
BASE_DURATION number(11),
BASE_COST number(7,2),
UNIT_COST number(7,4),
STATUS char(1) constraint COST_STATUS_CK
check (STATUS in (0,1)),
DESCR varchar2(100),
CREATIME date default sysdate ,
STARTIME date
);
insert into COST values (1,'5.9元套餐',20,5.9,0.4,0,'5.9元20小时/月,超出部分0.4元/时',default,null);
insert into COST values (2,'6.9元套餐',40,6.9,0.3,0,'6.9元40小时/月,超出部分0.3元/时',default,null);
insert into COST values (3,'8.5元套餐',100,8.5,0.2,0,'8.5元100小时/月,超出部分0.2元/时',default,null);
insert into COST values (4,'10.5元套餐',200,10.5,0.1,0,'10.5元200小时/月,超出部分0.1元/时',default,null);
insert into COST values (5,'计时收费',null,null,0.5,0,'0.5元/时,不使用不收费',default,null);
insert into COST values (6,'包月',null,20,null,0,'每月20元,不限制使用时间',default,null);
commit;
展开