-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael She wrote:
Yes, in some cases. It's called Normalization.

Although normalization is good practice, it can complicate queries.

Have you thought about storing just M/T/W/etc and then storing the Opening, Closing times as a comma delimited string? Maybe like

Monday: 11AM,1PM,5PM,1AM
Tuesday 10AM,1PM,6PM,12AM

You'll only need 7 fields.
It _really_ depends on how you are going to use the data. For example, answering the query 'How many restaurants are open between 7 AM and 3 PM ' is _really_ hard with your data model, but a piece of cake with a normalized one.

I'm not saying that people should always go down to 3rd, 4th, or 5th normal form (yes it does go that far), but in many cases, doing things like storing delimitted strings, or 56 columns to represent things that would be better off as rows in another table can end up 'boxing' you in, so to speak.

Besides, rationally-normalized tables in most cases take up less storage space, which means more fits in RAM, which means faster queries :)

-Mark

- -- For technical support contracts, visit https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE98DD/tvXNTca6JD8RAukdAJ0WeWJi1AAmBN2A7hTHgueU3qo7iwCfWCPK
nrOGMLYFA36ITmpPjAizQfA=
=YINw
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
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