Welcome! Log In Create A New Profile

Advanced

Sample database

Posted by mauritz 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Sample database
October 29, 2009 02:37PM
Hi guys!

It may have appeared that I dissapeared of the face of the earth smiling smiley Well I moved and Telkom took FOREVER to install my ADSL line! But fortunetaly I am back, and hopefully just intime to submit my project smiling smiley Working around the clock to get this guy finished!

I have a question, which may sound pretty stupid, but I miss the point of the 3rd sample database provided in our tutorial letter "student_course" - This would appear to be a database to store records of which students are registered for which courses?

Wont it work by just adding a additional field in the student table called "course" and then doing a sql join when doing a select query to get the results? I also noticed a field called "year", what would its function be?

I have hope that I will be done in time smiling smiley Chat to you guys soon!
Anonymous User
Re: Sample database
October 29, 2009 04:46PM
Hi Mauritz

Welcome back smile

We need to use the db provided unless we're going to host the project ourselves and email Mac the code.
I think that the db was designed to provide us with a challenge (and therefore extra work). It just means additional sql queries to insert into and select from the course_student table. It also means that we can delete course and student associations, effectively deregistering a student from a particular course without deleting the student's other details, allowing him/her to register for a different course without entering all the other details over again. Yes, it probably would be simpler with a slightly different db structure, but there you have it...

The year field is basically the year in which the student has registered for the particular course(s). I used the date function to get the year (hopefully it is okay to do it that way).

I hope this helps a bit.

Good luck...hopefully we all finish in time smileys with beer
Re: Sample database
October 29, 2009 06:39PM
Hey Prav thank you for replying ... well so far so good smiling smiley

Yes, I think some of the fields in the sample database can maybe change smiling smiley I am considering to actually drop the student_course table as I think by incorporating a course_id field into the student table, you can run a cross reference in your sql query, but then, I never considered the year of registration for the course .... mmmm ... so that makes a little more sense smiling smiley So far, I have my layout ready, got both courses and students to register smiling smiley Now comes the difficult part, dynamic linking for student edit smiling smiley

I am going to just get everything to *work* and then fine tune things. Atm my code needs some functioning, but I have inserted some cool features which actually went quick smiling smiley
Re: Sample database
October 29, 2009 10:50PM
Okay well .... Playing around with this I came to my own (hopefully right conclusion, and hopefully Mac can assist me here)

The student_course table appears to me relatively pointless, but depending on how you write your project and what the specific needs are for the database.

I am going to go with my own route here, by adding a registration year field and a course_id field to the student table. When the admin registers a new student, he will be given the option what course the student will register for, and by default will enter the registration year into the database with the PHP date function. Admin can be changed the course of a student by merely going to edit the student and changing the course. Thinking logically about the project, an lecturer would want to see what courses hes students are registered for, so the course report page will then basically draw a report per course of which students are registered for the specific course, and show the year the student was/is registered for the course. the only thing I am not sure off, and this may be the make or break (but not really specified in the project diagram) is does the lecturer want to see an archive of course registrations? I mean, should the report be able to hold data of e.g. the same student registering for multiple courses over a number of years or is it primary for what students are registered for individual courses at the moment (meaning that when the student takes a different course, it will not show a record of the students registration with the previous course?)

Hope this makes sense, and I really hope this question wont cause a upset with other completed projects, as this would appear to be a loophole smiling smiley Ill try to avoid completing this section for now until I get feedback from Mr. Mac smiling smiley
avatar
Mac
Re: Sample database
October 30, 2009 06:54AM
In another thread I indicated that this db is by no way "well designed". I chose the current structure to get you thinking, and to see how you code based on this structure - as prav rightly indicated. If I allowed you to design your own db, everyone would have their own structure, depending on what they want to achieve. So you have to work with what I gave you, otherwise I need to recreate your db - and no matter how I do it (you can include a dump, a script) it will be a nightmare. Which is why most apps comes with an install script to ease the process. There is no time for that here. I must limit is to a minimum - and that minimum is defined in the flow chart in the tut. I you want to add extra functionality - that is fine - but only code side.

The fact that you want to change the structure is good - it is what this course also wants to achieve - to get you thinking about more than just the coding part.

How you want to do it is not good db design. Adding a course_id to the student table - what happens if the student registers for two courses? You will then have two rows - repeating his personal information...! So we separate his personal information, separate the course information, so we can change that info in one place if it changes.We put that info together in another table. Btw - it may appear that one does not really require a sno - why not just use his id number? No two id's are the same? But what about a non-SA student who does not have a 13-digit id number? See where this is going?

Point is - you must stay with the structure I provided.
Re: Sample database
October 30, 2009 12:39PM
Hi Mac

Thank you for the response. yes it makes sense now. I never considered a student wanting to register for 2 courses. This will not actually mean that I have to change the way I wanted the students to register courses. At the moment I have a self populated dropdown list of the courses, but as You know I cannot really make the student register for 2 courses if there is only 1 dropdown list. mmmm .... ill have to go think about this one.

Lets see how it all turns out smiling smiley
Sorry, only registered users may post in this forum.

Click here to login