Avatar of Arikael
Arikael
Flag for Switzerland asked on

An ERM and a complex recursive relation

Hi experts

I'm at my witt's end and hope you can help me.
In my ERM I have an entity "user" which has a recursive relation.
-------------
a user can also have one or none substitute user, while a subtitute user can substitute (n) users.

like:
user --1-------- substitutes -------- mc -- user
user --1 ------- has substitute user --------- c -- user

-------------
and a user (or subsitute user) can have (n) threads
 user -- 1 -------------------- mc -- threads

I tried many things, but I'm not sure how to transform this relations into a valid ERM.

The Problem is I need to be able to tell if a substitute user or a normal user owns a certain thread.

I'm very thankful for any help :)
DatabasesMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
Arikael

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
David Todd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Arikael

ASKER
thanks

I think I didn't explain the thing with the threads correctly.

Whenever a user creates/owns a thread, I need to be able to tell if a normal user or a substitute user owns the thread. But when a substitute user owns a thread I also need  to know which user he substitutes.

I think this is the part where I struggle.

With your solution this doesn't seem possible (or am I wrong?)
Arikael

ASKER
Hi

I just gave your solution an other look, I think I was wrong when I said, your solution wouldn't work.
But to make it work I would have to create the relation between users and threads with the field ManagerID (in your example)

Which would result in redundant data, I guess.


I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck