Results 1 to 2 of 2

Thread: Mapping Problem

  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Unanswered: Mapping Problem

    Hi,

    I have this case:

    Entities

    1-Classes
    2-Students
    3-Teachers
    4-Subjects: Mandatory (Math, English, Geography) and Elective (Biology, Chemistry).


    Details

    1-Each class has some students.
    2-Each student must study mandatory subjects and two elective subjects.
    3-Each teacher teaches in one class at least.
    4-Only managers have permission to know teachers salaries.

    My Solution is:

    Class
    *************
    ClassName
    TeacherID(FK)

    Subject Master
    **********************
    SubjectId
    SubjectType (mandatory/elective)

    StudentMaster
    **************************
    StudentId
    StudentName
    ClassName(FK)

    StudentsSubjects
    **********************
    StudentId
    SubjectId

    Teacher
    **********************
    TeacherId
    TeacherName
    ManagerId (foreign key FK_TeacherIdManagerId)

    Detail #2:How to be sure that with every students all mandatory subjects have been added.

    Detail #3:How to make sure that ach teacher teaches in one class at least.

    Detail #4: How to make only managers have permission to know teachers salaries.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Detail #1 --- Design - Why have ClassName in StudentMaster table?
    Detail #2 --- look at not exists to find the students that are not in a mandatory class
    Detail #3 --- you could perform a count and gran the null count, you could left outer join and then change back to an inner join by putting where class.col is null, you could try a not exists.
    Detail #4 --- take a look at LBAC, views, security in general

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •