clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335687 fiddles created (27448 in the last week).

CREATE TABLE ejercicio( estudiante_carnet VARCHAR(100), primer_nombre VARCHAR(100), primer_apellido VARCHAR(100), nota1 INT );
 hidden batch(es)


INSERT INTO ejercicio(estudiante_carnet, primer_nombre, primer_apellido, nota1) VALUES ("2018-1", "Alfredo", "Sanchez", 89), ("2018-1", "Alfredo", "Sanchez", 19), ("2018-1", "Alfredo", "Sanchez", 29), ("2018-1", "Alfredo", "Sanchez", 30), ("2018-1", "Alfredo", "Sanchez", 12), ("2018-1", "Alfredo", "Sanchez", 21), ("2018-1", "Alfredo", "Sanchez", 10);
 hidden batch(es)


SELECT estudiante_carnet, CONCAT(primer_nombre, primer_apellido) as NombreEstudiante, SUM(CASE WHEN nota1 = 89 THEN nota1 ELSE NULL END) as NOta1, SUM(CASE WHEN nota1 = 19 THEN nota1 ELSE NULL END) as NOta2, SUM(CASE WHEN nota1 = 29 THEN nota1 ELSE NULL END) as NOta3, SUM(CASE WHEN nota1 = 30 THEN nota1 ELSE NULL END) as NOta4, SUM(CASE WHEN nota1 = 12 THEN nota1 ELSE NULL END) as NOta5, SUM(CASE WHEN nota1 = 21 THEN nota1 ELSE NULL END) as NOta6, SUM(CASE WHEN nota1 = 10 THEN nota1 ELSE NULL END) as NOta7 FROM ejercicio GROUP BY primer_nombre;
estudiante_carnet NombreEstudiante NOta1 NOta2 NOta3 NOta4 NOta5 NOta6 NOta7
2018-1 AlfredoSanchez 89 19 29 30 12 21 10
 hidden batch(es)