Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental...

13
Database Models: Flat Files and the Relational Database Objectives : •Understand the fundamental structure of the relational database model •Learn the circumstances under which it is a better choice than the flat file

Transcript of Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental...

Page 1: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Database Models: Flat Files and the Relational Database

Objectives:•Understand the fundamental structure of the relational database model•Learn the circumstances under which it is a better choice than the flat file

Page 2: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

What is a database?

• Structured Data

• Procedures for– Data entry– Storage– Validity checking– Sorting– Selection– Reporting

Page 3: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Why use a database?

• To organize & preserve data

• To facilitate analysis and modeling

• To gain insights into the relationships in your data

• To help turn data into information

• To explore data using exploratory techniques

• To support the organization

Page 4: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Flat file databases

• Text files (word processing packages)

• Loosely structured storage

• Sorting (whole tables or individual columns, by number/data/text)

• Reports (via mail and merging functions)

Page 5: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Excel as a database

• All Word database capabilities plus– Data entry– Selection/Queries– Statistics– Calculations– Graphics / chart development data

summarization

Page 6: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Relational Database Systems

• All the features support by Excel– Plus all of the following features

• Validity Checking• Relational queries• Extensive import/export capabilities• Object-oriented model• Strong data typing: support for formatted text,

memo fields, OLE, calculated fields

Page 7: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Why use the relational model?

• Minimize redundancy

• Minimize wasted storage

• Facilitate updates, appending new data to existing systems

• Facilitate queries, makes asking questions of the database easier

• Keeps tables small for portability and improved data processing

Page 8: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Things to be cautious about

• Issues and Design considerations– Boolean, Integer, Long, Currency, Single,

Double, Date, String, and Variant– How expressions with different data types are

defined– When to split entries between different fields

and when to combine them in a common field– When to use more than one table in a data

base and when to use only one table

Page 9: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Other things to consider

• Redundancy – unnecessary repetition of information, wastes computing resources

• One-to-one relationships

• One-to-many relationships

• Many-to-many relationships (special case)

Page 10: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Databases are dynamic

• Can accept entry of new data even while displaying results from current data

• Desktop vs. Client/Server

• Transaction databases

• Internet databases

Page 11: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Timber Stand InventoryCompartment Stand Origin Watershed ELTP

63 184 1889 Dry Gulch 26

78 200 1967 Dead Horse 18

210 24 1942 Whitefish Mountain

45

Information in each column are the attributes of the database, information ineach row are records.

Page 12: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

How to design a relational database

• Identify the purpose of the relational database• Identify the various the subjects of the database• Determine what information on each subject is

necessary• Determine how the subject information is

related to other subject information• Refine and redesign the database when design

flaws are identified. Final designs are seldom the first designs considered.

Page 13: Database Models: Flat Files and the Relational Database Objectives: Understand the fundamental structure of the relational database model Learn the circumstances.

Example

• Tall Timbers Forest Management Inc.– Tables

• Forest communities• Harvest schedules• Prescribed burn schedule• Wildlife habitat quality• Riparian management objectives• Restoration plans• Special concerns for threatened and endangered

species