-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExampleSQLDump.sql
440 lines (438 loc) · 12.7 KB
/
ExampleSQLDump.sql
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
-- Major database version: 3
-- Minor database version: 0
-- Major JDBC version: 2
-- Minor JDBC Version: 1
---
DROP TABLE IF EXISTS "planets";
CREATE TABLE "planets" (
"planet_id" INTEGER,
"name" VARCHAR(15) NOT NULL,
"popvalue" INTEGER,
PRIMARY KEY ("planet_id")
);
---
DROP TABLE IF EXISTS "heroes";
CREATE TABLE "heroes" (
"hero_id" INTEGER,
"codename" VARCHAR(30),
"secretIdentity" VARCHAR(30),
"homeWorld_id" INTEGER,
PRIMARY KEY ("hero_id"),
FOREIGN KEY ("homeWorld_id") REFERENCES "planets"("planet_id")
);
---
DROP TABLE IF EXISTS "powers";
CREATE TABLE "powers" (
"hero_id" INTEGER,
"description" VARCHAR (100),
PRIMARY KEY ("hero_id", "description"),
FOREIGN KEY ("hero_id") REFERENCES "heroes"("hero_id")
);
---
DROP TABLE IF EXISTS "missions";
CREATE TABLE "missions" (
"name" VARCHAR (100),
"planet_name" VARCHAR (15) NOT NULL,
PRIMARY KEY ("name"),
FOREIGN KEY ("planet_name") REFERENCES "planets"("name")
);
---
INSERT INTO planets VALUES(1, 'Antares', 17);
---
INSERT INTO planets VALUES(2, 'Bgztl', 8);
---
INSERT INTO planets VALUES(3, 'Bismoll', 27);
---
INSERT INTO planets VALUES(4, 'Braal', 8);
---
INSERT INTO planets VALUES(5, 'Cargg', 20);
---
INSERT INTO planets VALUES(6, 'Colu', 30);
---
INSERT INTO planets VALUES(7, 'Daxam', 30);
---
INSERT INTO planets VALUES(8, 'Dryad', '\N');
---
INSERT INTO planets VALUES(9, 'Durla', 10);
---
INSERT INTO planets VALUES(10, 'Earth', '\N');
---
INSERT INTO planets VALUES(11, 'Hyrakius', '\N');
---
INSERT INTO planets VALUES(12, 'Imsk', 27);
---
INSERT INTO planets VALUES(13, 'Krypton', 0);
---
INSERT INTO planets VALUES(14, 'Naltor', 27);
---
INSERT INTO planets VALUES(15, 'Orando', 8);
---
INSERT INTO planets VALUES(16, 'Phlon', '\N');
---
INSERT INTO planets VALUES(17, 'Rimbor', 30);
---
INSERT INTO planets VALUES(18, 'Starhaven', 27);
---
INSERT INTO planets VALUES(19, 'Talok VIII', 27);
---
INSERT INTO planets VALUES(20, 'Teall', '\N');
---
INSERT INTO planets VALUES(21, 'Tharr', 27);
---
INSERT INTO planets VALUES(22, 'Titan', '\N');
---
INSERT INTO planets VALUES(23, 'Trom', 27);
---
INSERT INTO planets VALUES(24, 'Winath', 8);
---
INSERT INTO planets VALUES(25, 'Xanthu', '\N');
---
INSERT INTO planets VALUES(26, 'Zoon', 34);
---
INSERT INTO heroes VALUES(1, 'Cosmic Boy', 'Rokk Krinn ', 4);
---
INSERT INTO heroes VALUES(2, 'Lightning Lad ', 'Garth Ranzz ', 24);
---
INSERT INTO heroes VALUES(3, 'Saturn Girl ', 'Imra Ardeen ', 22);
---
INSERT INTO heroes VALUES(4, 'Triplicate Girl', 'Luornu Durgo ', 5);
---
INSERT INTO heroes VALUES(5, 'Phantom Girl', 'Tinya Wazzo ', 2);
---
INSERT INTO heroes VALUES(6, 'Superboy', 'Kal-El (a.k.a. Clark Kent) ', 13);
---
INSERT INTO heroes VALUES(7, 'Chameleon Boy', 'Reep Daggle ', 9);
---
INSERT INTO heroes VALUES(8, 'Colossal Boy ', 'Gim Allon ', 10);
---
INSERT INTO heroes VALUES(9, 'Invisible Kid ', 'Lyle Norg ', 10);
---
INSERT INTO heroes VALUES(10, 'Star Boy ', 'Thom Kallor ', 25);
---
INSERT INTO heroes VALUES(11, 'Kid Quantum ', 'James Cullen ', 1);
---
INSERT INTO heroes VALUES(12, 'Brainiac 5', 'Querl Dox ', 6);
---
INSERT INTO heroes VALUES(13, 'Supergirl ', 'Kara Zor-El', 13);
---
INSERT INTO heroes VALUES(14, 'Laurel Gand ', '', 7);
---
INSERT INTO heroes VALUES(15, 'Sun Boy ', 'Dirk Morgna ', 10);
---
INSERT INTO heroes VALUES(16, 'Shrinking Violet', 'Salu Digby ', 12);
---
INSERT INTO heroes VALUES(17, 'Bouncing Boy ', 'Chuck Taine ', 10);
---
INSERT INTO heroes VALUES(18, 'Ultra Boy', 'Jo Nah ', 17);
---
INSERT INTO heroes VALUES(19, 'Mon-El', 'Lar Gand ', 7);
---
INSERT INTO heroes VALUES(20, 'Matter-Eater Lad ', 'Tenzil Kem ', 3);
---
INSERT INTO heroes VALUES(21, 'Element Lad', 'Jan Arrah ', 21);
---
INSERT INTO heroes VALUES(22, 'Lightning Lass', 'Ayla Ranzz ', 24);
---
INSERT INTO heroes VALUES(23, 'Dream Girl ', 'Nura Nal ', 14);
---
INSERT INTO heroes VALUES(24, 'Ferro Lad ', 'Andrew Nolan ', 10);
---
INSERT INTO heroes VALUES(25, 'Karate Kid ', 'Val Armorr ', 10);
---
INSERT INTO heroes VALUES(26, 'Princess Projectra', 'Projectra Wind''zzor ', 15);
---
INSERT INTO heroes VALUES(27, 'Shadow Lass ', 'Tasmia Mallor ', 19);
---
INSERT INTO heroes VALUES(28, 'Chemical King ', 'Condo Arlik ', 16);
---
INSERT INTO heroes VALUES(29, 'Timber Wolf', 'Brin Londo ', 26);
---
INSERT INTO heroes VALUES(30, 'Wildfire', 'Drake Burroughs ', 10);
---
INSERT INTO heroes VALUES(31, 'Tyroc ', 'Troy Stewart ', 10);
---
INSERT INTO heroes VALUES(32, 'Dawnstar', '', 18);
---
INSERT INTO heroes VALUES(33, 'Blok ', '', 8);
---
INSERT INTO heroes VALUES(34, 'Invisible Kid II ', 'Jacques Foccart ', 10);
---
INSERT INTO heroes VALUES(35, 'White Witch', 'Mysa Nal ', 14);
---
INSERT INTO heroes VALUES(36, 'Magnetic Kid ', 'Pol Krinn ', 4);
---
INSERT INTO heroes VALUES(37, 'Polar Boy ', 'Brek Bannin ', 21);
---
INSERT INTO heroes VALUES(38, 'Quislet ', '(an unpronounceable glyph) ', 20);
---
INSERT INTO heroes VALUES(39, 'Tellus ', 'Ganglios ', 11);
---
INSERT INTO heroes VALUES(40, 'Hero on non-existant planet', 'Nobody', 473);
---
INSERT INTO powers VALUES(1, 'Magnetism manipulation');
---
INSERT INTO powers VALUES(1, 'control and generation of magnetic fields');
---
INSERT INTO powers VALUES(2, 'Electrical manipulation');
---
INSERT INTO powers VALUES(2, 'control and generation of electrical fields');
---
INSERT INTO powers VALUES(3, 'Telepathy');
---
INSERT INTO powers VALUES(3, 'ability to read and control minds');
---
INSERT INTO powers VALUES(4, 'Ability to split into three bodies');
---
INSERT INTO powers VALUES(5, 'Intangibility');
---
INSERT INTO powers VALUES(6, 'Flight');
---
INSERT INTO powers VALUES(6, 'Invulnerability');
---
INSERT INTO powers VALUES(6, 'Superhuman Strength');
---
INSERT INTO powers VALUES(6, 'Superhuman Speed');
---
INSERT INTO powers VALUES(6, 'Super vision, consisting of');
---
INSERT INTO powers VALUES(6, 'X-Ray Vision');
---
INSERT INTO powers VALUES(6, 'Telescopic/Microscopic Vision');
---
INSERT INTO powers VALUES(6, 'Heat Vision');
---
INSERT INTO powers VALUES(6, 'Super-hearing');
---
INSERT INTO powers VALUES(6, 'Super Breath (including Freeze Breath)');
---
INSERT INTO powers VALUES(6, 'Eidetic memory');
---
INSERT INTO powers VALUES(6, 'Regeneration');
---
INSERT INTO powers VALUES(6, 'Longevity');
---
INSERT INTO powers VALUES(6, 'Other enhanced physical senses (including olfaction)');
---
INSERT INTO powers VALUES(7, 'Shapeshifting');
---
INSERT INTO powers VALUES(8, 'Ability to grow to gigantic size');
---
INSERT INTO powers VALUES(9, 'Invisibility to the naked eye');
---
INSERT INTO powers VALUES(10, 'Ability to increase the mass of objects');
---
INSERT INTO powers VALUES(11, 'Ability to cast stasis fields');
---
INSERT INTO powers VALUES(12, '12th level intelligence');
---
INSERT INTO powers VALUES(13, 'Flight');
---
INSERT INTO powers VALUES(13, 'Invulnerability');
---
INSERT INTO powers VALUES(13, 'Superhuman Strength');
---
INSERT INTO powers VALUES(13, 'Superhuman Speed');
---
INSERT INTO powers VALUES(13, 'Super vision, consisting of');
---
INSERT INTO powers VALUES(13, 'X-Ray Vision');
---
INSERT INTO powers VALUES(13, 'Telescopic/Microscopic Vision');
---
INSERT INTO powers VALUES(13, 'Heat Vision');
---
INSERT INTO powers VALUES(13, 'Super-hearing');
---
INSERT INTO powers VALUES(13, 'Super Breath (including Freeze Breath)');
---
INSERT INTO powers VALUES(13, 'Eidetic memory');
---
INSERT INTO powers VALUES(13, 'Regeneration');
---
INSERT INTO powers VALUES(13, 'Longevity');
---
INSERT INTO powers VALUES(13, 'Other enhanced physical senses (including olfaction)');
---
INSERT INTO powers VALUES(14, 'Flight');
---
INSERT INTO powers VALUES(14, 'Invulnerability');
---
INSERT INTO powers VALUES(14, 'Superhuman Strength');
---
INSERT INTO powers VALUES(14, 'Superhuman Speed');
---
INSERT INTO powers VALUES(14, 'Super vision, consisting of');
---
INSERT INTO powers VALUES(14, 'X-Ray Vision');
---
INSERT INTO powers VALUES(14, 'Telescopic/Microscopic Vision');
---
INSERT INTO powers VALUES(14, 'Heat Vision');
---
INSERT INTO powers VALUES(14, 'Super-hearing');
---
INSERT INTO powers VALUES(14, 'Super Breath (including Freeze Breath)');
---
INSERT INTO powers VALUES(14, 'Eidetic memory');
---
INSERT INTO powers VALUES(14, 'Regeneration');
---
INSERT INTO powers VALUES(14, 'Longevity');
---
INSERT INTO powers VALUES(14, 'Other enhanced physical senses (including olfaction)');
---
INSERT INTO powers VALUES(15, 'light generation');
---
INSERT INTO powers VALUES(15, 'Heat generation');
---
INSERT INTO powers VALUES(16, 'Ability to shrink to microscopic size');
---
INSERT INTO powers VALUES(17, 'Super-bouncing');
---
INSERT INTO powers VALUES(18, 'Super-strength');
---
INSERT INTO powers VALUES(18, 'super-speed');
---
INSERT INTO powers VALUES(18, 'flight');
---
INSERT INTO powers VALUES(18, 'invulnerability');
---
INSERT INTO powers VALUES(18, 'flash vision');
---
INSERT INTO powers VALUES(18, 'penetra-vision');
---
INSERT INTO powers VALUES(19, 'Flight');
---
INSERT INTO powers VALUES(19, 'Invulnerability');
---
INSERT INTO powers VALUES(19, 'Superhuman Strength');
---
INSERT INTO powers VALUES(19, 'Superhuman Speed');
---
INSERT INTO powers VALUES(19, 'Super vision, consisting of');
---
INSERT INTO powers VALUES(19, 'X-Ray Vision');
---
INSERT INTO powers VALUES(19, 'Telescopic/Microscopic Vision');
---
INSERT INTO powers VALUES(19, 'Heat Vision');
---
INSERT INTO powers VALUES(19, 'Super-hearing');
---
INSERT INTO powers VALUES(19, 'Super Breath (including Freeze Breath)');
---
INSERT INTO powers VALUES(19, 'Eidetic memory');
---
INSERT INTO powers VALUES(19, 'Regeneration');
---
INSERT INTO powers VALUES(19, 'Longevity');
---
INSERT INTO powers VALUES(19, 'Other enhanced physical senses (including olfaction)');
---
INSERT INTO powers VALUES(20, 'Can eat any substance');
---
INSERT INTO powers VALUES(21, 'Elemental transmutation');
---
INSERT INTO powers VALUES(22, 'Electrical manipulation');
---
INSERT INTO powers VALUES(22, 'control and generation of electrical fields');
---
INSERT INTO powers VALUES(23, 'Precognition');
---
INSERT INTO powers VALUES(24, 'Ability to transform into iron');
---
INSERT INTO powers VALUES(24, 'superhuman strength');
---
INSERT INTO powers VALUES(24, 'invulnerability');
---
INSERT INTO powers VALUES(25, 'Mastery of all known martial arts');
---
INSERT INTO powers VALUES(26, 'Generation of illusions');
---
INSERT INTO powers VALUES(27, 'Shadow-casting');
---
INSERT INTO powers VALUES(28, 'Control over the rate of chemical reactions');
---
INSERT INTO powers VALUES(29, 'Superhuman agility');
---
INSERT INTO powers VALUES(29, 'Superhuman strength');
---
INSERT INTO powers VALUES(30, 'Energy blasts');
---
INSERT INTO powers VALUES(30, 'Energy manipulation');
---
INSERT INTO powers VALUES(30, 'flight.');
---
INSERT INTO powers VALUES(31, 'Sonic power that creates unusual effects');
---
INSERT INTO powers VALUES(32, 'Interstellar tracking');
---
INSERT INTO powers VALUES(32, 'unaided space travel');
---
INSERT INTO powers VALUES(32, 'flight');
---
INSERT INTO powers VALUES(33, 'Superhuman strength');
---
INSERT INTO powers VALUES(33, 'Superhuman physical resistance');
---
INSERT INTO powers VALUES(500, 'deliberately wrong');
---
INSERT INTO powers VALUES(33, 'energy absorption');
---
INSERT INTO powers VALUES(34, 'Invisibility to the naked eye and to most forms of detection');
---
INSERT INTO powers VALUES(35, 'Spellcasting');
---
INSERT INTO powers VALUES(36, 'Magnetism manipulation');
---
INSERT INTO powers VALUES(36, 'ability to generate and control magnetic fields');
---
INSERT INTO powers VALUES(37, 'Cold manipulation');
---
INSERT INTO powers VALUES(37, 'ability to absorb heat and produce cold');
---
INSERT INTO powers VALUES(39, 'Telepathy');
---
INSERT INTO powers VALUES(39, 'telekinesis');
---
INSERT INTO missions VALUES('Darkseid', 'Apocalypse');
---
INSERT INTO missions VALUES('Earth War', 'Earth');
---
INSERT INTO missions VALUES('Planet Kidnap', 'Daxam');
---
INSERT INTO missions VALUES('Mission on non-existant planet', 'Zorgorn');
---
DROP INDEX IF EXISTS "planets_id_index";
---
CREATE INDEX 'planets_id_index' ON planets (planet_id);
---
DROP INDEX IF EXISTS "heroes code name index";
---
CREATE INDEX 'heroes code name index' ON heroes (codename);
---
DROP INDEX IF EXISTS "planets_id_index";
---
CREATE INDEX 'planets_id_index' ON planets (planet_id);
---
DROP INDEX IF EXISTS "heroes code name index";
---
CREATE INDEX 'heroes code name index' ON heroes (codename);
---
DROP INDEX IF EXISTS "planets_id_index";
---
CREATE INDEX 'planets_id_index' ON planets (planet_id);
---
DROP INDEX IF EXISTS "heroes code name index";
---
CREATE INDEX 'heroes code name index' ON heroes (codename);
---
DROP INDEX IF EXISTS "planets_id_index";
---
CREATE INDEX 'planets_id_index' ON planets (planet_id);
---
DROP INDEX IF EXISTS "heroes code name index";
---
CREATE INDEX 'heroes code name index' ON heroes (codename);
---
-- Views: