Re: Database design question
From: Jacco Schalkwijk (jacco.please.reply_at_to.newsgroups.mvps.org.invalid)
Date: 07/29/04
- Next message: Louis Davidson: "Re: Triggering on 93rd column being updated?"
- Previous message: David Portas: "Re: Triggering on 93rd column being updated?"
- In reply to: Louis Davidson: "Re: Database design question"
- Next in thread: Louis Davidson: "Re: Database design question"
- Reply: Louis Davidson: "Re: Database design question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 15:55:57 +0100
> Perhaps in an object oriented programming newsgroup you might
> find more support.
Maybe. I have worked with a database which included this design, but after
having to work with it for a while, _even_ the C++ programmers agreed it
caused no end of problems.
-- Jacco Schalkwijk SQL Server MVP "Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message news:eq$mpkXdEHA.3076@TK2MSFTNGP10.phx.gbl... >I would just say this. The kind of design you are suggesting is going to > cause you way more trouble than it is worth. Every table should model one > and only one thing. It makes your database(, and it follows data) far > easier to use, and far easier to understand. > > I understand what you are trying to do, but it is not at all what SQL > Server > is designed to do. Using SQL Server as merely a storage for text values > is > a way to go, but you will get little support here for it, because many of > us > have seen this kind of thing and had to deal with the clean up. > > I also don't want to say that this approach is never valuable. > Occasionally > we have situations where we need to store properties/attributes about an > object that is unknown at design time. I have used this kind of > structure > to store information about networking devices that have wildly varying > values and attributes. Using this data was kind of a pain for the most > part, but it was the only way to store values that could not be known at > design time. > > However, for things like vendors, and thing that you can specifically > define, this sort of construct is, from a SQL-based view, a very bad idea. > And if you are proposing to build a database where you define your > database > in metadata and store the data in these not predefined buckets rather than > building a static, well structured, normalized database, you will get > little > support here. Perhaps in an object oriented programming newsgroup you > might > find more support. > > -- > ---------------------------------------------------------------------------- > Louis Davidson (drsql@hotmail.com) > Compass Technology Management > > Pro SQL Server 2000 Database Design > http://www.apress.com/book/bookDisplay.html?bID=266 > > Note: Please reply to the newsgroups only unless you are > interested in consulting services. All other replies will be ignored :) > > "Anders" <reply_to_group@news.com> wrote in message > news:%23XuZKpWdEHA.720@TK2MSFTNGP11.phx.gbl... >> Hi Jacco, >> >> We would handle referential integrity from code only. This means that we >> validate the user input before saving data. The lookup values we often >> encounter will be user-defined, and it will be hard/impossible to make >> the >> users specify criterias for validation. This means that a user could >> potentially put the value "Male" into the country column, making it a > valid >> country lookup value, but this is not very likely... And many of the > values >> will be transferred from other systems, ensuring that only correct values >> are available for registration. >> >> When it comes to the "20 joins" argument, it is true that you would have > to >> make a complex query with many joins to the same table if you need to > search >> on many different lookup-values at the same time. However, when selecting >> all values on one document you would only need one join. >> This is actually true for both solutions sketched in the original post, > and >> we think this is a huge benefit. >> With many lookup-tables you would always need to join, both for selecting >> data and for searching. >> >> Anders >> >> "Jacco Schalkwijk" <jacco.please.reply@to.newsgroups.mvps.org.invalid> > wrote >> in message news:%23HFLWuVdEHA.2544@TK2MSFTNGP10.phx.gbl... >> > Ask yourself, how would you enforce referential integrity in your > design? >> In >> > other words, how would you prevent the code for say a country being >> entered >> > in the column for say gender? >> > >> > > Imagine the join you would have to create with 20 lookup-tables(we > could >> > > be >> > > facing many more). Each of them could potentially be quite large. >> > >> > If you have 20 "look up columns" in one table, you still need to create > 20 >> > joins, whether you store your lookup values in one table or 20 tables. >> > >> > -- >> > Jacco Schalkwijk >> > SQL Server MVP >> >> > >
- Next message: Louis Davidson: "Re: Triggering on 93rd column being updated?"
- Previous message: David Portas: "Re: Triggering on 93rd column being updated?"
- In reply to: Louis Davidson: "Re: Database design question"
- Next in thread: Louis Davidson: "Re: Database design question"
- Reply: Louis Davidson: "Re: Database design question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|