NRSC 2230 / GEOG 2750

Module F: Managing Attribute Data

Overview

Learning Objectives

Upon successful completion of this topic you will be able to:

  • Explain the concept of a Database
  • Describe the contents of a table structure
  • Describe the functions of a Primary Key and a Foreign Key
  • Perform basic table queries using Structured Query Language (SQL)
  • Add a new attribute table using ArcGIS
  • Add fields to a feature / attribute table using ArcGIS
  • Populate new fields with attribute data using ArcGIS
  • Join / Relate attribute tables to feature tables using ArcGIS
  • Display Features using attribute data using ArcGIS
  • Display Feature Labels using attribute data using ArcGIS

Most modern organizations tend to manage their data in databases.  A database is the most efficient means of managing large quantities of data. Some databases are quite complex, others are fairly simple and straight-forward.

Activity 1 – Why are databases used

Use your favourite search engine to find the main advantages of databases for managing data.  What is a relational database? This link is a good start.

Activity 2 – Usefulness of a database in our study

Post a message in your blog outlining the usefulness of a database in your study.  Comment on a least two postings of your classmates.

Table Structure, Primary Key and Foreign Key

A relational database consists of a number of linked tables (entities).  These tables are made up of rows (record,tuples) and columns (fields, attributes).  Every field is defined by:

  • Name
  • Data Type
  • Field Length (Width)

This is referred to as the table structure / schema and these characteristics are collectively called the ‘domain’ of the table.

An important characteristic of any table is a field(s) that can serve to identify each record individually.  This field(s) is called the Primary Key.

If two tables are to be joined, they must have a common link field,ie both tables have the same field.  These fields must have the same domain ie. their data types and field widths must be identical.  In some systems, the names must also be the same.

The Table Join and Relate involved some concepts on relationship between tables. There are four basic relationships between tables:

One to One relation

Many to One relation
One to Many relation
Many to Many relation

To find more details, check the online help by clicking on Help->ArcGIS Desktop Help
from either ArcCatalog or ArcMap.

Many operations use the Primary Key of each table as the link fields. The link field from the linked table is referred to as the Foreign Key in the main table.

Activity  3 – Describing table structures

Use ArcCatalog to describe the structure of the following files:

  • the attribute table of a geo-spatial file (layer / theme) e.g. SOILS
  • the table of a non-spatial file (e.g  .dbf etc) e.g. SC_LAYR1

The procedure is:

  1. Right Click on the layer
  2. Choose Properties
  3. Click the ‘Fields’ tab
  4. Record the name and Data type
  5. Click on the Data type and field Length information shows in the ‘Field Properties’ box below
  6. Open the table in the preview tab of the display window and examine the values in each field

What is the Primary Key in each table?

If you are to link these two tables, what fields would you use?

What would be the Foreign Key in the SC_LAYR1 table?

Activity 4 – Join tables / Symbol categorization

This activity enables the creation of a symbol categories based on an attribute in a table that is joined to the layer attribute table.

Join the above tables in ArcCatalog as follows:

  1. Open SOILS layer  Properties
  2. Select ‘Joins and Relates’
  3. Select ‘Join’
  4. Input ‘SOILKEY’ in textbox 1
  5. Input the file ‘SC_LAYR1’ in textbox 2
  6. Input ‘OBJECTID’ in textbox 3
  7. Hit ‘OK’
  8. If the software asks about creating an index choose ‘Yes’

Symbolize the layer using Categories derived from the ‘TEX_CSSC’ field that has been added to the attribute table.

Activity 5 – Group attributes into generalized categories

Our previous activity gives us a long list of categories and we may wish to group some of these.  This is done as follows:

  1. In the symbology tab of the Layer properties box, select and remove the unclassified symbol
  2. Select all classes that do not contain Loam (ie. “L” does not appear in the code)
  3. Right Click and select ‘Group Values’
  4. Repeat steps 2 and 3 for  the classes that contain Loam
  5. Assign appropriate symbols to the two new groups