I have two table
Table Leave
ID | TYPE
1 Annual
2 Sick
3 Unpaid
4 Marriage
Table LeaveData
IDLEAVEDATA | LEAVETYPE*
1 1
2 1
3 2
4 2
LEAVETYPE is foreign key (refer to ID in table leave)
How do i count the occurence of ID in table LeaveData?
Output example :
TYPE | COUNT
Annual 2
Sick 2
Unpaid 0 or null
Marriage 0 or null