table_a
user_id score
1 10
2 10
3 10
5 43
6 43
9 20
10 42
table_b
user_id flag
1 0
2 0
3 0
4 1
5 1
6 0
7 1
In the above case, how can I populate the table_b.flag
to 1
if user_id
from table_a
has a (score > 40
)?