From 7360deaafff815c0f12f8730ccd46e8551013d4d Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 20 Mar 2023 19:18:54 +0000 Subject: [PATCH] add sql-statements.sql to repository. I've been using this outside of the repo. to extract the data from the database (DB not in repository). I'm adding it now because it's getting to point which is no longer 'throw-away' code (it's got comments now and everything). So, I'm adding it here so I don't lose it. --- sql-statements.sql | 114 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sql-statements.sql diff --git a/sql-statements.sql b/sql-statements.sql new file mode 100644 index 0000000..1ed4807 --- /dev/null +++ b/sql-statements.sql @@ -0,0 +1,114 @@ +/* NOTES +================================================================================ +Git Repo: https://git.abbether.net/return-to-ritherdon/ritherdon-charts +Project: https://www.nicolaellisandritherdon.com/ + +This file is part of the Ritherdon Charts repository ('Git Repo' link above). +The repository does not include the SQLite database used by this file. The +reason why is because I did not want to include a 500MB database in the +repository. + +The main aim of this file is to extract the data from the database and export it +as CSV files. From there, those CSV file can be process into smaller more +manageable files on (below) average spec'd computers. So, this file is probably +going to be useless for you but I (Craig) needed a place to put this file. +The project's repository seemed like the most appropriate place. + +The database contains the Light Meter readings (two in total) recorded by the +'Personal Flash' artworks during the 'No Gaps in the Line' art exhibition +('Project' link above). +*/ + +-- LIGHT METER 1 +-- ============================================================================= + +-- Gets all the readings for Light Meter 1 in the database. +-- The exhibiton ('No Gaps in the Line') ran betwen 13th June 2021 and 1st August 2021. +-- DO NOT ALTER THIS STATEMENT. USE THE ONE BELOW FOR INSPECTING DATE RANGES. +SELECT + time, + reading +FROM + meter1 +WHERE + time BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-08-01'); + +-- Gets readings between two dates for Light Meter 1 in the database. +-- USE THIS TO EXPLORE READINGS FROM A PARTICULAR DATE RANGE. +SELECT + time, + reading +FROM + meter1 +WHERE +-- NOTE: SET SECOND DATETIME TO DAY AFTER TO GET READINGS FOR SINGLE DAY. +-- ============================================================================= +-- BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-06-14') gets all the +-- readings for the 13th June 2021. + time BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-06-14'); + +-- Gets all readings which were above 0, recorded by Light Meter 1. +SELECT + time, + reading +FROM + meter1 +WHERE + reading > 0; + +-- Gets all readings which were below or equal to 0, recorded by Light Meter 1. +-- This equates to welding booth having no light source active in them. +SELECT + time, + reading +FROM + meter1 +WHERE + reading =< 0; + +-- LIGHT METER 2 +-- ============================================================================= + +-- Gets all the readings for Light Meter 2 in the database. +-- The exhibiton ('No Gaps in the Line') ran betwen 13th June 2021 & 1st August 2021. +-- DO NOT ALTER THIS STATEMENT. USE THE ONE BELOW FOR INSPECTING DATE RANGES. +SELECT + time, + reading +FROM + meter2 +WHERE + time BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-08-01'); + +-- Gets readings between two dates for Light Meter 2 in the database. +-- USE THIS TO EXPLORE READINGS FROM A PARTICULAR DATE RANGE. +SELECT + time, + reading +FROM + meter2 +WHERE +-- NOTE: SET SECOND DATETIME TO DAY AFTER TO GET READINGS FOR SINGLE DAY. +-- ============================================================================= +-- BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-06-14') gets all the +-- readings for the 13th June 2021. + time BETWEEN DATETIME('2021-06-13') AND DATETIME('2021-06-14'); + +-- Gets all readings which were above 0, recorded by Light Meter 2. +SELECT + time, + reading +FROM + meter2 +WHERE + reading > 0; + +-- Gets all readings which were below or equal to 0, recorded by Light Meter 2. +-- This equates to welding booth 2 having no light source active in them. +SELECT + time, + reading +FROM + meter2 +WHERE + reading =< 0; \ No newline at end of file