473,395 Members | 1,456 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.

Database Normalization/Design Question

Normalization Question - Please bear with me, hopefully things will be
clear at the end of the question.

Given a treaty table containg treaties; Treaty1, Treaty2 etc and a
benefit table; Benefit1, Benefit2 etc. A treaty can only have certain
benefits:-

For example Treaty 1 can process Benefit1 and Benefit2.

To maintain this relationship a new table TreatyBenefit has been
created: -

Treaty1 Benefit1
Treaty1 Benefit2

A further table called policy has been added. A treaty can have many
policies

Treaty1 Policy1
Treaty1 Policy2

A Policy can contain 1 or more benefits

Policy1 Benefit1
Policy1 Benefit2 etc.

Giving structure as follows:-

T - TB - B
|
P

Given the above, should there be a constraint between policy and
TreatyBenefit or Policy and Benefit to enforce referential integrity.
If so which constraint, if not what form of constraint / checking
should I be using, to ensure that a Policy will contain the correct
benefits.

Thanks

Adrian
Jul 23 '05 #1
7 1679
Based on what is described so far, treaty as 1:M with benefits and
treaty as 1:M with policy. So... Create two tables TreatyBenefit and
TreatyPolicy, with both tables's treaty column being a FK to the Treaty
table.

Jul 23 '05 #2
Adrian (ap*********@hotmail.com) writes:
Given a treaty table containg treaties; Treaty1, Treaty2 etc and a
benefit table; Benefit1, Benefit2 etc. A treaty can only have certain
benefits:-

For example Treaty 1 can process Benefit1 and Benefit2.

To maintain this relationship a new table TreatyBenefit has been
created: -

Treaty1 Benefit1
Treaty1 Benefit2

A further table called policy has been added. A treaty can have many
policies

Treaty1 Policy1
Treaty1 Policy2

A Policy can contain 1 or more benefits

Policy1 Benefit1
Policy1 Benefit2 etc.

Giving structure as follows:-

T - TB - B
|
P

Given the above, should there be a constraint between policy and
TreatyBenefit or Policy and Benefit to enforce referential integrity.
If so which constraint, if not what form of constraint / checking
should I be using, to ensure that a Policy will contain the correct
benefits.


I'm not sure that I understand the problem. As you have described, I
would expect a table TablePolicies and PolicyBenefits:

T - TB - B
| /
TP /
| /
P - PB

But I guess that there is something I'm missing. If treaty T1 can process
benefits B1 and B2, T1 has policies P1 and P2, can P1 then also contain
B3?

Or is a policy always a subitem of Treaty? That is, a policy can only
belong to one treaty? And a benefit can only belong to one policy?
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn********************@127.0.0.1>...
Adrian (ap*********@hotmail.com) writes:
Given a treaty table containg treaties; Treaty1, Treaty2 etc and a
benefit table; Benefit1, Benefit2 etc. A treaty can only have certain
benefits:-

For example Treaty 1 can process Benefit1 and Benefit2.

To maintain this relationship a new table TreatyBenefit has been
created: -

Treaty1 Benefit1
Treaty1 Benefit2

A further table called policy has been added. A treaty can have many
policies

Treaty1 Policy1
Treaty1 Policy2

A Policy can contain 1 or more benefits

Policy1 Benefit1
Policy1 Benefit2 etc.

Giving structure as follows:-

T - TB - B
|
P

Given the above, should there be a constraint between policy and
TreatyBenefit or Policy and Benefit to enforce referential integrity.
If so which constraint, if not what form of constraint / checking
should I be using, to ensure that a Policy will contain the correct
benefits.


I'm not sure that I understand the problem. As you have described, I
would expect a table TablePolicies and PolicyBenefits:

T - TB - B
| /
TP /
| /
P - PB

But I guess that there is something I'm missing. If treaty T1 can process
benefits B1 and B2, T1 has policies P1 and P2, can P1 then also contain
B3?

Or is a policy always a subitem of Treaty? That is, a policy can only
belong to one treaty? And a benefit can only belong to one policy?


Thanks for the responses so far. To clarify my question, a treaty can
have a number of policies, but a policy can only belong to 1 treaty.
(Essentially my policy table above is TreatyPolicy)

T
|
/|\
TP
This Policy table can contain a number of benefits but only those
benefits which the treaty supports.

What I am trying to determine is whether the constraint between the
Treaty Policy Benefit table should be with the TreatyBenefit or
Benefit table. (I know what I think it is but a collegue is
disagreeing and I would like an unbias assessment :) )

ie
T--------TB------B
| /
TP /
| /
TPTB--/

(Can get back to the treaty table via 2 routes)

OR
T----TB-----B
| /
| /
TP /
| /
TPB----/

(Not restricting the treaty policy benefit table by just those
benefits which belong to the treaty)

Hope I'm making sense :)

Thanks

Adrian
Jul 23 '05 #4
Adrian (ap*********@gmail.com) writes:
Thanks for the responses so far. To clarify my question, a treaty can
have a number of policies, but a policy can only belong to 1 treaty.
(Essentially my policy table above is TreatyPolicy)
...
This Policy table can contain a number of benefits but only those
benefits which the treaty supports.

What I am trying to determine is whether the constraint between the
Treaty Policy Benefit table should be with the TreatyBenefit or
Benefit table. (I know what I think it is but a collegue is
disagreeing and I would like an unbias assessment :) )

