Observe this scheme, it could be improved:
You can add the sums you want, and try the queries in this sqlfidle .
You will have a line by subject and a column with all the notes of all the units of a student separated by a character (| in this case) if you want to divide each note in other columns you can do it by programming, doing split on the column notes. The advantage (among others) is that, if you do not know how many notes a student could have, it is best to have a single column where you receive all the notes and then divide them as you wish, knowing that there is a '|' between each one.
SQL Fiddle
MySQL 5.6 Schema Setup :
CREATE TABLE estudiantes
('id_estudiante' int, 'estudiante' varchar(70))
;
INSERT INTO estudiantes
('id_estudiante', 'estudiante' )
VALUES
(1, 'Pedro'),
(2, 'Santiago'),
(3, 'Juan')
;
CREATE TABLE asignaturas
('id_asignatura' int, 'asignatura' varchar(70))
;
INSERT INTO asignaturas
('id_asignatura', 'asignatura')
VALUES
(1, 'POO'),
(2, 'POO II'),
(3, 'Java')
;
CREATE TABLE unidades
('id_unidad' int, 'unidad' varchar(70))
;
INSERT INTO unidades
('id_unidad', 'unidad')
VALUES
(1, 'Primera Unidad'),
(2, 'Segunda Unidad'),
(3, 'Tercera Unidad')
;
CREATE TABLE valoraciones
('id_valoracion' int, 'valoracion' varchar(70), 'peso' int)
;
INSERT INTO valoraciones
('id_valoracion', 'valoracion', 'peso' )
VALUES
(1, 'Examen',40),
(2, 'Práctica',40),
(3, 'Actitudinal',20)
;
CREATE TABLE notas
('id' int, 'id_estudiante' int, 'id_asignatura' int, 'id_unidad' int, 'id_valoracion' int, 'nota' float)
;
INSERT INTO notas
('id', 'id_estudiante', 'id_asignatura', 'id_unidad', 'id_valoracion', 'nota')
VALUES
(1, 1, 1, 1, 1, 14.2),
(2, 1, 2, 1, 2, 14.4),
(3, 2, 1, 1, 1, 13.4),
(4, 2, 2, 1, 2, 13.9),
(5, 1, 1, 2, 1, 10.2),
(6, 1, 2, 2, 2, 18.4)
;
Query 1 :
SELECT
e.estudiante, a.asignatura,
v.valoracion, v.peso
,
GROUP_CONCAT(n.nota SEPARATOR '|') AS nota
FROM estudiantes e
JOIN notas n ON e.id_estudiante=n.id_estudiante
JOIN asignaturas a ON n.id_asignatura=a.id_asignatura
JOIN unidades u ON n.id_unidad=u.id_unidad
JOIN valoraciones v ON v.id_valoracion=n.id_valoracion
WHERE e.id_estudiante=1
GROUP BY e.id_estudiante, a.id_asignatura
Results :
| estudiante | asignatura | valoracion | peso | nota |
|------------|------------|------------|------|-----------|
| Pedro | POO | Examen | 40 | 10.2|14.2 |
| Pedro | POO II | Práctica | 40 | 14.4|18.4 |