Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational...

22
Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database

Transcript of Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational...

Page 1: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-1

CS3754 Class Note 12

Summery of Relational Database

Page 2: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-2

Database Technology

• A collection of related data organized in a way that makes it valuable and useful

• Allows organizations to retrieve, store, and analyze information easily

• Is vital to an organization’s success in running operations and making decisions

Page 3: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-3

Database Terminology

Entities • Things we store information about. (i.e.

persons, places, objects, events, etc.)• Have relationships to other entities (i.e. the

entity Student has a relationship to the entity Grades in a University Student database

Attributes• These are pieces of information about an

entity (i.e. Student ID, Name, etc. for the entity Student)

Page 4: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-4

File Processing vs Database Approach Summary

File Processing Approach (Old School)• Storage Media: Sequential tapes or files • Data: stored in long sequential files• Organization: redundant data in multiple files• Efficiency: data embedded to support processing• Updates: requires multiple updates in many files• Processing: slower query/faster processing

Data Base Approach (New School-TODAY)• Storage Media: Direct Access Storage Device (DASD) • Data: stored in related tables• Organization: redundant data minimized/eliminated• Efficiency: data only stored only in tables• Updates: requires few or one update for a data field• Processing: faster query/slower processing

Page 5: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-5

Advantages of the Database Approach

Page 6: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-6

Roles in Database Development and Use

Database Administrator (DBA)• Designs, develops and monitors

performance of databases• Enforces policy and standards

for data uses and security

Database Administrator (DBA)• Designs, develops and monitors

performance of databases• Enforces policy and standards

for data uses and security

Systems Programmer• Creates business applications

that connect to databases• Tests the new systems and

databases before use

Systems Programmer• Creates business applications

that connect to databases• Tests the new systems and

databases before use

Systems Analyst• Defines data requirements

working with a DBA • Incorporates the database

design into new program designs

Systems Analyst• Defines data requirements

working with a DBA • Incorporates the database

design into new program designs

Page 7: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-7

Designing Databases – Data Model

Example: ERD (Entity Relationship Diagram)

ER or EER Data Model (Conceptual Data Model)• A map or diagram that represents entities and

their relationships• Used by Database Administrators to design tables

with their corresponding associations

Page 8: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-8

Designing Databases – Keys

Primary KeyA unique attribute type used to identify a single instance of an entity.

Secondary KeyAn attribute that can be used to identify one or more records within a table with a given value

Compound Primary KeyA unique combination of attributes types used to identify a single instance of an entity

Database KeysMechanisms used to identify, select, and maintain one or more records using an application program, query, or report

Page 9: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-9

Designing Databases – Keys (Example)

Primary Key- Student ID

ENTITIES

Compound Primary Key- Student ID - Course ID - Sec No.- Term

SecondaryKey- Major

Entities are translated into Tables

(Students and Grades)

Entities arejoined by commonattributes

Page 10: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-10

Designing Databases - Associations

Associations• Define the relationships one entity has to another• Determine necessary key structures to access data• Come in three relationship types:

- One-to-One - One-to-Many - Many-to-Many

Foreign Key• An attribute that appears as a non-primary

key in one entity (table) and as a primary key attribute in another entity (table)

Page 11: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-11

Designing Databases - Associations

Entity Relationship Diagram (ERD) • Diagramming tool used to express entity relationships• Very useful in developing complex databases

Example• Each Home Stadium has a Team (One-to-One) • Each Team has Players (One-to-Many)• Each Team Participates in Games• For each Player and Game there are Game Statistics

Page 12: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-12

Designing Databases - Associations

Page 13: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-13

Designing Databases – Associations (Example)

Page 14: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-14

The Relational Model

The Relational Model• The most common type of database model used

today in organizations• Is a three-dimensional model compared to the

traditional two-dimensional database models - Rows (first-dimension)- Columns (second-dimension)- Relationships (third-dimension)

• The third-dimension makes this model so powerful because any row of data can be related to any other row or rows of data

Page 15: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-15

The Relational Model - Example

Page 16: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-16

The Relational Model - Normalization

Normalization• A technique to make complex databases more efficient by

eliminating as much redundant data as possible• Example: Database with redundant data (below)

Page 17: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-17

The Relational Model - Normalization

Normalized Database

Page 18: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-18

The Relational Model – Data Dictionary

Data Dictionary

• Is a document that database designers prepare to help individuals enter data

• Provides several pieces of information about each attribute in the database including:

- Name- Key (is it a key or part of a key)- Data Type (date, alpha-numeric, numeric, etc.)- Valid Value (the format or numbers allowed)

• Can be used to enforce Business Rules which are captured by the database designer to prevent illegal or illogical values from entering the database. (e.g. who has authority to enter certain kinds of data)

Data Dictionary

• Is a document that database designers prepare to help individuals enter data

• Provides several pieces of information about each attribute in the database including:

- Name- Key (is it a key or part of a key)- Data Type (date, alpha-numeric, numeric, etc.)- Valid Value (the format or numbers allowed)

• Can be used to enforce Business Rules which are captured by the database designer to prevent illegal or illogical values from entering the database. (e.g. who has authority to enter certain kinds of data)

Page 19: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-19

Organizational Use of Databases

DepartmentDatabases

Data Warehouse

Data Mart

Operational Informational

ExtractData

ExtractData

ExtractData

ExtractData

•Day to Day Department Transactions

•Used primarily by departments

• Extracted Department transactions

• Used for business analysis

• Extracted subset of a data warehouse

• Used for highly specific business analysis

Page 20: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-20

Data Mining

Data Mining

• Is a method companies use to analyze information to better understand their customers, products, markets, or any other phase of their business for which they have data

• With data mining tools you can graphically drill down, sort or extract data based on certain conditions, perform a variety of statistical analysis

• Data mining applications are very powerful and use highly complex algorithms to analyze and to identify opportunities

Page 21: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-21

Data Warehouse Example

Page 22: Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.

Information Systems Today (©2006 Prentice Hall)3-22

Uses of Data Warehousing