Demo entry 6634981

DASDASDAS

   

Submitted by ASD on Aug 15, 2017 at 18:15
Language: SQL. Code size: 681 Bytes.

    SELECT t6.id as ID, t6.name as Nombre, t6.lastname_1 as Apellido, 
        COUNT(t6.average) AS Reprobadas
    FROM
    (SELECT t2.id, t2.name, t2.lastname_1,
        t4.subject, AVG(t2.value) as average
        FROM
        (SELECT t1.id, t1.name, t1.lastname_1, t0.value, t0.test_id
            FROM student_grade t0
            INNER JOIN student t1
            ON t0.student_id = t1.id) t2
        INNER JOIN school_test t3
            ON t2.test_id = t3.id
        INNER JOIN school_class t4
            ON t3.school_class_id = t4.id
        GROUP BY t2.id, t4.subject) t6
    WHERE t6.average < 50
    GROUP BY t6.id
    HAVING COUNT(t6.average) > 1;

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).