I have two tables containing scores and I would like to obtain a single average score from those two tables. Is there a way to do that?
I've the sql below as follows:
SELECT COUNT(*) AS count1, AVG(score) AS avg_score1
UNION ALL SELECT COUNT(*) AS count2, AVG(score) AS avg_score2
Sample table values
That got me the results as follows:
I was looking for a way to get the average of all the five scores. In order words, I would like the query to produce the average score of 78 (sum of all the test scores divided by 5).