0% found this document useful (0 votes)
7 views39 pages

Chapter 6

Chapter 6 of the document discusses the relational model of database systems, detailing its structure, key concepts, and properties. It covers database schemas, views, and relational integrity constraints, along with their advantages and disadvantages. The chapter concludes by emphasizing the relational model's significance in database management due to its simplicity and theoretical foundation.

Uploaded by

Faridah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views39 pages

Chapter 6

Chapter 6 of the document discusses the relational model of database systems, detailing its structure, key concepts, and properties. It covers database schemas, views, and relational integrity constraints, along with their advantages and disadvantages. The chapter concludes by emphasizing the relational model's significance in database management due to its simplicity and theoretical foundation.

Uploaded by

Faridah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

ISLAMIC UNIVERSITY IN UGANDA

Bridging Communities

DATABASE SYSTEMS
Chapter 6 : The Relational Model

Dr. Guma Ali


Objectives (1/2)
At the end of the chapter, the student should be able to:
• Describe the structure of relational databases.
• Examine the properties of database relations.
• Define the key concepts in the relational model.
• Explain database schema with relevant examples.
• Define views and state its purposes.
• Define relational integrity constraints.
• Examine the four types of relational integrity
constraints in DBMS. 2
Objectives (2/2)
• List the advantages of the relational model.
• Outline the disadvantages of the relational model.

3
Introduction (1/15)
• The relational model is a way of managing data using a
structure composed of relations (often called tables).
• The relational model is a foundation for DBMS
introduced by E.F. Codd in 1970.
• It is based on organizing data into relations (tables)
composed of rows (tuples) and columns (attributes).
• The primary goal of the relational model is to provide a
high level of data independence and abstraction while
allowing for efficient data manipulation. 4
Introduction (2/3)
• The relational model organizes data into tables, where
each table represents a set of entities, and each row
represents a single entity.
• The columns represent attributes of the entities.

5
Introduction (3/3)

6
Properties of Relations (1/3)

7
Properties of Relations (2/3)

8
Properties of Relations (3/3)

9
Key Concepts in the Relational Model
(1/2)

10
Key Concepts in the Relational Model
(2/2)

11
Database Schema (1/5)
• A database schema describes the structure of a
database.
• It defines the tables, fields, relationships, and
constraints that make up the database.
• Database schemas generally contain information about
table, column names, data types, constraints,
relationships between tables, and user roles.

12
Database Schema (2/5)

13
Database Schema (3/5)
• It provides a clear and concise representation of the
database design and helps ensure that data is stored in a
consistent and organized way.
• A database schema typically includes the following
elements:
 Tables: The individual data entities that make up the
database.
 Columns: The attributes or properties of each table.
14
Database Schema (4/5)
 Relationships: The connections between tables and
how they relate to each other.
 Indexes: Structures used to optimize data retrieval
and speed up queries.
 Constraints: Rules that govern the type and quality
of data that can be stored in the database.

15
Database Schema (5/5)
• Creating a database schema is an important step in
designing a database because it helps ensure that the
database is efficient, scalable, and able to meet the
needs of its users.
• A well-designed schema can also make it easier to
maintain the database over time and reduce the risk of
errors or inconsistencies in the data.

16
Views (1/4)
• A view is a virtual relation that does not necessarily
exist in the database but can be produced upon request
by a particular user, at the time of request.

• A view is a relation that appears to the user to exist, can


be manipulated as if it were a base relation, but does not
necessarily exist in storage in the sense that the base
relations do.

17
Views (2/4)
• The contents of a view are defined as a query on one or
more base relations.
• Any operations on the view are automatically translated
into operations on the relations from which it is derived.
• Views are dynamic, meaning that changes made to the
base relations that affect the view are immediately
reflected in the view.
• When users make permitted changes to the view, these
changes are made to the underlying relations. 18
Views (3/4)
Purpose of Views
• The view mechanism is desirable for several reasons:
 It provides a powerful and flexible security
mechanism by hiding parts of the database from
certain users.
 It permits users to access data in a way that is
customized to their needs, so that the same data can
be seen by different users in different ways, at the
same time. 19
Views (4/4)
 It can simplify complex operations on the base
