-
Notifications
You must be signed in to change notification settings - Fork 21
/
ShopRecommender.script
77 lines (77 loc) · 3.46 KB
/
ShopRecommender.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
SET DATABASE UNIQUE NAME HSQLDB4056335895
SET DATABASE GC 0
SET DATABASE DEFAULT RESULT MEMORY ROWS 0
SET DATABASE EVENT LOG LEVEL 0
SET DATABASE SQL NAMES FALSE
SET DATABASE SQL REGULAR NAMES TRUE
SET DATABASE SQL REFERENCES FALSE
SET DATABASE SQL SIZE TRUE
SET DATABASE SQL TYPES FALSE
SET DATABASE SQL TDC DELETE TRUE
SET DATABASE SQL TDC UPDATE TRUE
SET DATABASE SQL TRANSLATE TTI TYPES TRUE
SET DATABASE SQL CONCAT NULLS TRUE
SET DATABASE SQL NULLS FIRST TRUE
SET DATABASE SQL UNIQUE NULLS TRUE
SET DATABASE SQL CONVERT TRUNCATE TRUE
SET DATABASE SQL AVG SCALE 0
SET DATABASE SQL DOUBLE NAN TRUE
SET DATABASE SQL LONGVAR IS LOB FALSE
SET DATABASE TRANSACTION CONTROL LOCKS
SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED
SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
SET DATABASE TEXT TABLE DEFAULTS ''
SET FILES WRITE DELAY 500 MILLIS
SET FILES BACKUP INCREMENT TRUE
SET FILES CACHE SIZE 10000
SET FILES CACHE ROWS 50000
SET FILES SCALE 32
SET FILES LOB SCALE 32
SET FILES DEFRAG 0
SET FILES NIO TRUE
SET FILES NIO SIZE 256
SET FILES LOG TRUE
SET FILES LOG SIZE 50
CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e'
ALTER USER SA SET LOCAL TRUE
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
SET SCHEMA PUBLIC
CREATE MEMORY TABLE PUBLIC.ITEM(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,ITEM_NAME VARCHAR(255) NOT NULL,VERSION INTEGER)
ALTER TABLE PUBLIC.ITEM ALTER COLUMN ID RESTART WITH 6
CREATE MEMORY TABLE PUBLIC.PURCHASE(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION INTEGER,PURCHASER BIGINT)
ALTER TABLE PUBLIC.PURCHASE ALTER COLUMN ID RESTART WITH 5
CREATE MEMORY TABLE PUBLIC.PURCHASE_ITEMS(PURCHASE BIGINT NOT NULL,ITEMS BIGINT NOT NULL,PRIMARY KEY(PURCHASE,ITEMS),CONSTRAINT FK7151CB02EED05EAA FOREIGN KEY(ITEMS) REFERENCES PUBLIC.ITEM(ID),CONSTRAINT FK7151CB0245534259 FOREIGN KEY(PURCHASE) REFERENCES PUBLIC.PURCHASE(ID))
CREATE MEMORY TABLE PUBLIC.SHOPPER(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,USERNAME VARCHAR(255) NOT NULL,VERSION INTEGER)
ALTER TABLE PUBLIC.SHOPPER ALTER COLUMN ID RESTART WITH 6
ALTER TABLE PUBLIC.PURCHASE ADD CONSTRAINT FK67E905015647E6C1 FOREIGN KEY(PURCHASER) REFERENCES PUBLIC.SHOPPER(ID)
ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1
SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC
GRANT DBA TO SA
SET SCHEMA SYSTEM_LOBS
INSERT INTO BLOCKS VALUES(0,2147483647,0)
SET SCHEMA PUBLIC
INSERT INTO ITEM VALUES(1,'Coin',0)
INSERT INTO ITEM VALUES(2,'Axe',0)
INSERT INTO ITEM VALUES(3,'Fan',0)
INSERT INTO ITEM VALUES(4,'Tin Soldier',0)
INSERT INTO ITEM VALUES(5,'Union Jack',0)
INSERT INTO PURCHASE VALUES(1,0,2)
INSERT INTO PURCHASE VALUES(2,0,4)
INSERT INTO PURCHASE VALUES(3,0,3)
INSERT INTO PURCHASE VALUES(4,0,4)
INSERT INTO PURCHASE_ITEMS VALUES(1,1)
INSERT INTO PURCHASE_ITEMS VALUES(1,2)
INSERT INTO PURCHASE_ITEMS VALUES(2,2)
INSERT INTO PURCHASE_ITEMS VALUES(3,4)
INSERT INTO PURCHASE_ITEMS VALUES(3,5)
INSERT INTO PURCHASE_ITEMS VALUES(4,4)
INSERT INTO SHOPPER VALUES(1,'Marlotte',0)
INSERT INTO SHOPPER VALUES(2,'Mary',0)
INSERT INTO SHOPPER VALUES(3,'Becky',0)
INSERT INTO SHOPPER VALUES(4,'Tom',0)
INSERT INTO SHOPPER VALUES(5,'Huck',0)