You are on page 1of 24

14-Dec-22

Concepts of Database Management

Chapter 1
Introduction to Database Management

Objectives

• Introduce Premiere Products, the company that is


used as the basis for many of the examples
throughout the text
• Introduce basic database terminology
• Describe database management systems (DBMSs)
• Explain the advantages and disadvantages of
database processing
• Introduce Henry Books, the company that is used
in a case that appears throughout the text

Introduction to Database Management 2

sophorn26sun.blogspot.com 1
14-Dec-22

Premiere Products Background

• Premiere Products
– Distributor of appliances, housewares, and sporting
goods
– Uses spreadsheet software to maintain important
data
– Recent growth has made spreadsheet approach
problematic

Introduction to Database Management 3

Premiere Products Background


(continued)

Sample orders spreadsheet


Introduction to Database Management Slide 34 4

sophorn26sun.blogspot.com 2
14-Dec-22

Premiere Products Background


(continued)
• Problems using spreadsheet
– Redundancy
• Duplication of data or the storing of the same data in
more than one place
– Difficulty accessing related data
– Limited security
What problems does redundancy cause?
– Size limitations - Wastes space
- Problem with changing data
(Add, Delete and Update)
- Lead to inconsistencies

Introduction to Database Management 5

Premiere Products Background


(continued)
• Information Premiere Products needs to maintain
– Sales Reps (Sales Representatives)
• Sales rep number, last name, first name, address,
total commission, commission rate
– Customers
• Customer number, name, address, current balance,
credit limit, number of customer’s sales rep
– Parts Inventory (Products Inventory)
• Part number, description, number units on hand, item
class, warehouse number, unit price

Introduction to Database Management 6

sophorn26sun.blogspot.com 3
14-Dec-22

Premiere Products Background


(continued)

Sample order

Introduction to Database Management 7

Premiere Products Background


(continued)
• Items for each customer’s order
– Order
• Order number, order date, customer number
– Order line
• Order number, part number, number of units ordered,
quoted price
– Overall order total
• Not stored because it can be calculated

Introduction to Database Management 8

sophorn26sun.blogspot.com 4
14-Dec-22

Database Background

• Data
- Raw, unorganized facts that need to be processed.
• Database
– Structure that can store information about:
• Different categories of information
• Relationships between those categories of information
• Entity
Order
– Person, place, object, or event
– Entities for Premiere Products: sales reps,
customers, orders, and parts

Introduction to Database Management 9

Database Background (Cont.)


12/6/98
Data NY Jonh Male

063 456 789

Database

Name Gender DoB City Tel


Information Jonh Male 12/6/98 NY 063 456 789
- - - - -

Introduction to Database Management 10

sophorn26sun.blogspot.com 5
14-Dec-22

Database Background (Cont.)

• Attribute
– Characteristic or property of an entity
– Example: Customer has name, street, city, etc.
– May also be called a field or column
• Relationship
– Association between entities
– One-to-many relationship
• Each rep is associated with many customers
• Each customer is associated with a single rep

Introduction to Database Management 11

Keys
• Primary Key: A column (or columns) in a table that
uniquely identifies the rows in that table.
• Candidate Key: is a column that meets all of the
requirements of a primary key.
• Foreign Key: A column (or columns) in a table that
refer to another table.
Customers
CID Name IDCardNo Address Orders
110 Jonh 123456 NY ID Date CID
220 David 456123 LA 01 7/8/20 220
330 Jonh 789456 NY 02 7/8/20 110

Introduction to Database Management 12

sophorn26sun.blogspot.com 6
14-Dec-22

Types of Relationship

• One-to-Many: A row in table A can have many


matching rows in table B, but a row in table B can
have only one matching row in table A.

Customers
CID Name IDCardNo Address Orders
110 Jonh 123 NY ID Date CID
220 David 456 LA 01 7/8/20 220
330 Jonh 789 NY 02 7/8/20 110
03 8/8/20 110

