Analyzing spatial relationships
Locating datasets is a necessary step for analysis. We have uploaded several datasets from NYC Open Data. The Department of Health and Mental Hygiene (DOHMH) dataset reports environmental complaints logged by the DOHMH.
How can we find out where the type and frequency of these complaints are located? Are there areas where the complaints are handled more efficiently?
Let’s learn how to join tables and analyze data based on additional columns and data types. Run the following code to use INNER JOIN
on the two tables:
SELECT * FROM ch2."nyc_neighborhoods" JOIN ch2."DOHMH" ON name = "NTA"; SELECT * FROM ch2."nyc_neighborhoods",ch2."DOHMH" WHERE name = "NTA";
Although tables are not visually informative in the same way as maps, they can be instrumental in formulating questions and bringing datasets together. Figure 2.16 shows a join of tables in pgAdmin: