Teams table
+------+------------+
|team_id | week |
+------+------------+
| 1 | 2012-09-10 |
| 2 | 2012-09-10 |
| 3 | 2012-09-17 |
| 4 | 2012-09-17 |
+------+------------+
TeamPlayers Join Table
+---------+-----------+
| team_id | player_id |
+---------+-----------+
| 1 | 1 |
| 2 | 2 |
| 3 | 1 |
| 4 | 1 |
+---------+-----------+
Based on the schema above I need to put a query together that will show me which player was added and which player was dropped between this week and last week.
For example
Between week 2012-09-10 and 2012-1=09-17 Player 8 was moved on successfully (he appeared on one team last week and 2 teams this week).
Player 9 appeared on a team last week 2012-09-10 but did not make it to this week 2012-09-17.
I am currently doing this in the application code (because I am not a sql expert), but have a nagging feeling that there is likely a way to perform this directly in the database (mysql).
Any help would be greatly appreciated.