dbTalk Databases Forums  

Normalizing Tree Data

comp.databases.theory comp.databases.theory


Discuss Normalizing Tree Data in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #81  
Old   
Bob Badour
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-11-2008 , 04:51 PM






cr113 wrote:
Quote:
On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

cr113 wrote:

On Feb 8, 5:07 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Is the first level always Company? Is the next level always Division? Is
the next level always Manager? Is the next level always Employee?

Yes.

What does the ID table give you that you don't get from foreign key
references from Employee to Manager, from Manager to Division, and from
Division to Company?

IBM
Div-A
Jones
Smith
Div-B
Smith
Microsoft
Div-A
Johnson
Div-B
Jones
Smith

I'm not sure what you mean by foreign key references.

Do you mean this?

Company Table
Company
IBM
Microsoft

Division Table
Company Division
IBM Div-A
IBM Div-B
Microsoft Div-A
Microsoft Div-B

Manager Table
Company Division Manager
IBM Div-A Jones
IBM Div-A Smith
IBM Div-B Smith
Microsoft Div-A Johnson
Microsoft Div-B Jones
Microsoft Div-B Smith

Or this?

Company Table
CompanyKey Company
1 IBM
2 Microsoft

Division Table
DivisionKey Division CompanyKey
1 Div-A 1
2 Div-B 1
3 Div-A 2
4 Div-B 2

Manager Table
ManagerKey Manager DivisionKey
1 Jones 1
2 Smith 1
3 Smith 2
4 Johnson 3
5 Jones 4
6 Smith 4

I've tried both of these and they seem to get awkward with 3 or more
levels. Are you talking about one of these methods?

Those both use foreign key references. Yes, either of these methods.
What does your ID table give you that you don't get from using foreign
key references?

The first method uses up huge amounts of space. I think you may be
right, though. I'm starting to lean towards the 2nd method. I lied a
little. I never actually used the 2nd method. I started a few times
but changed my mind because I thought it would be too hard to use. I'm
thinking if I write some simple functions it would make it much
easier. For example a function like GetCompany(Manager). Otherwise all
those SQL joins would get ugly.

Thanks!
I am not sure what you are thanking me for. I don't think I helped you
at all.


Reply With Quote
  #82  
Old   
Bob Badour
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-11-2008 , 04:51 PM






cr113 wrote:
Quote:
On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

cr113 wrote:

On Feb 8, 5:07 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Is the first level always Company? Is the next level always Division? Is
the next level always Manager? Is the next level always Employee?

Yes.

What does the ID table give you that you don't get from foreign key
references from Employee to Manager, from Manager to Division, and from
Division to Company?

IBM
Div-A
Jones
Smith
Div-B
Smith
Microsoft
Div-A
Johnson
Div-B
Jones
Smith

I'm not sure what you mean by foreign key references.

Do you mean this?

Company Table
Company
IBM
Microsoft

Division Table
Company Division
IBM Div-A
IBM Div-B
Microsoft Div-A
Microsoft Div-B

Manager Table
Company Division Manager
IBM Div-A Jones
IBM Div-A Smith
IBM Div-B Smith
Microsoft Div-A Johnson
Microsoft Div-B Jones
Microsoft Div-B Smith

Or this?

Company Table
CompanyKey Company
1 IBM
2 Microsoft

Division Table
DivisionKey Division CompanyKey
1 Div-A 1
2 Div-B 1
3 Div-A 2
4 Div-B 2

Manager Table
ManagerKey Manager DivisionKey
1 Jones 1
2 Smith 1
3 Smith 2
4 Johnson 3
5 Jones 4
6 Smith 4

I've tried both of these and they seem to get awkward with 3 or more
levels. Are you talking about one of these methods?

Those both use foreign key references. Yes, either of these methods.
What does your ID table give you that you don't get from using foreign
key references?

The first method uses up huge amounts of space. I think you may be
right, though. I'm starting to lean towards the 2nd method. I lied a
little. I never actually used the 2nd method. I started a few times
but changed my mind because I thought it would be too hard to use. I'm
thinking if I write some simple functions it would make it much
easier. For example a function like GetCompany(Manager). Otherwise all
those SQL joins would get ugly.

Thanks!
I am not sure what you are thanking me for. I don't think I helped you
at all.


Reply With Quote
  #83  
Old   
Bob Badour
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-11-2008 , 04:51 PM



cr113 wrote:
Quote:
On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

cr113 wrote:

On Feb 8, 5:07 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Is the first level always Company? Is the next level always Division? Is
the next level always Manager? Is the next level always Employee?

Yes.

What does the ID table give you that you don't get from foreign key
references from Employee to Manager, from Manager to Division, and from
Division to Company?

IBM
Div-A
Jones
Smith
Div-B
Smith
Microsoft
Div-A
Johnson
Div-B
Jones
Smith

I'm not sure what you mean by foreign key references.

Do you mean this?

Company Table
Company
IBM
Microsoft

Division Table
Company Division
IBM Div-A
IBM Div-B
Microsoft Div-A
Microsoft Div-B

Manager Table
Company Division Manager
IBM Div-A Jones
IBM Div-A Smith
IBM Div-B Smith
Microsoft Div-A Johnson
Microsoft Div-B Jones
Microsoft Div-B Smith

Or this?

Company Table
CompanyKey Company
1 IBM
2 Microsoft

Division Table
DivisionKey Division CompanyKey
1 Div-A 1
2 Div-B 1
3 Div-A 2
4 Div-B 2

Manager Table
ManagerKey Manager DivisionKey
1 Jones 1
2 Smith 1
3 Smith 2
4 Johnson 3
5 Jones 4
6 Smith 4

I've tried both of these and they seem to get awkward with 3 or more
levels. Are you talking about one of these methods?

Those both use foreign key references. Yes, either of these methods.
What does your ID table give you that you don't get from using foreign
key references?

The first method uses up huge amounts of space. I think you may be
right, though. I'm starting to lean towards the 2nd method. I lied a
little. I never actually used the 2nd method. I started a few times
but changed my mind because I thought it would be too hard to use. I'm
thinking if I write some simple functions it would make it much
easier. For example a function like GetCompany(Manager). Otherwise all
those SQL joins would get ugly.

Thanks!
I am not sure what you are thanking me for. I don't think I helped you
at all.


Reply With Quote
  #84  
Old   
Bob Badour
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-11-2008 , 04:51 PM



cr113 wrote:
Quote:
On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

cr113 wrote:

On Feb 8, 5:07 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Is the first level always Company? Is the next level always Division? Is
the next level always Manager? Is the next level always Employee?

Yes.

What does the ID table give you that you don't get from foreign key
references from Employee to Manager, from Manager to Division, and from
Division to Company?

IBM
Div-A
Jones
Smith
Div-B
Smith
Microsoft
Div-A
Johnson
Div-B
Jones
Smith

I'm not sure what you mean by foreign key references.

Do you mean this?

Company Table
Company
IBM
Microsoft

Division Table
Company Division
IBM Div-A
IBM Div-B
Microsoft Div-A
Microsoft Div-B

Manager Table
Company Division Manager
IBM Div-A Jones
IBM Div-A Smith
IBM Div-B Smith
Microsoft Div-A Johnson
Microsoft Div-B Jones
Microsoft Div-B Smith

Or this?

Company Table
CompanyKey Company
1 IBM
2 Microsoft

Division Table
DivisionKey Division CompanyKey
1 Div-A 1
2 Div-B 1
3 Div-A 2
4 Div-B 2

Manager Table
ManagerKey Manager DivisionKey
1 Jones 1
2 Smith 1
3 Smith 2
4 Johnson 3
5 Jones 4
6 Smith 4

I've tried both of these and they seem to get awkward with 3 or more
levels. Are you talking about one of these methods?

Those both use foreign key references. Yes, either of these methods.
What does your ID table give you that you don't get from using foreign
key references?

The first method uses up huge amounts of space. I think you may be
right, though. I'm starting to lean towards the 2nd method. I lied a
little. I never actually used the 2nd method. I started a few times
but changed my mind because I thought it would be too hard to use. I'm
thinking if I write some simple functions it would make it much
easier. For example a function like GetCompany(Manager). Otherwise all
those SQL joins would get ugly.

Thanks!
I am not sure what you are thanking me for. I don't think I helped you
at all.


Reply With Quote
  #85  
Old   
Bob Badour
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-11-2008 , 04:51 PM



cr113 wrote:
Quote:
On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

cr113 wrote:

On Feb 8, 5:07 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Is the first level always Company? Is the next level always Division? Is
the next level always Manager? Is the next level always Employee?

Yes.

What does the ID table give you that you don't get from foreign key
references from Employee to Manager, from Manager to Division, and from
Division to Company?

IBM
Div-A
Jones
Smith
Div-B
Smith
Microsoft
Div-A
Johnson
Div-B
Jones
Smith

I'm not sure what you mean by foreign key references.

Do you mean this?

Company Table
Company
IBM
Microsoft

Division Table
Company Division
IBM Div-A
IBM Div-B
Microsoft Div-A
Microsoft Div-B

Manager Table
Company Division Manager
IBM Div-A Jones
IBM Div-A Smith
IBM Div-B Smith
Microsoft Div-A Johnson
Microsoft Div-B Jones
Microsoft Div-B Smith

Or this?

Company Table
CompanyKey Company
1 IBM
2 Microsoft

Division Table
DivisionKey Division CompanyKey
1 Div-A 1
2 Div-B 1
3 Div-A 2
4 Div-B 2

Manager Table
ManagerKey Manager DivisionKey
1 Jones 1
2 Smith 1
3 Smith 2
4 Johnson 3
5 Jones 4
6 Smith 4

I've tried both of these and they seem to get awkward with 3 or more
levels. Are you talking about one of these methods?

Those both use foreign key references. Yes, either of these methods.
What does your ID table give you that you don't get from using foreign
key references?

The first method uses up huge amounts of space. I think you may be
right, though. I'm starting to lean towards the 2nd method. I lied a
little. I never actually used the 2nd method. I started a few times
but changed my mind because I thought it would be too hard to use. I'm
thinking if I write some simple functions it would make it much
easier. For example a function like GetCompany(Manager). Otherwise all
those SQL joins would get ugly.

Thanks!
I am not sure what you are thanking me for. I don't think I helped you
at all.


Reply With Quote
  #86  
Old   
David Cressey
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-12-2008 , 08:22 AM




"cr113" <cr113 (AT) hotmail (DOT) com> wrote

On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
Otherwise all those SQL joins would get ugly.
What is ugly about SQL joins? Why are fnction calls not ugly?




Reply With Quote
  #87  
Old   
David Cressey
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-12-2008 , 08:22 AM




"cr113" <cr113 (AT) hotmail (DOT) com> wrote

On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
Otherwise all those SQL joins would get ugly.
What is ugly about SQL joins? Why are fnction calls not ugly?




Reply With Quote
  #88  
Old   
David Cressey
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-12-2008 , 08:22 AM




"cr113" <cr113 (AT) hotmail (DOT) com> wrote

On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
Otherwise all those SQL joins would get ugly.
What is ugly about SQL joins? Why are fnction calls not ugly?




Reply With Quote
  #89  
Old   
David Cressey
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-12-2008 , 08:22 AM




"cr113" <cr113 (AT) hotmail (DOT) com> wrote

On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
Otherwise all those SQL joins would get ugly.
What is ugly about SQL joins? Why are fnction calls not ugly?




Reply With Quote
  #90  
Old   
David Cressey
 
Posts: n/a

Default Re: Normalizing Tree Data - 02-12-2008 , 08:22 AM




"cr113" <cr113 (AT) hotmail (DOT) com> wrote

On Feb 11, 3:18 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
Otherwise all those SQL joins would get ugly.
What is ugly about SQL joins? Why are fnction calls not ugly?




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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.