www.webdeveloper.com
Results 1 to 2 of 2

Thread: need help with a query

  1. #1
    Join Date
    Apr 2011
    Posts
    3

    need help with a query

    How would I get the average grade of each student?


    table name = grade
    +---+---------+
    | student | grade |
    +---+---------+
    | john | 85 |
    +---+---------+
    | jeff | 90 |
    +---+---------+
    | jenny | 85 |
    +---+---------+
    | jeff | 88 |
    +---+---------+
    | john | 89 |
    +---+---------+
    | jenny | 82 |
    +---+---------+

  2. #2
    Join Date
    Jul 2008
    Location
    Carnoustie, Scotland
    Posts
    36
    select student, avg(grade) average_grade
    from grade
    group by student;
    /* no comment */

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles