Unix Technical Forum

table names as keys?

This is a discussion on table names as keys? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello all, I got a chance to peak into a database system. Part of its design is rather unfamiliar ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:50 PM
ewu
 
Posts: n/a
Default table names as keys?

Hello all,

I got a chance to peak into a database system. Part of its design is
rather unfamiliar to me. When I look at the diagram generated by SQL
Server, there are many floating tables. Eventually it turns out that
these many floating tables are actually not floating. Their table
names relate to fields (as TableID) in other tables. In this case,
you can get a handle to one of such tables by search TableID columns
in other tables.

To be more specific, the database is a microarray database implemented
in SQL Server 2000. They have a table called MICROARRAYS. In this
table, there is a column called table_id. These table_ids are in fact
table names of a bunch of other tables.

My questions are

1) Is this good relational design?
2) How well is this kind of design supported in SQL Server?
3) Are there better alternatives?

Any other comment or link to helpful resources will also be
appreciated.

Thanks,

Eric Wu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:51 PM
Erland Sommarskog
 
Posts: n/a
Default Re: table names as keys?

ewu (neurite@excite.com) writes:
> I got a chance to peak into a database system. Part of its design is
> rather unfamiliar to me. When I look at the diagram generated by SQL
> Server, there are many floating tables. Eventually it turns out that
> these many floating tables are actually not floating. Their table
> names relate to fields (as TableID) in other tables. In this case,
> you can get a handle to one of such tables by search TableID columns
> in other tables.
>
> To be more specific, the database is a microarray database implemented
> in SQL Server 2000. They have a table called MICROARRAYS. In this
> table, there is a column called table_id. These table_ids are in fact
> table names of a bunch of other tables.


I'm not sure that I understand this. I'm not even sure that I want to
understand it.

It certainly does not seem like a regular use of a relational database
engine, and while it work with smaller amount of data, I doubt that
this system hosts 100 GB of data. Or even 1 GB.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 05:54 PM
Mike Sherrill
 
Posts: n/a
Default Re: table names as keys?

On 10 Sep 2003 10:14:56 -0700, neurite@excite.com (ewu) wrote:

>I got a chance to peak into a database system. Part of its design is
>rather unfamiliar to me. When I look at the diagram generated by SQL
>Server, there are many floating tables. Eventually it turns out that
>these many floating tables are actually not floating. Their table
>names relate to fields (as TableID) in other tables. In this case,
>you can get a handle to one of such tables by search TableID columns
>in other tables.
>
>To be more specific, the database is a microarray database implemented
>in SQL Server 2000. They have a table called MICROARRAYS. In this
>table, there is a column called table_id. These table_ids are in fact
>table names of a bunch of other tables.


I don't know what a microarray is. (A millionth of an array?)

>My questions are
>
>1) Is this good relational design?


Can't say, based only on what you've posted. The "floating" tables
might represent subtypes. If that's the case, then table names that
are stored in the supertype (I presume) table should be used by a
trigger or stored procedure as a part of "referential" integrity.
(You have to indicate the subtype table somehow, but using the table
name itself constitutes tight coupling.)

>2) How well is this kind of design supported in SQL Server?


If it's really a supertype/subtype issue, not as well as I'd like.
You really need deferred constraint checking to do it right.

>3) Are there better alternatives?


I'm not sure anyone here can answer without knowing *why* the database
was designed that way.

--
Mike Sherrill
Information Management Systems
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com