Skip to content

Instantly share code, notes, and snippets.

@RomeAnalytics458
RomeAnalytics458 / dc_tree_unique_identifier.sql
Created January 7, 2026 17:42
dc_tree_unique_identifier.sql
-- There is no readily apparent unique identifier for the dataset so far,
-- this appears to have caused duplication issues during importing in DBeaver
-- this will be addressed first.
-- city_ID could be a unique identifier for all rows.
SELECT city_ID,
scientific_name,
COUNT(*) AS row_count
FROM dc_tree
GROUP BY city_ID, scientific_name
@RomeAnalytics458
RomeAnalytics458 / dc_tree_exploratory_analysis
Last active January 1, 2026 05:56
DC_tree_exploratory_analysis.sql
-- Washington DC Tree Survey, Exploratory Data Analysis
SELECT *
FROM dc_tree_unique
;
-- How many total trees are there?
SELECT COUNT(*)
FROM dc_tree_unique
@RomeAnalytics458
RomeAnalytics458 / dc_tree_cleaning
Last active January 1, 2026 05:55
dc_tree_cleaning
-- Welcome to my Washington DC Tree Survey Project.
-- Lets first select all and view the data
SELECT *
FROM dc_tree
;
SELECT *
FROM dc_tree
@RomeAnalytics458
RomeAnalytics458 / dc_tree_cleaning_script.sql
Last active December 20, 2025 02:39
dc_tree_cleaning_script.sql
SELECT *
FROM dc_tree_final
;
-- Removing any rows that have nulls in both name columns
SELECT *
FROM dc_tree_final
WHERE scientific_name = ''
AND common_name = ''