-
Notifications
You must be signed in to change notification settings - Fork 1
/
PRODUCTS.sql
65 lines (59 loc) · 1.76 KB
/
PRODUCTS.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ALTER TABLE SOOMANIB.PRODUCTS
DROP PRIMARY KEY CASCADE;
DROP TABLE SOOMANIB.PRODUCTS CASCADE CONSTRAINTS;
CREATE TABLE SOOMANIB.PRODUCTS
(
PRODUCT_ID NUMBER NOT NULL,
NAME VARCHAR2(50 BYTE) NOT NULL,
CATEGORY VARCHAR2(20 BYTE),
PRICE NUMBER NOT NULL,
SUPPLIER_ID NUMBER NOT NULL,
QUANTITY NUMBER NOT NULL
)
TABLESPACE SYSTEM
PCTUSED 40
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MAXSIZE UNLIMITED
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
MONITORING;
-- There is no statement for index SOOMANIB.SYS_C007556.
-- The object is created when the parent object is created.
ALTER TABLE SOOMANIB.PRODUCTS ADD (
PRIMARY KEY
(PRODUCT_ID)
USING INDEX
TABLESPACE SYSTEM
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MAXSIZE UNLIMITED
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
)
ENABLE VALIDATE);
ALTER TABLE SOOMANIB.PRODUCTS ADD (
FOREIGN KEY (SUPPLIER_ID)
REFERENCES SOOMANIB.SUPPLIERS (SUPPLIER_ID)
ON DELETE CASCADE
ENABLE VALIDATE);