473,394 Members | 1,866 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,394 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 1453
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
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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...
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...

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.