You are here:

C++/Entity / relationship Diagram


QUESTION: Entity / relationship Diagram

I know this is totally off the topic but was just wondering if you could help me on a simple data base related question?

thank you so much :)

ANSWER: i really do not know much (hardly anything) about databases and ER diagrams. if you pose a specific question, i might be able to point you in the right direction, even if i am not competent enough to give you a complete answer.

---------- FOLLOW-UP ----------

QUESTION: Well I need to come up with the ERD of the following and then the rational model of it. I then would have to create the appropriate tables.  I have already sketched it for myself but don't know how to send it to you since I cannot attach anything to this mail?!

A teacher teaches one or several subjects of one or more units. (i.e. Mathematics is a subject and Algebra and Calculus are units)
A subject is thought by only one teacher.
A student registers for at least one subject or at more subjects with different units. A student will have 1 diploma.
Each diploma consists of one field which needs a secretary (to be taken care of).  A secretary can take care of one or more diplomas.
A student has 3 marks (midterm, final, assignment).
A teacher is a part of one lab. A teacher is one part of only 1 discipline.
A subject can be taught in different diplomas with different coefficients.

ANSWER: relationships between entities which fall into three types:

one to one: example => diploma - consists of - field
one to many: example => secratary - takes care of - diplomas
many to many: example => students - registers for - courses

it is not possible to represent many to many relationships in a database. normalization involves the resolution of a many to many relationship into two one to many relationships.

1. each student can register for one or more subjects
2. each subject can have one or more students

for this you would have to create additional entities. a registration in the above example. a registration is an entity which has the information about one subject and one student.

1. a registration is made by one student.
2. a registration is for one subject.
3. a student can have one or more (many) registrations.
4. a subject can have one or more (many) registrations.

here are a couple of links which deal with a similar problem:

---------- FOLLOW-UP ----------

QUESTION: Thanks for your help and the links.
The problem is that I am not sure if 8 entities that I found are good or not, to continue with the assignment. that is why I need to double check my answer with someone.
I tried to find that particular course which you had sent me the link on the MIT website but couldn't. If you have that could you possibly send it to me cause normally they have assignments with answers there which can help me a lot.
Thanks again for your BIG help :)  

this is the mit opencourseware page:

Spatial-Database-Management-and-Advanced-Geographic-Information-SystemsSpring2003 is here:
under lecture notes, lecture 9 is what you had looked at.

read only resources for this course are here:  


All Answers

Answers by Expert:

Ask Experts




my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.


about 15 years or so

post graduate engineer

©2016 All rights reserved.