Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Posts
    5

    Urgent help needed

    Hi there just start a course in database development and I was given an assignment on computer department in college. We were told to define a schema which I did see the code below.

    Code:
    CREATE CLASS Department
    SUPERCLASS object
    RELATIONSHIP set (programme) register inverse programme assigned to
    
    CREATE CLASS Programme
    SUPERCLASS: student
    RELATIONSHIP set (module) memberOfModule inverse module enrolment
    RELATIONSHIP programme leader course leader inverse lecture leads
    
    CREATE CLASS Module
    ATTRIBUTE ModuleName: STRING
    ATTRIBUTE level: INTEGER
    ATTRIBUTE roll: INTEGER
    RELATIONSHIP LIST (programme leader) taught by inverse lecture teaches
    RELATIONSHIP SET (module) prerequisite
    
    CREATE CLASS student
    SUPERCLASS: Object
    ATTRIBUTE student: CHARACTER
    ATTRIBUTE termAddress: CHARACTER
    ATTRIBUTE dateOfBirth: DATE
    ATTRIBUTE dataOfEnrolement: DATE
    
    CREATE CLASS Mode of study
    ATTRIBUTE studentDetails: student
    ATTRIBUTE moduletDetails: student
    
    CREATE CLASS year of study
    ATTRIBUTE studentDetails: student
    ATTRIBUTE moduletDetails: student
    
    CREATE CLASS moduleAssessment
    ATTRIBUTE studentDetails: student
    ATTRIBUTE moduletDetails: student
    
    CREATE CLASS programme leader
    RELATIONSHIP set (module) teaches inverse module taughtBy
    RELATIONSHIP programme leader inverse lecture leads

    The problem is that I don’t know were to add the appropriate primary and foreign keys . Your help will be truly appreciated . Thanks in advance .

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    in your own words, what is the purpose of a primary key? what is the purpose of a foreign key?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2008
    Posts
    5
    what I understand is that primary keys are attribute that are used to uniquely identify the tuples of relation while the foreign keys link relations.This schema is meant to be in third normal form, for some reason I've been trying for days to get it into 3NF.

    I recently managed to get it into 3NF but my lecturer told me to add in primary and foreign keys. which should be easy, but for some reason i can't wrap my mind around these two concepts .

    My biggest mistake for the schema was failing to normalize the data.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you understand PKs and FKs adequately

    by the way, what language is that?

    most databases use tables and columns

    is that some kid of oops inheritance with the classes and attributes?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    May 2008
    Posts
    5
    Quote Originally Posted by r937
    you understand PKs and FKs adequately

    by the way, what language is that?

    most databases use tables and columns

    is that some kid of oops inheritance with the classes and attributes?
    SQL
    yeah the schema contains inhertance.
    It's acually a schema for an object oriented database it meant to define object class.

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    that's SQL? whoa

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    May 2008
    Posts
    5
    thanks hope i'm on the right track.

Posting Permissions

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