forked from ScottOaks/JavaPerformanceTuning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstock.sql
More file actions
24 lines (23 loc) · 718 Bytes
/
stock.sql
File metadata and controls
24 lines (23 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DROP TABLE STOCKPRICE CASCADE CONSTRAINTS;
CREATE TABLE STOCKPRICE (
SYMBOL VARCHAR(16) not null,
PRICEDATE DATE not null,
LOW DECIMAL(30,2) not null,
HIGH DECIMAL(30,2) not null,
OPENINGPRICE NUMERIC(30,2) not null,
CLOSINGPRICE NUMERIC(30,2) not null,
ISYEARHIGH INTEGER,
ISYEARLOW INTEGER,
primary key (symbol, pricedate)
);
DROP TABLE STOCKOPTIONPRICE;
CREATE TABLE STOCKOPTIONPRICE (
PRICE NUMERIC(30,2) not null,
EXPIRATIONPERIOD INTEGER,
PRICEDATE DATE not null,
SYMBOL VARCHAR(16) not null,
primary key (symbol, pricedate, expirationperiod),
CONSTRAINT FK_OPTION
FOREIGN KEY (PRICEDATE, SYMBOL)
REFERENCES STOCKPRICE (PRICEDATE, SYMBOL)
);