I have 3 tables
users courses types
a user has several courses and one course belongs to a type. how to return the number of courses per type per user?