March 26, 201510 yr Hello, I have a database with the information of every student in the school linked and everyone has a unique ID provided by the school. Now, I have access to their school schedules from an excel file. Each student has 8 periods. What is the best way to create a relationship so I can have some sort of portal on the layout with the student information to show their schedule sorted from period 1 - 8. What I currently did was have 8 excel files each with the student ID and each excel file had only one period. So I imported the period 1 and period 2 but without matching, i just kept adding new records. Right there would be 8 records in the "Schedule" table all with the same student ID. This approach worked but I know it is not the best way to do this. Can anyone suggest a better way?
March 27, 201510 yr Author Sounds about right to me, what is it that's troubling you? Isn't it bad that there are 8 serials which are supposed to be unique? I created a separate database for a Saturday school session we are having and only some of the students of the school participated in it. Now, I want to import the schedule from the other database that has the schedule of all the students but when I go to do that it only imports one period since I am importing by matching student ID and it overrides the original data when the student id comes up again during the import.
March 27, 201510 yr You're being extremely vague. Which ID fields are you talking about? What does your relationship graph look like?
March 27, 201510 yr Isn't it bad that there are 8 serials which are supposed to be unique? In the Schedule table, each Student is supposed to have many (8 in your example) records, and the StudentID is not supposed to be unique. That's how every one-to-many relationship works: in the parent (one) table the ParentID must be unique - usually this will be an auto-entered serial number; in the child (many) table, the ParentID field is just a regular field and the values will not be unique, because by definition one parent has many children.
Create an account or sign in to comment