Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2014
    Posts
    1

    Unanswered: Make a multiple query to build a table with some data summary

    I have the following MYSQL tables:

    pupils:

    id_pupil
    name
    surname
    email
    user
    pass
    level
    class

    califications:

    id_calification
    calification
    date
    time
    subject
    id_pupil
    id_user
    id_trimester
    type_calification (misses, delayes or attitude)

    incidents:

    id_incidents
    date
    time
    type_incident
    comments
    id_pupil
    id_user
    subject
    id_trimester

    trimesters:

    id_trimester
    starting_date
    ending_date

    timetables:

    id_timetable
    subject
    date
    time
    level
    class
    id_user

    users:

    id_user
    name
    surname
    email
    user
    pass
    type_user

    and I would like to build a summary table with the next information:




    http://i.stack.imgur.com/Rhm43.png

    I don´t know how to build this table with multiple queries. Can anyone help me?

    Thanks a lot!

  2. #2
    Join Date
    Jan 2014
    Posts
    1
    I'd imagine you can achieve this in one query with multiple subqueries.

    Some questions:

    • Are misses, delays, attitudes supposed to be a count of each type of calification?
    • Is this a summary of califications for one class only?
    • Is "class" an ID, string, enum?
    • Where does the exam information come from?
    • And... what is a calification?!
    Last edited by taybagger; 01-18-14 at 12:19.

Tags for this Thread

Posting Permissions

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