473,398 Members | 2,120 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,398 software developers and data experts.

Listing Courses

I have a table, which is a list of courses with a CourseID key field and
about a dozen fields describing the courses. I also have a table that lists
all of the students taught by one teacher, which also has a field called
CourseID, which is linked to the CourseID in the other table. There will be
many students in each course and a teacher will teach more than one course.
What I want to do is to create a recordset that lists the courses taught by
that teacher, along with their included description fields. I am a bit
unsure how to get the list. For example, Teacher A teaches 3 courses, each
course having up to 15 students. This information is in one table with an
individual entry for each student - called "StudentInfo". The other table,
called "CourseInfo", consists of maybe 50 courses, with a dozen fields
accompanying them. What I am trying to extract, is just the list of the 3
courses with the fields accompanying them.
Nov 12 '05 #1
2 1484
I am a little confused about your table structure, but I could think of
two ways you could have it set up. To extract just the list of the 3
courses with the fields accompanying them, try

SELECT * FROM CourseInfo INNER JOIN TeacherInfo ON CourseInfo.TeacherID
= TeacherInfo.TeacherID WHERE TeacherInfo.TeacherName = "A"

or

SELECT * FROM CourseInfo (INNER JOIN StudentInfo ON StudentInfo.CourseID
= CourseInfo.CourseID) INER JOIN TeacherInfo ON TeacherInfo.TeacherID =
StudentInfo.TeacherID WHERE TeacherInfo.TeacherName = "A"

Pavel

Colin wrote:

I have a table, which is a list of courses with a CourseID key field and
about a dozen fields describing the courses. I also have a table that lists
all of the students taught by one teacher, which also has a field called
CourseID, which is linked to the CourseID in the other table. There will be
many students in each course and a teacher will teach more than one course.
What I want to do is to create a recordset that lists the courses taught by
that teacher, along with their included description fields. I am a bit
unsure how to get the list. For example, Teacher A teaches 3 courses, each
course having up to 15 students. This information is in one table with an
individual entry for each student - called "StudentInfo". The other table,
called "CourseInfo", consists of maybe 50 courses, with a dozen fields
accompanying them. What I am trying to extract, is just the list of the 3
courses with the fields accompanying them.

Nov 12 '05 #2
I agree with Pavel... I had to do this kind of thing for a class... I
think the best structure might be something like this:

Department--(1,M)--Course--(1,M)--ClassSection-(1,M)-SectionRoster--(M,1)--Student

Then Instructor would be related to ClassSection (1,M)

ClassSection(
CourseID, (FK from Course)
ClassSectionID, (Primary Key)
InstructorID, (FK from Instructor)
RoomNo,
StartTime,
FinishTime,
....)

SectionRoster(
ClassSectionID,
StudentID,
Grade...)

If you do it this way, it's a lot more flexible, and you can get
pretty much any information you want without having to resort to union
queries etc.

HTH,
Pieter
Nov 12 '05 #3

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

Similar topics

0
by: Ola Olarinde | last post by:
Hi, I am tring to build a registration online form that participants will be able to choose from about 75 diferent courses divided into various sessions and choosing a course per session. The...
0
by: Rare Book School | last post by:
RARE BOOK SCHOOL (RBS) is pleased to announce its Winter and Early Spring Sessions 2004, a collection of five-day, non-credit courses on topics concerning rare books, manuscripts, the history of...
0
by: Rare Book School | last post by:
RARE BOOK SCHOOL (RBS) is pleased to announce its Spring and Summer Sessions 2004, a collection of five-day, non-credit courses on topics concerning rare books, manuscripts, the history of books...
1
by: Pieter Linden | last post by:
Hi, I think the subject line pretty much says it all... Say I have a students-classes database and I add a twist. I want to filter what courses a student can take by comparing the courses he...
1
by: Will | last post by:
I have a 3 main tables, tblStudent, tblEnrolled and tblCourse. I have an unmatched query which will tell me which students are not enrolled for a specific course. I also have an unmatched query...
0
by: Marian Heddesheimer | last post by:
Rent-a-Tutor.com is in search for testers as online-courses students. As operators of rent-a-tutor.com we are proud to offer high quality online courses over the internet at reasonable prices. At...
1
by: gordon | last post by:
Hi I have been using C# for a few months after reading a few books and I like to take my 'knowledge' to a more structured level. I am thinking about doing microsoft courses CSN2124 and...
3
by: deltaquattro | last post by:
Hi, I'll work on an OOP code written in Microsoft Visual C++ 6.0, and I would like to follow an introductory course on C++. My IT experience is in Fortran 95 and (a bit of) C. Can you point me...
3
by: touf | last post by:
Hi, I'm looking for courses about VB.NET et C#, I need a structured course defined by hours and containing all materiel (presentations, labs) Do you know a web site or a person who sell this kind...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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...
0
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...
0
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,...

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.