D
Devon
Hello
I am a teacher and am trying to move my students grades from Excel to
Access. I plan on using the Classroom management database from MS Office
template, and then expanding upon that dbase as needed.
One of the expansions, I am struggling with. During the semester, I will
give out quizes and homeworks. I may give out 19 quizes, but I will only
count 15 of those. The extra four can be dropped. In other words, the
student will take all the quizes and then the lowest 4 will drop, so even
though they will take 19 quizes, only 15 count toward their final grade. The
homeworks will work much the same way, however, the 19th homework is
mandatory. So the student will complete 19 homeworks, only the top 15 and
the 19th will count toward their final grade.
I have been struggling the past couple of days to get the SQL correct for
this quiz. At present, I am using the sample data from the Classroom
management database to get the SQL correct before entering it on my own
database. For the data below, I have run SQL on several tables, as I believe
that this would be necessary.
Student ID Results ID Name Class Name Assignment Description Score
2 87 Alan Shen Great Works Quiz - Quiz #4 10
2 97 Alan Shen Great Works Quiz - Quiz #6 10
2 102 Alan Shen Great Works Quiz - Quiz #7 10
2 2 Alan Shen Great Works Quiz - Quiz #1 9
2 82 Alan Shen Great Works Quiz - Quiz #3 9
2 77 Alan Shen Great Works Quiz - Quiz #2 8
2 92 Alan Shen Great Works Quiz - Quiz #5 6
3 78 Conor C Great Works Quiz - Quiz #2 10
3 88 Conor C Great Works Quiz - Quiz #4 10
3 103 Conor C Great Works Quiz - Quiz #7 10
3 3 Conor C Great Works Quiz - Quiz #1 9
3 83 Conor C Great Works Quiz - Quiz #3 8
3 93 Conor C Great Works Quiz - Quiz #5 8
3 98 Conor C Great Works Quiz - Quiz #6 8
6 80 Erik A Great Works Quiz - Quiz #2 10
6 85 Erik A Great Works Quiz - Quiz #3 10
6 90 Erik A Great Works Quiz - Quiz #4 10
6 100 Erik A Great Works Quiz - Quiz #6 10
6 105 Erik A Great Works Quiz - Quiz #7 10
6 5 Erik A Great Works Quiz - Quiz #1 0
6 95 Erik A Great Works Quiz - Quiz #5 0
From this data above, I would like to run SQL that takes the top 5 (scaled
down version of the real top 15) from each person in the class. So for Erik
A, it would show 50 for a Score on Quizes.
Below is some SQL for a subquery I have created after going through the
discussion groups for other people with similar problems. However, it is
still not quite working correctly. I know that Access will show ties in the
data, and that appears to be what it is doing in my case. I have tried
including the PK, but it still isn't quite right.
SELECT A.Name, A.ClassName, A.AssignmentDescription, A.Score
FROM Table1 AS A
WHERE (((A.Score) In (SELECT Top 5 b.Score
FROM Table1 as B
WHERE b.StudentID = a.StudentID
ORDER BY b.Score DESC)))
ORDER BY A.StudentID, A.Score DESC;
Any ideas for how to calculate the quizes? How about the homework with the
one homework which is mandatory?
Thanks
D
I am a teacher and am trying to move my students grades from Excel to
Access. I plan on using the Classroom management database from MS Office
template, and then expanding upon that dbase as needed.
One of the expansions, I am struggling with. During the semester, I will
give out quizes and homeworks. I may give out 19 quizes, but I will only
count 15 of those. The extra four can be dropped. In other words, the
student will take all the quizes and then the lowest 4 will drop, so even
though they will take 19 quizes, only 15 count toward their final grade. The
homeworks will work much the same way, however, the 19th homework is
mandatory. So the student will complete 19 homeworks, only the top 15 and
the 19th will count toward their final grade.
I have been struggling the past couple of days to get the SQL correct for
this quiz. At present, I am using the sample data from the Classroom
management database to get the SQL correct before entering it on my own
database. For the data below, I have run SQL on several tables, as I believe
that this would be necessary.
Student ID Results ID Name Class Name Assignment Description Score
2 87 Alan Shen Great Works Quiz - Quiz #4 10
2 97 Alan Shen Great Works Quiz - Quiz #6 10
2 102 Alan Shen Great Works Quiz - Quiz #7 10
2 2 Alan Shen Great Works Quiz - Quiz #1 9
2 82 Alan Shen Great Works Quiz - Quiz #3 9
2 77 Alan Shen Great Works Quiz - Quiz #2 8
2 92 Alan Shen Great Works Quiz - Quiz #5 6
3 78 Conor C Great Works Quiz - Quiz #2 10
3 88 Conor C Great Works Quiz - Quiz #4 10
3 103 Conor C Great Works Quiz - Quiz #7 10
3 3 Conor C Great Works Quiz - Quiz #1 9
3 83 Conor C Great Works Quiz - Quiz #3 8
3 93 Conor C Great Works Quiz - Quiz #5 8
3 98 Conor C Great Works Quiz - Quiz #6 8
6 80 Erik A Great Works Quiz - Quiz #2 10
6 85 Erik A Great Works Quiz - Quiz #3 10
6 90 Erik A Great Works Quiz - Quiz #4 10
6 100 Erik A Great Works Quiz - Quiz #6 10
6 105 Erik A Great Works Quiz - Quiz #7 10
6 5 Erik A Great Works Quiz - Quiz #1 0
6 95 Erik A Great Works Quiz - Quiz #5 0
From this data above, I would like to run SQL that takes the top 5 (scaled
down version of the real top 15) from each person in the class. So for Erik
A, it would show 50 for a Score on Quizes.
Below is some SQL for a subquery I have created after going through the
discussion groups for other people with similar problems. However, it is
still not quite working correctly. I know that Access will show ties in the
data, and that appears to be what it is doing in my case. I have tried
including the PK, but it still isn't quite right.
SELECT A.Name, A.ClassName, A.AssignmentDescription, A.Score
FROM Table1 AS A
WHERE (((A.Score) In (SELECT Top 5 b.Score
FROM Table1 as B
WHERE b.StudentID = a.StudentID
ORDER BY b.Score DESC)))
ORDER BY A.StudentID, A.Score DESC;
Any ideas for how to calculate the quizes? How about the homework with the
one homework which is mandatory?
Thanks
D