clients
- id
- email
client_plans
- id
- client_id
- plan_id
- date_started
- date_ended
plans
- id
- name
- price
clients:
1,"[email protected]"
client_plans:
1,1,7,2013-01-01,2013-01-03
2,1,8,2013-01-03,2013-01-06
3,1,7,2013-01-07,null
plans:
7,"small",$10
8,"large",$50
clients with a client_plans record with a null date_ended are still on that plan
- Give me all the ids of clients who at some point (now or in the past) were on plan_id 7
- Give me the email addresses of clients currently on plan_id 7