Introduction to Database Management 13

Types of Relationship (continued)

• Many-to-Many: A row in table A can have many


matching rows in table B, and vice versa.
• You create such a relationship by defining a third
table, called a junction table, whose primary key
consists of the foreign keys from both table A and
table B.
Orders Products
ID Date CID PID Desc Price
01 7/8/20 220 P1 7/8/20 $4.5
02 7/8/20 110 P2 7/8/20 $5.2
03 8/8/20 110 P3 8/8/20 $3.8

Introduction to Database Management 14

sophorn26sun.blogspot.com 7
14-Dec-22

Types of Relationship (continued)

• One-to-One: A row in table A can have no more


than one matching row in table B, and vice versa.
• A one-to-one relationship is created if both of the
related columns are primary keys or have unique
constraints.
Employees Spouses
EID Name SID Name
01 David 03 Matt
02 James 01 Rose
03 Jucy

Introduction to Database Management 15

Database Background (continued)

Entities and attributes

Introduction to Database Management 16

sophorn26sun.blogspot.com 8
14-Dec-22

Database Background (continued)

One-to-many relationship

Introduction to Database Management 17

Database Background (continued)

• Data file
– File used to store data
– Computer counterpart to ordinary paper file
• Database
– Structure that can store information about:
• Multiple types of entities
• Attributes of those entities
• Relationships between the entities

Introduction to Database Management 18

sophorn26sun.blogspot.com 9
14-Dec-22

Database Background (continued)

Sample data for Premiere Products


Introduction to Database Management 19

Database Background (continued)

Sample data for Premiere Products (continued)

Introduction to Database Management 20

sophorn26sun.blogspot.com 10
14-Dec-22

Database Background (continued)

Sample data for Premiere Products (continued)

Introduction to Database Management 21

Database Background (continued)

Alternative Orders table structure

Introduction to Database Management 22

sophorn26sun.blogspot.com 11
14-Dec-22

Database Background (continued)

• Entity-relationship (E-R) diagram


– Visual way to represent a database
– Rectangles represent entities
– Lines represent relationships between connected
entities

Introduction to Database Management 23

E-R diagram for the Premiere Products database

Slide 34

24

sophorn26sun.blogspot.com 12
14-Dec-22

Database Management Systems

• Database Management System (DBMS)


– Program, or collection of programs, through which
users interact with a database
• Popular DBMSs: MS-Access, Oracle, PostgreSQL,
MySQL, and SQL Server
• Premiere Products decides to use MS-Access
• Database Design
– Determining the structure of the required database

Introduction to Database Management 25

Database Management Systems


(continued)

Using a DBMS directly

Using a DBMS through another program


Introduction to Database Management 26

sophorn26sun.blogspot.com 13
14-Dec-22

Database Management Systems


(continued)
• Forms
– Screen objects used to maintain, view, and print
data from a database
– DBMS creates forms that Premiere Products needs
• Reports
– DBMS creates reports for Premiere Products based
on user’s answers about the desired content and
appearance of each report

Introduction to Database Management 27

Database Management Systems


(continued)

Part form

Introduction to Database Management 28

sophorn26sun.blogspot.com 14
14-Dec-22

Database Management Systems


(continued)

Orders form

Introduction to Database Management 29

Database Management Systems


(continued)

Parts report

Introduction to Database Management 30

sophorn26sun.blogspot.com 15
14-Dec-22

Database Applications (Database


System)
• Database Applications:
- A computer application whose primary purpose is
to entering and retrieving information
computerized by DBMS.
• Examples: Accounting system, airline reservation
system, student registration, computerized library
system…

Introduction to Database Management 31

Database Processing
• Non-database Approach
- Example of a university database

Introduction to Database Management 32

sophorn26sun.blogspot.com 16
14-Dec-22

Database Processing
(continued)
• Database Approach

