vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | -- Sccsid: @(#)dss.ddl 2.1.8.1 |
| 2 | CREATE TABLE NATION ( N_NATIONKEY INTEGER NOT NULL, |
| 3 | N_NAME CHAR(25) NOT NULL, |
| 4 | N_REGIONKEY INTEGER NOT NULL, |
| 5 | N_COMMENT VARCHAR(152)); |
| 6 | |
| 7 | CREATE TABLE REGION ( R_REGIONKEY INTEGER NOT NULL, |
| 8 | R_NAME CHAR(25) NOT NULL, |
| 9 | R_COMMENT VARCHAR(152)); |
| 10 | |
| 11 | CREATE TABLE PART ( P_PARTKEY INTEGER NOT NULL, |
| 12 | P_NAME VARCHAR(55) NOT NULL, |
| 13 | P_MFGR CHAR(25) NOT NULL, |
| 14 | P_BRAND CHAR(10) NOT NULL, |
| 15 | P_TYPE VARCHAR(25) NOT NULL, |
| 16 | P_SIZE INTEGER NOT NULL, |
| 17 | P_CONTAINER CHAR(10) NOT NULL, |
| 18 | P_RETAILPRICE DECIMAL(15,2) NOT NULL, |
| 19 | P_COMMENT VARCHAR(23) NOT NULL ); |
| 20 | |
| 21 | CREATE TABLE SUPPLIER ( S_SUPPKEY INTEGER NOT NULL, |
| 22 | S_NAME CHAR(25) NOT NULL, |
| 23 | S_ADDRESS VARCHAR(40) NOT NULL, |
| 24 | S_NATIONKEY INTEGER NOT NULL, |
| 25 | S_PHONE CHAR(15) NOT NULL, |
| 26 | S_ACCTBAL DECIMAL(15,2) NOT NULL, |
| 27 | S_COMMENT VARCHAR(101) NOT NULL); |
| 28 | |
| 29 | CREATE TABLE PARTSUPP ( PS_PARTKEY INTEGER NOT NULL, |
| 30 | PS_SUPPKEY INTEGER NOT NULL, |
| 31 | PS_AVAILQTY INTEGER NOT NULL, |
| 32 | PS_SUPPLYCOST DECIMAL(15,2) NOT NULL, |
| 33 | PS_COMMENT VARCHAR(199) NOT NULL ); |
| 34 | |
| 35 | CREATE TABLE CUSTOMER ( C_CUSTKEY INTEGER NOT NULL, |
| 36 | C_NAME VARCHAR(25) NOT NULL, |
| 37 | C_ADDRESS VARCHAR(40) NOT NULL, |
| 38 | C_NATIONKEY INTEGER NOT NULL, |
| 39 | C_PHONE CHAR(15) NOT NULL, |
| 40 | C_ACCTBAL DECIMAL(15,2) NOT NULL, |
| 41 | C_MKTSEGMENT CHAR(10) NOT NULL, |
| 42 | C_COMMENT VARCHAR(117) NOT NULL); |
| 43 | |
| 44 | CREATE TABLE ORDERS ( O_ORDERKEY INTEGER NOT NULL, |
| 45 | O_CUSTKEY INTEGER NOT NULL, |
| 46 | O_ORDERSTATUS CHAR(1) NOT NULL, |
| 47 | O_TOTALPRICE DECIMAL(15,2) NOT NULL, |
| 48 | O_ORDERDATE DATE NOT NULL, |
| 49 | O_ORDERPRIORITY CHAR(15) NOT NULL, |
| 50 | O_CLERK CHAR(15) NOT NULL, |
| 51 | O_SHIPPRIORITY INTEGER NOT NULL, |
| 52 | O_COMMENT VARCHAR(79) NOT NULL); |
| 53 | |
| 54 | CREATE TABLE LINEITEM ( L_ORDERKEY INTEGER NOT NULL, |
| 55 | L_PARTKEY INTEGER NOT NULL, |
| 56 | L_SUPPKEY INTEGER NOT NULL, |
| 57 | L_LINENUMBER INTEGER NOT NULL, |
| 58 | L_QUANTITY DECIMAL(15,2) NOT NULL, |
| 59 | L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, |
| 60 | L_DISCOUNT DECIMAL(15,2) NOT NULL, |
| 61 | L_TAX DECIMAL(15,2) NOT NULL, |
| 62 | L_RETURNFLAG CHAR(1) NOT NULL, |
| 63 | L_LINESTATUS CHAR(1) NOT NULL, |
| 64 | L_SHIPDATE DATE NOT NULL, |
| 65 | L_COMMITDATE DATE NOT NULL, |
| 66 | L_RECEIPTDATE DATE NOT NULL, |
| 67 | L_SHIPINSTRUCT CHAR(25) NOT NULL, |
| 68 | L_SHIPMODE CHAR(10) NOT NULL, |
| 69 | L_COMMENT VARCHAR(44) NOT NULL); |
| 70 | |