-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trybesmith.sql
83 lines (69 loc) · 1.71 KB
/
Trybesmith.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
DROP SCHEMA IF EXISTS Trybesmith;
CREATE SCHEMA IF NOT EXISTS Trybesmith;
CREATE TABLE Trybesmith.Users (
id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
username TEXT NOT NULL,
classe TEXT NOT NULL,
level INTEGER NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE Trybesmith.Orders (
id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
userId INTEGER,
FOREIGN KEY (userId) REFERENCES Trybesmith.Users (id)
);
CREATE TABLE Trybesmith.Products (
id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
amount TEXT NOT NULL,
orderId INTEGER,
FOREIGN KEY (orderId) REFERENCES Trybesmith.Orders (id)
);
INSERT INTO
Trybesmith.Users (username, classe, level, password)
VALUES
("reigal", "Guerreiro", 10, "1dragaonoceu");
INSERT INTO
Trybesmith.Users (username, classe, level, password)
VALUES
("vyrion", "Inventor", 8, "pagandodividas");
INSERT INTO
Trybesmith.Users (username, classe, level, password)
VALUES
("yraa", "Ladina", 5, "valarmorg");
INSERT INTO
Trybesmith.Orders (userId)
VALUES
(1);
INSERT INTO
Trybesmith.Orders (userId)
VALUES
(3);
INSERT INTO
Trybesmith.Orders (userId)
VALUES
(2);
INSERT INTO
Trybesmith.Products (name, amount)
VALUES
("Espada curta", "10 peças de ouro");
INSERT INTO
Trybesmith.Products (name, amount, orderId)
VALUES
(
"Escudo desnecessariamente grande",
"20 peças de ouro",
1
);
INSERT INTO
Trybesmith.Products (name, amount, orderId)
VALUES
("Adaga de Aço Valírico", "1 peça de ouro", 2);
INSERT INTO
Trybesmith.Products (name, amount, orderId)
VALUES
("Colar de fogo", "1 peça de ouro", 2);
INSERT INTO
Trybesmith.Products (name, amount, orderId)
VALUES
("Engenhoca aleatória", "15 peças de ouro", 3);