473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Relational Theory Question

If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?

TIA.

Nov 12 '05 #1
7 1850
Bill George wrote:
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?

TIA.


It does seem odd. Will Primes always be GC's and subs always subs? I would
think the definition of primary/sub contractors would be defined at the job.

I would think you'd want an additional table with an autonumber field, a prime
(gc) id and a subid field. Then store the primary in it (blank sub means its
the GC) and any sub records would have their id in the sub field and their GC
in the prime field....if you aren't doing this from the job.

GCs may work with some subs multiple times but I doubt the'd do so for every
job.

Nov 12 '05 #2
Aside from the business rules questions raised by Salad, the kind of table
you describe is normal for a many to many relationship... but it does not,
of course, define the job for which that relationship applies.

Yes, a many-to-many can join records in the same table.

You'll probably want to include some validation that you don't have the same
contractor ID in both fields (unless you have a business rule that says a
contractor can subcontract to themselves). And, if it is correct that a
prime is always and only a prime, and a sub is always and only a sub, then
you'd want validation of that against the type, as well.

In programming/development contract work, the roles do often switch. In
construction, there is a more defined line between a "general" contractor
and a subcontractor... sometimes limited by the license that each has.

Larry Linson
Microsoft Access MVP

"Bill George" <Wo*******@frontiernet.net> wrote in message
news:BC3814A2.787B%Wo*******@frontiernet.net...
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?

TIA.

Nov 12 '05 #3
I thought "Type" was a reserved word and may cause complications during the
build
"Bill George" <Wo*******@frontiernet.net> wrote in message
news:BC3814A2.787B%Wo*******@frontiernet.net...
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?

TIA.

Nov 12 '05 #4
Bill George <Wo*******@frontiernet.net> wrote in
news:BC3814A2.787B%Wo*******@frontiernet.net:
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate
normalization principles to define a table to represent a
teaming relationship between a Prime and various Subs like
this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the
contractor table?

Not at all. This type of relationship is the basis for a pedigree
tree, or a Bill of Material tree.

One word of Caution: Your type field does not belong in the
contractors table. I would see definition as a field call
Prime_contractor in the contracts table. You may, and in my
business (Aerospace) see one contract where company A is the
prime and B, C and D are sub-contractors to A.Onanother contract
B is the prime and C,D and A are subs.

Even more confusing can be a major job, like the International
Space Station which has many layers of subcontracts, and some
even involve the prime contractor receiving a small sub contract
from a sub-sub contractor.

Good luck.

Bob Q
Nov 12 '05 #5
Many thanks.

in article BC*********************@frontiernet.net, Bill George at
Wo*******@frontiernet.net wrote on 1/24/04 12:25 PM:
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?

TIA.


Nov 12 '05 #6
In addition to all the advice you've gotten so far, read these two articles:

Bill of Materials:
http://www.mvps.org/access/modules/mdl0027.htm

Sub-classing Entities:
http://www.mvps.org/access/tables/tbl0013.htm

They may apply to your problem.

HTH,
Pieter
Nov 12 '05 #7
On Sat, 24 Jan 2004 17:25:11 GMT, Bill George
<Wo*******@frontiernet.net> wrote:
If I have a table of contractors with this layout:

ID
Name
Address
Type

And type can be Prime or Subcontractor, does it violate normalization
principles to define a table to represent a teaming relationship between a
Prime and various Subs like this:

Prime-ID
Sub-ID

Where Prime-ID is a foreign key to the primary key, ID of the contractor
table?


No, that just shows there's some kind of relationship between the two
contractors. But . . .

In the general case, the problem is that a given company can be a
prime contractor for some jobs, and a subcontractor for others. That
is, the terms /prime/ and /sub/ don't always identify different types
of contractors, but they do always describe a relationship between
contractors.

--
Mike Sherrill
Information Management Systems
Nov 12 '05 #8

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

Similar topics

3
by: Matt Saunders | last post by:
There's lots of ways of representing a hierarchical data structure in a relational database. These range from the trivially easy to implement in PHP (adjacency list; each node has an ID and a...
34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
12
by: Doug Baroter | last post by:
Hi, This question has been bothering me for some time. A lot of people seem to "think" XML is the king of data problems, and I've heard that next version of SQL Server is going to have a strong...
5
by: Markus Seibold | last post by:
Dear NG, I am working on a student project about a mobile tourism information system and among others I have to answer the question whether to use: - a relational database - a XML-native database...
5
by: Martin Marques | last post by:
Has someone read this: http://www.wiscorp.com/sql/Sql99_p2.zip Are this guys at Whitemarsh Information Systems Corporation important in the SQL99 writing? -- select 'mmarques' || '@' ||...
3
by: Jeff Brown | last post by:
Where would be the best place to find some good resources that cover more than just linking 2 -3 tables? I know how to link them and i get my data set up right i think but then i am not sure about...
49
by: Mike MacSween | last post by:
I frequently hear that there isn't a commercially available dbms that fully implements the relational model. Why not? And which product comes closest. Mike MacSween
3
by: cassandra.flowers | last post by:
I'm designing a database because I have to do it for the preperation work for my A-Level ICT exam. The database is for a building company. It has to store information on building projects...
7
by: Pradeep | last post by:
Hello, I need to take a set of input tables and create an XML output file. The format of the XML output must be user-definable and must be intuitive enough for non-techies to use. input...
2
by: Vadim Tropashko | last post by:
http://vadimtropashko.wordpress.com/why-relational-division-is-so-uncommon/
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.