sonicefu
asked on
How to solve the following problem ?
Hi,
Can anyone provide me help to to solve the following ? or just give me pointer that how to solve it please ?
Given n tables, R1, R2, …, Rn, such that the foreign key of table R2 references to the primary key of table R1 (RIC2), the foreign key of table R3 references to the primary key of table R2 (RIC3), …., the foreign key of table Rn references to the primary key of table Rn-1 (RICn), and the foreign key of table R1 references to the primary key of table Rn (RIC1).
1. Please describe how to create tables R1, …, Rn and to enforce all the referential integrity constraints RIC1, RIC2, …, RICn.
2. Please describe how to populate the data into tables R1, …, Rn.
Best Regards
Can anyone provide me help to to solve the following ? or just give me pointer that how to solve it please ?
Given n tables, R1, R2, …, Rn, such that the foreign key of table R2 references to the primary key of table R1 (RIC2), the foreign key of table R3 references to the primary key of table R2 (RIC3), …., the foreign key of table Rn references to the primary key of table Rn-1 (RICn), and the foreign key of table R1 references to the primary key of table Rn (RIC1).
1. Please describe how to create tables R1, …, Rn and to enforce all the referential integrity constraints RIC1, RIC2, …, RICn.
2. Please describe how to populate the data into tables R1, …, Rn.
Best Regards
ASKER
Let me explain it simple words that what I need.
I just want to know that how can I implement recursive relationships between tables as for as CREATE TABLE and UPDATE TABLE is concerned ?
This is my simple requirement, can you provide me simple hint to solve it ?
I just want to know that how can I implement recursive relationships between tables as for as CREATE TABLE and UPDATE TABLE is concerned ?
This is my simple requirement, can you provide me simple hint to solve it ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks rrjegan17,
Can you elaborate a bit please
3. Update (foreign key of table R1 to table Rn) column with the actual value..
actually here Rn is referencing to R1 not opposite one
Is there specific SQL to use in the scenarios like this (MS-SQL)
Can you elaborate a bit please
3. Update (foreign key of table R1 to table Rn) column with the actual value..
actually here Rn is referencing to R1 not opposite one
Is there specific SQL to use in the scenarios like this (MS-SQL)
>> actually here Rn is referencing to R1 not opposite one
Ok, Got it the other way..
In that case, you need to have R1 table inserted first before Rn
>> Is there specific SQL to use in the scenarios like this (MS-SQL)
Nothing specific, just follow the order in which the Foreign keys references..
Or in other words, Parent tables first and then the Child tables.
Ok, Got it the other way..
In that case, you need to have R1 table inserted first before Rn
>> Is there specific SQL to use in the scenarios like this (MS-SQL)
Nothing specific, just follow the order in which the Foreign keys references..
Or in other words, Parent tables first and then the Child tables.
ASKER
thanks a lot rrjegan17 !
Welcome sonicefu
Kindly let me know if you have any other doubts..
Kindly let me know if you have any other doubts..
ASKER
I'll come with examples.
Should I close this Question by giving you points and I'll ask a new question for more details ?
Should I close this Question by giving you points and I'll ask a new question for more details ?
If you feel those examples are related to this question, then you can keep it open..
Else close this question and open up a new question as required..
Else close this question and open up a new question as required..
ASKER
Thanks a lot !
If you have a specific question, you are welcome to ask it, and we can maybe help you with that.