I'm developing a database for a small application.
My bank has 3 tables: students, disciplines and school_letter, the latter used to insert 3 individual notes.
I have been able to calculate the average of these NOTES through the SUM () function so far, my difficulty is to display the three notes of the TABLE followed by this result of the SUM () function.
How do I do this correctly? I'm using SQL SERVER 2008 R2.
- select from the notes table
SELECT * FROM boletim_escolar
- function that calculate the AVERAGE OF EACH STUDENT - Moisés Ramos 7 mins ago
SELECT sum(((nota1*1)+(nota2*1)+(nota3*2))/4) AS 'Media Final'
FROM boletim_escolar GROUP BY id_codaluno
Assuming the table is with the notes, you would like to display the SUM () result next to the nota3 column
nota1 | note2 | note3 | Average ???
It will be possible to urgently need this HELP.