473,699 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1699
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*********@ho tmail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************@1 27.0.0.1>...
Adrian (ap*********@ho tmail.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*********@gm ail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>...
Adrian (ap*********@gm ail.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_rFa ct.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
2316
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? Check List needed.
2
1814
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 normalization I am including the 9 tables and there fields that I have already developed. I have and I am not sure what to name the tables and I am thinking of making the incident # field the pimary key?? Can I put that in all the tables? I...
6
5117
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) box, 1,0,0,2 hat, 0,0,0,1 car, 3,0,0,0 This format leads to a lot of zeros in the rows which take up a lot of
7
2455
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 are: tblCompanies: CompanyID - PK other fields like address, type of business, etc
29
3569
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 one data field - but i'm not sure) :-) Background info:
6
2896
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 functions. The database I want to create would import quite a few records -- maybe as many as 100,000. I would be importing them from an Internet source (comma delimited) to my desktop so that I could manipulate the data how I wanted. Despite the...
10
7696
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 close' I think that I have read in some threads (althoug I cannot find them now) that others place such tables in a local, linked database. I could do this but I am interested to know what would be the advantages. And disadvantages, if any. Any...
1
2979
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 for databases? I don't simple normalization, but higher-level stuff. Anyone have pointers to any books, papers, ideas, etc?? TIA
18
5149
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 relate to the childrem ?
0
8697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8622
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9184
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8892
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7767
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5878
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3062
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 we have to send another system
2
2359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.