May 19 2012, 12:54 PM
I have a table with a list of students classes. It is information about the what they study, what professor, days in week and time (eg. 14.30-16.00).
What is the best way to store days and time in a table? yes / no field for each day (that would be easy for user when create class to check what deys are)?
Time in two separate field?
Maybe one day they would like to print schedule from that information, so what is way for manipulating data?
May 19 2012, 01:03 PM
Are you saying that you have 1 table to store all of that information about the Student??
If you say "Yes" then your structure is wrong
Maybe it would help if you can upload a zipped copy of the Db so we can see the structure
May 19 2012, 02:59 PM
Students are separate in students table. This is class (groups) that go mon-wed, and tue-thr for now.
I use joint table students-group for storing what student go to what class.
May 19 2012, 03:00 PM
Can you upload the Db so we can see the structure??
May 19 2012, 03:12 PM
There is a lot of work to remove all data and all are in croatian language.
But in short, i have students, they have contract to learn some language and i have group id in that contract. its really simple.
(in previous post i said i used join table, but that was for exam, one contract many exam. But here we have one contract one group so i just wrote group id in student contract.
So basicly, in group table i just want to store days group id, id of profesor, what days in week is that group....
May 19 2012, 04:19 PM
Sorry, I like to see the structure before making any suggestions
Maybe someone else will jump in and give you an answer
May 20 2012, 07:11 PM
Typically this would use four tables to model the many to many relationship:
StudentID <primary key>
<other biographical information>
CourseID <primary key>
CourseName <e.g. History, Croatian Literature, Database Design>
<other information about the course as a whole>
ClassID <primary key>
CourseID <link to Courses>
StartTime <date/time, e.g. 5/21/2012 10:30am>
EndTime <e.g. 5/21/2012 11:45am>
AttendanceID <primary key>
ClassID <link to Classes>
StudentID <link to Students>
<any information about this student with respect to this class session, e.g. excused absence>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here