473,388 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Relationships MS Access

12
I am creating a database and unsure how to continue.

I have two tables created so far: Members, Instructors

Each student can attend only one class; but each instructor can teach multiple classes. I have linked Customer ID as Primary Key with Course ID. However they are linked in the order they are shown. I want to link multiple customers with a Class.


I hope I have made sense.



Thanks in advance!!

Andrew
Aug 10 '12 #1
16 1799
Seth Schrock
2,965 Expert 2GB
Can you give the field names?
Aug 10 '12 #2
and111
12
Table 1 Field names: Customer ID (PK); Prename; Surname;Address
Table 2 Field Names: ClassID; Date/Time; Exercise; Instructor
Aug 10 '12 #3
twinnyfo
3,653 Expert Mod 2GB
You should have some sort of Enrollment table that has foreign keys for students, instructors and courses. This should allow any combination for your classes.
Aug 10 '12 #4
and111
12
So I need to have 3 tables?
Aug 10 '12 #5
twinnyfo
3,653 Expert Mod 2GB
I would recommend at least these:

1 Table listing all your students
1 Table listing all your courses
1 Table listing all your instructors

1 Table listing all enrollments, which would use the PK from the other tables to know which students are taking which courses (which gives the instructor, too).

Depending on if you have different terms or semesters, you would have a table for that as well.

Structure is simple, but would allow you to adjust instructors to classes as necessary.

Please let m eknow if you have any additional questoins.
Aug 10 '12 #6
Seth Schrock
2,965 Expert 2GB
I believe that you will need 4 tables. Since each class can have many students and each student can take multiple classes, this forms a many-to-many relationship which requires a join table. So your tables would be like the following:

tblInstructors
InstructorID PK
Prename
Surname
Address
etc.

tblStudents
StudentID PK
StuPrename
StuSurname
StuAddress
etc.

tblClasses
ClassID PK
ClassName
Instructor
NumberOfCredits
etc.

Your join table would be
tblStudentClasses
StudentID PK
ClassID PK

Instructors would be related to the classes, classes to the join table and students to the join table.
Aug 10 '12 #7
and111
12
Ok thanks for your answers, but the database I am making means that one student can only join one class but a class can have multiple students.
Aug 10 '12 #8
Seth Schrock
2,965 Expert 2GB
Okay, then you can get rid of the join table (tblStudentClasses) and add a Class field to tblStudents and make a relationship on that.
Aug 10 '12 #9
twinnyfo
3,653 Expert Mod 2GB
Of course, this assumes that a student would only ever take one class. If the student returns for another class, you still need the tblStudentClasses so keep a record of which classes the student took in the past.....
Aug 10 '12 #10
and111
12
so in terms of relationship, what fields would i join together
Aug 10 '12 #11
Seth Schrock
2,965 Expert 2GB
Assuming no tblStudentClasses...
tblInstructors to tblclasses on InstructorID:Instructor.
tblStudents to tblClasses on Class:ClassID.
Aug 10 '12 #12
twinnyfo
3,653 Expert Mod 2GB
Seth gave a pretty good example in #7 above. That should really be your starting point. There will probably be more info you need to build into this table, but this should be the skeleton you start with.
Aug 10 '12 #13
and111
12
Ok, I managed to do it on MS Access and its working.

Thank you Seth and twinnyfo.
Aug 10 '12 #14
and111
12
Sorry for asking another question, but do you know how I would make a query which would list the classes a particular instructor must attend
Aug 10 '12 #15
Seth Schrock
2,965 Expert 2GB
As this is a separate question from the original topic, please start a new thread and I/we can help you there. I'm not an admin for this website, or I would move it for you.
Aug 10 '12 #16
and111
12
Ok thanks, will do that now
Aug 10 '12 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the...
2
by: Max | last post by:
Hi. I really hope someone can help me. Going slowly insane with this problem. I have a two Access 2000 databases. One is the backend containing tables and some admin queries. The other is the...
7
by: Ruben Baumann | last post by:
Just wondered if anyone has had occasion to use, or does use, FileMaker, or Raining Data's Omnis, or Alpha5's software, and how they compare with Access? Ruben
7
by: davegb | last post by:
I'm totally new to relational database design. My boss has asked me to create a database of information on the employees in our group. Seemed to me like a simple application to learn the ropes. A...
10
by: Dixie | last post by:
I need to delete some relationships in code. How do I know what the names of those relationships are?
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
10
by: Richard | last post by:
Hi folks, thanks for taking the time to read this (and hopefully point our where I'm going wrong). The scenario: I have a local Access2007 database which links in several read only mySql...
8
by: Phil Stanton | last post by:
I have a FE, BE database on my home computer and a duplicate on the office computer. Both use Ak2 on Windows XP. The one at home appears normal. The BE consists of about 50 tables with numerous...
0
by: Gordon Padwick | last post by:
A form contains controls, one or more of which can be other forms. A form that contains another form is known as a main form. A form contained by a main form is known as a subform. A subform itself...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.