|
Posted by Erland Sommarskog on 10/01/42 11:24
turnstyle (scott@turnstyle.com) writes:
> Hi Erland, thanks -- are you suggesting something like:
>
> Rooms
> . . RoomID
>
> RoomContents
> . . RoomID
> . . ContentType
> . . ContentID
> . . PersonName
> . . BookTitle
> . . FurnitureType
>
> or even
>
> RoomContents
> . . RoomID
> . . ContentType
> . . ContentID
> . . VariableText1
> . . VariableText2
>
> (where 'VariableText' would store different kinds of stuff, depending
> on the ContentType)
>
>
> Since some of these objects may have a few attributes, such a
> supertable could have lots of nulls -- is that "ok"?
Nah, rather I was thinking you would keep the existing tables, and
just add this RoomContents table. Probably you should move some columns
into this table, for instance a string that represents a name of some
sort. (That is "sofa" for furnitures.)
This would make it easier to write a simple query that lists all the
contents in the room. If you need furniture-specific information you would
go to that table.
In the end it may be a trade-off where you place things. If some attributes
are common to most contents, it may be better to have it as a nullable
column in the main table.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|