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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:09:40+00:00 2026-05-30T22:09:40+00:00

I am developing an appointment system which has the following tables(see the attached picture).

  • 0

I am developing an appointment system which has the following tables(see the attached picture). The table tblScheduleDates has some fixed dates for the appointments during the year that are entered at the beginning of the year, For example 28/02/2012,1/03/2012,4/3/2012 etc. and the tblscheduleTimes has some fixed Times for those appointments. So for example on 28/02/2012 the available times are 10:00,11:00,12:00 etc. The tblBookings is when an appointment is scheduled taking the fixed date and the fixed time and the booking status take values booked or canceled. I want to try to write a stored procedure to return the remaining Available dates and times from tblscheduledates and tblscheduleTimes. So i am thinking somehow the fixed dates and times have to be checked if they are exist in the tblbookings and if they are not to be returned by the stored procedure. Any ideas or help are welcome Database Schema

  • 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-30T22:09:42+00:00Added an answer on May 30, 2026 at 10:09 pm

    Is ScheduleTime linked to ScheduleDates? The schema as far as you have it seems like you will either have A LOT of duplicate data, or just plain wrong data.

    It looks like your PK/FK mapping of time to date is not displaying correctly. The link points type to time. But, the scheduletimeid is in the scheduledates?

    If the values are right:


    SELECT tblScheduleDates.*, tblScheduleDates.* 
    FROM tblScheduleDates
        JOIN tblScheduleTimes
            ON tblScheduleTimes.scheduleTimeID =
                tblScheduleDates.scheduleTime_ID
    WHERE NOT EXISTS 
        (
            SELECT 1 
            FROM tblBookings 
                JOIN tblBookingStatus
                    ON tblBookingStatus.Status = 'Booked'
            WHERE tblBookings.ScheduleDate_ID 
                = tblScheduleDates.scheduleDateID
        ) 
    

    I would suggest renaming the table as it seems to really be a schedule date and time mixed together. A solution similar to my second bullet below would solve this misnaming.

    If the links in the diagram are right:


    Maybe I am missing something, but here is what I see:

    The booking table is only tied to the scheduleddate. However, this scheduled date has a type which ties to a time. Is this so that you can have a type that is an all day schedule? Otherwise, every booking on 28/02/2012 will need to create a new entry into the SchedulDates. So, you could have 5 rows for the same date, only because they have different times? I do not see a need to store the date 5 separate times when it is really the times that are different.

    • Why not have the booking tie to a scheduledate AND scheduletime? This will also make your query much easier.

    • Or, you could have a mapping table that is scheduleddateANDtime that ties the two together, and then you only need to reference that one table in the booking?

    • Or, you could just store date and time together in one table?

    Maybe there is a business reason that I am missing, though.

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

Sidebar

Related Questions

Developing a brand new schema/app which uses hibernate to create tables from pojo's. My
Developing a project of mine I realize I have a need for some level
When developing an ERP-like software or any other complex business system, what resources do
When developing an application which mostly interacts with a database, what is a good
Developing rails has become lots of fun over the year that I've done it,
Developing search utility to search a file entire computer system, works fine on windows
Developing an app where all tabular data is returned as an object. Some cells
Developing with Google Maps v3. For some sort of reason, my custom marker icon
Developing a Struts 2 app I run in a following problem. I need to
Developing a site that requires monthly subscriptions via PayPal. If a buyer has an

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.