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 9242017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:29:32+00:00 2026-06-18T08:29:32+00:00

Hi I’m newbie in Programming especially in Database Design. I’ve just started to work

  • 0

Hi I’m newbie in Programming especially in Database Design.
I’ve just started to work with database and I wonder to know Which one of these designs give me better performance and are more rational.
I have built reservation Hotel table Like these:

Set DateIn and DateOut for each Resevation
Set DateIn and DateOut for each Resevation

Set Flag for each Room/Day
Set Flag for each Room

Hypothetically we have max 100 rooms so if I want to generate table(for 50 years) for second picture approximately It takes 15MB((100(room)*8(bit)+3(Date))*365(Day)*50(year)) of capacity but I think when I want to query, it gives me better performance.
query of first picture is more complex and I think less performance
I would Appreciate if you give me the reason or better approach.
Thanks in Advance

  • 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-06-18T08:29:34+00:00Added an answer on June 18, 2026 at 8:29 am

    I mean, It really has to do more with how you’re planning on accessing and altering the data. I’d recommend the first one in pretty much every case, but I won’t deny there may exist edge cases where the second is better. I doubt yours is such a case.

    The first provides a more reasonable approximation for how people think about reservations (which is good) – it also subtly encodes who is going to be staying in which rooms on which days, connecting it relationally to the rest of your DB with thinks like reservation information, guest information. These provide you with the ability to re-imagine data relationships down the line when you’re attempting to glean insight from the data you’re collecting. For instance. After ten years, what would you do if the CEO said “Hey, what have been our historically most popular dates of the year? With the ‘Reservation’ model, you could easily write a programmatic query to find that out. With the ‘Date/Room Matrix’ model, you’re going to have to manually check every single column. Gross.

    While the second model is great for a hotel that never plans to change, what if rooms need to be placed in and out of rotation? Another 100 column table with booleans for which rooms are available to the public on which days? Conflating occupied with out of order? What if you add a wing? Are you going to add another 25 columns to this table, etc etc? It will likely offer you some operational efficiency for “Which rooms are available right know?” – but how would you structure a query for “Which rooms will be available from August 3rd through sixth?”

    Remember that in a relational database, you’re selecting a specific set of rows based on what the values in their columns are, you’ll have a much harder time selecting a set columns basted on what their row values are.

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

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.