relations.

20
Relational Integrity Constraints (1/11)
• Relational integrity constraints are rules that are used
to maintain the accuracy, consistency, and integrity of
data in a relational database.
• These constraints ensure that the data in a database
follows a set of rules and guidelines that govern the
relationships between tables and columns.

21
Relational Integrity Constraints (2/11)
• Relational integrity constraints are categorised into:
1. Domain constraints
2. Key constraints
3. Entity integrity constraint
4. Referential integrity constraints

22
Relational Integrity Constraints (3/11)
❑ Domain constraints
• Domain constraint specifies that every attribute is
bound to have a value that lies inside a specific range
of values.
• It can be violated if an attribute value is not appearing
in the corresponding domain or it is not of the
appropriate data type.
• Domain constraints specify that within each tuple, the
value of each attribute must be unique. 23
Relational Integrity Constraints (4/11)
o For example, in the Employee table, if we want to
enter the salary in the whole number, then we can
define the domain Integer on the Salary attribute so
that the attribute accepts only whole numbers.

24
Relational Integrity Constraints (5/11)
❑ Key constraints
• Key constraint states that every relation must contain
an attribute or a set of attributes (primary key) that can
uniquely identify a tuple in that relation.
• The value of the attribute for different tuples in the
relation has to be unique.
o For example, in the Employee table, Employee_ID
is a key attribute.
25
Relational Integrity Constraints (6/11)
o In this attribute, no two values can have the same
Employee_ID.
• This attribute cannot have any Null value.

26
Relational Integrity Constraints (7/11)
❑ Entity integrity constraint
• Entity integrity constraint specifies that the value of the
primary key cannot be NULL.
• If the primary key has a NULL value, you cannot
identify those rows.
• A field other than the primary key field in a relation can
have a NULL value.

27
Relational Integrity Constraints (8/11)
o For example, in the table, Student, suppose rollno is
the primary key.
o The value of rollno cannot be null as it uniquely
identifies each record in the table.

28
Relational Integrity Constraints (9/11)
❑ Referential integrity constraints
• Referential integrity constraints in DBMS are based on
the concept of foreign keys.
• A referential integrity constraint state happens where
relation refers to a key attribute of a different or same
relation.
• A foreign key is an important attribute of a relation
which should be referred to in other relationships.
29
Relational Integrity Constraints (10/11)
• It states that if a given relation refers to a key attribute
of a different or same table, then that key must exist in
the given relation.
o For example, Course and Student are two tables,
and in the Student table, Course_ID is a foreign
key.

30
Relational Integrity Constraints (11/11)

31
Advantages of the Relational Model
(1/2)

32
Advantages of the Relational Model
(2/2)

33
Disadvantages of the Relational Model
(1/2)

34
Disadvantages of the Relational Model
(2/2)

35
Conclusion (1/1)
• The relational model remains one of the most widely
adopted models in database management due to its
simplicity, flexibility, and adherence to a strong
theoretical foundation.
• Its structured approach has set the standard for most
commercial database systems.

36
Reading Lists (1/2)
1. Silberschatz, A., Korth, H. F., & Sudarshan, S. (2020).
Database System Concepts (7th ed.). New York: McGraw-
Hill.
2. Lemahieu, W., Broucke, V. S., & Baesens, B. (2018).
Principles of database management: The practical guide to
storing, managing and analyzing big and small data.
Cambridge University Press.
3. Elmasri, R., & Navathe, S. (2017). Fundamentals of
Database Systems (7th ed.). Pearson India
37
Reading Lists (2/2)
4. Jukic, N., Vrbsky, S., & Nestorov, S. (2016). Database
systems: Introduction to databases and data warehouses.
Prospect Press.
5. Connolly, T., & Begg, C. (2015). Database Systems: A
Practical Approach to Design, Implementation, and
Management (6th ed.). Essex, Harlow, England: Pearson
Education Limited.
6. Hoffer, J. A., Ramesh, V., & Heikki, T. (2013). Modern
Database Management (11th ed.). Boston, U.S: Pearson
Education Limited. 38
39

You might also like