7 Replies Latest reply on Apr 15, 2013 4:33 PM by VoodooSpellcasters

    Relationships problem

    xtremu

      Title

      Relationships problem

      Post

       Hi guys,

      I am using Filemaker Pro 11 Advanced and I am started to develop a simple enrollment system. I am still beginner in Filemaker especially in scripting and for making good relationships. I have two tables now and I want to start from the scratch so that I will fully understand everything specially the relationships of one table to another table.

      Tables:  1. Student = table of student/s information with pkStud_ID (Number-auto serial-)

                      Fields: pkStud_ID (number-auto serial)

                                 StudFirst, StudLast, etc..

                      2. Subject = table of subject/s information with pkSub_ID (Number only)

                    Fields: pkSub_ID (number)

                                SubSection, Description, time, days, etc..

      Relationships: Student::pkStud_ID = Subject::pkSub_ID

      I have already the data in my Student Table, also in my Subject table, I have 6 layout, layout for the Registrar to Add student, student list view,  Subject to add subject/s, Print student to finally print the student report, Block section to view the block section ready to print and the Free Section layout to select subject/s before printing.

      I have Student List View button to go to the student list view layout then go to Print Student layout for final printing but before printing I want to add subject/s that I want from the Free Section Layout. In Free Section Layout I have different Courses and corresponding subjects, if my course is BS Accountancy then all subjects are available and it’s up for the student to select it. After selection it will add to the fields that provided below the student information and up to the maximum units allowed then ready to print.

      1. My problem is I cannot figure out the script to add the subject/s when I click it from the Free Section Layout to go to the Print Student. Please help.

      2. Another problem is when I click the Block section Button I want the Student Information appeared in the Block section layout with fixed Subjects below and ready to print. Any suggestion please

      Thanks for the big help..

        • 1. Re: Relationships problem
          philmodjunk

          Looks like you need a lot more than two tables.

          Courses: A table where each record is a Course and has a pkCourseID field.

          Course_Subject: A table that links one subject to one Course you can build a list of courses for a given subject.

          Enrollment: where you match a student record to a course offered at a given time(section?).

          From there you'll also need a table for setting up the sections (schedules?) for each time a course is offered.

          And more than that may ultimately be needed depending on the needs of your database users.

           

          • 2. Re: Relationships problem
            xtremu

             

            Ok Phil, the followings are my tables:

                                                            1. Student table for student information

                                                            2. Courses table for list of courses

                                                            3. Enrollment table to match student record to a course

                                                            4. Course_Subject table for subject information

                                                            5. Course_Accountancy table for accountancy course

                                                            6. Course_BSBA table for BSBA course

                                                            7. Course_MBA table for MBA course

                                                            8. Course_DBA table for DBA course

            Relationships:

            Course_Subject::pkSub_ID = Courses::pkCourse_ID

            Course_Subject::pkSub_ID = Enrollment::pkEnroll_ID

            Course_Subject::pkSub_ID = Course_MBA::pkCourse_MBA_ID

            Course_Subject::pkSub_ID = Course_DBA::pkCourse_DBA_ID

            Course_Subject::pkSub_ID = Course_BSBA::pkCourse_BSBA_ID

            Course_Subject::pkSub_ID = Course_Accountancy::pkCourse_Acc_ID

            and Student::pkStud_ID = Courses::pkCourse_ID

            This is correct Phil? Below is the picture of the relationships that I temporary made base on my understanding. Please advice or correct me how to connect each table.

            • 3. Re: Relationships problem
              philmodjunk

              Relationships and tables for items 5 through 8 should not be needed. Course_Subject should work for all of them.

              Also, keep in mind that a course might be offered at more than one time. If the time a student is expected to attend the course is important, Enrollment should link a Student to a "session" on which the course is offered. That's one more table you need, a table to list each session that a given course is offered. (If you aren't concerned with the student's exact schedule, just what courses they are taking, you don't need this.)

              • 4. Re: Relationships problem
                xtremu

                Ok Phil here are my new tables:                                       

                1. Student table for student information

                Fields are: pkStud_ID -(Number, auto serial number)

                                 StudentNumber, StudentFirst, StudentLast, StudentYear, StudentCourse etc..

                2. Courses table for list of courses

                Fields are: pkCourses_ID - (number only)

                                fkStud_ID (number), Course_Accountancy, Course_BSBA, Course_MBA, Course_DBA etc..

                3. Enrollment table to match student record to a course

                Fields are: pkEnroll_ID (number)

                                fkStud_ID , Enrollment (I have only 1 field here Phil -Enrollment)

                4.. Course_Subject table for subject information

                Fields are: pkCourse_Sub_ID - number

                                fkCourse_ID, Section, description, units, time, days, room, prof, status - (Open/close)

                5. Session table to list each session of a given course

                Fields are: pkSession_ID - number

                                Section, description, units, time, days, room, prof, status - (Open/close) This is correct Phil? the same fields of Course_Subject?

                That's one more table you need, a table to list each session that a given course is offered?

                Relationships:

                Student::pkStud_ID = Enrollment::fkStud_ID

                Student::pkStud_ID = Courses::fkStud_ID

                Courses::pkCourses_ID = Course_Subject::fkCourses_ID

                Session::fkEnroll_ID = Enrollment::pkEnroll_ID

                Phil are my tables, fields, relationship is correct? Please help. thanks..

                • 5. Re: Relationships problem
                  philmodjunk

                  Not what I was suggesting.

                  The tables would link like this:

                  Student---<Enrollment>----Sesssions>-----Courses-----<Course_Subject>-------Subjects    (--< means "one to many" )

                  Student::__pk_StudentID = Enrollment::_fk_StudentID

                  Enrollment::_fk_SessionID = Sessions::__pk_SessionID

                  Courses::__pk_CourseID = Sessions::_fk_CourseID

                  Courses::__pk_CourseID = Course_Subject::_fk_CourseID

                  Subjects::__pk_SubjectID = Course_Subject::_fk_SubjectID

                  All fields starting with __pk are auto-entered serial number fields and all fields starting with _fk are number fields.

                  This is just the main "back bone" set of relationships. Many occurrences of these basic tables in different sets of relationships may be needed before you finish this project. Note that you have two many to many relationships here each with a join table (Enrollment and Course_Subject).

                  You may find that this demo file that illustrates the basic set up for using a join table in a many to many relationship plus a few extras for enhanced interfaces to be useful: http://www.4shared.com/file/dZ0bjclw/ManyToManywDemoWExtras.html

                  • 6. Re: Relationships problem
                    xtremu

                     Sorry for my late reply Phil, Thanks for the inputs/ suggestions. I started to work on this relationships..

                    xtremu

                    • 7. Re: Relationships problem
                      VoodooSpellcasters

                           POWERFUL HERBAL SPIRITUAL HEALER & FORTUNE READER/PSYCHOLOGIST (Relationship Specialist) DR.BRAI.  IN WEST AFRICAN:

                            Get the Below Problems solved in just 5days of Spell....
                           1. Charms/Spell to take away Bad Luck & Give Good Luck in Life
                           2. Fix broken Relationships, Marriages
                           3. Gives Quick Fertility
                           4. Fight Evil/ Witchcraft/ Ghost/ Bad spell/ Curse/ Nightmares & Cleans Homes.
                           5. Bring back Lost Lover/Family
                           6. Makes Court Cases/Divorces/Bad Debts to disappear.
                           7. Attracts Customers in Business.
                           8. Herbs to Cure HIV-AIDS.
                           9. Lucky Spells/Charms to increase your Wealth.
                           10. Charms for Gambling/Lotto/ Casinos. ETC

                           Contact Details: Voodoospellcast@yahoo.com, Homepage: http://voodoohome.hpage.com,  Tel: +2347030759636