@peter, the logic of structuring categories as entries in a table is one very sound one, If i were you i would not ignore it (unless this piece of software is what my peeps call <hit and run >, design the system with future needs in mind, create a table for categories, give them a unique id and in your query do a count where category id is used to deal with duplicates.
You can always add categories later if you come across an unhandled category.
For the question of an accident being in more than one category, you can introduce a table to map accidents to a category resulting in 3 tables
1. Accident - contains the accident details, time, location... Blah blah blah
2. Categories - contains ur accidents defination
3. AccidentMappings - maps an accident to a catrgory, contains 2 foreign keys categoryID, AccidentID . Add a unique key on (categoryID,AccidentID)
Sent from my BlackBerry®
-----Original Message-----
From: Peter Karunyu <pkarunyu@gmail.com>
Sender: skunkworks-bounces@lists.my.co.ke
Date: Tue, 25 Oct 2011 11:40:02
To: Shadrack Mwaniki<shadrack_mwaniki@yahoo.com>; Skunkworks Mailing List<skunkworks@lists.my.co.ke>
Reply-To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
Subject: Re: [Skunkworks] Database design question
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
“The twentieth century has been characterized by three developments of great political importance: the growth of democracy, the growth of corporate power, and the growth of corporate propaganda as a means of protecting corporate power against democracy” | |
~ Alex Carey ~ Tel No: 0x2af23696 |