Structure of Relational Model
Structure of Relational Model
Institute
of
Technology
By
5. Foreign Key:
•Definition: A foreign key is a column (or set of columns) in one table that establishes a
link to the primary key in another table.
•Role: Foreign keys create relationships between tables, enabling the relational aspect of
the database.
•Example: An OrderID column in an "OrderItems" table might be a foreign key that links
to the OrderID primary key in an "Orders" table.
Structure of Relational Model:
Indexes:
•Definition: Indexes are special database objects that improve the speed of data retrieval
operations on a table.
•Role: Indexes help the database quickly locate data without having to scan every row in a
table.
•Example: An index on the CustomerID column in the "Customers" table would speed up
queries searching for a customer by their ID.
7. Relationships:
•One-to-One: A single row in one table is associated with a single row in another table.
•One-to-Many: A single row in one table is associated with multiple rows in another table.
•Many-to-Many: Multiple rows in one table are associated with multiple rows in another
table, typically managed through a junction table.
•Example: In an "Orders" table, a CustomerID foreign key might establish a one-to-many
relationship with the "Customers" table, indicating that each customer can place multiple
orders.
Structure of Relational Model:
• Schemas:
• Definition: A schema is a logical container for database objects like tables, views, andMadhav
Institute
indexes. of
Technology
• Role: Schemas help organize and group related objects within the database, often &
Science
reflecting different areas or modules of the application. Gwalior (M.P.)
(Deemed
• Example: A database for an e-commerce platform might have schemas for "Sales", University)
"Inventory", and "CustomerService".
• 9. Constraints:
• Not Null: Ensures that a column cannot have NULL (empty) values.
• Unique: Ensures that all values in a column are unique across rows.
• Check: Ensures that all values in a column meet a specific condition.
• Default: Automatically assigns a default value to a column if no value is provided.
• Foreign Key Constraint: Ensures referential integrity by restricting actions that
would break links between tables.
Structure of Relational Model:
•Relationships:
Madhav
•Relationships define the associations or interactions between entities. For example, a Institute
of
Student enrolls in a Course. Technology
•Relationship Set: A collection of similar relationships. For instance, the set of all &
Science
instances where students enroll in courses. Gwalior (M.P.)
(Deemed
•Degree of Relationship: University)
Thank You
Science
Gwalior (M.P.)
(Deemed
University)