Ok i was assigned the task of making a student database for all the students in a class. The database through a switchboard should be able to add students delete students and perform queries to find an individual student and determine what subject he currently has and the instructor for that subject.
What i've done so far
Created the student table with the following fields: - Student ID, Student Name, Age, Sex, Grade, Parent/Guardian, Contact Number, Email
schedule table (have one for each day of the school week) fields:- Period, Subject, Instructor, Start Time, End Time
My question is can someone please indicate to me how to created the necessary queries to perform the objective of my database. What I can't seem to figure out is how i'm suppose to link these two tables
thanks for the reply, actually the objective is a query to display the
Student Name, Period, Subject, Grade, Instructor from entering the student name and period. I've kind of figured out how to perform the query but without proper relationship among the tables it don't display the correct info.
Would it be possible for you to give me a sample on how i can link the tables i have no idea of an appropriate foreign key to use
Thanks for your input i realise that my tables are incomplete
First, get rid of Age. Such a field is crazy... who is going to be tasked with keeping the age current for every student? Instead just store DOB and then age is just a calculation.
As for linking, there is a significant design problem. Just adding a foreign key isn't going to work since a scheduled session (Period, Subject, Instructor, Start Time, End Time) needs to have many students associated with it and each student will need many sessions associated with them, so you need to study up on how to create a many to many relationship.
Would it be possible for you to give me a sample on how i can link the tables
This wouldn't happen to be a homework problem would it? The reason I ask is that I see a post from a new member asking almost the exact same thing about once a month. What you've asked for is a classic homework problem.