In this course, we will study the relational data model, the concepts related to it-tables, tuple, instances, schema, key, attribute domain and the constraints related to it.
The Relational Model was given by E.F. Codd to model data in the form of tables or relations.
After designing the conceptual model of Database, we convert the conceptual model into the relational model which can be implemented using any RDBMS languages like Oracle SQL, MySQL, etc.
The purpose of the relational model is to provide a method to specify data and queries: users can directly state what information the database contains and what information they want from it.
The database management system software is responsible for describing the data structures for storing the data and retrieval procedures for answering the queries.
A relation can be said to be nothing but a table of values. Every row represents a collection of related data. These rows in the table are used to denote a real-world entity or relationship.
The relational data model is the primary data model.
The relational model is widely used around the world for storing data and processing it. This model is very simple and has all the properties and capabilities required for processing data with storage efficiency.
Consider the relation <STUDENT> having attributes student_id. Student_name, contact, and address.
Each and every column in a Table. Attributes are the properties that are used to define a relation. e.g., Student_name , contact, etc.
The relations in the relational data model are saved in the table format. The relations are stored along with their entities. A table consists of two properties: rows and columns. Rows are used to represent records and columns represent attributes.
It is a single row of a table, which consists of a single record.
A relation schema is used to represent the name of the relation along with its attributes.
The total number of attributes present in the relation is called the degree of relation.
The total number of rows that are present in the Table.
The column describes the set of values for a specific attribute.
Relation instance is a finite set of tuples in the system. Relation instances never contain duplicate tuples.
Every row consists of one, two or multiple attributes, which is known as a relation key.
The scope predefined with every attribute is known as the attribute domain.
While designing the Relational Model the conditions that are defined and which must hold for data present in the database are known as Constraints. These constraints are validated before performing any operation like insertion, deletion, and updation in the database system. If there is any violation in any of the constraints, the operation is terminated or failure occurs.
An attribute is permitted to take only those values that lie inside the domain range. e.g, If a constraint AGE>0 is applied to the relation, on inserting the negative value of AGE the operation will fail.
Every relation in the database must contain at least one set of attributes that can define a tuple uniquely. This set of attributes is called a key. e.g.; id in the Employee table is a key. No two employees can have the same id. So there are two properties of key:
When an attribute in a relationship is only capable of taking values from another attribute of the same relation or any other relation, it is called referential integrity.
|sjkd998||Computer science and eng.|
In this case, the BRANCH_CODE of <STUDENT> table can only take the values which are present in BRANCH_CODE of <BRANCH> table which is referential integrity constraint. The relation which is referencing to the other relation is known as REFERENCING RELATION (which is STUDENT in this case) and the relation to which other relations referred is known as REFERENCED RELATION (which is BRANCH in this case).
A relational data model is simpler and much easier to use than the hierarchical and network model.
The performance of the model id improved as it does not focus on the structure.
The relational model is easy as it contains tables having rows and columns which is quite natural and simple to understand.
We can avoid high complex database navigation.
Without changing any application the structure of the database can be changed.
A large number of records, or rows, and the number of fields can be there.
Some of the relational databases have limits on field lengths which can not be exceeded.
Sometimes the databases can become complex as the amount of data grows, and the relations between data become complicated.
In the case of complex relational database systems, isolated databases can be there, in this the information can not be shared between systems.