T--------TB------B
| /
TP /
| /
TPTB--/

(Can get back to the treaty table via 2 routes)


This looks better than the other, but I'm sure that it's the right one.
I have a killer question: Can a benefit be associated with a treaty
without appearing in none of the policies of the treaty? If not, your
TB table appears to be superfluous. (Unless there is data on the TB
connection which is independent of the policy.)
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
Adrian (ap*********@gmail.com) writes:
Thanks for the responses so far. To clarify my question, a treaty can
have a number of policies, but a policy can only belong to 1 treaty.
(Essentially my policy table above is TreatyPolicy)
...
This Policy table can contain a number of benefits but only those
benefits which the treaty supports.

What I am trying to determine is whether the constraint between the
Treaty Policy Benefit table should be with the TreatyBenefit or
Benefit table. (I know what I think it is but a collegue is
disagreeing and I would like an unbias assessment :) )

T--------TB------B
| /
TP /
| /
TPTB--/

(Can get back to the treaty table via 2 routes)


This looks better than the other, but I'm sure that it's the right one.
I have a killer question: Can a benefit be associated with a treaty
without appearing in none of the policies of the treaty? If not, your
TB table appears to be superfluous. (Unless there is data on the TB
connection which is independent of the policy.)


Yes, a benefit can be associated with a treaty without any policies
for that treaty having the benefit.

Essential a treaty can have any benefit, but a policy can only have
benefits in which the treaty to which it belongs allows those
benefits.

So if the complete benefit list contains the benefits BEN1, BEN2,
BEN3. But Treaty 1 only allows BEN1 and BEN2, then any policy
belonging to Treaty 1 should only be allows BEN1 and BEN2 as well.

Cheers

Adrian
Jul 23 '05 #6
On 7 Feb 2005 01:43:13 -0800, Adrian wrote:
Yes, a benefit can be associated with a treaty without any policies
for that treaty having the benefit.

Essential a treaty can have any benefit, but a policy can only have
benefits in which the treaty to which it belongs allows those
benefits.

(snip)

Hi Adrian,

Based on this and your previous postings, the *FIRST STEP* in my design
would look like this:

T-----TB-----B
| | /
| | /
TP | /
\ | /
\ | /
TPTB

I tried to put in some crowfoots to depict cardinalty, but the drawing
would have become a mess - I trust you can work that out for yourself,
though :-)

In the *SECOND STEP*, I would recognise that the relationship between TPTB
and B is superfluous, as it's already implied by the relationship between
TPTB to TB in combination with the relationship between TB and B. That
means it's safe to remove the TPTB - B relationship, leaving this as the
final design:

T-----TB-----B
| |
| |
TP |
\ |
\ |
TPTB

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #7
Hugo Kornelis <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message news:<7u********************************@4ax.com>. ..
On 7 Feb 2005 01:43:13 -0800, Adrian wrote:
Yes, a benefit can be associated with a treaty without any policies
for that treaty having the benefit.

Essential a treaty can have any benefit, but a policy can only have
benefits in which the treaty to which it belongs allows those
benefits.

(snip)

Hi Adrian,

Based on this and your previous postings, the *FIRST STEP* in my design
would look like this:

T-----TB-----B
| | /
| | /
TP | /
\ | /
\ | /
TPTB

I tried to put in some crowfoots to depict cardinalty, but the drawing
would have become a mess - I trust you can work that out for yourself,
though :-)

In the *SECOND STEP*, I would recognise that the relationship between TPTB
and B is superfluous, as it's already implied by the relationship between
TPTB to TB in combination with the relationship between TB and B. That
means it's safe to remove the TPTB - B relationship, leaving this as the
final design:

T-----TB-----B
| |
| |
TP |
\ |
\ |
TPTB

Best, Hugo


Hugo,

thanks for this. I totally agree with your reasoning and very well explained.

Thanks

Adrian
Jul 23 '05 #8

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

Similar topics

2
by: SuryaPrakash Patel via SQLMonster.com | last post by:
Dear All, How to reach to the highest level of normalization for database designing? Guide Lines Needed. What will be the characteristics of a database of a completely normalized databae? ...
2
by: John C | last post by:
I am trying to develop a access database version 2002 from scratch and I am a novice programmer and need much direction. I have been researching and studying about relational database design and...
6
by: DH | last post by:
I have a VERY basic question about figuring database size. I've inherited a database which is generally similar to this basic one: Item, Red, Blue, Green, Yellow (text), (int),(int),(int),(int)...
7
by: John Welch | last post by:
I have three tables and the way they are currently set up violates good normalization, but I'm having trouble figuring out a better way. Can someone suggest a more elegant solution? My tables...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
6
by: No Spam Man | last post by:
Hi, I am not a programmer and in the past have only created very simple, flat file databases. Although I'm a newbie, I think I could probably figure out basic Boolean logic and financial...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
1
by: aj | last post by:
I'm sure some (maybe many) of the folks in the group are familiar w/ the Gamma/Helm/Johnson/Vlissides Design Patterns book (often call Gang of Four or GoF). My question: Is there any such thing...
18
by: Cliff Chapin | last post by:
I want to create a Family database some of these "families " are single fathers with children some are single women with children they will be assigned Rooms /w children. what would be the best to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.