By SQL: https://user-images.githubusercontent.com/112998708/191015575-bcd41346-b421-4e1a-9f17-19344d26f5e2.png By diagram: https://user-images.githubusercontent.com/112998708/191016355-56337f1f-566d-45d6-aa1b-0126a98cd74b.png