CREATE TABLE CMP3_CUSTOMER(CUST_ID INTEGER PRIMARY KEY NOT NULL,CUST_VERSION INTEGER,CITY VARCHAR(255),NAME VARCHAR(255));
CREATE TABLE CMP3_ITEM(ITEM_ID INTEGER PRIMARY KEY NOT NULL,ITEM_VERSION INTEGER, DESCRIPTION VARCHAR(255),NAME VARCHAR(255));
CREATE TABLE CMP3_ORDER(ORDER_ID INTEGER PRIMARY KEY NOT NULL,ORDER_VERSION INTEGER,QTY INTEGER,SHIPADD VARCHAR(255),CUST_ID INTEGER,ITEM_ID INTEGER);
ALTER TABLE CMP3_ORDER ADD CONSTRAINT FK_ORDER FOREIGN KEY (CUST_ID) REFERENCES CMP3_CUSTOMER (CUST_ID) ;
ALTER TABLE CMP3_ORDER ADD CONSTRAINT FK_ITEM FOREIGN KEY (ITEM_ID) REFERENCES CMP3_ITEM(ITEM_ID) ;
CREATE TABLE WEB_CUSTOMER(CUST_ID INTEGER PRIMARY KEY NOT NULL,CITY VARCHAR(255),CUSTNAME VARCHAR(255));
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (1,'Santa Clara', 'Alice_1');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (2,'Cupertino', 'Alice_2');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (3,'Mountain View', 'Alice_3');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (4,'Fremont', 'Alice_4');
select city from web_customer where cust_id=1;
select * from web_customer where custname Like 'Alice_1';