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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:52:23+00:00 2026-05-26T16:52:23+00:00

Part 1: Which MySQL data type to use for scheduling? In Part 1 of

  • 0

Part 1: Which MySQL data type to use for scheduling?

In Part 1 of my question, I asked which MySQL data type to use for, say, scheduling movies at a cinema. When scheduling a movie, you need to know the date (e.g. Jan 1, 2011) and time (e.g. 9:00 am). Please don’t discuss part 1 of my question here.

Here’s my part 2: what if I wanted to store a cinemas daily hours of operation? For example:

  • Monday, 9am – 9pm
  • Tuesday, 9am – 5pm
  • etc.

What is a good way to represent this in the database? Keep in mind that, in this case, the date does not matter (e.g. I don’t need to know what date the particular Monday is on). I only case about days of the week and times of the day.

Here’s how I would probably do it:

TABLE: schedule
- schedule_id
- day (ENUM: 0, 1, 2, 3, 4, 5, 6)
- start_time (INT)
- end_time (INT)

start_time and end_time would represent the number of minutes since midnight. So, 0 for midnight, 1 for 12:01 am, 2 for 12:02 am, and so on.

Am I approaching this right? Suggestions?

  • 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-26T16:52:24+00:00Added an answer on May 26, 2026 at 4:52 pm

    As I said in my answer to your first question, in my opinion a person should use the datatype that better fits and describes the reality. In this case I would like to use Time type for the start_time and end_time fields.

    Instead for the day field I would like to use numbers from 1 to 7.

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

Sidebar

Related Questions

which part of huge package nltk I must study and use, if I need
I need to store of 100-200 data in mysql, the data which would be
I have an array to which I need to compare data from mysql. Usually
In a MySQL book I came across a part which was said: If you
I need to read data from an Excel sheet as part of a data
I want to store data on various engines in a MySQL database, which includes
I'm retrieving data from a MySQL db and creating reports from it. I need
I have a web part which uses many SharePoint controls like menu, SPGrid, tool
I have a query which part of a SP which is executed fairly regularly,
I have a BizTalk (2006 R2) scope with a Catch Exception part in which

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.