]> git.ardis.lu - sheets-db/commitdiff
Update example SQL query to match updated database
authorArdis Lu <ardisglu@gmail.com>
Sun, 29 Aug 2021 09:01:13 +0000 (02:01 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 29 Aug 2021 09:01:13 +0000 (02:01 -0700)
demo/index.html

index 76e30f7dc0c453e18ad949e1fc16138c87c90e8b..492d3801c08eecdff90880ad73bb3a74f6a526d0 100644 (file)
 
   <main>
     <label for="editor">Enter a SQL query:</label>
-    <textarea id="editor" name="editor">SELECT state, COUNT(id), AVG(number_column_1) FROM table_1 GROUP BY state</textarea>
+    <textarea id="editor" name="editor">
+    SELECT
+      users.first_name
+      , users.last_name
+      , STRFTIME('%Y-%m-%d', users.birthday) AS BIRTHDAY
+      , transactions.category
+      , SUM(transactions.price) AS TOTAL
+    FROM
+      users
+      INNER JOIN transactions ON users.user_id = transactions.user_id
+    GROUP BY
+      users.user_id
+      , transactions.category
+    </textarea>
     <button id="execute">Execute SQL</button>
 
     <table id="output">
This page took 0.036331 seconds and 4 git commands to generate.