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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:51:21+00:00 2026-06-17T06:51:21+00:00

The system is as such. Tutors provide their availability (Monday – Sunday) and the

  • 0

The system is as such. Tutors provide their availability (Monday – Sunday) and the time frame they are available on that day (0700 – 1400) (ie: 7am – 2pm).

I am trying to figure out the best way to store and search through this information to find available tutors. Searching only needs to be done on a daily system (ie: day of the week – mon, tues, wed, etc).

My planned infrastructure:

//Tutor Availability
---------------------------------------------------------------------------
  tutorID  |  monday   |  tuesday  | wednesday  | thursday   |   friday   |
---------------------------------------------------------------------------
   27      | 0700-1200 |   NULL    | 1400-1800  |  NULL      |    NULL    |
---------------------------------------------------------------------------
   35      |   NULL    | 1400-1600 |    NULL    |  NULL      | 1100-1900  |

//Scheduled tutor sessions
------------------------------------
  tutorID  |    day    |  time     | 
------------------------------------
   27      |  monday   | 0700-0900 | 
------------------------------------
   35      |  friday   | 1300-1500 |

Query: SELECT tutorid FROM tutoravailability WHERE 'monday'=… is available between 0900-1100 and is not in scheduled tutor session.

I have been searching forever about how I can search through (and store) these time intervals in MySQL. Is this the best way to store the time intervals of a 24 hours day? Will it even be possible to search between these intervals? Am I approaching this from the wrong way? Any insight is appreciated.

Updated Infrastructure

//Tutor Availability
-----------------------------------------------------
  tutorID  |  day   | start_time | end_time  |  PK  | 
-----------------------------------------------------
   27      |  mon   |   0700     |   1200    |  1   |
-----------------------------------------------------
   27      |  fri   |   1400     |   1800    |  2   |
-----------------------------------------------------
   35      |  tue   |   1100     |   1600    |  3   |
//Scheduled tutor sessions
--------------------------------------------------------
  tutorID  |    day    |  start_time | end_time  |  PK |
--------------------------------------------------------
   27      |    mon    |     0800    | 1000      |  1  |
--------------------------------------------------------
   27      |    fri    |     1600    | 1800      |  2  |

So with this system it will be much simpler to search for available times. However I am still at a loss as to how to compare the availability against the scheduled lessons to ensure no overlap.

SELECT tutorID 
FROM tutoravailability WHERE day = 'fri' 
AND start_time <= '1400' 
AND end_time >= '1530'

Now I don’t understand how I would compare this query against the Scheduled tutor sessions table to avoid duplicate bookings.

Final Update

To ensure their are no overlapping of the Scheduled Tutors sessions I will use the MySQL BETWEEN clause to search for the start and end time.

  • 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-17T06:51:23+00:00Added an answer on June 17, 2026 at 6:51 am

    If you store the time interval using two columns it will be much easier for you to perform a search using sql query.

    i.e. tutorID, day, startTime, endTime

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

Sidebar

Related Questions

Is there a system (such as a development framework, Wiki or CMS) that enables
The architecture of our system is such that there is a set of functionally
Problems: to make the picture a coordinate system such that you can apply functions
I want to use a mobile code system such that when logging into a
How might it be possible to rig a system such that some removable media,
My Python utility script contains UNIX system calls such as status, output = commands.getstatusoutput(ls
Suppose I have a system where I have metadata such as: table: ====== key
I've seen some code such as: out.println(print something); I tried import java.lang.System; but it's
Is it possible to call winrar through perl on a windows system, such as
I'm currently working on the back-end of ACM-like public programming contest system. In such

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.