473,804 Members | 3,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One class, multiple students?

I have four tables created so far: Courses, Instructors, Courses and
Instructors (which shows the Course and Instructor Name fields, but holds
their IDs since those are the keys), and Students. Now, I wish to create a
Classrooms (or something similar) table which will allow me to pick the
Course from Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple students. I
only want to store the information once, though. I can't declare an array of
Students for each class.... can I? What is the right way to do this?

Thanks,
Eric
Oct 7 '07 #1
13 3793
Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table, and foreign
key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO******** *******@newsfe0 6.lga...
>I have four tables created so far: Courses, Instructors, Courses and
Instructors (which shows the Course and Instructor Name fields, but holds
their IDs since those are the keys), and Students. Now, I wish to create a
Classrooms (or something similar) table which will allow me to pick the
Course from Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple students.
I only want to store the information once, though. I can't declare an
array of Students for each class.... can I? What is the right way to do
this?

Thanks,
Eric


Oct 7 '07 #2
Heh... guess I should have seen that one. I only wanted it to show the class
once, but that is really not an option, I now realize. :)
Okay, so this will make it so that I can put in the class and put in the
student. I can list the same class and many students (showing the same class
each time), and I can have the same student in multiple classes.

I'm used to thinking in a programming fashion, where only one object is
defined but it can have an array (or linked list) of other objects in its
definition. They are not analogous to Access database programming, though :)

Thanks,
Eric

"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******** *************** *******@comcast .com...
Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table, and
foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO******** *******@newsfe0 6.lga...
>>I have four tables created so far: Courses, Instructors, Courses and
Instructors (which shows the Course and Instructor Name fields, but holds
their IDs since those are the keys), and Students. Now, I wish to create a
Classrooms (or something similar) table which will allow me to pick the
Course from Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple students.
I only want to store the information once, though. I can't declare an
array of Students for each class.... can I? What is the right way to do
this?

Thanks,
Eric



Oct 7 '07 #3
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in
news:c6******** *******@newsfe0 6.lga:
Heh... guess I should have seen that one. I only wanted it to show
the class once, but that is really not an option, I now realize.
:) Okay, so this will make it so that I can put in the class and
put in the student. I can list the same class and many students
(showing the same class each time), and I can have the same
student in multiple classes.

I'm used to thinking in a programming fashion, where only one
object is defined but it can have an array (or linked list) of
other objects in its definition. They are not analogous to Access
database programming, though :)

Thanks,
Eric
That third table is called a junction table.

Consider each record in a table as an array, so the whole table
becomes a two-dimensional array. The primary key of each table is
sort of the subscript to identify which ekement of the array you
work with.

The junction table is an array of pointers to the subscripts in the
main arrays (tables) It's just, in database parlance, the
subscripts are called keys. in your junction table, the keys are
foreign keys, refering to the records in othre tables.

As to showing the class once, or the student once, it's very easy to
do based on this table structure,

If you put the class info in the form header, and the student info
in the detail rows, you get the class once, and each student in a
row below that. You can even get more sophisticated, by using the
form for the class, and a sub-form for the students.
"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******** *************** *******@comcast .com...
>Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table,
and foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO******* ********@newsfe 06.lga...
>>>I have four tables created so far: Courses, Instructors, Courses
and Instructors (which shows the Course and Instructor Name
fields, but holds their IDs since those are the keys), and
Students. Now, I wish to create a Classrooms (or something
similar) table which will allow me to pick the Course from
Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple
students. I only want to store the information once, though. I
can't declare an array of Students for each class.... can I?
What is the right way to do this?

Thanks,
Eric






--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 8 '07 #4

"Bob Quintal" <rq******@sPAmp atico.cawrote in message
news:Xn******** **************@ 66.150.105.47.. .
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in
news:c6******** *******@newsfe0 6.lga:
>Heh... guess I should have seen that one. I only wanted it to show
the class once, but that is really not an option, I now realize.
:) Okay, so this will make it so that I can put in the class and
put in the student. I can list the same class and many students
(showing the same class each time), and I can have the same
student in multiple classes.

I'm used to thinking in a programming fashion, where only one
object is defined but it can have an array (or linked list) of
other objects in its definition. They are not analogous to Access
database programming, though :)

Thanks,
Eric

That third table is called a junction table.

Consider each record in a table as an array, so the whole table
becomes a two-dimensional array. The primary key of each table is
sort of the subscript to identify which ekement of the array you
work with.

The junction table is an array of pointers to the subscripts in the
main arrays (tables) It's just, in database parlance, the
subscripts are called keys. in your junction table, the keys are
foreign keys, refering to the records in othre tables.

As to showing the class once, or the student once, it's very easy to
do based on this table structure,

If you put the class info in the form header, and the student info
in the detail rows, you get the class once, and each student in a
row below that. You can even get more sophisticated, by using the
form for the class, and a sub-form for the students.
Excellent! I am going to now create a report based on all of my work. Thank
you again!
>"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******* *************** ********@comcas t.com...
>>Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table,
and foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO****** *********@newsf e06.lga...
I have four tables created so far: Courses, Instructors, Courses
and Instructors (which shows the Course and Instructor Name
fields, but holds their IDs since those are the keys), and
Students. Now, I wish to create a Classrooms (or something
similar) table which will allow me to pick the Course from
Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple
students. I only want to store the information once, though. I
can't declare an array of Students for each class.... can I?
What is the right way to do this?

