Relational Model
The Relational Model is the most widely used data model in DBMS.
It represents data in the form of tables (relations) consisting of rows and columns.
1. What is Relational Model?
The relational model organizes data into relations (tables). Each table consists of tuples (rows) and attributes (columns).
- Simple and easy to understand
- Based on mathematical relations
- Uses SQL for data manipulation
2. Basic Terminology
Relation β Table Tuple β Row Attribute β Column Degree β Number of attributes Cardinalityβ Number of tuples
3. Example of a Relation
STUDENT +---------+--------+-------+ | RollNo | Name | Marks | +---------+--------+-------+ | 101 | Amit | 78 | | 102 | Riya | 85 | | 103 | Suman | 72 | +---------+--------+-------+ Degree = 3 Cardinality = 3
4. Domains
A domain defines the set of valid values that an attribute can take.
- RollNo β Integer
- Name β Character string
- Marks β Integer (0β100)
5. Relational Schema
A relational schema defines the structure of a relation including its name and attributes.
STUDENT (RollNo, Name, Marks)
6. Properties of Relations
- No duplicate tuples
- Order of rows and columns does not matter
- Each attribute has atomic values
- Unique attribute names
7. Keys in Relational Model
Keys are used to uniquely identify tuples in a relation.
- Super Key
- Candidate Key
- Primary Key
- Foreign Key
STUDENT RollNo β Primary Key
8. Integrity Rules
- Entity Integrity: Primary key cannot be NULL
- Referential Integrity: Foreign key must match primary key
9. Advantages of Relational Model
- Simple structure
- Flexible querying using SQL
- Strong data integrity
- Easy database maintenance
10. Limitations of Relational Model
- Performance issues with very large databases
- Not ideal for complex multimedia data
- Requires joins for related data
Practice Questions
- Define relational model.
- Explain basic terminology of relational model.
- What is degree and cardinality?
- Explain integrity rules.
- List advantages of relational model.
Practice Task
Design relations for a library system and identify:
β Relations
β Attributes
β Primary keys
β Foreign keys