Solved

help with database relationships scenario  entity relationship diagram.

Posted on 2012-03-25
1
643 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:jonathan1978
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now