```
table1

----------------|------------------|-------------------|-------------------|
|      email          |     selection1   | selection2        |     selection3
|                                                           
|---------------------|------------------|-------------------|-------------------|
|  test@test.com      |        4       |           7                     9
|---------------------|------------------|-------------------|------------------|
|test2@test.com                2                     9                6
---------------------|------------------|--------------------|-------------------|      

table2
|---------------------|------------------|-------------------|-------------------|
|      race1|                 race2      |         race3     |       race4
|                                                           
|---------------------|------------------|-------------------|-------------------|
|  5                   |        7       |           9                    2
|---------------------|------------------|-------------------|------------------|

```

So, I have two tables.
One is based on user input selecting 3 races for the number of the winner.

The second table is the number of the race winner.

I want to compare the two tables and create a third table. If the person's selection matches the winning race then they receive 50 points. So the third table would display "email" and "points" 

This will continue for 4 days so if the same email matches another race winner they gain an extra 50 points.

I've tried INNER JOIN, but there are too many combinations. I'm new to PHP and SQL, so I really don't know what approach to take.