You are on page 1of 23

AIS615 CHAPTER 4

Relational Databases
LECTURED BY,
Nur Afiqah

• Fifteenth Edition, Global Edition


• Copyright © 2018 Pearson Education, Ltd. All Rights Reserved
LEARNING OUTCOMES
Students must be able to….

Explain database
Explain the importance and systems, including Describe what a relational
advantages of databases, logical and physical database is, how it
as well as the difference views, schemas, the organizes data, and how
between database and data dictionary, and to create a set of well-
file-based legacy DBMS languages. structured relational
systems. database tables.
WHAT IS A DATABASE?
3

Efficiently and centrally


coordinates information for a
related group of files

A file is a related group of records

A record is a related group of


fields

A field is a specific attribute of


interest for the entity
(record)

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Figure 4.1 File-Oriented Systems versus 4

Database Systems

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Copyright © 2021 Pearson Education Ltd.
Using Data Warehouse for 5

Data Analytics
• Data warehouse is one or more very large databases
containing detailed and summarized data for a number of
years used for analysis rather than transaction processing.
• Analyzing large amounts of data for strategic decision making
is referred to as data analytics.
– In data analytics, one can find a vast array of sophisticated
tools that allow for multidimensional analysis, complex
calculations, data projections, and simulations.

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
6

ADVANTAGES OF DATABASES

Data is integrated Minimize data


redundancy and
inconsistencies

Data sharing

Data is
independent
of the
programs that
Data is easily accessed for use the data
reporting and cross-
functional analysis
www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
DATABASE USERS AND DESIGNERS
7

Different users of the database


A information are at an external level
of the database. These users have
logical views of the data.
At an internal level of the database is the
physical view of the data which is how B

the data is actually physically stored in


the system. Designers of a database need to
understand user’s needs and the
C
conceptual level of the entire
database as well as the physical
view.
www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
SCHEMES
8

Conceptual-level Internal-level
organization wide low level view
view

External-level

individual
user’s view
www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Figure 4.5 Three Levels of Schemas 9

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Copyright © 2021 Pearson Education Ltd.
Access Rights 10

• Access rights are permissions granted to create, read,


update, and delete data, database records, or data files.
• There are four basic access rights that can be granted in a
subschema:
– Create (C), Read (R), Update (U), and Delete (D)
• These access rights are imposed at the database level, not at
the application level

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Copyright © 2021 Pearson Education Ltd.
DATABASE DESIGN
11

To design a database, you DATA


need to have a DICTIONARY
Business
conceptual view of the The data dictionary is a
entire database. The “blueprint” of the
conceptual view structure of the
illustrates the different database and includes
files and relationships data elements, field
between the files. types, programs that
DESIGN A use the data element,
DATABASE Design outputs, and so on.

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
DBMS LANGUAGES
12

Data Definition Data Manipulation Data Query


Language (DDL) Language (DML) Language (DQL)
• Builds the data dictionary Changes the content in the Enables users to retrieve,
• Creates the database database sort, and display specific
• Describes logical views >Creates, updates, data from the database
for each user insertions, and deletions
• Specifies record or field
www.yourcompany.com
security constraints © 2017 The Worthy PowerPoint Presentation.
RELATIONAL DATABASE
13

2
1
Although the
A Collection of conceptual view
two-dimensional appears to the
tables with each user that this
table representing information is in
the object about one big table, it
which we wish to really is a set of
collect and store tables that relate
information. to one another.

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
CONCEPTUAL VIEW EXAMPLE 14

Customer Name Sales Invoice # Invoice Total


D. Ainge 101 $1,447
G. Kite 102 $4,394
D. Ainge 103 $ 898

G. Kite 104 $ 789


F. Roberts 105 $3,994

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
RELATIONAL DATA TABLES (1 OF 2)
15

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
RELATIONAL DATA TABLES (2 OF 2)
16

• Primary Keys
• Foreign Key (Customer # is a Foreign key in
the Sales table because it is a Primary key that
uniquely identifies Customers in the
Customer table). Because of this, the Sales
table can relate to the Customer table (see
red arrow above).

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
WHY HAVE A SET OF RELATED TABLES?
17

Update Insert
anomaly Data stored in one large table can be
redundant and inefficient causing the anomaly
1 following problems:
3

Delete
2
anomaly
www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
RELATIONAL DATABASE DESIGN RULES
18

• Every column in a row must be single valued


• Primary key cannot be null (empty) also known as entity integrity
• If a foreign key is not null, it must have a value that corresponds to the
value of a primary key in another table (referential integrity)
• All other attributes in the table must describe characteristics of the object
identified by the primary key
• Following these rules allows databases to be normalized and solves the
update, insert, and delete anomalies.
www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Two Approaches to Database Design 19

• One way to design a relational database, called normalization,


begins by assuming that everything is initially stored in one
large table.
• In an alternative design approach, called semantic data
modeling, the designer uses knowledge of business processes
and information needs to create a diagram that shows what to
include in the database.

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
Copyright © 2021 Pearson Education Ltd.
QUERIES
20

Users may want specific


information found in a
relational database and not
have to sort through all the
files to get that information.
So they query (ask a
question) the data. An example of a query
might be: What are
the invoices of
customer D. Ainge and
who was the
salesperson for those

QUERIES
invoices?
QUERIES

www.yourcompany.com
© 2017 The Worthy PowerPoint Presentation.
CREATING THE QUERY

Copyright © 2018 Pearson Education, Ltd. Chapter 4: Relational Databases Slide 1 - 21


QUERY ANSWER

Copyright © 2018 Pearson Education, Ltd. Chapter 4: Relational Databases Slide 1 - 22


• Update anomaly

KEY TERMS
• Insert anomaly
• Delete anomaly
• Relational database
• Entity integrity rule
• Referential integrity rule


Normalization
Semantic data modeling
• External-level schema
• Subschema
THANK
YOU
• Database • Internal-level schema
• Database management system (DBMS) • Data dictionary
• Database system • Data definition language (DDL)
• Database administrator (DBA) • Data manipulation language (DML)
• Data warehouse • Data query language (DQL)
• Business intelligence
• Report writer
• Online analytical processing (OLAP)
• Data model
• Data mining
• Record layout • Relational data model
• Logical view • Tuple
• Physical view • Primary key
• Schema • Foreign key
• Conceptual-level schema

You might also like