Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.
-
Upload
roderick-fewkes -
Category
Documents
-
view
217 -
download
0
Transcript of Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.
![Page 1: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/1.jpg)
Understanding RDBMSUnderstanding RDBMS
Keith T. WeberGIS Director
ISU-GIS Training and Research Center
![Page 2: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/2.jpg)
RDBMSRDBMS
• Relational Database Management System
![Page 3: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/3.jpg)
DatabasesDatabases
• The “I” in GIS
![Page 4: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/4.jpg)
Database software...Database software...
• Light Duty
• Medium Duty
• Heavy Duty
![Page 5: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/5.jpg)
Database software...Database software...
• Light Duty
• Medium Duty
• Heavy Duty
![Page 6: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/6.jpg)
IBM DB2 UDBIBM DB2 UDB
• The GIS Center’s heavy hitter- IBM DB2, Universal Database
![Page 7: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/7.jpg)
Spreadsheets vs. Databases
Spreadsheets vs. Databases
• Integrity!• Structure
![Page 8: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/8.jpg)
RDBMS Concepts and Terms
RDBMS Concepts and Terms
![Page 9: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/9.jpg)
IndependenceIndependence
• Physical• Logical
![Page 10: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/10.jpg)
IntegrityIntegrity• Important for consistency and
transaction management.• Types:
– Domain– Redundancy– Constraint– Entity– Referential
• Cascading or non-cascading
![Page 11: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/11.jpg)
Key FieldsKey Fields
• Unique Identifiers (?)– Primary key– Foreign key
• AKA- Relate fields.
![Page 12: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/12.jpg)
RDBMS StructureRDBMS Structure
![Page 13: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/13.jpg)
Database TablesDatabase Tables
Database
Table1 Table2 Table3
![Page 14: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/14.jpg)
Table StructureTable Structure
Column 1(Field 1)
Column 2(Field 2)
Row 1(Record 1)
Value
Row 2(Record 2)
![Page 15: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/15.jpg)
Data Value TypesData Value TypesType Name Storage Occupied/ data value Valid Domain Range
Short Integer 2 bytes -35768 to 32767
Long Integer 4 bytes -2147483648 to 2147483647
Float 4 bytes Any number from n-45 to n38
Double 8 bytes Any number from n-324 to n308
Text (string) 10 + max. length = bytes Any alphanumeric characters
Date 8 bytes Jan 1, 100 to Dec. 31 9999
LOB (variant) 22 + max. length = bytes Any alphanumeric characters
![Page 16: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/16.jpg)
Basic Steps in Database Design
Basic Steps in Database Design
• Understand and document the business’ needs.– Problem statement– Business object types– Business relationships– Business constraints
• Create an ERM• Data and process inventory• Develop tuple types• Tuple types to tables• Integrity• Populate the database
![Page 17: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/17.jpg)
A Scenario...A Scenario...
• Develop a GIS-Based Tourism database for Southeast Idaho.
![Page 18: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/18.jpg)
Document the business needs
Document the business needs
• What problem or issue is this database going to address?
• This is a business statement
![Page 19: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/19.jpg)
DINING
The Preliminary ERMThe Preliminary ERM• Symbolized.
– Standard Representation– Attribute Representation– Entity Instance Representation
DININGK Restaurant Number
Name
Type of food
DININGK Restaurant Number: 126
Name: Burger King
Type of food: Fast
![Page 20: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/20.jpg)
RelationshipsRelationships
• Determine the relationships between your entity types.
• Add these to the ERM
![Page 21: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/21.jpg)
Define the ListDefine the List• Database
Dictionary– Restaurant_N
ame
– Food_Type
– Cost_Mean
• The name of the restaurant
• Categories of food (e.g., 1 = Continental, 2 = Fast food, etc.)
• The average cost of all regular menu items.
![Page 22: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/22.jpg)
Develop Tuple TypesDevelop Tuple Types
• Use your ERM with relationships• Perform a “Walk-through” exercise
– Simulate information is being added/used in your database.
• Symbolize using Attribute Representation
![Page 23: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/23.jpg)
Tuple Types to TablesTuple Types to Tables
ENTITY TYPES
RELATIONSHIP TYPES
TUPLE TYPES
TABLES
![Page 24: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/24.jpg)
NormalizationNormalization
• First-Fifth Form Normal (1FN, 2FN,…5FN)
• Academic• Applied
![Page 25: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/25.jpg)
1FN1FN
• All values are atomic– Single cell contains single data value
• Eliminate repeating groups– Puppy_Trick1, Puppy_Trick2, …
• Note: some tables will be OK as planned… just check to make sure.
![Page 26: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/26.jpg)
Check this (1FN)…Check this (1FN)…
![Page 27: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/27.jpg)
2FN2FN
• Satisfy 1FN and…• Redundant data must be
eliminated– How?– Example: Puppy_ID, Trick_ID,
Trick_Name
![Page 28: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/28.jpg)
Check this (2FN)…Check this (2FN)…
![Page 29: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/29.jpg)
3FN3FN
• Satisfy 1NF and 2FN and…• No non-key attributes are
dependent on other non-key attributes.– Example: Appointment_ID, Name,
Date, Time, Species
![Page 30: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/30.jpg)
After NormalizationAfter Normalization• New tuple types will be created.• New tables will be planned.• Many-many relationships will be
handled using associative tables (bridge tables).
![Page 31: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/31.jpg)
De-NormalizationDe-Normalization
• What? Is this heresy?
![Page 32: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/32.jpg)
Designing the Actual RDBMS
Designing the Actual RDBMS
• Visual modeling based upon your ERM and Tuple type model.
• Implementation of integrity rules based upon your business constraints.
![Page 33: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/33.jpg)
Populate...Populate...
• Questions and concerns to revisit– Null data– Reporting discrepancies and
variations– Measuring or estimating methods– Client utility/efficiency
![Page 34: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/34.jpg)
The Last Step?The Last Step?
![Page 35: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/35.jpg)
Questions?Questions?
![Page 36: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/36.jpg)
Reading a Business Statement
Reading a Business Statement
IT4GISKeith T. Weber, GISP
GIS Director, ISU
![Page 37: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/37.jpg)
Identify Candidate Classes
Identify Candidate Classes
• A candidate class may or may not remain a class throughout the design process
• A candidate class may or may not become a table
• Do not think about tables and relationship classes at this point
![Page 38: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/38.jpg)
Think Object-OrientedThink Object-Oriented
• Classes are nouns• A noun is a “person, places, and
things”
![Page 39: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/39.jpg)
And now…VerbsAnd now…Verbs
• Candidate methods are verbs– They show action– They are behaviors
![Page 40: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/40.jpg)
MethodsMethods• Identifying candidate methods allows us
to better understand how the business operates and how the Enterprise uses GIS data.
• A method is a behavior…a relationship between classes
• The candidate methods will describe an inheritance, aggregation, or dependency relationship
![Page 41: Understanding RDBMS Keith T. Weber GIS Director ISU-GIS Training and Research Center.](https://reader035.fdocuments.us/reader035/viewer/2022062417/5518a7cd550346b31f8b4b20/html5/thumbnails/41.jpg)
Questions?Questions?