Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Posts
    38

    database design for school grades

    I'm designing a database so I can enter my students marks using SQLite which is a non-relational database.

    The information I have is
    Course Name & Code (for example 'International Business', 'BUS800')
    Course Section (for example '001')
    Course Term (for example 'Fall'
    Year Taught ('2007')

    Student name & number ('John Doe', '000 000 000')

    Assignments (there maybe 4 assignments and 2 exams)

    Student Grade (grade for each assignment)

    So I was thinking this might be the optimal way to make the database so I can compare the different classes or just print out marks from one course.

    Table course (c_RowID, course_name, course_code) // 'International Business' 'US800'
    Table section (s_RowID, section_number) // '001'
    Table terms (t_RowID, term_name) // 'fall'
    Table year (y_RowID, year_taught) // '2008'

    TABLE course_relations (cr_rowID, c_rowID, s_rowID, t_rowID, y_rowID) //where cr_rowID is course_relations rowID so I can then compare this to Students, and Assignment Marks

    Table student(student_ID, first_name, last_name)
    Table assignments(a_rowID, assign_name)

    TABLE assign_course_relations (acr_rowID, cr_rowID, a_rowID) //this would then control which assignment is for which course

    Table student_assign_relations (student_ID, acr_rowID, Grade)

    ---------------
    Is this the correct way of going about it ?

    Any advice is appreciated TIA

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    here is an exercise for you:

    try to see how many of those tables make sense if you do not use an "id" but rather use some other identifying unique key for each table
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2005
    Posts
    38
    Sorry I have no clue what that means, I'm not really a database person, I can just fudge my way through it on the best of days. (come downtown to Ryerson and show me what you mean )

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    to answer your original question ("Is this the correct way of going about it ?") you are very very close

    about coming down to ryerson, that's a wonderful idea, contact me via my site and maybe we can set something up
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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