1 -- http://sql2java.sourceforge.net/copied/sample-hsqldb.sql
7 -- test reserved words (class & throws)
8 create table CUSTOMER (
9 CUSTOMER_NAME VARCHAR(50),
11 CUSTOMER_ADDRESS VARCHAR(50),
16 -- test 2 fields as primary key...
17 create table SHIPPER (
18 SHIPPER_NAME VARCHAR(50) NOT NULL,
19 SHIPPER_COUNTRY VARCHAR(50) NOT NULL,
20 SHIPPER_DESCRIPTION VARCHAR(50),
21 CONSTRAINT PK_SHIP PRIMARY KEY (SHIPPER_NAME, SHIPPER_COUNTRY)
26 create table MANUFACTURER (
27 MANUFACTURER_ID IDENTITY,
28 MANUFACTURER_NAME VARCHAR(50),
29 MANUFACTURER_DESCRIPTION VARCHAR(50)
32 -- test foreign key features
33 create table PRODUCT (
35 PRODUCT_PRICE DECIMAL(10,2) NOT NULL,
36 MANUFACTURER_ID INTEGER,
37 PRODUCT_NAME VARCHAR(50),
38 PRODUCT_DESCRIPTION VARCHAR(50),
39 PRODUCT_INSERTIONDATE DATETIME,
40 CONSTRAINT FK_M2M FOREIGN KEY (MANUFACTURER_ID) REFERENCES MANUFACTURER (MANUFACTURER_ID)
43 -- test junction table
44 create table DELIVERY (
47 DELIVERY_DATE DATETIME,
48 CONSTRAINT FK_C2C FOREIGN KEY (CUSTOMER_ID) REFERENCES CUSTOMER (CUSTOMER_ID),
49 CONSTRAINT FK_P2P FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT (PRODUCT_ID)