A: 

With Microsoft SQL Server database you could store that data as typed XML and still be able to sort and serach data based on one or more values in that field. Make any calculations if needed etc.

A value in that column could look similar to this:

<businessDays>
    <monday>
        <hours from="12" to="15" />
        <hours from="16" to="21" />
    </monday>
    <friday>
        <hours from="13" to="15" />
        <hours from="16" to="18" />
        <hours from="19" to="21" />
    </friday>
</businessDays>

References on Typed XML:

References on indexing and quering XML data in SQL Server:

In your application you could serialize/deserialize this data into and from business objects.

Extremely simple and efficient.

Koistya Navin
Why would that be an advantage?
Joe Philllips
Only 1 column is used for storing this unstractured data. In the application you can deserialize it into business entity by using existing serialization/deserialization features of .NET. If you split that data into several columns or even tables like other guys suggest -> result is "overnormilized"
Koistya Navin
Sorry, I tagged the question as MySQL but I didn't specify that as a requirement in the question. Updating the question.
andyh_ky
What if you want to find all businesses open 24 hours a day or something of that nature? You sort of limit the entire point of a database with this type of structure.
Joe Philllips
@d03boy, it's not a problem. You still will be able to index and query that data. Check out the references I specified.
Koistya Navin
+5  A: 

How about:

create table business (
  id int not null auto_increment primary key,
  name varchar(255)
);

create table open_hour_range (
  id int not null auto_increment primary key,
  business_id int,
  day_of_week tinyint, /* 0-6 */
  open_time time,
  close_time time,
  foreign key(business_id) references business(id)
);

This allows you any combination of hours, including multiple per day. However, it may be a bit slow from a querying perspective, in that you'll need to do a fair amount of joining to come up with the list of what hours a business is open.

Also, if you want to be able to display hours in a format like:

M-F 9-5 Sa-Su 9-12

You'd need to merge similar ranges in code, outside the database. If you wanted this sort merging, you could change day_of_week to a start_day and an end_day.

Scotty Allen
This is similar to what I was going to post. I wouldn't consider the joins an issue however... I would do a single separate query to select all the applicable hour ranges for a business, and let the app code handle the formatting. You can always cache the output as well.
zombat
What is the benefit of the open_hour_range.id column?
Jonathan Leffler
The open_hour_range.id column gives a way to uniquely identify a particular open_hour_range for updating/deletion. This may be a bad habit - I guess you could make the full column set of the table be the primary key.
Scotty Allen
+1  A: 

A minor tweak to Scotty Allen's model:

business table:
id - int
business_name - string
open_hour_range table:
id - int
business_id - int //foreign key to business
days_of_week- int // (bitmask) 1-127
open_time - time
close_time - time

sympatric greg
Ooh, I like the bitmask idea - clever:)
Scotty Allen
A: 

I wolud rather use datetime in columns open_time and close_time. Its for meetings that will start at night and will end in the morning next day. :)

Bajlo