Massachusetts Institute of Technology - Department of Urban Studies and Planning


11.521: Spatial Database Management and Advanced Geographic Information Systems
11.523: Fundamentals of Spatial Database Management

Relational Database Management, Geospatial Data, & Enterprise GIS

Joseph Ferreira, 4 February 2010



Administrative


Class Introduction - - spatial database management & geospatial services


Illustrative Example of One-To-Many Complications - Mass population density


Intro to Relational Model for tabular data

 

 


Manipulating the 'Toy' Parcel database in Lab Exercise #1


SQL Notes and the Sample Parcel Database

 

    SELECT [DISTINCT] column_name1[, column_name2, ...]
      FROM table_name1[, table_name2, ...]
     WHERE search_condition1
      [AND search_condition2 ...]
      [OR search_condition3...]
    [GROUP BY column_names]
    [ORDER BY column_names];


Using SQL queries to solve Mass 'density' computation problem

select town_id, town, count(*) parts, avg(pop90) AS pop90, sum(area) AS area, 
       10000*(avg(pop90)/sum(area)) AS density
  from jf.matown2000
 group by town_id, town
 order by town
   TOWN_ID TOWN                       PARTS      POP90       AREA    DENSITY
---------- --------------------- ---------- ---------- ---------- ----------
85 EAST LONGMEADOW 1 13367 33675444 3.96936118
86 EASTHAM 10 4462 37154979.2 1.20091576
87 EASTHAMPTON 1 15537 35234084 4.40965061
88 EASTON 1 19807 75713048 2.61606163
89 EDGARTOWN 5 3062 74423017.1 .411431856
90 EGREMONT 1 1229 48896216 .251348693
91 ERVING 1 1372 37206844 .368749362
92 ESSEX 8 3260 37689239 .86496838
93 EVERETT 2 35701 8925302.06 39.9997667
etc...
create view v_madensity as
     select town_id, town, count(*) parts, avg(pop90) pop90, sum(area) area, 
 10000*(avg(pop90)/sum(area)) density
 from matown2000
 group by town_id, town
 order by town;

Additional Notes - to be covered in more depth later on



Home
| Syllabus | Lectures | Labs | CRON | MIT

Developed by Joseph Ferreira and Tom Grayson.
Last modified: Joe Ferreira February 5, 2009