View Single Post
03-03-2008, 07:58 PM
Join Date: Nov 2007
Another well thought out, informative post, thank you. Some constructive criticism follows, however.
I strongly disagree with the use of a VARCHAR type column for the date. IMHO you should only ever store a date value in a column of one of the predefined DATE types (unless of course you're storing the UNIX TIMESTAMP value, which has it's own pros and cons, in an INT type column). You'll only have heartache trying to make sense of date formatting and date calculations in a non-standard field.
You may have other experience setting a date in a field such as this, if so, please let me know.
Although I'm sure it would work fine for a very small limited blog as a testbed, TINYINT is also too small to be used, make sure you use at least SMALLINT for the PK field. INT won't hurt, either.
It's also not clear to me why you'd want a LEFT OUTER JOIN rather than an INNER JOIN to join the `blog_articles` and `blog_users` table - you'll wind up returning records with missing author data. Since you've defined your `author` FK field as NOT NULL, this seems highly unlikely.
Really nice post about relations between tables and how to set things up, though. I also like the use of UTF8 and utf8_bin collation, something we should all be looking into.
I reject your reality, and substitute my own.
View Public Profile
Send a private message to SOCK
Find More Posts by SOCK