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

Can a table be both parent and child to another table.

112 100+
hi there,

Can someone please clear this for me with an example. Can one table, say T1, be parent to another table, say T2, and also be the child of T2 at the same time.

to be more clear, T1 is parent of T2 and T1 is child of T2.
is this possible, if so can you please give me a an example.

thank you for your time
Jan 11 '11 #1
3 1997
Rabbit
12,516 Expert Mod 8TB
Parent and child are terms used to describe a hierarchical relationship. They are not properties of a table but rather descriptors of a particular way of laying out data.

What is the purpose of this question?
Jan 11 '11 #2
user1980
112 100+
to elaborate my question, I have a primary key in T1 which is foreign key in T2 and similarly a priamry key in T2 is a foreign key for T1. is this possible? if so what would be the parent table in this relationship?

this was asked in an interview.thank you
Jan 11 '11 #3
Rabbit
12,516 Expert Mod 8TB
It's certainly possible to create such a relationship but I don't see why someone would need to implement something like this.

Which table would be considered the parent table in such a relationship, or whether a parent/child relationship is the correct term for this layout will always depend on what kind of data you're looking at. In a vacuum, none of them are parent tables and none of them are child tables. It is only with context that the labels parent and child can be applied.
Jan 11 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Michael | last post by:
I have two tables with a 1-many relationship. I want to write a select statement that looks in the table w/many records and compares it to the records in the primary table to see if there are any...
7
by: Philip Mette | last post by:
I have been searching many postings and I cant seem to find anyone that has this answer so I decided to post. I am using SQL (Transact-SQL).If I have 2 tables with columns...
2
by: Colm O'Hagan | last post by:
Hi there, I having a problem with a database I'm setting up, I would be delighted if someone out there could help. The database I'm setting up is a task register datebase, it will be used to...
2
by: vorley99 | last post by:
I am trying to write some VB to copy the field names from one table in a db to a field in another table in the same database i.e., so they appear as a set of records. Any clue how to achieve...
10
by: Forest14 | last post by:
Hello! Happy Christmas/holidays to you all I have this huge table named "Positions" with more than 160 fields of which the fields are named with non obvious abbreviations. I have another table...
7
by: underground | last post by:
I wonder if possible on page load to query the value of a specific colmn and insert the result into another table. My query looks like so <? include("include/session.php"); ?> <? $usr =...
1
by: lunas | last post by:
hi i have to update a table based on a criteria with value selected from another table. i am writting a java progg for it . i just want to know can it be done with one statement. my purpose is ...
1
by: Jerh9e1k5 | last post by:
Hi there! I'm trying to organize data into single line exports in order to take it out of a database. The database contains customer information. Some customers have more than one "Business"...
1
by: boss1 | last post by:
hi all, i m new in php.i have a problem that is i m using a php form where i can retrieve one field value from one table in oracle db by ajax and its working properly. but i need to insert the...
6
by: Kenneth Osenbroch | last post by:
Hi. I want to create a trigger that only allows delete from table A if corresponding record in table B does not exist. Any idea on how this can be done? Thanks, Kenneth.
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: 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
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...
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
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.