Relational Data Model In DBMS

  1.  
  2.  

Relational Data Model In DBMS

The relational data model provides a framework for organizing data into a structured format. This data model was proposed by E.F. Codd in 1970. It is the most widely used in modern DBMS. It collects data into tables(consisting of rows and columns). These tables are relations, rows are tuples and columns are attributes. Each table represents an entity, and the relationships between these entities are organized through foreign keys. This model can be implemented using any RDBMS language like Oracle SQL or MySQL.

relational data model

Finally can say the relational data model uses a collection of tables to represent data and the relationships among those data using key constraints.

Main Key Term Use In Relational Model:

  • Domain: It is a set of atomic values that an attribute can take.
  • Attribute: It is the name of a column in a table. Each attribute must have a domain, for example, the Student table has SID, Roll no, Name, and Class.
  • Degree: It refers to the total number of attributes that are there in the relation. The STUDENT relation defined here has Degree 4. (In the above picture sid, roll no, name, class)
  • Cardinality: It refers to the total number of rows in a table. The STUDENT relation defined here has cardinality 5. ( In above picture total record s01,s02,s03,s04,s05)
  • Relational instance: It is represented by a finite set of tuples. it doesn’t have duplicate tuples. The set of tuples of a relation at a particular instance of time is called a relation instance.
  • Relational schema: It contains the name of the relation and the name of all columns or attributes, for example, sid, roll no, name, and class.
  • Relational key: Each row has one or more attributes. that can identify the row in the relation uniquely.
       Types of keys used in this model
  1. Primary Key(unique Key)
  2. Candidate Key(Ability to make Unique key)
  3. Super Key,
  4. Foreign Key(Uniquely Identified in another table)
  5. Alternate Key,
  6. Composite Key
  • Tuple: Each row in the relation is a tuple.
  • Columns, Rows, Null Value.

Constraints in the Relational Model

In the relational model, constraints are rules that control the integrity and consistency of data in a database. These parameters ensure that data meets certain conditions, prevent errors, and maintain the integrity of stored data. Let’s examine the different types of constraints commonly used in relational models:

  1. Domain Constraints
  2. Key Constraints
  3. Entity Integrity Constraint
  4. Referential Integrity Constraint
  5. Check Constraint
  6. Not Null Constraint
  7. Default Constraint
  8. Tuple Uniqueness Constraint
  9. Assertion Constraint

1. Domain Level Constraints:

This is column-level (attribute) level constraints. Each attribute in a table is associated with a specific domain. An attribute can only hold values that fall within the defined domain range. for example, the AMOUNT column has a domain constraint that can AMOUNT>1000 if in this field insert 900 it will not accept.

2. Key Constraints

Key constraints ensure that each row in a table can be uniquely identified by a key. The purpose of key constraints in dbms. it maintains the uniqueness and relationship integrity of data within and across tables.

There are several types of key constraints:
  1. Primary Key Constraint: Ensures unique and non-null values in a set of columns.
  2. Unique Key Constraint: Ensures that values set of columns are unique across the table.
  3. Foreign Key Constraint: Ensures that a value in one table corresponds to a value in another table. foreign key constraint maintaining referential integrity.

for example STUDENT table has an SID Column which is the primary key field, this column field accepts unique values in this field.

3. Entity Integrity Constraint

it ensure that every table has a primary key and that column field can not have null values. this ensures that each record in the table is uniquely identifiable.
The purpose of this constraint is all rows in a table have a unique identity, for example, STUDENT table, the SID column field has a primary key that can not have a null. it ensures each student is uniquely identified.

4. Referential Integrity Constraint

These integrity constraints ensure that a foreign key value in one table matches a primary key value in another table, this maintains the logical link between two tables.
purpose of this constraint it make valid relationships between tables and prevent orphaned records. It means a record whose foreign key value references a non-existent primary key value.

5. Check Constraint

check constraint makes valid rules for accepting column value in a field. it allows the database to accept only specific criteria values in columns. purpose of this constraint it enforce domain-specific business rules within a column. for example STUDENT table FEE “CHECK(FEE>0)” column accept only positive value.

6. Not Null Constraint

Not-null constraint ensures that a column field cannot have a null value. The purpose of this is that the field always contains valid data for example STUDENT table NAME field always has a student name, which can not be a null field.

7. Default Constraint

A default constraint provides a default value for a column when no value is inserted in a column field. purpose of this it automatically inserts the default value in the column field when no value is inserted by user in the column field.
for example STUDENT table if the admission date is not inserted in the ADMISSION DATE filed, the current date is automatically inserted in this field.

8. Tuple Uniqueness Constraint

This constraint makes sure that no two rows in a table have the same values in certain columns. purpose is to prevent duplicate record in a table based on specified column field.
for example, in a REGISTER table, a uniqueness rule on the combination of SID(student ID) and CID(class ID) makes sure that a student can’t register for the same class more than once.

9. Assertion Constraint

An assertion constraint checks complex conditions across multiple tables. We often use assertions to handle complex rules that other constraints can’t enforce. For example, an assertion might ensure that the total fee of all students in a school does not exceed a certain amount.

Advantages of Relational Data Model

  1. Data Independence: this facility provides the structure of the database that can change without affecting the applications that use it. This separation of concerns allows for easier maintenance and updates to the database schema.
  2. Data Integrity and Accuracy: Using key constraints, ensures that data is consistent and accurate, errorless. For example, foreign key constraints prevent the entry of invalid data, maintaining the integrity of relationships between tables.
  3. Standardization: It uses SQL standardized language for database queries.
  4. Flexibility: This model is highly flexible allowing users to create complex queries that can retrieve, manipulate, and analyze data in various ways easily.
  5. Scalability: Relational databases can handle large volumes of data, making them suitable for small applications and large enterprise systems alike.

6. Secure model, simple model, and easily operational.

Disadvantages of the Relational Data Model

1. Cost: setup and maintenance in the relational model is costly. operation like hardware, software, regular backup, etc.
2. Rigidity: any significant changes in database schema need careful planning. It can disrupt the normal database operation.
3. Limitation with unstructured data: can not be successful for unstructured data like documents, and images.
4. Complexity with Large Datasets: As the amount of data increases in a database, queries can become more complex and take longer to process, which may slow down the system. it is not good for large databases.
Due to the complex structure, the response time for queries is high.

Conclusion:

The data relationship model has stood the test of time and has proven to be a powerful and useful framework for managing data across a variety of applications. Its emphasis on data integrity, flexibility, and scalability makes it the first choice for organizations worldwide. While it faces challenges in the era of big data and inappropriate content, continuous innovation continues to enhance its capabilities, ensuring it remains relevant in data management in the coming year.

Click For the Online Video Class Playlist 

What is the Relational Model?

The relational data model provides a framework for organizing data into a structured format. It uses a collection of tables to represent data and the relationships among those data using key constraints.

What terminology is used in the relational model?

Domain, attribute, tuple, degree, cardinality, relational schema, relational instance, relational key.

How many types of keys are used in the relational model?

Primary key, composite key, alternate key, foreign key, super key

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *