473,407 Members | 2,546 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,407 software developers and data experts.

Q: Help with recursive tables needed

1. Overview-
Every Product (tbl_Product) has a single licensor (tbl_Licensor).
Tricky part is, each licensor may have a sublicensor. So, a product
could have a licensor or a sublicensor.

2. Examples-
a. Product: Star Wars
Licensor: Fox
Sublicensor: Lucas
b. Product: X-Men
Licensor: Fox
Sublicensor: (None)

3. Tables (showing only primary keys)-
a. tbl_Product
Product_ID (PK)
b. tbl_Licensor
Licensor_ID (PK)
c. tbl_Product_Licensor
Product_ID (PK, FK)
Licensor_ID (PK, FK)

4. Problem-
I don't know where/how to add a sublicensor in tbl_Product_Licensor
without adding nulls when a product has a licensor but no sublicensor.
Also, should I use a composite key or surrogate key in the table
combining licensor and sublicensor, assuming there is such a table
required.

Any help is certainly appreciated!

John
Nov 12 '05 #1
1 1455
On 7 Apr 2004 20:25:01 -0700, so*********@hotmail.com (John) wrote:

This does not have to be recursive, if there are no sub-sublicensors.
I would have a tblProducts table with LicensorID (required) and
SubLicensorID (not required), both related to tblLicensors. I'm
assuming here that Fox can sometimes be a sublicensor, and Lucas could
potentially be a licensor.
Yes there will be nulls in the SubLicensorID field. So what?

-Tom.

1. Overview-
Every Product (tbl_Product) has a single licensor (tbl_Licensor).
Tricky part is, each licensor may have a sublicensor. So, a product
could have a licensor or a sublicensor.

2. Examples-
a. Product: Star Wars
Licensor: Fox
Sublicensor: Lucas
b. Product: X-Men
Licensor: Fox
Sublicensor: (None)

3. Tables (showing only primary keys)-
a. tbl_Product
Product_ID (PK)
b. tbl_Licensor
Licensor_ID (PK)
c. tbl_Product_Licensor
Product_ID (PK, FK)
Licensor_ID (PK, FK)

4. Problem-
I don't know where/how to add a sublicensor in tbl_Product_Licensor
without adding nulls when a product has a licensor but no sublicensor.
Also, should I use a composite key or surrogate key in the table
combining licensor and sublicensor, assuming there is such a table
required.

Any help is certainly appreciated!

John


Nov 12 '05 #2

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

Similar topics

4
by: Hank | last post by:
I have two SQL Server 2000 machines (server_A and server_B). I've used sp_addlinkedserver to link them both, the link seems to behave fine. I can execute remote queries and do all types of neat...
22
by: nobody | last post by:
hello everybody, is there a way of creating an array with help of a function that would accept the name of this array as a parameter and then create global Array type variable of that name? so...
1
by: John | last post by:
1. Overview- Every Product (tbl_Product) has a single licensor (tbl_Licensor). Tricky part is, each licensor may have a sublicensor. So, a product could have a licensor or a sublicensor. 2....
1
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
9
by: Csaba Gabor | last post by:
Inside a function, I'd like to know the call stack. By this I mean that I'd like to know the function that called this one, that one's caller and so on. So I thought to do: <script...
0
by: Michael L | last post by:
Hi Guys(I apologize for the lengty post - Im trying to explain it as best i can) I've been cracking my head on this one for the past 24+ hours and i have tried creating the function in ten...
4
by: david.karr | last post by:
I have a simple test page with a "div" that just contains text content. I assigned a var to the "div" element, and I'm trying to get the "first child" of that element to get the text content. I'm...
3
by: Davy | last post by:
Hi all, Sometimes I need to pass same parameter in recursive function. From my point of view, the style is redundant, and I don't what to use some global style like self.A, self.B, Is there any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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...
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,...

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.