0% found this document useful (0 votes)
37 views

Relational Models

Relational models

Uploaded by

Muktai Malekar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Relational Models

Relational models

Uploaded by

Muktai Malekar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

RDBMS

UNIT-1

What is Relational Model

The relational model represents the database as a collection of relations. A relation is


nothing but a table of values. Every row in the table represents a collection of related data
values. These rows in the table denote a real-world entity or relationship.

The table name and column names are helpful to interpret the meaning of values in each
row. The data are represented as a set of relations. In the relational model, data are stored
as tables. However, the physical storage of the data is independent of the way the data are
logically organized.

Some popular Relational Database management systems are:

DB2 and Informix Dynamic Server - IBM


Oracle and RDB Oracle
SQL Server and Access - Microsoft

Relational Model Concepts

1. Attribute: Each column in a Table. Attributes are the properties which define a
relation. e.g., Student_Rollno, NAME,etc.
2. Tables In the Relational model the, relations are saved in the table format. It is
stored along with its entities. A table has two properties rows and columns. Rows
represent records and columns represent attributes.
3. Tuple It is nothing but a single row of a table, which contains a single record.
4. Relation Schema: A relation schema represents the name of the relation with its
attributes.
5. Degree: The total number of attributes which in the relation is called the degree of
the relation.
6. Cardinality: Total number of rows present in the Table.
7. Column: The column represents the set of values for a specific attribute.
8. Relation instance Relation instance is a finite set of tuples in the RDBMS system.
Relation instances never have duplicate tuples.
9. Relation key - Every row has one, two or multiple attributes, which is called relation
key.
10. Attribute domain Every attribute has some pre-defined value and scope which is
known as attribute domain
Relational Integrity constraints

Relational Integrity constraints is referred to conditions which must be present for a valid
relation. These integrity constraints are derived from the rules in the mini-world that the
database represents.

There are many types of integrity constraints. Constraints on the Relational database
management system is mostly divided into three main categories are:

1. Domain constraints
2. Key constraints
3. Referential integrity constraints

Domain Constraints

Domain constraints 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, and the value of each attribute must be
unique. This is specified as data types which include standard data types integers, real
numbers, characters, Booleans, variable length strings, etc.

Key constraints

An attribute that can uniquely identify a tuple in a relation is called the key of the table. The
value of the attribute for different tuples in the relation has to be unique.

Referential integrity constraints

Referential integrity constraints is base on the concept of Foreign Keys. A foreign key is an
important attribute of a relation which should be referred to in other relationships.
Referential integrity constraint state happens where relation refers to a key attribute of a
different or same relation. However, that key element must exist in the table.

The diagram given below will show this concept.

In the above example, we have 2 relations, Customer and Billing.

Tuple for Customer ID =1 is referenced twice in the relation Billing. So we know Customer
Name=Google has billing amount $300

Operations in Relational Model

Four basic update operations performed on relational database model are

Insert, update, delete and select.

Insert is used to insert data into the relation


Delete is used to delete tuples from the table.
Modify allows you to change the values of some attributes in existing tuples.
Select allows you to choose a specific range of data.
Codd Rules :

Codd rules were proposed by E.F. Codd which should be satisfied by relational model.
1. Foundation Rule: For any system that is advertised as, or claimed to be, a relational
data base management system, that system must be able to manage data bases
entirely through its relational capabilities.
2. Information Rule: Data stored in Relational model must be a value of some cell of a
table.
3. Guaranteed Access Rule: Every data element must be accessible by table name, its
primary key and name of attribute whose value is to be determined.
4. Systematic Treatment of NULL values: NULL value in database must only correspond
to missing, unknown or not applicable values.
5. Active Online Catalog: Structure of database must be stored in an online catalog which
can be queried by authorized users.
6. Comprehensive Data Sub-language Rule: A database should be accessible by a
language supported for definition, manipulation and transaction management
operation.
7. View Updating Rule: Different views created for various purposes should be
automatically updatable by the system.
8. High level insert, update and delete rule: Relational Model should support insert,
delete, update etc. operations at each level of relations. Also, set operations like Union,
Intersection and minus should be supported.
9. Physical data independence: Any modification in the physical location of a table should
not enforce modification at application level.
10. Logical data independence: Any modification in logical or conceptual schema of a table
should not enforce modification at application level. For example, merging of two
tables into one should not affect application accessing it which is difficult to achieve.
11. Integrity Independence: Integrity constraints modified at database level should not
enforce modification at application level.
12. Distribution Independence: Distribution of data over various locations should not be
visible to end-users.
13. Non-Subversion Rule: Low level access to data should not be able to bypass integrity
rule to change data.

Relational Algebra

Relational algebra is a procedural query language, which takes instances of relations as


input and yields instances of relations as output. It uses operators to perform queries. An
operator can be either unary or binary. They accept relations as their input and yield
relations as their output. Relational algebra is performed recursively on a relation and
intermediate results are also considered relations.
The

Select
Project
Union

You might also like