in reply to [OT] Database Design

You got good advice from ikegami already. I just want to add, since we're OT, that I find this naming convention-

CREATE TABLE `posts` ( `post_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_cat` INT(11) UNSIGNED NOT NULL, ...

-completely annoying. It's like naming a hash like so %hash_variable_name. Redundant information is almost always suboptimal if not an outright mistake in code design. I have no idea how it's become popular in schema design. I'd rather see cat spelled out category or catalog or catamaran or whatever you're assuming everyone will know it's short for than see something like posts.post_cat.

Replies are listed 'Best First'.
Re^2: [OT] Database Design
by Anonymous Monk on Aug 11, 2010 at 03:07 UTC

    I've seen too many people using 'cat' as a short cut for 'category'

    About the naming convention ... I think it's used that way so you don't get confused or type too much when selecting from multiple tables ... i.e: you don't have to say posts.post_id ... otherwise if you're selecting from 2 tables that have the same field name you'll have to do something like posts.id and if you want to use it somewhere you'll have to provide a temporary name using 'As `fields`'

    At least that's what I remember from my readings.

      How is posts.id more typing or more confusing than posts.post_id?