CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE STOCKITEM(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,NAME VARCHAR(50),PRICE NUMERIC,QUANTITY INTEGER DEFAULT 0)
CREATE MEMORY TABLE SALE(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,SELLINGTIME TIMESTAMP,CLIENT_ID INTEGER)
CREATE MEMORY TABLE SOLDITEM(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,SALE_ID INTEGER,STOCKITEM_ID INTEGER,NAME VARCHAR(50),QUANTITY INTEGER,ITEMPRICE NUMERIC)
CREATE MEMORY TABLE CLIENT(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,FIRST_NAME VARCHAR(50),LAST_NAME VARCHAR(50),DISCOUNT INTEGER DEFAULT 0)
ALTER TABLE STOCKITEM ALTER COLUMN ID RESTART WITH 8
ALTER TABLE SALE ALTER COLUMN ID RESTART WITH 18
ALTER TABLE SOLDITEM ALTER COLUMN ID RESTART WITH 22
ALTER TABLE CLIENT ALTER COLUMN ID RESTART WITH 7
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 20
SET SCHEMA PUBLIC
INSERT INTO STOCKITEM VALUES(2,'\u00d5lu',15.0,8)
INSERT INTO STOCKITEM VALUES(5,'Layz Kr\u00f5psud',30.0,12)
INSERT INTO STOCKITEM VALUES(6,'Peekon',55.0,30)
INSERT INTO SALE VALUES(1,'2005-09-25 00:50:29.486000000',NULL)
INSERT INTO SALE VALUES(2,'2006-10-13 16:32:11.593000000',NULL)
INSERT INTO SALE VALUES(3,'2008-10-22 12:40:30.515000000',NULL)
INSERT INTO SALE VALUES(4,'2008-10-20 17:49:25.202000000',NULL)
INSERT INTO SALE VALUES(5,'2008-11-05 14:21:35.577000000',NULL)
INSERT INTO SALE VALUES(6,'2008-11-05 14:33:47.858000000',NULL)
INSERT INTO SALE VALUES(7,'2008-11-05 14:38:18.515000000',NULL)
INSERT INTO SALE VALUES(8,'2008-11-05 16:05:43.358000000',NULL)
INSERT INTO SALE VALUES(9,'2008-11-05 16:34:35.311000000',NULL)
INSERT INTO SALE VALUES(10,'2008-11-05 16:34:46.764000000',NULL)
INSERT INTO SALE VALUES(11,'2008-11-05 22:59:09.749000000',2)
INSERT INTO SALE VALUES(12,'2008-11-05 22:59:25.624000000',NULL)
INSERT INTO SALE VALUES(13,'2008-11-05 22:59:37.436000000',2)
INSERT INTO SALE VALUES(14,'2008-11-17 16:06:12.624000000',4)
INSERT INTO SALE VALUES(15,'2008-11-18 15:12:02.343000000',2)
INSERT INTO SALE VALUES(16,'2008-11-18 15:13:26.827000000',2)
INSERT INTO SALE VALUES(17,'2008-11-18 15:15:17.281000000',2)
INSERT INTO SOLDITEM VALUES(1,1,NULL,'Layz kr\u00f5psud',2,10.5)
INSERT INTO SOLDITEM VALUES(2,1,NULL,'\u00d5lle vorstikesed',1,15.0)
INSERT INTO SOLDITEM VALUES(3,1,NULL,'P\u00e4hklid',1,10.0)
INSERT INTO SOLDITEM VALUES(4,2,NULL,'\u00d5lle vorstikesed',6,15.0)
INSERT INTO SOLDITEM VALUES(5,3,NULL,'Layz kr\u00f5psud',2,10.5)
INSERT INTO SOLDITEM VALUES(6,4,NULL,'\u00d5lle vorstikesed',1,15.0)
INSERT INTO SOLDITEM VALUES(7,5,NULL,'Layz kr\u00f5psud',1,10.5)
INSERT INTO SOLDITEM VALUES(8,6,NULL,'Layz kr\u00f5psud',4,10.5)
INSERT INTO SOLDITEM VALUES(9,7,NULL,'roosa sink',10,35.0)
INSERT INTO SOLDITEM VALUES(10,8,NULL,'P\u00e4hklid',1,10.0)
INSERT INTO SOLDITEM VALUES(11,9,NULL,'\u00d5lle vorstikesed',5,15.0)
INSERT INTO SOLDITEM VALUES(12,10,NULL,'kondoom',1,15.0)
INSERT INTO SOLDITEM VALUES(13,11,NULL,'Kondoom',4,16.0)
INSERT INTO SOLDITEM VALUES(14,12,NULL,'Kondoom',9,16.0)
INSERT INTO SOLDITEM VALUES(15,13,NULL,'Kondoom',7,16.0)
INSERT INTO SOLDITEM VALUES(16,14,2,'\u00d5lu',3,15.0)
INSERT INTO SOLDITEM VALUES(17,14,5,'Layz Kr\u00f5psud',3,30.0)
INSERT INTO SOLDITEM VALUES(18,15,2,'\u00d5lu',1,15.0)
INSERT INTO SOLDITEM VALUES(19,16,2,'\u00d5lu',4,15.0)
INSERT INTO SOLDITEM VALUES(20,17,5,'Layz Kr\u00f5psud',5,30.0)
INSERT INTO SOLDITEM VALUES(21,17,2,'\u00d5lu',4,15.0)
INSERT INTO CLIENT VALUES(2,'Indrek','Klanberg',20)
INSERT INTO CLIENT VALUES(3,'Toomas','Kalmer',5)
INSERT INTO CLIENT VALUES(4,'Int','Klannu',10)
INSERT INTO CLIENT VALUES(6,'Gunnar','Heamees',20)
