GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Modeling
Go To First  |  Previous Question  |  Next Question 
 Data Modeling  |  Question 2 of 22    Print  
Why are recursive relationships are bad? How do you resolve them?

  
Total Answers and Comments: 3 Last Update: November 12, 2007   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Jeetendra Nalawade
 
We have used a different way of maintaning recursive relationship. We have created a ancestry table which will give the childs for each entry upto n th level. This way you can fire queries directly to get the child upto any specific level.

Above answer was rated as good by the following members:
Michigan
June 24, 2005 20:25:03   #1  
John        

RE: Why are recursive relationships are bad? How do you resolve them?
Recursive relationships are an interesting and more complex concept than the relationships you have seen in the previous chapters, such as a one-to-one, one-to-many, and many-to-many. A recursive relationship occurs when there is a relationship between an entity and itself. For example, a one-to-many recursive relationship occurs when an employee is the manager of other employeess. The employee entity is related to itself, and there is a one-to-many relationship between one employee (the manager) and many other employees (the people who report to the manager). Because of the more complex nature of these relationships, we will need slightly more complex methods of mapping them to a schema and displaying them in a stylesheet.
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
July 21, 2005 00:45:58   #2  
ritwik roy        

RE: Why are recursive relationships are bad? How do you resolve them?
using the concept of self join may be a solution to this problem. e.g if a table called employees contains three fields like emp_id,name and manager_id and we will have to find out the name of the manager for each employee, then we can use the following code 
select a.name,b.name 
from employees a, employees b 
where a.manager_id=b.emp_id 

 
Is this answer useful? Yes | No
November 12, 2007 04:57:35   #3  
Jeetendra Nalawade        

RE: Why are recursive relationships are bad? How do yo...
We have used a different way of maintaning recursive relationship. We have created a ancestry table which will give the childs for each entry upto n th level. This way you can fire queries directly to get the child upto any specific level.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape