SQL AVG function on multiple tables

Mar*_*sen 1 sql average

I have two more or less identical tables:

test_score

id  int(11) PK AI
user_id int(11) 
module_id   int(11) 
score   double 
number_correct  int(11) 
correct_total   int(11) 
timestamp   datetime 
phase_id    int(11) 
medal_id    int(11) 
team_id int(11) 
status_id   int(11) 
Run Code Online (Sandbox Code Playgroud)

And

id  int(11) PK AI
user_id int(11) 
module_id   int(11) 
score   double 
number_correct  int(11) 
correct_total   int(11) 
timestamp   datetime 
phase_id    int(11) 
medal_id    int(11) 
team_id int(11) 
status_id   int(11) 
Run Code Online (Sandbox Code Playgroud)

Now the reason for these two being so identical is that they contain data from each of their own component in my system.

Now i want to use the AVG() function to find the average score of these two tables combined.

is this possible?

Ant*_*ull 5

SELECT user_id, average_score = AVG(score)
FROM (
    SELECT user_id, score FROM test_score1
    UNION ALL
    SELECT user_id, score FROM test_score2
) AS subquery
GROUP BY user_id
Run Code Online (Sandbox Code Playgroud)