-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperimental.surql
57 lines (47 loc) · 1.32 KB
/
experimental.surql
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
REMOVE table driver;
REMOVE table team;
REMOVE table scored;
DEFINE TABLE team SCHEMALESS PERMISSIONS NONE;
CREATE team SET name="Alpine";
CREATE team SET name="Aston Martin";
CREATE team SET name="Ferrari";
CREATE team SET name="Haas";
CREATE team SET name="Sauber";
CREATE team SET name="McLaren";
CREATE team SET name="Mercedes";
CREATE team SET name="RB";
CREATE team SET name="Red Bull";
CREATE team SET name="Williams";
DEFINE TABLE drivers SCHEMALESS PERMISSIONS NONE;
CREATE driver SET name="Pierre Gasly",team.name=Alpine;
CREATE driver SET name="Esteban Ocon",team.name=Alpine;
Let $dn = SELECT VALUE id from driver where name="Pierre Gasly";
Let $tn = SELECT VALUE id FROM team where name="Alpine";
RELATE $dn->scored->$tn
CONTENT {
2024: {
Dubai: {
finished: 18
},
Saudi: {
finished: 18
},
}
};
Let $dn = SELECT VALUE id from driver where name="Esteban Ocon";
RELATE $dn->scored->$tn
CONTENT {
2024: {
Dubai: {
finished: 19
},
Saudi: {
finished: 17
},
}
};
Let $tn = SELECT VALUE id FROM team where name="Alpine";
-- race result scored by Alpine Drivers in Dubai - 2024
SELECT in.name as driver,2024.Dubai.finished FROM scored;
-- race result scored by Alpine Drivers in Saudi - 2024
SELECT in.name as driver,2024.Saudi.finished FROM scored;