473,470 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

table names as keys?

ewu
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
Jul 20 '05 #1
2 1874
ewu (ne*****@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, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
On 10 Sep 2003 10:14:56 -0700, ne*****@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
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am...
1
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
2
by: charles leviton | last post by:
Hi all, Just trying to get a feel here. THe shop I work at insists on prefixing all column names with the table name, so it is order_id in the ORDER table and Customer_id in the CUSTOMER table. ...
4
by: Dave | last post by:
I am working on an access 2000 DB for some tree-growers that will be storing items in a heirarchy of locations. The items will obviously be stored at the lowest level in the heirarchy (in a row)...
5
by: Ilan Sebba | last post by:
When it comes to adding records in related tables, Access is really smart. But when I try to do the same using ADO, I am really stupid. Say I have two parent tables (eg Course, Student) and one...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
3
by: das | last post by:
Hello all, Can someone help me with this SQL? 1) EMPLOYEE table has columns 'employee_id' and 'emp_sid' and other columns 2) EMPLOYEE_BENEFITS table has a column called employee_entity, this...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
1
by: que576 | last post by:
I have created a junction table so that I can relate data from 2 other tables. Table 1 - Category Table (has the following fields with data) CatID (primary key) CategoryName CategoryStatus ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.