On Fri, Dec 06, 2002 at 03:26:03AM +0100, Alliax wrote:
> Thank you for this and for the previous answer about create temporary table,

You're welcome.

> your RestTimes is a nice way to do it, but it multiplies the number of rows
> of the table.

Does this matter?  It should take up the same (or less) space as your idea and
since you'll probably never do "SELECT * FROM RestTimes" just for fun, its not
really relevant either.

> So you say it's better to have more rows than have less row, when doing
> simple select query?

No, its better to be able to do everything you want to do with a simple table
structure.  You'll notice that my table is very simple and yet it will do all
the things you want it to do and queries are very simple to perform as well.
Consider, as an exercise, what a query would look like for:

1) What times is this restaurant open all week, in order of days, then times
   of day.
2) What times of day are all the fast food restaurants open today?
3) Which restaurants are open at 4:00 PM today and don't close for at least 
   two hours?

That is to say, I always consider what I will be doing with the table, and then
structure it accordingly.  I'm not saying that suggestion was perfect; I can
think of a few ways to improve it and you may find that its easier to specify
how long it is open instead of what time it closes, etc.

> I'll do it your way then, except if somebody has a better idea ?
 
I'd be interested in seeing other suggestions as well.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd.     (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to