summaryrefslogtreecommitdiff
path: root/storage/views
diff options
context:
space:
mode:
Diffstat (limited to 'storage/views')
-rw-r--r--storage/views/Ancients/Best.gosql18
-rw-r--r--storage/views/Ancients/BestSkips.gosql17
-rw-r--r--storage/views/Cards/Best.gosql10
3 files changed, 45 insertions, 0 deletions
diff --git a/storage/views/Ancients/Best.gosql b/storage/views/Ancients/Best.gosql
new file mode 100644
index 0000000..bd87658
--- /dev/null
+++ b/storage/views/Ancients/Best.gosql
@@ -0,0 +1,18 @@
+SELECT
+ AVG(ActIndex) + 1 AS Act,
+ Character,
+ Key,
+ Count(*) AS Amount,
+ Sum(Win) AS Wins,
+ Amount - Sum(Win) AS Losses,
+ ROUND(Wins / Amount, 2) as Winrate,
+FROM
+ AncientChoice
+WHERE
+ Chosen = TRUE,
+GROUP BY
+ Character,
+ Key,
+ ActName,
+ORDER BY
+ Wins \ No newline at end of file
diff --git a/storage/views/Ancients/BestSkips.gosql b/storage/views/Ancients/BestSkips.gosql
new file mode 100644
index 0000000..0b926c1
--- /dev/null
+++ b/storage/views/Ancients/BestSkips.gosql
@@ -0,0 +1,17 @@
+SELECT
+ AVG(ActIndex) + 1 AS Act,
+ Character,
+ Key,
+ Sum(Win) as Wins,
+ Count(*) - Sum(Win) as Losses,
+ ROUND(Wins / Count(*), 2) as Winrate,
+FROM
+ AncientChoice
+WHERE
+ Chosen = FALSE
+GROUP BY
+ Character,
+ Key,
+ ActName
+ORDER BY
+ Wins * Winrate DESC \ No newline at end of file
diff --git a/storage/views/Cards/Best.gosql b/storage/views/Cards/Best.gosql
new file mode 100644
index 0000000..73e3b31
--- /dev/null
+++ b/storage/views/Cards/Best.gosql
@@ -0,0 +1,10 @@
+SELECT
+ Card,
+ ActIndex + 1 AS Act,
+ Sum(Win) as Wins,
+ Count(*) - Sum(Win) as Losses,
+ ROUND(Wins / Count(*), 2) as Winrate,
+FROM
+ CardChoice
+WHERE
+ Picked = TRUE \ No newline at end of file