78 lines
1.6 KiB
SQL
78 lines
1.6 KiB
SQL
-- Create table
|
|
create table SALVAGEDB
|
|
(
|
|
num NUMBER(20),
|
|
vin VARCHAR2(20),
|
|
svin VARCHAR2(15),
|
|
odo NUMBER(11),
|
|
odos VARCHAR2(50),
|
|
title VARCHAR2(200),
|
|
dem1 VARCHAR2(200),
|
|
dem2 VARCHAR2(200),
|
|
year NUMBER(4),
|
|
month NUMBER(4),
|
|
last_update DATE,
|
|
auction VARCHAR2(1)
|
|
)
|
|
tablespace USERS
|
|
pctfree 10
|
|
initrans 1
|
|
maxtrans 255
|
|
storage
|
|
(
|
|
initial 3581M
|
|
next 1M
|
|
minextents 1
|
|
maxextents unlimited
|
|
)
|
|
compress;
|
|
-- Add comments to the columns
|
|
comment on column SALVAGEDB.num
|
|
is 'ID';
|
|
comment on column SALVAGEDB.vin
|
|
is 'vin';
|
|
comment on column SALVAGEDB.odo
|
|
is 'îäîìåòð';
|
|
comment on column SALVAGEDB.odos
|
|
is 'îäîìåòð ñòàòóñ';
|
|
comment on column SALVAGEDB.title
|
|
is 'äîêóìåíò';
|
|
comment on column SALVAGEDB.dem1
|
|
is 'ïîâðåäåëíèå 1';
|
|
comment on column SALVAGEDB.dem2
|
|
is 'ïîâðåæåäíèå 2';
|
|
comment on column SALVAGEDB.year
|
|
is 'ìåñÿö';
|
|
comment on column SALVAGEDB.month
|
|
is 'ãîä';
|
|
comment on column SALVAGEDB.auction
|
|
is 'Ñ êîïàðò I - IAAI';
|
|
-- Create/Recreate indexes
|
|
create index IDX_SALVAGEDB_NUM on SALVAGEDB (NUM)
|
|
tablespace USERS
|
|
pctfree 10
|
|
initrans 2
|
|
maxtrans 255
|
|
storage
|
|
(
|
|
initial 64K
|
|
next 1M
|
|
minextents 1
|
|
maxextents unlimited
|
|
)
|
|
compress nologging;
|
|
create index IDX_SALVAGEDB_SVIN_VIN on SALVAGEDB (SVIN, VIN)
|
|
tablespace USERS
|
|
pctfree 10
|
|
initrans 2
|
|
maxtrans 255
|
|
storage
|
|
(
|
|
initial 64K
|
|
next 1M
|
|
minextents 1
|
|
maxextents unlimited
|
|
);
|
|
-- Grant/Revoke object privileges
|
|
grant read on SALVAGEDB to SALVAGEBOT;
|