Database design is the process of structuring a database schema to efficiently store, manage, and retrieve data while minimizing redundancy and ensuring relationships between entities are properly maintained.
city_id, city_name, state
user_id, user_name, city_id
Requirement Analysis:
Entity | Description |
---|---|
User | Can book, review, and wishlist hotels |
Hotel | Listed by owners, has many rooms |
Room | Belongs to a hotel, multiple categories |
Booking | Represents a user booking a room |
Review | Represents a user’s review for a hotel |
Wishlist | Represents a user’s bookmarked hotels |
Room Category | Type of room (Standard, Deluxe, Suite, etc.) |
City | Represents all cities |
State | Represents all states |
Notation:
1 : N
= One to ManyN : 1
= Many to OneM : N
= Many to Many