Building a database for your website Part 1
So you want a database for your website, so where do you start?
When I started to write this, I thought just a few lines with all the big bullet points in would do but after hitting 4 pages in ms word , I decided to split it down so here is Part1
Database Design for the Internet 101 Part1
Firstly you need to decide what information you will need? Sounds obvious but you don’t want to go down the spaghetti programming methodology if you can help it as it will cause you problems later on. So the best place to start is a blank A4 piece of paper and create an ERD.
An ERD is a graphical representation of the Database, where you can see the Relationships between the data you want to store. Drawing it out has a lot of advantages as you can chop and change it about very easily at the start before you build the database.
In these diagrams you can use the infinity sign to indicate a 1 to many relationship and lines to link fields. So as you can see from the example diagram above for each Registration you can have multiple payments.
In the Payments table there is a field called RegistrationID which links to the RegistratioinID in the Registration table. And then in the Payments table there is a Payment type which links to the Payments type table.
So why layout the data like this? Its all about data integrity, take the above example, if every time a payment was made the user had to enter a card type there could be all sorts of variations and typos in the table for example “VISA”, “Visa”,” VISA”,”Visa “, “Bisa” so by adding a PaymentsType table, this gives them the ability to select from a know and verified list. Going through this process is database normalization, for a database to work well you want to get to what is called the third nominal form where no data is replicated.
There ends Part 1, Part to will cover more on data relationships and normalization.
June 12th, 2011 at 12:22 pm
hello…
really good article. Ready to hear more next week,my blog http://skaters.com/blogs/posts/Mariali Many Thanks….
June 16th, 2011 at 3:50 pm
really good article…
I have spent a bit of time going through your posts, more than I should have but I must say, its worth it! http://cake071.blogetery.com/wp-admin/index.php?easyadmin=on#post-new-php many Thanks….
June 20th, 2011 at 3:28 am
hello…
Hello there just quality post! http://austin11.blogspot.es/ ,i’d a good read.thank you for your article,My problem continues to be resolved….
June 21st, 2011 at 1:47 pm
Great…
You did a great job! http://deandreaa.thai-talks.com/2011/06/20/gail-sorronda-minimised-from-the-future/...
July 18th, 2011 at 1:33 pm
Great One…
I must say, its worth it! My link!http://lillian071.quebecblogue.com/ ,thanks haha…
August 9th, 2011 at 3:26 am
Great…
love your blog, http://bargainbabela.townluxe.com/users/ingrid ,Thanks again….
August 9th, 2011 at 6:46 am
Great One…
I must say, its worth it! My link, http://blog.livedoor.jp/daisy11a/,thanks haha…
September 1st, 2011 at 4:26 pm
very helpful…
I preferred to thank you for this good article. http://www.blogth.com/manager/view_entries.php I by all odds liked every little bit of it…