473,320 Members | 1,881 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,320 software developers and data experts.

Which Courses students have not taken query

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 based on tblEnrolled which returns students that are not on
any courses. What I want is a query which will give me a list of names
along with the courses they have not taken. I have tried but I can't get
the course ID/details to show in my unmatched queries. Thanks in advance

Will

Nov 13 '05 #1
1 1580
"Will" <Wi*****************@hotmail.com> wrote in message
news:37*************@individual.net...
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 based on tblEnrolled which returns students that are not
on
any courses. What I want is a query which will give me a list of names
along with the courses they have not taken. I have tried but I can't get
the course ID/details to show in my unmatched queries. Thanks in advance


Make a cartesian join between the students and courses tables, then use a
subquery to return presence or absence in the enrollments table.

something like this:

select s.studentName, c.courseName,
iif(
exists(
select * from enrollments as e
where e.studentID=s.studentID
and e.courseName = c.courseName
),"yes","no") as taken
from students as s, courses as c
More elegant would be to feed the above query to a crosstab to give you a
grid showing who is taking what.
Nov 13 '05 #2

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

Similar topics

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...
22
by: larry | last post by:
I was just looking at a demo training that mindleaders has on .net training: http://www.mindleaders.com/products/democourse3.asp And I don't believe this is correct or at least is misleading...
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...
0
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
4
by: Dave White | last post by:
Hello everyone, I would like to assign a lesson to many students as a group rather than individually. Any suggestions would be appreciated. Dave White
6
by: anne001 | last post by:
The university allocates 2 Gigs to students in non-public unix space. The space allocated for public web area is much smaller. So the idea is to have pictures, movies etc in the non-public unix...
0
by: Wingware | last post by:
Hi, We're pleased to announce the first public beta release of Wing IDE 101, a free scaled back edition of Wing IDE that was designed for teaching introductory programming courses. We are...
0
by: Vijay | last post by:
Prep Courses for International Certifications by QAI,USA After receiving overwhelming response to our last 95 batches, Spectramind now announces a new batch of Prep Courses for CSQA & CSTE so as...
33
by: mjvm | last post by:
HI, I have a main table (tblStudents) that holds students where the unique field is StudentID; and a related table (tblNotes) on a one-to-many relationship, where the unique field is NotesID, and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.