SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2003
    Location
    Auckland
    Posts
    309
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Design Help - Course Prerequisites

    I'm looking for help in designing part of this database i'm working. I work at a University and as such have courses that are run.

    These courses have prerequisites (which are just other courses). It isn't as simple as just assigning a course as a prerequisite though.

    Example 1 (Made up courses):

    To take Economics 202 you must take either ECON 101 or ECON 202 AND MATH 101


    In this example i basically have 2 groups of prerequisites.
    Group1: ECON 101, ECON 202
    Group2: MATH 101

    So to solve this i've used to following database structure:


    A Course can have many PrerequisiteGroups. The Field JoinType lets you 'join' two or more PrerequisiteGroups together, so in the above example i can join Group1 and Group2 by setting Group1's JoinType to NULL and Group2's JoinType to AND.

    Each PrerequisiteGroup has 1 or more Courses assigned to it - in the table PrerequisiteGroup_Course, courses are 'joined' in the same way as the PrerequisiteGroup's with JoinType containing NULL, AND or OR.

    I don't think this is the best solution though. It can only model one level of grouping i.e. you can't have nested groups. (i'm not sure if i'll need to go into another level though).

    It's also a bit messy with that JoinType field, which only currently works with the order the information is entered. Perhaps assigning a priority/order to each PrerequisiteGroup and PrerequisiteGroup_Course would help?

    If anyone has any idea's on how I can model this data better it would be appreciated.

  2. #2
    SitePoint Addict
    Join Date
    May 2003
    Location
    Auckland
    Posts
    309
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No Idea's then?

    Or is my solution the best one possible?


Bookmarks

Posting Permissions

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