Professional Documents
Culture Documents
• 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 …
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»
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.
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
• 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
• 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
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
5
Categorical
Relate Types of Attributes Numerical
RDBMS
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