If I’d known this stuff when I first started to design databases for web applications, I think it would have helped me a lot, these are not necessarily ‘formal recommendations’ or even what some people might call ‘best practice’, but these rules work for me when I’m designing my web applications. It makes development quicker, because I don’t have to think about the names of my columns and tables when I’m writing code.
So with that in mind, these are my ‘rules’ for database design:
- Name everything in lowercase, that means table names, column names, everything!
- always use the plural for table names
- always use singular for columns names
- always name primary key ‘index’ fields ‘id’ this prevents any issues with the name ‘index’
- always name your database columns using something that accurately describes the content of the column e.g. email, first_name, last_name, tel
Short and sweet, but these rules stand me in good stead these days.
On a similar topic, and equally useful, use a database administration tool, like MySQLAdministrator since it’s so much faster than installing old faithful PhpMyAdmin. Don’t get me wrong PhpMyAdmin is still great, and I still use it a lot, but when I can get away with it MySQLAdministrator is just so much faster for creating databases tables.
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment