我有两张桌子.一个拥有所有可用的奖杯,另一个拥有用户和奖杯之间的关系.
trophy
--------------------------------------
| trophy_id | name |
--------------------------------------
| 1 | kill 100 people |
| 2 | kill 200 people |
| 3 | fly 5000 feet upwards |
| 4 | fly into a mountain |
--------------------------------------
earned_trophys
------------------------------------------
| earned_trophy_id | trophy_id | user_id |
------------------------------------------
| 1 | 1 | 3 |
| 2 | 1 | 2 |
| 3 | 3 | 4 |
| 4 | 2 | 1 |
| 5 …Run Code Online (Sandbox Code Playgroud)