FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Bad database design can cause unnecessary coding
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Bad database design can cause unnecessary coding [message #179509 is a reply to message #179492] Sat, 03 November 2012 10:04 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 02-11-2012 08:12, Tony Marston wrote:
> When you design your database for your PHP application are you aware
> that some of your design decisions can have a detrimental effect when it
> comes to writing the code to access that database? I have been designing
> databases, and building the applications which use them, for several
> decades, and I have learned over the years that there are some design
> decisions which help the developer while others do nothing more than
> hinder. I have produced a document which lists 14 of these “hindrances”
> which can be read at
> http://www.tonymarston.net/php-mysql/database-design-ru-novice-ninja-or-nin compoop.html
>
>
> Do you agree with my opinions? Can you think of any more questionable
> design decisions which can be added to this list?
>
> Tony Marston
>
> http://www.tonymarston.net
> http://www.radicore.org

Basic Database Rules

2.The primary key can be of almost any data type, but should not exceed
the size limit for the database (which is usually 255 characters). The
primary key can also span more than one column, and need not be the
first column(s) to be defined for the table.

- This is not a 'basic database rule'. It's more a techinal-note on how
the world (might, because i did not verify) look like. The "size limit
for the database" is for sure something techical, which should not be a
'BASIC' rule...
- Some say you should only use 1 column for your primary key.

7.All database, table and column names should use the standard character
set, which is comprised of letters, numbers and underscores. Attempting
to use symbols may seem "cool" at first, but eventually you will feel
the pain.
9.All databases, both past and present, are case INsensitive when it
comes to names. This means that names such as "foo_bar", "FOO_BAR" and
"Foo_Bar" will all resolve to the same column.

- I would not use underscores in my table or column names.
- a 'basic database rule' should be that consistency in naming should be
used. If you use 'CarsSold' in one table, thant you should not have
another field named like 'cars_wrecked'.
The consistency in naming you tables (and columns) is more important
than the case INsentiviity of it.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php daemon
Next Topic: keeping the page content stay in their positions and not merging
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 04:40:24 GMT 2024

Total time taken to generate the page: 0.05128 seconds