473,698 Members | 2,869 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 3776
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
5654
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
6202
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
1404
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
12978
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
2462
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
6253
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
2549
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
1936
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
2832
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
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
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
9026
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...
0
8861
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
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
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
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.