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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:17:37+00:00 2026-05-31T16:17:37+00:00

I need help on the best way to design a database/tables for the following

  • 0

I need help on the best way to design a database/tables for the following data.

I have a supplier : Supplies various products for a Project.

For each product they supply. the rate changes depending on the day of the week, the time of day and if it is a public holiday or a weekend.

Any Ideas???

Example:

                    Week Day Rates        | Saturday/Sunday & Public Holiday Rates                  
Start Time  0:00    3:00    6:00    17:00 | 0:00    3:00    6:00    17:00   20:00   
End Time    3:00    6:00    17:00   20:00 | 3:00    6:00    17:00   20:00   23:59

Product 1   1.00    2.00    3.00    4.00  | 6.00    7.00    8.00    9.00    10.00   
Product 2   5.00    8.00    8.00    9.00  | 2.00    6.00    7.00    8.00    9.00    
Product 3   3.00    2.00    3.00    5.00  | 3.00    4.00    5.00    8.00    10.00   
  • 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-31T16:17:38+00:00Added an answer on May 31, 2026 at 4:17 pm

    The best way to manage this while minimizing the amount of data to maintain and preserving flexibility is to use ranges of date/time. For the holiday rate, you can either keep two rate columns (regular/holiday) or you can keep separate records with a flag indicating whether the price is for a regular day or a holiday.

    You have choices for how to represent this information. You could represent it using datetime columns adjusted to some arbitrary starting date. That would be simple in terms of columns, but it could be confusing to use. The other way to go would be to use two columns: Day_of_Week (tiny int) and Time (datetime without a date or time only, if your DBMS supports it).

    I’d recommend the second option. So your table could look like this:

    PRICE (
      id            int identity
    , product_id    int
    , day_of_week   int
    , start_time    time
    , end_time      time
    , regular_price money
    , holiday_price money
    )
    

    Of course, you’ll want to add in the primary and foreign key constraints…

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

Sidebar

Related Questions

I need help to design the best data structure for a GRAPH. The following
I need help understanding the best way to manipulate a JavaScript data structure (if
need help in error in database pivot. i have table tamed table_score like below:
I need help with the best practice to localize asp mvc apps, I saw
Need help writing a script downloads data from google insight using c# this is
need help/guide for sql select query, I have 2 table stock and stock_history, in
need help regarding USSD Gateway. I have to develop an app, which will directly
I need help getting the this week full date range in the following format:
I'm trying to figure out the best way to approach the following: Say I
I am trying to figure out the best database/data architecture approach for a system

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.