Note: The AMEND database is about 60 MB in size and may take a minute to download.
Step 2: Write query
Step 3: Execute query
Make sure you have loaded the database (Step 1) and written a SQL query (Step 2).
Results will be displayed here
Example SQL queries
Copy and paste each of the below tables into the demo at left to test out the query.
List tables in database:
SELECT name, sql
Print MA DEP budget table:
Calculate total number of MA DEP enforcements per year:
SELECT year, count(*)
GROUP BY year;
Calculate total number of MA DEP enforcements per year and join with DEP staff per year:
SELECT staff.year, count_enforcement, count_staff FROM
(SELECT year, count(*) AS count_enforcement
GROUP BY year) enf
CalendarYear AS year,
count(*) AS count_staff
GROUP BY year) staff