Introduction to Database Management Slide 35 33

Advantages of Database Processing


(Database Approach)
1. Getting more information from the same amount
of data Slide 24
2. Sharing data
3. Balancing conflicting requirements
– Database administrator or database
administration (DBA): person or group in charge
of the database
4. Controlling redundancy
5. Facilitating consistency

Introduction to Database Management 34

sophorn26sun.blogspot.com 17
14-Dec-22

Advantages of Database Processing


(continued)
6. Improving integrity
• Integrity constraint: a rule that data must follow in
the database
7. Expanding security
• Security: prevention of unauthorized access
8. Increasing productivity
9. Providing data independence Slide 33

– Data independence: can change structure of a


database without changing the programs that
access the database

Introduction to Database Management 35

Disadvantages of Database
Processing
1. Larger file size
2. Increased complexity
3. Greater impact of failure
4. More difficult recovery

Introduction to Database Management 36

sophorn26sun.blogspot.com 18
14-Dec-22

Introduction to Henry Books Database


Case
• Henry Books
– Book store chain operated by Ray Henry
– Sells used books and remainders
• Henry decided to use database to gather and store
information on:
– Branches
– Publishers
– Authors
– Books

Introduction to Database Management 37

Introduction to Henry Books Database


Case (continued)

Sample branch and publisher data for Henry Books

Introduction to Database Management 38

sophorn26sun.blogspot.com 19
14-Dec-22

Introduction to Henry Books Database


Case (continued)

Sample branch and


publisher data for
Henry Books

Introduction to Database Management 39

Introduction to Henry Books Database


Case (continued)

Sample author data


for Henry Books

Introduction to Database Management 40

sophorn26sun.blogspot.com 20
14-Dec-22

Introduction to Henry Books Database


Case (continued)

Sample book data for


Henry Books

Introduction to Database Management 41

Introduction to Henry Books Database


Case (continued)

Sample data that


relates books to
authors and books
to branches for
Henry Books

Introduction to Database Management 42

sophorn26sun.blogspot.com 21
14-Dec-22

Introduction to Henry Books Database


Case (continued)

Sample data that relates books to authors


and books to branches for Henry Books

Introduction to Database Management 43

Introduction to Henry Books Database Case

E-R diagram for


the Henry Books
database

Introduction to Database Management 44

sophorn26sun.blogspot.com 22
14-Dec-22

Summary

• Problems with nondatabase approaches to data


management: redundancy, difficulties accessing
related data, limited security features, limited data
sharing features, and potential size limitations
• Entity: person, place, object, event, or idea for
which you want to store and process data
• Attribute, field, or column: characteristic or property
of an entity
• Relationship: an association between entities

Introduction to Database Management 45

Summary (continued)
• One-to-many relationship: each occurrence of first
entity is related to many occurrences of the second
entity and each occurrence of the second entity is
related to only one occurrence of the first entity
• Database: structure that can store information
about multiple types of entities, attributes of
entities, and relationships among entities
• Premiere Products requires information about reps,
customers, parts, orders, and order lines
• Entity-relationship (E-R) diagram: represents a
database visually by using various symbols
Introduction to Database Management 46

sophorn26sun.blogspot.com 23
14-Dec-22

Summary (continued)
• Database management system (DBMS): program
through which users interact with a database; lets
you create forms and reports quickly and easily
and obtain answers to questions about the data
• Advantages of database processing: getting more
information from the same amount of data, sharing
data, balancing conflicting requirements, controlling
redundancy, facilitating consistency, improving
integrity, expanding security, increasing
productivity, and providing data independence

Introduction to Database Management 47

Summary (continued)
• Disadvantages of database processing: larger file
size, increased complexity, greater impact of
failure, and more difficult recovery
• Henry Books needs to store information about:
branches, publishers, authors, books, inventory,
and author sequence

Introduction to Database Management 48

sophorn26sun.blogspot.com 24

You might also like