How to average in SQL?

1

I have a job to do where I enter name and two notes into a database using VoiceXML. I have two tables, one with nome , notaum , notadois and another with nome , media . How do I calculate the average of notaum and notadois and insert in the other table?

    
asked by anonymous 13.12.2016 / 15:15

1 answer

5

That?

UPDATE t1 SET t1.media = (t2.notaum + t2.notadois) / 2
    FROM t1 INNER JOIN t2 ON t1.nome = t2.nome;
    
13.12.2016 / 15:21