Scenario: An online store has various types of products, including electronics and clothing. Each product has common attributes like name and price, but they also have specific attributes. How would you design the database schema for this scenario?
- Create separate tables for each product type
- Implement a superclass-subclass relationship with a product superclass and electronics/clothing subclasses
- Use a NoSQL database instead of a relational database
- Use a single table for all products with nullable columns for specific attributes
To design the database schema for this scenario, a superclass-subclass relationship with a product superclass and electronics/clothing subclasses is ideal. This allows common attributes like name and price to be stored in the superclass while specific attributes can be stored in the subclasses. It provides flexibility and scalability in the database design.
Loading...
Related Quiz
- The process of removing redundant data and ensuring data integrity in a database is known as _______.
- How is cardinality different from modality in an ERD relationship?
- How does compression affect data retrieval speed in a database system?
- What does the term "weak entity" refer to in an ERD?
- ER diagram tools support _______ engineering to transition between conceptual and logical database designs.