Results 1 to 4 of 4

Thread: Seeking Advice

  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Seeking Advice

    How can I select the student whose first assignment's grade is lower than that of his assignment 2 and 3 from the following table?


    student course assignment grade
    1 c1 1 76
    1 c1 2 78
    1 c1 3 85
    2 c2 1 98
    2 c2 2 78
    2 c3 1 87
    2 c3 2 29
    .......

    Thank you

  2. #2
    Join Date
    Jun 2007
    Posts
    41

    find smallest grade

    select assignment, grade, student,course
    from Table_StudentMarks
    where (grade) IN (SELECT min(grade) FROM Table_StudentMarks group by student,course)
    and assignment=1;

  3. #3
    Join Date
    Sep 2007
    Posts
    2
    Thank you Shamshe

    How about if I want to discard those students who have submitted Assignment 1 only for a course?

  4. #4
    Join Date
    Jun 2007
    Posts
    41
    select student,course
    from Table_StudentMarks
    group by student, course
    having max(assignment) > 1

    good luck with assignment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •