Normalisation

Mar 28, 2008

Hello,
I am relatively new to database design but think I understand most of the basics but would appreciate some clarification on a few points. I have just been lumbered with what I believe an extremely inefficient and badly designed database and would like to improve in the most logical way.

-Is it always preferable to fully normalise a database?
For example, if the table held people, it could contain the house, town, country, continent that this person belonged to. At the moment the database I'm dealing with has all of these things contained in the 'people' table, and stored as text, not as a foriegn key linked to another table, which is obviously not an ideal approach and not normalised at all. In a fully normalised database, all these attributes should have their own table I.e., one for house, town etc.

Now to run a query to find out all the people who lived in Europe, I would have to join all these tables together I.e. person to house, house to town, town to country, country to continent. This seems logical but perhaps a bit long winded. If this was a common query, would I solve this situation by creating a 'view' in the database? I've also read about stored queries, but from it seems the consensus now is that these are to be avoided as it mixes business logic with database management creating a brittle system that is difficult to evolve. Wouldn't a 'view' pose a similar problem though? I could write everything in the application, but wouldn't this slow queries down?


I really appriciate the effort you guys put into answering all the questions posted here, thanks! My other questions are in different posts so that answers are only related to one subject.

View 2 Replies


ADVERTISEMENT

Normalisation Vs If It Works Just Do It!

Apr 16, 2006

Hi All,

As an accomplished web devver of many years using ASP and ASP.NET in conjunction with Access and SQL Server, I am a bit pedantic on the rules of good data structures.

Specifically the two main rules of data redundancy and normalisation.

The latter dictates at the lowest level that a data table should NOT contain a field that can be gleaned from one or a combination of others.

I have a problem with this now, I am building a betting system which will take the odds given, plus the stake placed and calculate the winnings or losses accordingly.

There is an added complication in that not all profit is calculated the same way, as a horse can also be 'placed' which does the same calculation as for profit, but then quarters it, so one single select statement won't do.

I could calculate this at data entry stage on a per entry basis and simply store in a Profit/Loss field and keep the value for each bet, however I know this is not the correct thing to do!

My other alternative [and the correct method] is to do this calculation at data request time, but that would involve the use of a cursor or loop in the SP.

I am aware of the huge resources a cursor can consume and I am not sure which is worse, using a cursor or ignoring the normalisation procedures.

So the question is this, what would you do here?

Since I may not be the same SQL Server expert as I am a programmer, is there an alternative way of reading all the bets and doing these calcs on SQL server and bang them back to ASP as a self contained recordset with all the profit/losses calculated for each bet?

Each bet as a unique EntryID and there is a field called Result which stores 'Win, Place or Loss' accordingly.

Thanks in advance of any help/opinions.

:)

View 4 Replies View Related

Books In Spanish For Database Design And Normalisation?

Oct 22, 2007

Hi,Can anyone recommend books in Spanish for Database Design andNormalisation?¿Puede alguien recomendar libros en español para Diseño de Base dedatos y Normalización?Thanks,Michael HolbertonHospedaje Los Jardines & Sacred Valley Mountain Bike ToursCusco Database Development and Cycling Serviceshttp://www.machawasi.com/http://machawasi.blogspot.com/http://databaseservices.blogspot.com

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved