Database for a College or School - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html) +--- Forum: Bar (https://python-forum.io/forum-27.html) +--- Thread: Database for a College or School (/thread-5628.html) |
Database for a College or School - nexusfactor - Oct-13-2017 While working on a task today, my brain was occupied by another task that I'm not quite sure how to solve. Either I'm trying to do too many things with a design that doesn't allow it or I'm not thinking about it properly. This isn't an professional issue or problem with code I'm having, so please don't move this thread to General Coding Help, it's more a recreational problem. Here it is: Suppose you've been tasked with creating a system to allow students to register for a course, and view there grades at the end of the course. This same system should allow the professor to generate an attendance list of his/her class. The problem I'm having is where would the student grade go? or the student relationship to class. My thinking is: A Student can enroll in a class, provided it isn't full. A Class can have a list of students. A Student can obtain a grade in the course they enrolled in. class Student: def __init__(self, id, firstname, lastname, listofcourses): self._id = id self._firstname = firstname self._lastname = lastname self._listofcourses = listofcourses; class Course: def __init__(self, courseID, courseName, professor listofStudents): self._courseID = courseID self._courseName = courseName self._professor = professor # A class called professor self._listofStudents = listofStudents self._isFull = False
A little Googling turned up this link and this one. Because of the many-to-many relationship, you would create a junction table, but how then would a professor generate an attendance list with the database? Would grade go in the junction table? RE: Database for a College or School - ichabod801 - Oct-14-2017 Given the requirements as stated, I would say the answers are:
RE: Database for a College or School - Larz60+ - Oct-14-2017 You might get some ideas here: http://try.orbund.com/einstein-capterra/ |