Top Banner
© Pearson Prentice Hall 2009 5-1 Using MIS 2e Chapter 5 Database Processing David Kroenke
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 5

© Pearson Prentice Hall 2009 5-1

Using MIS 2eChapter 5

Database Processing

David Kroenke

Page 2: Chapter 5

© Pearson Prentice Hall 2009 5-2

Study Questions

Q1 – What is the purpose of a database?

Q2 – What is a database?

Q3 – What are the components of a database application system?

Q4 – How do database applications make databases more useful?

Q5 – How are data models used for database development?

Q6 – How is a data model transformed into a database design?

Q7 – What is the user’s role in the development of databases?

Q8 – What are the responsibilities for database administration?

Page 3: Chapter 5

© Pearson Prentice Hall 2009 5-3

Q1 – What is the purpose of a database?

Spreadsheets are good for tracking items with just one theme. For example, the following spreadsheet tracks student grades only.

Fig 5-1 List of Student Grades, Presented in a Spreadsheet

What if I want to track student emails and office visits as well?

Page 4: Chapter 5

© Pearson Prentice Hall 2009 5-4

Q1 – What is the purpose of a database?

Fig 5-2 Student Data Shown in a Form, from a Database

A database can track things involving more than one theme.

Page 5: Chapter 5

© Pearson Prentice Hall 2009 5-5

Q2 – What is a database?

A database is a collection of related tables. In a database table

Columns are called fields. Rows are called records.

Fig 5-3 Student Table

Page 6: Chapter 5

© Pearson Prentice Hall 2009 5-6

Q2 – What is a database?

Fig 5-5 Components of a Database

A database is more than just a group of tables. It includes all of the following: tables relationships among tables metadata that describes the database’s structure.

Page 7: Chapter 5

© Pearson Prentice Hall 2009 5-7

Q2 – What is a database?

Fig 5-6 Example of Relationships Among Rows

This diagram shows relationships among different tables.

The Student Number value in the first row of the top table,1325, relates to the same Student Number value in a row in the second table.

Page 8: Chapter 5

© Pearson Prentice Hall 2009 5-8

Q2 – What is a database?

The primary key is a column that identifies a unique row in a table. In the Student Table, the primary key is Student Number.

The primary key, Student Number, can act as a foreign key in a different table, like the Email Table and Office Visit Table.

A relational database

stores data in the

form of tables and

uses foreign keys

to represent relationships

between tables

Page 9: Chapter 5

© Pearson Prentice Hall 2009 5-9

Q2 – What is a database?

Fig 5-7 Sample Metadata (in Access)

Metadata is data that describes data stored in the database. Metadata is always a part of a database.

The Field Name, Data Type, and Description at the top of this diagram are part of the database’s metadata.

The additional

field properties

at the bottom

are also

considered

metadata.

Page 10: Chapter 5

© Pearson Prentice Hall 2009 5-10

Q3 – What are the components of a database application system? By itself, a database is not very useful because there’s no way to

easily manage the data and turn it into useful information.

A database application system makes database data more accessible and useful by using forms, reports, queries, and application programs to provide useful information to users.

Fig 5-8 Components of a Database Application System

Page 11: Chapter 5

© Pearson Prentice Hall 2009 5-11

Q3 – What are the components of a database application system?

A DBMS is used to create, process, and administer a database. Popular DBMS products include:

DB2 from IBM Access from Microsoft (for personal computers) SQL Server from Microsoft (for large computer systems) Oracle from Oracle Corporation MySQL, a free open source product

IMPORTANT: DBMS and database are two different concepts DBMS is a software program. Database is a collection of tables, relationships, and metadata.

Page 12: Chapter 5

© Pearson Prentice Hall 2009 5-12

Q3 – What are the components of a database application system?

A DBMS is used to create or modify tables, relationships, and other structures in a database.

This figure shows how the metadata in an existing table is modified by adding a new field labeled “Response?”

Fig 5-9 Adding a New Column to a Table (in Access)

Page 13: Chapter 5

© Pearson Prentice Hall 2009 5-13

Q3 – What are the components of a database application system?

A DBMS is used to process databases by reading, inserting, modifying, or deleting data.

It also includes tools to administer a database. You can Set up a security system that includes user permissions and

passwords.

Back up the data to prevent it from being lost or compromised.

Improve the performance of applications by adding structures.

Remove data that’s no longer needed.

The Structured Query Language (SQL) is a standard computer language used by most major DBMS for processing databases.

Page 14: Chapter 5

© Pearson Prentice Hall 2009 5-14

Q4 – How do database applications make databases more useful?

A database application includes forms, reports, queries, and applications programs available to one or more users.

This figure shows three different applications stemming from a

single DBMS and a single database.

Fig 5-10 Use of Multiple Database Applications

Page 15: Chapter 5

© Pearson Prentice Hall 2009 5-15

Q4 – How do database applications make databases more useful?

Data entry forms are used to read, insert, modify, and delete data.

Reports are used to show data in a structured context (see the example).

Fig 5-11 Example of a Student Report

Page 16: Chapter 5

© Pearson Prentice Hall 2009 5-16

Q4 – How do database applications make databases more useful?

Fig 5-12 (a) & (b) Sample Query and Results

A query form helps the user quickly find answers to questions in a database.

In the example, the words “barriers to entry” were found in Baker’s record.

Page 17: Chapter 5

© Pearson Prentice Hall 2009 5-17

Q4 – How do database applications make databases more useful? Database application programs also enable database processing

over the Internet (see figure below). Users access the application programs on a Web server, which in turn accesses a single DBMS and database.

