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

  • SEARCH
  • Home
  • 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 7513427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:11:03+00:00 2026-05-30T00:11:03+00:00

I want to design a database structure for a hotel reservation system. My schema:

  • 0

I want to design a database structure for a hotel reservation system.

My schema:

client (
  client_id, 
  lastname
)

reservation (
  reservation_id, 
  client_id,
  checkIndate,
  roomno
)

My problem is in the check-in part. I have already created a reservation; do I still need to create a check-in table? If so, what should its schema be?

There are two ways customers can enter a hotel:

  1. by reservation (reserving a room prior to arrival) or
  2. by checkIn (goes to the hotel without reservation)

How Do I store the records that are checked-IN in the hotel??

  • 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-30T00:11:05+00:00Added an answer on May 30, 2026 at 12:11 am

    Just a couple of thoughts. I notice that “roomno” is a field in the “reservation” table. I assume then that you also have a “room” table, which has “roomno” as its primary key and whatever other data that you might keep track of on a room (phone_number, number_of_beds, etc…).

    What I would do, is create a table called “Occupancy”. This table would have three fields “client_id”, “roomno”, and checkin_time. “client_id” and “roomno” would both be foreign keys (to the client and room tables, respectively). To ensure uniqueness, I’d concatenate them both to make the primary key (after all, you could have one client buy two rooms).

    When the client checks-out, you would remove that row from the “Occupancy” table. You’ll want to archive that row in another table (“history”, “pastStays”…something like that) where you’ll also want to log the “checkout_time”.

    In terms of the changes that I have suggested or assumed, here is how they’d look:

    table: Room
    roomno INT
    phone_number INT
    number_of_beds INT
    smoking_allowed BOOLEAN
    
    table: Occupancy
    client_id BIGINT (FK referencing Client) (part of PK)
    roomno INT (FK referencing Room) (part of PK)
    checkin_time DATETIME
    
    table: pastStays
    client_id BIGINT (FK referencing Client) (part of PK)
    roomno INT (FK referencing Room) (part of PK)
    checkin_time DATETIME
    checkout_time DATETIME
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I want to design a database for a community site with blogs, photos,
I'm trying to design a system which reports activity events to a database via
I want to design a database which will keep record for financial transaction.I want
I've made database design for a small CRM system. It comprises of Companies and
I'm new to database design, and I haven't found a definitive way to structure
I want to design a database which is described as follows: Each product has
I want design my startup screen with progress bar. But I don't how to
That's my question, I want design all the interface of my application within an
I want to design a web page with a banner and an iframe. I
I want to design a c# program which can run program a 3rd exe

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.