From 08c04fe2026036bca3ec627a444162b1c28f3138 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:46:13 +0000 Subject: [PATCH 1/7] Bump docker/build-push-action in the github-actions group Bumps the github-actions group with 1 update: [docker/build-push-action](https://github.com/docker/build-push-action). Updates `docker/build-push-action` from 8c1e8f8e5bf845ba3773a14f3967965548a2341e to 10e90e3645eae34f1e60eeb005ba3a3d33f178e8 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/8c1e8f8e5bf845ba3773a14f3967965548a2341e...10e90e3645eae34f1e60eeb005ba3a3d33f178e8) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-version: 10e90e3645eae34f1e60eeb005ba3a3d33f178e8 dependency-type: direct:production dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/build-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 45262b3..329e7c3 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -52,7 +52,7 @@ jobs: # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image id: push - uses: docker/build-push-action@8c1e8f8e5bf845ba3773a14f3967965548a2341e + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 with: context: . push: true From 3e4e40d16cdaf6bf220cf4dd5ff4d5669587079f Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Tue, 24 Feb 2026 19:34:14 -0500 Subject: [PATCH 2/7] updated queries --- query02.sql | 7 +++++++ query03.sql | 1 + query04.sql | 1 + query05.sql | 4 ++++ query06.sql | 15 +++++++++++++++ query07.sql | 27 +++++++++++++++++++++++++++ query08.sql | 27 +++++++++++++++++++++++++++ query09.sql | 14 ++++++++++++++ query10.sql | 11 +++++++++++ query11.sql | 12 ++++++++++++ query12.sql | 11 +++++++++++ query13.sql | 22 ++++++++++++++++++++++ query14.sql | 22 ++++++++++++++++++++++ 13 files changed, 174 insertions(+) diff --git a/query02.sql b/query02.sql index 2b7ad18..b3db5da 100644 --- a/query02.sql +++ b/query02.sql @@ -11,6 +11,13 @@ -- Enter your SQL query here +SELECT ROUND(((indego_trips_2022_q3 - indego_trips_2021_q3) * 100.0 / indego_trips_2021_q3), 2) AS perc_change +FROM +( + SELECT + (SELECT count(*) FROM indego_trips_2021_q3) AS indego_trips_2021_q3, + (SELECT count(*) FROM indego_trips_2022_q3) AS indego_trips_2022_q3 +) AS trip_counts; /* diff --git a/query03.sql b/query03.sql index 83e9e36..eec2be0 100644 --- a/query03.sql +++ b/query03.sql @@ -6,3 +6,4 @@ */ -- Enter your SQL query here +SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2021_q3 diff --git a/query04.sql b/query04.sql index 8223f17..5611b92 100644 --- a/query04.sql +++ b/query04.sql @@ -6,3 +6,4 @@ */ -- Enter your SQL query here +SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2022_q3 \ No newline at end of file diff --git a/query05.sql b/query05.sql index fba8f23..0584cd6 100644 --- a/query05.sql +++ b/query05.sql @@ -5,3 +5,7 @@ */ -- Enter your SQL query here +SELECT GREATEST( + (SELECT MAX(duration) FROM indego.indego_trips_2021_q3), + (SELECT MAX(duration) FROM indego.indego_trips_2022_q3) +) AS max_duration; diff --git a/query06.sql b/query06.sql index 1cb254b..732fcd9 100644 --- a/query06.sql +++ b/query06.sql @@ -7,3 +7,18 @@ */ -- Enter your SQL query here +SELECT +2021 AS trip_year, +3 AS trip_quarter, +COUNT(*) AS num_trips +FROM indego.indego_trips_2021_q3 +WHERE duration < 10 + +UNION ALL + +SELECT +2022 AS trip_year, +3 AS trip_quarter, +COUNT(*) AS num_trips +FROM indego.indego_trips_2022_q3 +WHERE duration < 10 ; diff --git a/query07.sql b/query07.sql index 782eda5..73157a3 100644 --- a/query07.sql +++ b/query07.sql @@ -6,7 +6,34 @@ */ -- Enter your SQL query here +SELECT + trip_year, + trip_quarter, + COUNT(*) AS num_trips +FROM ( + SELECT + 2021 AS trip_year, + 3 AS trip_quarter, + start_time, + end_time + FROM indego.indego_trips_2021_q3 + UNION ALL + + SELECT + 2022 AS trip_year, + 3 AS trip_quarter, + start_time, + end_time + FROM indego.indego_trips_2022_q3 +) AS trips +WHERE start_time::date <> end_time::date +GROUP BY + trip_year, + trip_quarter +ORDER BY + trip_year, + trip_quarter; /* diff --git a/query08.sql b/query08.sql index f35a927..a461668 100644 --- a/query08.sql +++ b/query08.sql @@ -9,6 +9,33 @@ */ -- Enter your SQL query here +SELECT + s.id AS station_id, + s.geom AS station_geog, + COUNT(*) AS num_trips +FROM ( + SELECT start_time, start_station::int AS start_station + FROM indego.indego_trips_2021_q3 + + UNION ALL + + SELECT start_time, start_station::int AS start_station + FROM indego.indego_trips_2022_q3 +) AS t +JOIN indego.station_status AS s + ON s.id = t.start_station +WHERE EXTRACT(HOUR FROM t.start_time) BETWEEN 7 AND 9 +GROUP BY + s.id, + s.geom +ORDER BY + num_trips DESC +LIMIT 5; + + + + + /* diff --git a/query09.sql b/query09.sql index cc1d88d..714542e 100644 --- a/query09.sql +++ b/query09.sql @@ -7,3 +7,17 @@ */ -- Enter your SQL query here +SELECT + passholder_type, + COUNT(*) AS num_trips +FROM ( + SELECT passholder_type + FROM indego.indego_trips_2021_q3 + + UNION ALL + + SELECT passholder_type + FROM indego.indego_trips_2022_q3 +) AS t +GROUP BY passholder_type +ORDER BY num_trips DESC; \ No newline at end of file diff --git a/query10.sql b/query10.sql index 56cd844..ef70e3a 100644 --- a/query10.sql +++ b/query10.sql @@ -8,3 +8,14 @@ */ -- Enter your SQL query here +SELECT + s.id AS station_id, + s.geom AS station_geog, + ROUND( + ST_Distance( + s.geom::geography, + ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography + ) / 50.0 + ) * 50 AS distance +FROM indego.station_status AS s +ORDER BY distance; \ No newline at end of file diff --git a/query11.sql b/query11.sql index 36f6b65..7d2b56e 100644 --- a/query11.sql +++ b/query11.sql @@ -5,3 +5,15 @@ */ -- Enter your SQL query here +SELECT + s.id AS station_id, + s.geom AS station_geog, + ROUND( + ST_Distance( + s.geom::geography, + ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography + ) / 50.0 + ) * 50 AS distance +FROM indego.station_status AS s +ORDER BY distance; + diff --git a/query12.sql b/query12.sql index 448ca09..3a7be9d 100644 --- a/query12.sql +++ b/query12.sql @@ -6,3 +6,14 @@ */ -- Enter your SQL query here + +SELECT + COUNT(*) AS num_stations +FROM indego.station_status AS s +WHERE ST_DWithin( + s.geom::geography, + ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography, + 1000 + ) + AND s.isvirtual = false; + diff --git a/query13.sql b/query13.sql index ac9e192..f4ad6d0 100644 --- a/query13.sql +++ b/query13.sql @@ -7,3 +7,25 @@ */ -- Enter your SQL query here +SELECT + s.id AS station_id, + s.name AS station_name, + ROUND( + ST_Distance( + s.geom::geography, + ST_SetSRID( + ST_MakePoint(-75.192584, 39.952415), + 4326 + )::geography + ) / 50.0 + ) * 50 AS distance +FROM indego.station_status AS s +ORDER BY + ST_Distance( + s.geom::geography, + ST_SetSRID( + ST_MakePoint(-75.192584, 39.952415), + 4326 + )::geography + ) DESC +LIMIT 1; \ No newline at end of file diff --git a/query14.sql b/query14.sql index e039693..5841e59 100644 --- a/query14.sql +++ b/query14.sql @@ -7,3 +7,25 @@ */ -- Enter your SQL query here +SELECT + s.id AS station_id, + s.name AS station_name, + ROUND( + ST_Distance( + s.geom::geography, + ST_SetSRID( + ST_MakePoint(-75.192584, 39.952415), + 4326 + )::geography + ) / 50.0 + ) * 50 AS distance +FROM indego.station_status AS s +ORDER BY + ST_Distance( + s.geom::geography, + ST_SetSRID( + ST_MakePoint(-75.192584, 39.952415), + 4326 + )::geography + ) +LIMIT 1; \ No newline at end of file From b5c2f00a0371c8bb8fc6dbf11e2fe51da600539a Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Tue, 24 Feb 2026 20:18:32 -0500 Subject: [PATCH 3/7] sqlfluff and lint --- query02.sql | 12 ++++++------ query04.sql | 2 +- query06.sql | 16 ++++++++-------- query07.sql | 8 ++++---- query08.sql | 29 ++++++++++++++--------------- query09.sql | 16 ++++++++-------- query10.sql | 18 +++++++++--------- query11.sql | 17 ++++++++--------- query12.sql | 16 +++++++--------- query13.sql | 38 +++++++++++++++++++------------------- query14.sql | 38 +++++++++++++++++++------------------- 11 files changed, 103 insertions(+), 107 deletions(-) diff --git a/query02.sql b/query02.sql index b3db5da..ea47f18 100644 --- a/query02.sql +++ b/query02.sql @@ -12,12 +12,12 @@ -- Enter your SQL query here SELECT ROUND(((indego_trips_2022_q3 - indego_trips_2021_q3) * 100.0 / indego_trips_2021_q3), 2) AS perc_change -FROM -( - SELECT - (SELECT count(*) FROM indego_trips_2021_q3) AS indego_trips_2021_q3, - (SELECT count(*) FROM indego_trips_2022_q3) AS indego_trips_2022_q3 -) AS trip_counts; +FROM + ( + SELECT + (SELECT COUNT(*) FROM indego_trips_2021_q3) AS indego_trips_2021_q3, + (SELECT COUNT(*) FROM indego_trips_2022_q3) AS indego_trips_2022_q3 + ) AS trip_counts; /* diff --git a/query04.sql b/query04.sql index 5611b92..73bf8eb 100644 --- a/query04.sql +++ b/query04.sql @@ -6,4 +6,4 @@ */ -- Enter your SQL query here -SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2022_q3 \ No newline at end of file +SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2022_q3 diff --git a/query06.sql b/query06.sql index 732fcd9..6d79148 100644 --- a/query06.sql +++ b/query06.sql @@ -8,17 +8,17 @@ -- Enter your SQL query here SELECT -2021 AS trip_year, -3 AS trip_quarter, -COUNT(*) AS num_trips + 2021 AS trip_year, + 3 AS trip_quarter, + COUNT(*) AS num_trips FROM indego.indego_trips_2021_q3 -WHERE duration < 10 +WHERE duration < 10 UNION ALL SELECT -2022 AS trip_year, -3 AS trip_quarter, -COUNT(*) AS num_trips + 2022 AS trip_year, + 3 AS trip_quarter, + COUNT(*) AS num_trips FROM indego.indego_trips_2022_q3 -WHERE duration < 10 ; +WHERE duration < 10; diff --git a/query07.sql b/query07.sql index 73157a3..1377259 100644 --- a/query07.sql +++ b/query07.sql @@ -6,12 +6,12 @@ */ -- Enter your SQL query here -SELECT +SELECT trip_year, trip_quarter, COUNT(*) AS num_trips FROM ( - SELECT + SELECT 2021 AS trip_year, 3 AS trip_quarter, start_time, @@ -20,7 +20,7 @@ FROM ( UNION ALL - SELECT + SELECT 2022 AS trip_year, 3 AS trip_quarter, start_time, @@ -28,7 +28,7 @@ FROM ( FROM indego.indego_trips_2022_q3 ) AS trips WHERE start_time::date <> end_time::date -GROUP BY +GROUP BY trip_year, trip_quarter ORDER BY diff --git a/query08.sql b/query08.sql index a461668..96019f6 100644 --- a/query08.sql +++ b/query08.sql @@ -10,34 +10,33 @@ -- Enter your SQL query here SELECT - s.id AS station_id, - s.geom AS station_geog, - COUNT(*) AS num_trips + s.id AS station_id, + s.geom AS station_geog, + COUNT(*) AS num_trips FROM ( - SELECT start_time, start_station::int AS start_station + SELECT + start_time, + start_station::int AS start_station FROM indego.indego_trips_2021_q3 UNION ALL - SELECT start_time, start_station::int AS start_station + SELECT + start_time, + start_station::int AS start_station FROM indego.indego_trips_2022_q3 ) AS t -JOIN indego.station_status AS s - ON s.id = t.start_station +INNER JOIN indego.station_status AS s + ON t.start_station = s.id WHERE EXTRACT(HOUR FROM t.start_time) BETWEEN 7 AND 9 GROUP BY - s.id, - s.geom + s.id, + s.geom ORDER BY - num_trips DESC + num_trips DESC LIMIT 5; - - - - - /* Hint: Use the `EXTRACT` function to get the hour of the day from the timestamp. diff --git a/query09.sql b/query09.sql index 714542e..03fbff6 100644 --- a/query09.sql +++ b/query09.sql @@ -8,16 +8,16 @@ -- Enter your SQL query here SELECT - passholder_type, - COUNT(*) AS num_trips + passholder_type, + COUNT(*) AS num_trips FROM ( - SELECT passholder_type - FROM indego.indego_trips_2021_q3 + SELECT passholder_type + FROM indego.indego_trips_2021_q3 - UNION ALL + UNION ALL - SELECT passholder_type - FROM indego.indego_trips_2022_q3 + SELECT passholder_type + FROM indego.indego_trips_2022_q3 ) AS t GROUP BY passholder_type -ORDER BY num_trips DESC; \ No newline at end of file +ORDER BY num_trips DESC; diff --git a/query10.sql b/query10.sql index ef70e3a..41f5d90 100644 --- a/query10.sql +++ b/query10.sql @@ -9,13 +9,13 @@ -- Enter your SQL query here SELECT - s.id AS station_id, - s.geom AS station_geog, - ROUND( - ST_Distance( - s.geom::geography, - ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography - ) / 50.0 - ) * 50 AS distance + s.id AS station_id, + s.geom AS station_geog, + ROUND( + ST_DISTANCE( + s.geom::geography, + ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography + ) / 50.0 + ) * 50 AS distance FROM indego.station_status AS s -ORDER BY distance; \ No newline at end of file +ORDER BY distance; diff --git a/query11.sql b/query11.sql index 7d2b56e..4ecbeee 100644 --- a/query11.sql +++ b/query11.sql @@ -6,14 +6,13 @@ -- Enter your SQL query here SELECT - s.id AS station_id, - s.geom AS station_geog, - ROUND( - ST_Distance( - s.geom::geography, - ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography - ) / 50.0 - ) * 50 AS distance + s.id AS station_id, + s.geom AS station_geog, + ROUND( + ST_DISTANCE( + s.geom::geography, + ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography + ) / 50.0 + ) * 50 AS distance FROM indego.station_status AS s ORDER BY distance; - diff --git a/query12.sql b/query12.sql index 3a7be9d..21a7bf8 100644 --- a/query12.sql +++ b/query12.sql @@ -7,13 +7,11 @@ -- Enter your SQL query here -SELECT - COUNT(*) AS num_stations +SELECT COUNT(*) AS num_stations FROM indego.station_status AS s -WHERE ST_DWithin( - s.geom::geography, - ST_SetSRID(ST_MakePoint(-75.192584, 39.952415), 4326)::geography, - 1000 - ) - AND s.isvirtual = false; - +WHERE ST_DWITHIN( + s.geom::geography, + ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography, + 1000 +) +AND s.isvirtual = false; diff --git a/query13.sql b/query13.sql index f4ad6d0..06ab38e 100644 --- a/query13.sql +++ b/query13.sql @@ -8,24 +8,24 @@ -- Enter your SQL query here SELECT - s.id AS station_id, - s.name AS station_name, - ROUND( - ST_Distance( - s.geom::geography, - ST_SetSRID( - ST_MakePoint(-75.192584, 39.952415), - 4326 - )::geography - ) / 50.0 - ) * 50 AS distance + s.id AS station_id, + s.name AS station_name, + ROUND( + ST_DISTANCE( + s.geom::geography, + ST_SETSRID( + ST_MAKEPOINT(-75.192584, 39.952415), + 4326 + )::geography + ) / 50.0 + ) * 50 AS distance FROM indego.station_status AS s ORDER BY - ST_Distance( - s.geom::geography, - ST_SetSRID( - ST_MakePoint(-75.192584, 39.952415), - 4326 - )::geography - ) DESC -LIMIT 1; \ No newline at end of file + ST_DISTANCE( + s.geom::geography, + ST_SETSRID( + ST_MAKEPOINT(-75.192584, 39.952415), + 4326 + )::geography + ) DESC +LIMIT 1; diff --git a/query14.sql b/query14.sql index 5841e59..65d39d5 100644 --- a/query14.sql +++ b/query14.sql @@ -8,24 +8,24 @@ -- Enter your SQL query here SELECT - s.id AS station_id, - s.name AS station_name, - ROUND( - ST_Distance( - s.geom::geography, - ST_SetSRID( - ST_MakePoint(-75.192584, 39.952415), - 4326 - )::geography - ) / 50.0 - ) * 50 AS distance + s.id AS station_id, + s.name AS station_name, + ROUND( + ST_DISTANCE( + s.geom::geography, + ST_SETSRID( + ST_MAKEPOINT(-75.192584, 39.952415), + 4326 + )::geography + ) / 50.0 + ) * 50 AS distance FROM indego.station_status AS s ORDER BY - ST_Distance( - s.geom::geography, - ST_SetSRID( - ST_MakePoint(-75.192584, 39.952415), - 4326 - )::geography - ) -LIMIT 1; \ No newline at end of file + ST_DISTANCE( + s.geom::geography, + ST_SETSRID( + ST_MAKEPOINT(-75.192584, 39.952415), + 4326 + )::geography + ) +LIMIT 1; From 1817d3480b924aba520530650f29fbd86141929e Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Tue, 24 Feb 2026 20:36:23 -0500 Subject: [PATCH 4/7] Fix station_statuses table name --- query08.sql | 2 +- query10.sql | 2 +- query11.sql | 2 +- query12.sql | 2 +- query13.sql | 2 +- query14.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/query08.sql b/query08.sql index 96019f6..7cf4147 100644 --- a/query08.sql +++ b/query08.sql @@ -26,7 +26,7 @@ FROM ( start_station::int AS start_station FROM indego.indego_trips_2022_q3 ) AS t -INNER JOIN indego.station_status AS s +INNER JOIN indego.station_statuses AS s ON t.start_station = s.id WHERE EXTRACT(HOUR FROM t.start_time) BETWEEN 7 AND 9 GROUP BY diff --git a/query10.sql b/query10.sql index 41f5d90..c6ae9a4 100644 --- a/query10.sql +++ b/query10.sql @@ -17,5 +17,5 @@ SELECT ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography ) / 50.0 ) * 50 AS distance -FROM indego.station_status AS s +FROM indego.station_statuses AS s ORDER BY distance; diff --git a/query11.sql b/query11.sql index 4ecbeee..d32e891 100644 --- a/query11.sql +++ b/query11.sql @@ -14,5 +14,5 @@ SELECT ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography ) / 50.0 ) * 50 AS distance -FROM indego.station_status AS s +FROM indego.station_statuses AS s ORDER BY distance; diff --git a/query12.sql b/query12.sql index 21a7bf8..30dd608 100644 --- a/query12.sql +++ b/query12.sql @@ -8,7 +8,7 @@ -- Enter your SQL query here SELECT COUNT(*) AS num_stations -FROM indego.station_status AS s +FROM indego.station_statuses AS s WHERE ST_DWITHIN( s.geom::geography, ST_SETSRID(ST_MAKEPOINT(-75.192584, 39.952415), 4326)::geography, diff --git a/query13.sql b/query13.sql index 06ab38e..e544c0b 100644 --- a/query13.sql +++ b/query13.sql @@ -19,7 +19,7 @@ SELECT )::geography ) / 50.0 ) * 50 AS distance -FROM indego.station_status AS s +FROM indego.station_statuses AS s ORDER BY ST_DISTANCE( s.geom::geography, diff --git a/query14.sql b/query14.sql index 65d39d5..f53c952 100644 --- a/query14.sql +++ b/query14.sql @@ -19,7 +19,7 @@ SELECT )::geography ) / 50.0 ) * 50 AS distance -FROM indego.station_status AS s +FROM indego.station_statuses AS s ORDER BY ST_DISTANCE( s.geom::geography, From edf3e765fac46a9a9762db3ab3afd4bc6b5e8c0a Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Tue, 24 Feb 2026 20:46:32 -0500 Subject: [PATCH 5/7] Fix schema-qualified trip table names --- query02.sql | 6 +++--- query03.sql | 2 +- query04.sql | 2 +- query05.sql | 4 ++-- query06.sql | 4 ++-- query07.sql | 4 ++-- query08.sql | 4 ++-- query09.sql | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/query02.sql b/query02.sql index ea47f18..013fec8 100644 --- a/query02.sql +++ b/query02.sql @@ -11,12 +11,12 @@ -- Enter your SQL query here -SELECT ROUND(((indego_trips_2022_q3 - indego_trips_2021_q3) * 100.0 / indego_trips_2021_q3), 2) AS perc_change +SELECT ROUND(((indego.trips_2022_q3 - indego.trips_2021_q3) * 100.0 / indego.trips_2021_q3), 2) AS perc_change FROM ( SELECT - (SELECT COUNT(*) FROM indego_trips_2021_q3) AS indego_trips_2021_q3, - (SELECT COUNT(*) FROM indego_trips_2022_q3) AS indego_trips_2022_q3 + (SELECT COUNT(*) FROM indego.trips_2021_q3) AS indego.trips_2021_q3, + (SELECT COUNT(*) FROM indego.trips_2022_q3) AS indego.trips_2022_q3 ) AS trip_counts; diff --git a/query03.sql b/query03.sql index eec2be0..71c1ddb 100644 --- a/query03.sql +++ b/query03.sql @@ -6,4 +6,4 @@ */ -- Enter your SQL query here -SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2021_q3 +SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego.trips_2021_q3 diff --git a/query04.sql b/query04.sql index 73bf8eb..c4fdb41 100644 --- a/query04.sql +++ b/query04.sql @@ -6,4 +6,4 @@ */ -- Enter your SQL query here -SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego_trips_2022_q3 +SELECT ROUND(AVG(duration), 2) AS avg_duration FROM indego.trips_2022_q3 diff --git a/query05.sql b/query05.sql index 0584cd6..d262271 100644 --- a/query05.sql +++ b/query05.sql @@ -6,6 +6,6 @@ -- Enter your SQL query here SELECT GREATEST( - (SELECT MAX(duration) FROM indego.indego_trips_2021_q3), - (SELECT MAX(duration) FROM indego.indego_trips_2022_q3) + (SELECT MAX(duration) FROM indego.indego.trips_2021_q3), + (SELECT MAX(duration) FROM indego.indego.trips_2022_q3) ) AS max_duration; diff --git a/query06.sql b/query06.sql index 6d79148..8e7f854 100644 --- a/query06.sql +++ b/query06.sql @@ -11,7 +11,7 @@ SELECT 2021 AS trip_year, 3 AS trip_quarter, COUNT(*) AS num_trips -FROM indego.indego_trips_2021_q3 +FROM indego.indego.trips_2021_q3 WHERE duration < 10 UNION ALL @@ -20,5 +20,5 @@ SELECT 2022 AS trip_year, 3 AS trip_quarter, COUNT(*) AS num_trips -FROM indego.indego_trips_2022_q3 +FROM indego.indego.trips_2022_q3 WHERE duration < 10; diff --git a/query07.sql b/query07.sql index 1377259..dd3e0ad 100644 --- a/query07.sql +++ b/query07.sql @@ -16,7 +16,7 @@ FROM ( 3 AS trip_quarter, start_time, end_time - FROM indego.indego_trips_2021_q3 + FROM indego.indego.trips_2021_q3 UNION ALL @@ -25,7 +25,7 @@ FROM ( 3 AS trip_quarter, start_time, end_time - FROM indego.indego_trips_2022_q3 + FROM indego.indego.trips_2022_q3 ) AS trips WHERE start_time::date <> end_time::date GROUP BY diff --git a/query08.sql b/query08.sql index 7cf4147..6242365 100644 --- a/query08.sql +++ b/query08.sql @@ -17,14 +17,14 @@ FROM ( SELECT start_time, start_station::int AS start_station - FROM indego.indego_trips_2021_q3 + FROM indego.indego.trips_2021_q3 UNION ALL SELECT start_time, start_station::int AS start_station - FROM indego.indego_trips_2022_q3 + FROM indego.indego.trips_2022_q3 ) AS t INNER JOIN indego.station_statuses AS s ON t.start_station = s.id diff --git a/query09.sql b/query09.sql index 03fbff6..9a8eea5 100644 --- a/query09.sql +++ b/query09.sql @@ -12,12 +12,12 @@ SELECT COUNT(*) AS num_trips FROM ( SELECT passholder_type - FROM indego.indego_trips_2021_q3 + FROM indego.indego.trips_2021_q3 UNION ALL SELECT passholder_type - FROM indego.indego_trips_2022_q3 + FROM indego.indego.trips_2022_q3 ) AS t GROUP BY passholder_type ORDER BY num_trips DESC; From 8ee6179fa32f5c663caa1d2aa601e5e433dee459 Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Tue, 24 Feb 2026 21:49:08 -0500 Subject: [PATCH 6/7] commits for 2 and 5 --- query02.sql | 12 ++++++++---- query05.sql | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/query02.sql b/query02.sql index 013fec8..7eadf65 100644 --- a/query02.sql +++ b/query02.sql @@ -11,15 +11,19 @@ -- Enter your SQL query here -SELECT ROUND(((indego.trips_2022_q3 - indego.trips_2021_q3) * 100.0 / indego.trips_2021_q3), 2) AS perc_change +SELECT + ROUND( + ((indego_trips_2022_q3 - indego_trips_2021_q3) * 100.0 + / indego_trips_2021_q3), + 2 + ) AS perc_change FROM ( SELECT - (SELECT COUNT(*) FROM indego.trips_2021_q3) AS indego.trips_2021_q3, - (SELECT COUNT(*) FROM indego.trips_2022_q3) AS indego.trips_2022_q3 + (SELECT COUNT(*) FROM indego.trips_2021_q3) AS indego_trips_2021_q3, + (SELECT COUNT(*) FROM indego.trips_2022_q3) AS indego_trips_2022_q3 ) AS trip_counts; - /* If you want to get fancier here, you can cast the result to a string and concatenate a '%' to the end. For example: diff --git a/query05.sql b/query05.sql index d262271..a7f2e8b 100644 --- a/query05.sql +++ b/query05.sql @@ -6,6 +6,6 @@ -- Enter your SQL query here SELECT GREATEST( - (SELECT MAX(duration) FROM indego.indego.trips_2021_q3), - (SELECT MAX(duration) FROM indego.indego.trips_2022_q3) + (SELECT MAX(duration) FROM indego.trips_2021_q3), + (SELECT MAX(duration) FROM indego.trips_2022_q3) ) AS max_duration; From 6a29360a24f081acc7bcca43c5ed10c43974efb7 Mon Sep 17 00:00:00 2001 From: SidneyJeffries Date: Thu, 30 Apr 2026 20:39:45 -0400 Subject: [PATCH 7/7] Create ql --- ql | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ql diff --git a/ql b/ql new file mode 100644 index 0000000..fbef3c3 --- /dev/null +++ b/ql @@ -0,0 +1,29 @@ +warning: in the working copy of 'query01.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query02.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query03.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query04.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query05.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query06.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query07.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query08.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query09.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query10.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query11.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query12.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query13.sql', LF will be replaced by CRLF the next time Git touches it +warning: in the working copy of 'query14.sql', LF will be replaced by CRLF the next time Git touches it + query01.sql | 4 ++-- + query02.sql | 9 +++++++++ + query03.sql | 1 + + query04.sql | 2 ++ + query05.sql | 4 ++++ + query06.sql | 16 ++++++++++++++++ + query07.sql | 27 +++++++++++++++++++++++++++ + query08.sql | 21 +++++++++++++++++++++ + query09.sql | 15 +++++++++++++++ + query10.sql | 11 +++++++++++ + query11.sql | 13 +++++++++++++ + query12.sql | 9 +++++++++ + query13.sql | 23 +++++++++++++++++++++++ + query14.sql | 23 +++++++++++++++++++++++ + 14 files changed, 176 insertions(+), 2 deletions(-)