I have 2 places I'm stuck on with my DB design..
1**************************************************************************
how to translate ERD that looks like this into real tables?
http://schemabank.com/sites/default/files/images/notation_self_relationship.gif
my entity is "Course", if before student wants to take some course he must take few pre-courses then how should I model this?
tableCourse- id, name
tablePreCourses- courseId, preCourseId
and the other way around, if those are the tables, is it correct to draw the ERD like in that picture? or it should be 2 entities with 1-M connection?
2******************************************************************************
so, I have Students, which my program would categorize and give them a Status (good, has a warning, expeled..etc)
every student has only 1 status at any given moment, but they change them and can return to past statuses..like- good, bad, expelled, bad (return to school), good...etc
so I want to keep the hystory of their statuses.
so I have few options here and I don't know which is the right one!!
Hystory-studId,date,status
Status-statusName
Student-Id, name..
so I can make Hystory be the weak entity to Student cuz there's no hystory without the student, but I don't know if I even need the Status table, but it's a big deal in my program, so if I want to make a report of all the expelled students I'll have to do some crazy SQL with the Hystory table to get every student's current status, so maybe I should add a "current status" field to Student..so then I DO need the Status table or not? also don't know if I should make the "status" in Hystory a foreign key, or one of the primary keys..
another idea is to make the Hystory the relation table between Student and Status, cuz every student has many statuses, every status has many students..but the thing here is that, the same student can have the same status more than once, so I'll need 1 more key in Hystory (date). if I do it like this then I can't really add the "current status" to Student, can I?
buttom line I'm stuck in a maze!! any ideas to would be appreciated!