Thanks,
Eric




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 8 '07 #5

"Bob Quintal" <rq******@sPAmp atico.cawrote in message
news:Xn******** **************@ 66.150.105.47.. .
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in
news:c6******** *******@newsfe0 6.lga:
>Heh... guess I should have seen that one. I only wanted it to show
the class once, but that is really not an option, I now realize.
:) Okay, so this will make it so that I can put in the class and
put in the student. I can list the same class and many students
(showing the same class each time), and I can have the same
student in multiple classes.

I'm used to thinking in a programming fashion, where only one
object is defined but it can have an array (or linked list) of
other objects in its definition. They are not analogous to Access
database programming, though :)

Thanks,
Eric

That third table is called a junction table.

Consider each record in a table as an array, so the whole table
becomes a two-dimensional array. The primary key of each table is
sort of the subscript to identify which ekement of the array you
work with.

The junction table is an array of pointers to the subscripts in the
main arrays (tables) It's just, in database parlance, the
subscripts are called keys. in your junction table, the keys are
foreign keys, refering to the records in othre tables.

As to showing the class once, or the student once, it's very easy to
do based on this table structure,

If you put the class info in the form header, and the student info
in the detail rows, you get the class once, and each student in a
row below that. You can even get more sophisticated, by using the
form for the class, and a sub-form for the students.
Excellent! I am going to now create a report based on all of my work. Thank
you again!
>"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******* *************** ********@comcas t.com...
>>Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table,
and foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO****** *********@newsf e06.lga...
I have four tables created so far: Courses, Instructors, Courses
and Instructors (which shows the Course and Instructor Name
fields, but holds their IDs since those are the keys), and
Students. Now, I wish to create a Classrooms (or something
similar) table which will allow me to pick the Course from
Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple
students. I only want to store the information once, though. I
can't declare an array of Students for each class.... can I?
What is the right way to do this?

Thanks,
Eric




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


Oct 8 '07 #6
If you want to make the database even more normalized, you could eliminate
the "Courses and Instructors" table, add a third field to the
"CourseStudents " table for identifying if the record is for a student or for
an instructor, change the name of "CourseStudents " to
"CourseStudentI nstructor", and use that for both purposes.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:c6******** *******@newsfe0 6.lga...
Heh... guess I should have seen that one. I only wanted it to show the
class once, but that is really not an option, I now realize. :)
Okay, so this will make it so that I can put in the class and put in the
student. I can list the same class and many students (showing the same
class each time), and I can have the same student in multiple classes.

I'm used to thinking in a programming fashion, where only one object is
defined but it can have an array (or linked list) of other objects in its
definition. They are not analogous to Access database programming, though
:)

Thanks,
Eric

"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******** *************** *******@comcast .com...
>Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table, and
foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO******* ********@newsfe 06.lga...
>>>I have four tables created so far: Courses, Instructors, Courses and
Instructor s (which shows the Course and Instructor Name fields, but holds
their IDs since those are the keys), and Students. Now, I wish to create
a Classrooms (or something similar) table which will allow me to pick the
Course from Courses and Instructors, and hold multiple Students for each
Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple
students. I only want to store the information once, though. I can't
declare an array of Students for each class.... can I? What is the right
way to do this?

Thanks,
Eric




Oct 8 '07 #7
"Ken Snell (MVP)" <kt***********@ ncoomcastt.rena etlwrote in message
news:uW******** ******@TK2MSFTN GP06.phx.gbl...
If you want to make the database even more normalized, you could eliminate
the "Courses and Instructors" table, add a third field to the
"CourseStudents " table for identifying if the record is for a student or
for an instructor, change the name of "CourseStudents " to
"CourseStudentI nstructor", and use that for both purposes.
Note that, in this setup, the second field would hold either the Student
foreign key value or the Instructors foreign key value.

And, then you could have just one table -- StaffStudents -- instead of
Instructors and Students tables. And you could put instructors and students
in the same table (with fields to identify when a record is an instructor,
etc.).
--

Ken Snell
<MS ACCESS MVP>


>
--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:c6******** *******@newsfe0 6.lga...
>Heh... guess I should have seen that one. I only wanted it to show the
class once, but that is really not an option, I now realize. :)
Okay, so this will make it so that I can put in the class and put in the
student. I can list the same class and many students (showing the same
class each time), and I can have the same student in multiple classes.

I'm used to thinking in a programming fashion, where only one object is
defined but it can have an array (or linked list) of other objects in its
definition. They are not analogous to Access database programming, though
:)

Thanks,
Eric

"Ken Snell" <kt***********@ ncoomcastt.rena etlwrote in message
news:Y6******* *************** ********@comcas t.com...
>>Create an additional table: CourseStudents.

In that table, put two fields: foreign key for "Courses" table, and
foreign key for "Students" table.

