3561F09_l14 - Relationaldatabases:keysand cardinality...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Relational databases: keys and  cardinality
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Relational database system Keys must:  uniquely identify each record if it is different  SSN works as a key for identifying individuals better than name (which might  be duplicated)  be identical, in type and ID, in the two tables,   column names don’t have to match  sorting, counts don’t have to be the same  Parcel Number Area (acres) Owner 1006 0.2 Jeff Jones 1007 0.3 Susan Smith 1008 0.6 Paul Plane 1009 0.4 Harry Hectare 1010 0.3 Susan Smith 1011 5.0 City of Blaine Obj101 spatial aspatial
Image of page 2
Relational Database System  a joined table In GIS, the aspatial table is joined to the spatial table The joiner (aspatial):  the source table The joinee (spatial):  the destination table The destination table is the one that is added onto
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Polygon identifiers in the US  FIPS codes – numerical codings of most polygon units in the US  states, counties/parishes, zip codes, block groups, census tracts First three numbers: state Second three numbers:  county
Image of page 4
QDJ #whatever In a table of all 3000+ US counties, why would  NAME be a dangerous choice for a  key in a relational database?
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Cardinality relationships of RDBMS  links can be done in several ways:  one-to-one  many-to-one  one-to-many  many-to-many  cardinality relationships how the number of instances of a key in one table compares to that of the  other  Parcel Number Area (acres) Owner 1006 0.2 Jeff Jones 1007 0.3 Susan Smith 1008 0.6 Paul Plane 1009 0.4 Harry Hectare 1010 0.3 Susan Smith 1011 5.0 City of Blaine Obj104 One record in  the source table   for each record in  the  destination table These tables have a  one-to-one   cardinality  relationship
Image of page 6
One-to-one join
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Cardinality relationships of RDBMS  many-to-one:  destination table (e.g., spatial table) has  multiple instances of each value of the key; source has one  City State Mesa Arizona Phoenix Arizona Tucson Arizona Los Angeles California Sacramento California San Francisco California State Time Zone Alabama Central Alaska Pacific Arizona Mountain Arkansas Central California Pacific Colorado Mountain Obj107 destination source joined Often, not all records of the source table are  used in a join
Image of page 8
Many-to-one join
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
 one-to-many for each record in the destination table,  there are several records in the source;  each record in the source is linked to only  one in the destination  example: destination has property  parcels, source has every owner through   many-to-many  for each record in the destination, there are several records in the source, and vice  versa  example: destination has stores, source has brands of organic produce  Destination table  (spatial units in GIS) Source table 
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern