Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:27:37+00:00 2026-05-28T08:27:37+00:00

I want to model the following scenario in the database: I have a Package,

  • 0

I want to model the following scenario in the database:

I have a Package, comprising of independent Activities and Hotel:

Package P:

  • Activities A1, A2, A3
  • Hotel H

Activities and Hotel are independent entities which have their own price defined at the time of definition of entity.

When an entity is added to the package, it’s price can be changed (only specific to the package). Hence, every package would have a unique price for the activities/hotels.

E.g.
(Defining activities and hotel):

A1 - 10$
A2 - 20$

H1 - 100$

(Adding activities and hotel to package):

Package p;
p.addActivity("A1", 15);
p.addActivity("A2", 25);
p.addHotel("H1", 50);

yields => 

p
 - A1 - 15
 - A2 - 25
 - H1 - 50

Database Side:

Definition:

  • Activity:

    Activity-id, StartDate, EndDate, Price

  • Hotel:

    Hotel-id, StartDate, EndDate, Price

After adding to package

  • Package table:

Package-id, Hotel-id, Activity-id

  • Package-Activity price table:

    Package-id, Activity-id, Price //package-id and activity-id serve as unique key

  • Package-Hotel price table:

    Package-id, Hotel-id, Price //package-id and hotel-id serve as unique key

I need some feedback on the design that I’ve come up with.
Have I over complicated this ? Is there a simpler/better way to do this ?
Also, as I was writing this, I figured a package can have many Hotels and Activities, so will need to factor that in here.
Have I fragmented this too much since, for each price lookup of an entity I will be performing a join ?

EDIT

Found a relevant link on performance with Joins: When and why are database joins expensive?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:27:38+00:00Added an answer on May 28, 2026 at 8:27 am

    You actually do need five tables here.

    You have three entities: activities, hotels, and packages (assuming each package has some data which is not hotel- or activity-related). You have two relationships, both many-to-many, namely package-hotel and package-activity. Each relationship row is annotated with a particular price.

    Five tables is the way to go. No, having to do a join is not a problem: it’s better than having non-normal data. You can denormalize for performance later if necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in my Student model. I want to track the date
I want a Django model to have a date field in which the year,
Referring to this question, let's say we have the following scenario - A model
I have to deal with (a variation of) the following scenario. My model classes
I have the following scenario. I have the Edit/Employee view populated with a model
Consider the following scenario: You have an account model You have an external service
The scenario is the following: I have a java package ( myapp.config ) that
The scenario Suppose I have the following two model classes: public class ProductColor {
Given the following model, I want to index the fields (sequence,stock) class QuoteModel(models.Model): quotedate
I want to achieve the following hierarchical navigation model in a WPF MVVM application:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.