--

Ken Snell
<MS ACCESS MVP>
"Eric IsWhoIAm" <re******@postn ewsmessage.comw rote in message
news:wO****** *********@newsf e06.lga...
I have four tables created so far: Courses, Instructors, Courses and
Instructo rs (which shows the Course and Instructor Name fields, but
holds their IDs since those are the keys), and Students. Now, I wish to
create a Classrooms (or something similar) table which will allow me to
pick the Course from Courses and Instructors, and hold multiple Students
for each Course. I am unsure how to do this in Access.

Each student can have multiple classes; each class has multiple
students. I only want to store the information once, though. I can't
declare an array of Students for each class.... can I? What is the
right way to do this?

Thanks,
Eric




Oct 8 '07 #8
"Ken Snell \(MVP\)" <kt***********@ ncoomcastt.rena etlwrote in
news:uW******** ******@TK2MSFTN GP06.phx.gbl:
If you want to make the database even more normalized, you could
eliminate the "Courses and Instructors" table, add a third field
to the "CourseStudents " table for identifying if the record is for
a student or for an instructor, change the name of
"CourseStudents " to "CourseStudentI nstructor", and use that for
both purposes.
Doesn't that violate first rule of normalization?

First Normal Form (1NF)
First normal form (1NF) sets the very basic rules for an organized
database:
Eliminate duplicative columns from the same table.
Create separate tables for each group of related data and identify each
row with a unique column or set of columns (the primary key).

http://databases.about.com/od/specif...malization.htm

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 8 '07 #9
"Bob Quintal" <rq******@sPAmp atico.cawrote in message
news:Xn******** *************@6 6.150.105.47...
"Ken Snell \(MVP\)" <kt***********@ ncoomcastt.rena etlwrote in
news:uW******** ******@TK2MSFTN GP06.phx.gbl:
>If you want to make the database even more normalized, you could
eliminate the "Courses and Instructors" table, add a third field
to the "CourseStudents " table for identifying if the record is for
a student or for an instructor, change the name of
"CourseStudent s" to "CourseStudentI nstructor", and use that for
both purposes.

Doesn't that violate first rule of normalization?

First Normal Form (1NF)
First normal form (1NF) sets the very basic rules for an organized
database:
Eliminate duplicative columns from the same table.
Which is what my additional suggestion in the second post suggests doing --
one table for "people".
--

Ken Snell
<MS ACCESS MVP>

Create separate tables for each group of related data and identify each
row with a unique column or set of columns (the primary key).

http://databases.about.com/od/specif...malization.htm

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 8 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5662
by: Gary | last post by:
I haver a table of students - Say 100 students that I need to be able to update/delete and amend. I know I can do this one student at a time which is simple but lets say I want to see all the students on the screen at the same time, modify some, mark some for deletion and even have blank fields at the end to add a new record. In HTML which is generated I label each row and input field with a name/number combination i.e <input type=text...
7
6220
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
2
1408
by: Bodger | last post by:
Hi, Bearing in mind that I am new to this game, understand very little about SQL and don't work in IT, I was wondering if someone could give me some friendly advice on how to design relationships and/or forms for the following tables: 1) 'Students' - One record per student. Student can choose six different universities, so as well as all of the other student information, the table has six fields (called 'University 1',
9
12991
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
4
2469
by: Dave White | last post by:
Hello Everyone, I have created two tables to track my students' lessons. Each student is responsible for most, but not all. of the lessons. I've tried a junction table but I can't figure out an easy way to assign one or multiple lessons to a student. tbl_Students
7
6259
by: SeaviewBlue | last post by:
Howdy folks, I am new to the site and new to joins, so I'm hoping I can get some much needed assistance. Using ASP, VBscript & an Access 2003 db, I am building a page to display results from track and field events, and am struggling with joining information from 3 tables. I will try to explain what I have and what I am doing as clearly as possible. Table 1 - Results MeetID - Field used to select records from Results table
9
2554
by: pnayak | last post by:
Hi, I am trying to write an intrusive List template class that accepts any type that is derived from a class called Link. I've derived a class called Student from Link to experiment. When I use the Link and Student class without List they work very well but when I used them through the List class the new operator doesn't throw but seems to be return 0. I've pasted the full code here and the program output. The commented part of main...
3
1954
by: Ethan Furman | last post by:
Hey all. My thanks to all who have responded so far with my other questions. It is much appreciated. Some background on what I'm doing (a good explanation can be found at http://www.hazelwood.k12.mo.us/~grichert/sciweb/phys8.htm): When measuring, there is some uncertainty as to the *exact* value; so, when doing calculations with these measured numbers, one should not present an answer that seems more accurate than the source. For...
25
2851
by: doznot | last post by:
Let's say you want to use Moodle to teach an introductory class in PHP programming. Some of the students have little or no computer experience. In addition to background reading and topics-oriented assignments supplied by Moodle, you want to build an online text editor into the course, so students can type their PHP programs and HTML directly into files on the server, so they don't have to fight with NotePad on Windows PCs in a lab, and...
0
9588
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.