Solved

help with database relationships scenario  entity relationship diagram.

Posted on 2012-03-25
1
649 Views
Last Modified: 2012-03-26
We are building a system that will have student, parent, and teachers using the system.

We want to the system to beable to show relationships between the users,  so on a student profile it would list their teachers, and parents,  Parents would see their students (child) and their teachers. Teachers would see their students, and the students parents details.  It's a long time since i did entity relationships  so very rusty.  

I have tables called

Users (user_id, firstname, lastname, address1,address2,city,zip,phone,email,password, created_at,updated_at)
teacher_users (id, user_id, student_id, parent_id, created_at, updated_at)
student_users(id, user_id, teacher_id, parent_id, created_at, updated_at)
parent_users (id, user_id, teacher_id, student_id, created_at, updated_at)

Do those table look correct ? and how would i define relationships,  many-many etc.

teacher_users,student_users,parent_users  have One user  Users has many Teachers, Students,Parents.

Teacher would see many students, 1 or 2 parents for that student.

student would see many teachers, and 1 or 2 parents.

parent would see many teachers and 1 or many students (might have a few kids)

How would i show these in a ERD ?
0
Comment
Question by:Jon Imms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Sandeepratan earned 500 total points
ID: 37764809
this can be achieved by using relates tables, u can refer below design

1. People ( id,name,address,other fileds)
2. RelationType (rel_id,name)  (example 1,'teacher',  2,'parent'
3. PeopleRelats (id1,id2, relationid)
 
this is basic layout, you can extend the same for specific relations
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
clicking to find my folders on wamp 8 46
Concat multiple records into one line 3 70
CSS - Centering an image 2 47
How do I buy BitCoin? 4 27
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question