Scenario: A car rental company offers different types of vehicles such as cars, trucks, and vans. How would you implement a superclass-subclass relationship to represent this scenario in a database?
- Create separate databases for cars, trucks, and vans
- Create separate tables for each vehicle type
- Implement a superclass-subclass relationship with a vehicle superclass and car/truck/van subclasses
- Use a single table for all vehicles with a column specifying the vehicle type
In this scenario, implementing a superclass-subclass relationship with a vehicle superclass and car/truck/van subclasses is the appropriate approach. It allows common attributes to be stored in the superclass while specific attributes for each vehicle type can be stored in the respective subclasses. This ensures data consistency and facilitates efficient querying.
Loading...
Related Quiz
- _______ is a technique used in NoSQL databases to reconcile conflicting versions of data during eventual consistency.
- A retail company wants to analyze its sales data. It has a fact table containing sales revenue, quantity sold, and discounts applied. What type of information would you expect to find in the corresponding dimension tables?
- In graph databases, edges often have _______ to denote the type or nature of the relationship.
- Which dimension change type in SCD involves creating a new record for each change, thus preserving historical data?
- Conceptual schema design aims to create a high-level __________ of the database.