Results 1 to 2 of 2

Thread: designing a table

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    designing a table

    Hello,

    I am developing a database for a school, and l have got all the tables designed, but l have a few questions about the table that will be used to store data for an exam.

    The teacher will write the exam and could have 20 questions 25, or 30 questions. This depends on the teacher writing the exam, they could have as many as they want. So how could l develop the database inconsist number of questions? Should l have the maximum number of questions a teacher could have.

    The teacher will write the questions and these would be stored in the table. The exam could contain multiple choice or written exams questions. The relationship is a 1 teacher writes many exams. So it is a 1 to many relationship.

    How would l design a table with this data. The individual questions could be text datatype, and the multiple choice could be boolean.

    Many thanks in advance

    Steve
    steve

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Hi,

    Personally I'd do something like the following, and get a nifty screen to deal with the rest.

    tblStudents
    StudentID - Auto - PK
    ...

    tblTeachers
    TeacherID - Auto - PK
    ...

    tblExams
    ExamID - Auto - PK
    ExamName - Text - 50
    CreatedOn - Date/Time
    CreatedBy - Number (TeacherID)

    tblExamQs
    ExamQID - Auto - PK
    ExamID - Number - FK
    QTypeID - Number - FK
    QNo - Number
    (MaxNo - Number)
    CreatedOn - Date/Time
    CreatedBy - Number (TeacherID)

    tblExamQsOpts
    ExamQOptID - Auto - PK
    ExamQID - number - FK
    Choice - text - 50
    Value - number

    tblExamResponses
    ExamResponseID - Auto - PK
    ExamID - number - FK
    StudentID - number - FK
    ExamQID - number - FK
    WrittenResponse - memo
    Ticked - boolean
    OptionChoice - number

    tblLUQTypes
    QTypeID - Auto - PK
    QType - text

    Extra field to tblexams? (SubjectID - Number (???))

    Of course I don't know how the rest of the db is done, and how students will enter results, but that is hopefully a fairly good design.

    I see you are in the UK. PM me if you happen to know of any work using Databases (especially Access) for some part time freelance work, I'd be interested


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width