Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Практика. Отчет по производственной практике 2.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
2 Мб
Скачать
☆

Приложение б.9.

-- Create table

create table alfa.SKVTSST

(

num_sost_skv NUMBER(3) not null,

num_sost_grp NUMBER(2),

name_sost_skv VARCHAR2(40),

nm_sost_skv VARCHAR2(12),

r1 NUMBER,

num_sost_r3 NUMBER(3)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table alfa.SKVTSST

is 'Справочник cостояний скважин';

-- Add comments to the columns

comment on column alfa.SKVTSST.num_sost_skv

is 'Код состояния';

comment on column alfa.SKVTSST.num_sost_grp

is 'Код группы состояния';

comment on column alfa.SKVTSST.name_sost_skv

is 'Наименование состояния';

comment on column alfa.SKVTSST.nm_sost_skv

is 'Краткое наименование состояния';

-- Create/Recreate primary, unique and foreign key constraints

alter table alfa.SKVTSST

add constraint PRIM_SKVTSST primary key (NUM_SOST_SKV)

using index

tablespace INDX

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

alter table alfa.SKVTSST

add constraint FOR_K_SKVTSST_NUM_SOST_GRP foreign key (NUM_SOST_GRP)

references alfa.TSSTGRP (NUM_SOST_GRP);

-- Grant/Revoke object privileges

grant select on alfa.SKVTSST to ALFA_READ;

grant select on alfa.SKVTSST to PUBLIC;

grant select, references on alfa.SKVTSST to ZBS;