0% found this document useful (0 votes)
14 views

Assignment 6

The document discusses different methods for implementing generalization relationships in a database: using a single table, separate tables for each subclass, a table for the superclass and subclasses, or separate tables for each class. It outlines the advantages and disadvantages of each approach related to normalization, joins, queries, redundancy, and complexity.

Uploaded by

Samia Mahbub
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Assignment 6

The document discusses different methods for implementing generalization relationships in a database: using a single table, separate tables for each subclass, a table for the superclass and subclasses, or separate tables for each class. It outlines the advantages and disadvantages of each approach related to normalization, joins, queries, redundancy, and complexity.

Uploaded by

Samia Mahbub
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Course Title: Database Systems Lab

Course: CSE-414
Assignment-03
Date: 17-01-2024

Author: Samia Mahbub

ID: 21701013
Department: Computer Science and Engineering
Course: CSE-414
Submitted to: Dr. Rudra Pratap Deb Nath
Associate Professor
Department of Computer Science and Engineering
University of Chittagong

1
Contents
1 Question-01 2

2 Question-02 3

1
1 Question-01
Problem Statement:

2
2 Question-02
Problem Statement:

Description: Advantages and Disadvantages of Relation Creation Methods for Generalization Rela-
tionships:

1. Single Table:

Advantages:

Simple: Easy to implement and understand, requiring only one table.

Memory Efficient: Stores all data in a single table,potentially minimizing memory usage.

Efficient for Common Queries: Queries involving attributes shared by all classes are simple and effi-
cient.

Disadvantages:

Null Values: Can lead to many null values for subclass-specific attributes in rows representing other
subclasses.

Query Inefficiency: Queries on subclass-specific attributes require filtering based on the type at-
tribute, potentially impacting performance.

Update Anomalies: Updating shared attributes requires modifying the same data in every row, in-
creasing risk of inconsistencies.

3
2. Table for Each Subclass:
Advantages:

Data Normalization: Eliminates null values and redundancy, improving data integrity.

Reduced Joins: No joins needed for queries within a single subclass.

Disadvantages:

Increased Complexity: Requires more tables and joins, making the schema more complex and po-
tentially harder to manage.

Redundancy: Shared attributes are duplicated in each subclass table, leading to increased storage
requirements.

Join Overhead: Queries involving multiple subclasses require joins across several tables, impacting
performance.

3. Table for Superclass and Subclasses:

Advantages:

Balance between Normalization and Redundancy: Eliminates null values while minimizing data du-
plication compared to separate subclass tables.

Efficient Queries: Offers good performance for both shared and subclass-specific attribute queries.

Disadvantages:

Joins for Shared Attributes: Still requires joins for queries involving shared attributes across the
superclass and subclass tables.

Memory Usage:Might use more memory than a single table due to separate superclass and subclass
tables.

4. Table for Each Class:

Advantages:
Simple Queries: Individual class queries are highly efficient thanks to dedicated tables.

No Joins: Requires no joins for any queries as data is segregated by class.

Disadvantages:

Redundancy and Update Anomalies: Highly redundant data across all tables, leading to increased
storage requirements and risks of update inconsistencies.

Complex Schema: Difficult to manage due to numerous tables and potential for inconsistency when
updating shared attributes.

4
Problem Statement:

You might also like