0% found this document useful (0 votes)
3 views3 pages

Session 3

Chapter 10 discusses managing multiple tables in a database, including editing, deleting, and renaming tables, as well as establishing relationships to prevent data redundancy. It outlines the types of relationships (One-to-One, One-to-Many, Many-to-Many) and the importance of referential integrity for maintaining data consistency. The chapter also provides steps for creating and removing relationships between tables in LibreOffice Base.

Uploaded by

Sumit Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Session 3

Chapter 10 discusses managing multiple tables in a database, including editing, deleting, and renaming tables, as well as establishing relationships to prevent data redundancy. It outlines the types of relationships (One-to-One, One-to-Many, Many-to-Many) and the importance of referential integrity for maintaining data consistency. The chapter also provides steps for creating and removing relationships between tables in LibreOffice Base.

Uploaded by

Sumit Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 10: Working with Multiple Tables - Notes

1. Introduction
→ After creating a table in a database, you may need to edit or delete it.

→ When working with more than one table, you often have to set up relationships between
tables to avoid data redundancy and inconsistency.

→ Once relationships are set, updating or adding a record in one table can automatically
reflect in related tables.

2. Editing, Deleting & Renaming Tables


Editing a Table:

→ Open the Database UI window.

→ Select the table object in the database pane.

→ Right-click the table name → select Edit from pop-up menu.

→ The design-view window opens.

→ Make required modifications (add/delete/modify fields).

→ Save the table.

Deleting a Table:

→ Open database UI window.

→ Select the table object.

→ Right-click the table name → select Delete.

→ Confirm deletion.

Renaming a Table:

→ Right-click the table name.

→ Select Rename option.

→ Type new name → Press Enter.


3. Relationships between Tables
→ Helps manage multiple tables effectively and avoid redundancy.

→ Example: Student_Details (master) and Student_Result (transaction).

→ Common field (e.g., Admission_No) must have the same data type.

→ Master table = holds primary key.

→ Transaction table = holds foreign key.

4. Types of Relationships
→ One-to-One: One record in master ↔ one record in transaction.

→ One-to-Many: One record in master ↔ multiple records in transaction.

→ Many-to-Many: Multiple records in master ↔ multiple records in transaction.

5. Advantages of Relating Tables


→ Prevents data redundancy.

→ Maintains referential integrity.

→ Restricts entry of invalid data.

→ Updates in master reflect in related tables.

6. Creating Relationships between Tables (in LibreOffice Base)


→ Click: Tools → Relationships…

→ Relationship Design screen appears.

→ Add Tables dialog box opens.

→ Select tables → click Add → close dialog.

→ Drag common field from one table → drop in other table.

→ Line appears indicating relationship.

7. Removing Relationships
→ Right-click the relationship line → select Delete.

8. Referential Integrity
→ Ensures accuracy and consistency of data.

→ Example: If Admission_No=1001 deleted from master, it must not exist in transaction


table.
Options:

→ No action: prevents delete/update if related records exist.

→ Update cascade: updates/deletes reflected in related tables.

→ Set NULL: related fields set to NULL.

→ Set default: related fields set to default value.

9. Summary
→ Relationships control redundancy and inconsistency.

→ Common field must exist in both tables.

→ Three relationship types: One-to-One, One-to-Many, Many-to-Many.

→ Referential integrity ensures consistency of database.

You might also like