Fig 5-13 Four Application Programs on a Web Server Computer

Page 18: Chapter 5

© Pearson Prentice Hall 2009 5-18

Q4 – How do database applications make databases more useful?

Comparison of an Enterprise DBMS versus a Personal DBMS.

Enterprise DBMS Large organizational and

workgroup databases Thousands of users Many different database

applications 24/7 operations DB2, SQL Server, Oracle

Personal DBMS Smaller, simpler

applications Personal or small

workgroup applications Fewer than 100 users Microsoft Access is both

a DBMS and database application product as this figure depicts.

Fig 5-14 Personal Database System

Page 19: Chapter 5

© Pearson Prentice Hall 2009 5-19

Q5 – How are data models used for database development?

User involvement is critical for database development because: A database’s design depends on how users view their business

environment and how they do their jobs. Database developers cannot know what to include in the database. They

rely on users to tell them what data are important and how they are used. A data model is similar to blueprints for a house. It is a logical

representation of a database that describes data and table relationships.

Fig 5-15 Database Development Process

Page 20: Chapter 5

© Pearson Prentice Hall 2009 5-20

Q5 – How are data models used for database development?

An Entity-Relationship (ER) data model helps developers define entities that will be stored in the database as they are building a data model. It also defines relationships among those entities.

Entities are things users want to track. It can be a physical object (inventory items) or a logical transaction (sales order). The entity names are always singular.

Each entity has attributes that describe its characteristics. The entity “Order” has attributes like “OrderNumber” and “OrderDate”.

An identifier is an attribute whose value is associated with one and only one entity instance. “OrderNumber” is the identifier for the “Order” entity because there should only be one number for each order.

Page 21: Chapter 5

© Pearson Prentice Hall 2009 5-21

Q5 – How are data models used for database development?

Fig 5-16 Student Data Model Entities

Student, Department, Advisor, Email, and Office_Visit are the entity names in this model.

The entity identifiers are StudentNumber, DeptName, and AdvisorName. Not all entities require an identifier.

Page 22: Chapter 5

© Pearson Prentice Hall 2009 5-22

Q5 – How are data models used for database development?

Relationships join one entity to another entity One-to-one – 1:1 One-to-many – 1:N Many-to-many – N:M

This diagram shows that each Department Entity can have multiple Adviser Entities in a one-to-many relationship. Adviser Entities can have a many-to-many relationship with Student Entities.

Page 23: Chapter 5

© Pearson Prentice Hall 2009 5-23

Q5 – How are data models used for database development?

The line style between entities describes the type of relationship as shown in the entity-relationship diagram below.

This diagram depicts crow’s feet between the entities to describe the relationships. It shows a one-to-many (1:M) relationship between Department and Adviser and a many-to-many (N:M) relationship between Adviser and Student entities.

Fig 5-19 Sample Relationships – Version 1

Page 24: Chapter 5

© Pearson Prentice Hall 2009 5-24

Q5 – How are data models used for database development?

Fig 5-19 Sample Relationships – Version 2

The entity-relationship diagram below shows a many-to-many (N:M) relationship between Department and Adviser and a one-to-many (1:M) relationship between Adviser and Student.

Because relationships among entities can vary, only the user can describe the entity-relationship. That’s why it’s so important for users to help design databases.

Page 25: Chapter 5

© Pearson Prentice Hall 2009 5-25

Q5 – How are data models used for database development?

Fig 5-20 Sample Relationships Showing Maximum/Minimum Cardinality

Maximum cardinality represents the maximum number of entities that can be involved in a relationship.

Minimum cardinality represents the minimum number of entities that can be involved in a relationship.

The vertical bar below indicates that at least one entity is required between Department and Adviser and between Adviser and Student.

The oval below indicates that an entity is optional and doesn’t require a relationship.

Page 26: Chapter 5

© Pearson Prentice Hall 2009 5-26

Q6 How is a data model transformed into a database design?

This chart shows the necessary steps to transform a data model into a relational database design.

Fig 5-23 Transforming a Data Model into a Database Design

Page 27: Chapter 5

© Pearson Prentice Hall 2009 5-27

Q6 How is a data model transformed into a database design?

The figures below and on the next slide depict the steps used to create a well structured database that will produce useful

information. The figure on the left represents the relationship between tables.

The figure on the right shows a transformed table for each entity.

From Figure 5-24 Representing a 1:N Relationship

Page 28: Chapter 5

© Pearson Prentice Hall 2009 5-28

Q6 How is a data model transformed into a database design?

The figure below shows how relationships are represented using foreign keys. It’s the last step in transforming a data model into a database design.

From Figure 5-24 Representing a 1:N Relationship

Page 29: Chapter 5

© Pearson Prentice Hall 2009 5-29

Q7 – What is the user's role in the development of databases?

Your role in the database development process is to decide what data should be included how entities should relate to one another.

The best time to change a database structure is during the data modeling stage. It’s easier and cheaper to change your mind before anything is actually built.

Each entity must contain all the data you need to do your job.

Each relationship must accurately reflect the appropriate view of your business.

You must be the final judge of how well the database will serve your needs. Do not go forward until the data model is accurate.

Page 30: Chapter 5

© Pearson Prentice Hall 2009 5-30

Q8 – What are the responsibilities for database administration?

Database administration manages the development, operation, and maintenance of databases.

Database administration must protect the database and maximize its availability for authorized use.

Database administration tasks are divided into four categories

Page 31: Chapter 5

© Pearson Prentice Hall 2009 5-31

Q8 – What are the responsibilities for database administration?

Fig 5-26 Summary of Database Administration Tasks