You are on page 1of 7

Outline

• Definitions
• What is DBMS?
Database Basics • Types of databases
• Relational model
• Joint and relate

Definitions
DBMS
• Database – an integrated set of data on a • Provide means to manage buckets of data:
particular subject – Basic function is to safely store and quickly
• Geographic (=spatial) database - database retrieve data
containing geographic data of a particular • Read
subject for a particular area • Write
• Database Management System (DBMS) – • Delete
software to create, maintain and access • Query (Retrieve)
databases – e.g. Microsoft Access, Oracle, Microsoft SQL
Server …

Characteristics of DBMS Characteristics of DBMS (Cont.)


• Data management • Security – controlled access to data
– Support multiple data types – Work with separate tables
• e.g MS Access: Text, Memo, Number, Date/Time, – Multi-level groups
Currency, AutoNumber, Yes/No, OLE Object, Hyperlink …
– Controlled update using a transaction manager
– Index for rapid retrieval – Backup and recovery
– Data transferring and converting
• Application development: API
– Database Administrator (DBA) tools
– CASE tools
• Configuration, tuning
– Programmable API (Application programming – Forms builder
interface) – Report writer
– Query language – SQL – Internet Application Server

1
Role of DBMS in GIS Types of DBMS Models
System Task • Flat file
• Data load
Geographic • Editing
Information • Visualization
System • Mapping • Hierarchical
• Analysis

Database • Storage
• Indexing • Network
Management
• Security
System • Query
«Rel_Name»
«Attr1_Name» «Attr2_Name» «Attr3_Name»

Data • Relational – RDBMS

Relational DBMS Rational Table


Column = property
Table =
• Data stored as tuples (tup-el), Object Class
conceptualized as tables
• Table – data about a class of objects
– Two-dimensional list (array) Row = object
Object
– Rows (records, tuples) = objects Classes with
– Columns (fields) = object states (properties, Geometry
attributes) called
Feature
Classes

Relational DBMS (Cont.) Geo-Relational Model

• Most popular type of DBMS


– Over 95% of data in DBMS is in RDBMS
• Popular Commercial systems
– IBM DB2
– Informix
– Microsoft Access
– Microsoft SQL Server
– Oracle
– Sybase

2
Relation Rules (Codd, 1970) Normalization
• Only one value in each cell (intersection of
row and column) • Process of converting tables to conform to
• All values in a column are about the same Codd’s and other relational rules
subject – Split tables into new tables
• Later they can be joined back at query time: The
• Each row is unique relational join
• No significance in column sequence • Several levels of normalization
• No significance in row sequence – Forms: 1NF, 2NF, 3NF, etc.

Why Normalization? Example: Property Table

• Reduce storage space by removing data


redundancy
• Avoid:
– Update anomalies
– Deletion anomalies
– Modification anomalies
– Null values
• Limit Functional Dependencies

1st Normalization Form (1NF) After 1NF


• Domains of attributes include only atomic values
(no sets or tuples): one value one cell
• This is now part of the definition of a relation

3
Keys in Relational Table After 1NF Key

• Key
– a minimal set of attributes that makes a row unique
– Prime attribute: member of a key
– Non-prime attribute: other attribute
• Candidate Key
– Any key
• Primary Key
– Arbitrarily chosen from candidate keys as the One key
for identifying each record
– e.g. ID

2nd Normalization Form (2NF) After 2NF

• It is in 1NF
• Every nonprime attribute is fully functionally
dependent on a candidate key as a whole
– Violates: Owner address depends on Owner only, not
PIN

3rd Normalization Form (3NF) After 3NF

• It is in 2NF
• The only functional dependencies are
between prime attributes and keys
– Violates: Zone code depends on Zoning only

4
Negatives of Normalization Data Relationships BTW Tables
• Also called cardinality
• However normalization could create many
expensive joins
– In some cases, de-normalization is OK for
performance optimization
One-to-one relationship Many-to-one relationship

One-to-many relationship Many-to-many relationship

Many-to-One One-to-Many
PIN Owner

P101 Wang
PIN Owner Owner Owner
name address P101 Chang
P101 Wang Wang 101 Oak St PIN Sale Acre Zone Zoning
date s code
P102 Smith
P101 Chang P101 1-10- 1.0 1 residential
Chang 200 Maple St 98
P102 Jones
P102 10-6- 3.0 2 commercial
P102 Smith
Jones 105 Ash St 68
P103 3-7-97 2.5 2 commercial P103 Costello
P102 Jones
Smith 300 Spruce
Rd P104 7-30- 1.0 1 residential P104 Smith
78
P103 Costello
Costello 206 Elm St
Parcel table Owner table
P104 Smith
Address table
Owner table

Relational Join Relational Join


• Fundamental query operation Primary key Foreign key
• Occurs because
– Normalization
– Data created/maintained by different users, but
integration needed for queries
• Table joins use common keys (column values)
– Primary key and its counterpart foreign key Destination Source
– Table (attribute) join concept has been extended to
geographic case Æ spatial joint

• Suitable: one-to-one, sometimes many-to-one


• Unsuitable: one-to-many, many-to-many

5
Categorical
Relate Types of Attributes Numerical

• Nominal, category, e.g. land cover class


• Relate temporarily connects two tables but – Each object can only be in but one category
keeps the tables separate. • Ordinal, ranking, e.g. land suitability
• Relate is appropriate for all four relationships. It – not necessarily the difference between levels of
order
can also work with three or more tables • Interval, e.g. Celsius temperature
simultaneously by first establishing connections – No definable zero level
between these tables in pairs. – Differences make sense but not its magnitude
• One disadvantage of relate is that it tends to • Ratio, e.g. Kelvin temperature
slow down data access. – an inherent zero level
– Ratios make sense
• Cyclic, e.g. wind direction

Attribute data Conversion Recent DBMS Models


• Object-oriented - OODBMS
• Quantitative data Æ qualitative data
• Object-relational - ORDBMS
– Classify Vector data: attribute manipulation
– Reclassify Raster data: local operations Application
data structures
Copy and
Transparent translation
Relational
ODBMS
representation
data transfer

RDBMS

Object-Based Vector Data Model Types of DBMS Model


Attributes
a. Flat File b. Hierarchical

PIN Owner Zoning

P101 Wang Residential (1)

P101 Chang Residential (1) Zoning

P102 Smith Commercial (2)


1 2

P102 Jones Commercial (2)

P101 P104 P102 P103


P103 Costello Commercial (2)

Wang Chang Smith Smith Jones Costello


P104 Smith Residential (1)

Geodatabase

6
Types of DBMS Model Databases vs. Text
Files
file vs. dBase file

• Pros
– Security and standards can be defined and enforced
– Avoids redundancy and duplication
c. Network – Reduces data maintenance costs
– Applications are separated from the data
Zoning Owner • Applications persist over time
• Support multiple concurrent applications
1 2 Wang Chang Smith Jones Costello – Better data sharing
• Cons
– Expense
P101 P102 P103 P104
– Complexity
– Performance – especially complex data types
– Integration with other systems can be difficult

You might also like