chapter01 lecture notes

advertisement
Concepts of Database Management, Fifth Edition
1-1
Chapter 1
Introduction to Database Management
At a Glance
Table of Contents

Overview

Objectives

Instructor Notes

Quick Quizzes

Key Terms
Lecture Notes
Overview
In this chapter, students examine the requirements of Premiere Products, a company that will be used in many
examples in this chapter and in the rest of the text. Students learn how Premiere Products initially stored its data,
what problems employees encountered with this storage method, and why management decided to use a database
management system. Students then study the basic terminology and concepts of databases and database
management systems. They also learn the advantages and disadvantages of database processing. Finally, students
examine the database requirements for Henry Books, the company featured in the case that is used throughout the
text.
Chapter Objectives

Introduce Premiere Products, the company that is used as the basis for many of the examples throughout the
text.

Introduce database terminology.

Describe database management systems.

Explain the advantages and disadvantages of database processing.

Introduce Henry Books, the company that is used in the case that runs throughout the text.
Instructor Notes
Premiere Products Background
Premiere Products, a distributor of appliances, housewares, and sporting goods is a fictitious company that will be
used throughout the text. Since its inception, the company has used spreadsheet software to maintain company
data. Use Figure 1.1 to illustrate the problems associated with using spreadsheets to maintain this data.
Problems


Redundancy.
Difficulty accessing related data.
Concepts of Database Management, Fifth Edition



1-2
Limited security features.
Multiple updates.
Size limitations.
Define redundancy. Redundancy wastes spaces, makes changes more cumbersome and time-consuming, and can
lead to inconsistencies. Review the embedded question and answer on page 3. Use Figure 1.2 to introduce the type
of data that Premiere Products must be able to store and retrieve. Premiere Products must maintain information
about sales reps, customers, and parts inventory as well as store information about orders. The company needs to
maintain data on more than one category (customers, sales reps, orders, parts) and is interested in the relationships
between the categories. Point out that the amounts in the Total column are not stored in the database but are
calculated.
Database Background
Define and discuss the database terms: entity, attribute, and relationship. An entity is a person, place, object,
event, or idea for which you want to store and process data. An attribute is a characteristic or property of an entity.
The terms column and field are used as synonyms in many database systems. A relationship is an association
between entities. Use Figure 1.3 to point out the Rep and Customer entity and the attributes for each entity. The
one-to-many relationship that exists between sales reps and customers in the Premiere Products database is
illustrated in Figure 1.4. In a database system, a one-to-many relationship is handled by using common columns in
the two tables.
Define database. A database is a structure that can store information about multiple types of entities, the attributes
of those entities, and the relationships among the entities. A data file (a file used to store data) is not the same as a
database. Figure 1.5 lists the five tables that make up the Premiere Products database. Each table represents an
entity. The data in the tables are related through common fields. It is these relationships that allow the user to
access data from more than one table and produce reports, queries, and forms. Because the same part can be found
on many orders and one order can include many parts, there is a many to many relationship between the Part and
the Orders table. The OrderLine table relates the Part and Orders table by including both the OrderNum field and
the PartNum field. The OrderNum field is the common field between the Orders and the OrderLine tables. The
PartNum field is the common field between the Part and OrderLine tables. Point out the problems with storing data
in the table structure shown in Figure 1.6. Students will learn how to solve these problems in later chapters.
Review the embedded questions and answers on page 11. Students should be able to navigate through the tables to
find the answers.
Define entity-relationship diagram (E-R). An entity-relationship (E-R) diagram is a visual way to represent a
database. Rectangles represent entities and lines represent relationships between entities. Use the E-R diagram in
Figure 1.7 to review the entities, attributes, and relationships in the Premiere Products database. Students learn
how to create E-R diagrams in Chapter 6.
Quick Quiz
1.
A(n) _____ is a characteristic or property of an entity.
Answer: attribute
2.
A(n) _____ is a person, place, object, event, or idea for which you want to store and process data.
Answer: entity
3.
A(n) _____ is a structure that can store information about multiple types of entities, the attributes of those
entities, and the relationships among the entities.
Answer: database
Database Management Systems
Define Database Management System (DBMS). A Database Management System (DBMS) is a program, or
collection of programs, through which users interact with a database. Popular DBMSs include Access, Oracle,
DB2, MySQL and SQL Server. Access currently is the most popular DBMS for use with personal computers.
Concepts of Database Management, Fifth Edition
1-3
There are versions of Oracle, DB2, MySQL and SQL Server that run under Windows, Unix, and Linux as well as
mainframe operating systems. Figure 1.8 illustrates using a DBMS directly and Figure 1.9 describes using a
DBMS through another program.
Database design is the process of determining the structure of a database. Students learn database design principles
in later chapters. Figures 1.10 and 1.11 illustrate forms created for Premiere Products. Forms are screen objects
used to maintain, view, and print data from a database. A DBMS also must be able to generate reports such as the
one shown in Figure 1.12. A DBMS such as Access has the ability to create switchboard systems – a set of special
forms used to provide controlled access to the data, forms, reports, and other objects in a database. Use Figures
1.13 and 1.14 to show part of the switchboard system for the Premiere Products database.
Advantages of Database Processing
Discuss the advantages of database processing.
1. Getting more information from
In a nondatabase, file-oriented environment, data often is partitioned
the same amount of data
into several disjointed systems. Getting data from multiple systems can
be difficult and in some cases, impossible. When data is stored in a
single database, access is quick and easy.
2.
Sharing data
Several users can have access to the same data and still use it in a
variety of ways.
3.
Balancing conflicting
requirements
A database administrator (DBA) is a person or group in charge of the
database. The DBA is responsible for keeping the overall needs of the
organization in mind and ensuring that the database benefits the entire
organization and not just one group.
4.
Controlling redundancy
In a nondatabase, file-oriented system, multiple copies of the same data
usually exist. With a database approach, data is stored only once, thus
eliminating redundancy.
5.
Facilitating consistency
When the same data is stored more than once, the potential for
inconsistency exists. This means that the same piece of data can be
stored correctly in one location and incorrectly in another location.
Because the potential for inconsistency is a direct result of redundancy,
and because the database approach reduces redundancy, there is much
less potential for the occurrence of this sort of inconsistency.
6.
Improving integrity
An integrity constraint is a rule that must be followed by data in the
database. A database has integrity if the data in it satisfies all
established integrity constraints. A good DBMS should provide an
opportunity to incorporate integrity constraints in the database design.
7.
Expanding security
Security is the prevention of access to the database by unauthorized
users. A DBMS has features, for example, passwords, encryption, and
group permissions that help ensure the security of the data.
8.
Increasing productivity
A good DBMS reduces the need for individual programs to manipulate
data.
9.
Providing data independence
Data independence is a property that allows changes to the structure of
the database without changes to the programs that access the database.
Disadvantages of Database Processing
Discuss the disadvantages of database processing.
1. Larger file size
A DBMS is a large program that occupies a great amount of disk space as well a
substantial amount of internal memory. Also, because the data is stored in one
file, the database file requires a large amount of both disk space and internal
memory.
2.
Increased complexity
A DBMS is a complex product. To take full advantage of the system requires a
significant amount of learning. A sound database design is critical to the
Concepts of Database Management, Fifth Edition
1-4
successful use of a DBMS.
3.
Greater impact of
failure
In a nondatabase, file-oriented system, a failure of one system does not
necessarily affect users of any other systems. In a database approach, a failure on
the part of one user that damages the database can affect other users.
4.
More difficult recovery
If a database is damaged in some way, the process of recovering the database
requires several steps that restore the database first to its last known correct
status and then re-apply any database updates.
Introduction to Henry Books Database Case
Describe Henry Books. Ray Henry, the owner of a bookstore chain, must maintain information about bookstore
branches, publishers, authors, and books. Ray has decided to store his data in a database. The type of data that
Henry needs to maintain is described in Figures 1.17 through 1.20. The E-R diagram for the database appears in
Figure 1.21. The diagram shows six entities: Publisher, Author, Wrote, Branch, Book, and Inventory. There is a
one-to-many relationship (one publisher can publish many books) between the Publisher table and the Book table.
The common field between the two tables is Publisher Code. Because one author can write many books and one
book can be written by many authors, there is a many-to-many relationship between books and authors. The Wrote
table relates books and authors by including the BookCode field and the AuthorNum field. The BookCode field is
the common field between the Wrote and Book tables. The AuthorNum field is the common field between the
Wrote and Author tables. Because the same book can be found at many bookstore branches and one bookstore
branch has many books, there is a many-to-many relationship between the Branch and Book table. The BookCode
field is the common field between the Inventory and Book tables. The BranchNum field is the common field
between the Inventory and Branch tables. Review the embedded questions and answers in this section with
students to make sure they understand the Henry Books database.
Key Terms
All key terms are defined in the Glossary section of the textbook.
Attribute
Column
Data file
Data independence
Database
Database administration (dba)
Database administrator
Database design
Database management system (dbms)
Entity
Entity-relationship (e-r) diagram
Field
Forms
Integrity
Integrity constraint
One-to-many relationship
Redundancy
Relationship
Security
Switchboard
Download