I am trying to create a select that will allow me to join two tables together without using any operation that uses JOIN. The catch is that these two tables contain a one to many relationship.
Let's say there are two tables, Department and Course.
Department
D_CODE | SCHOOL
01 | 1111
02 | 1111
03 | 2222
Course
CRS_CODE | D_CODE
MATH1 | 01
MATH2 | 02
ACCT1 | 03
How do I find all schools and the total number of courses it provides without using any type of join?
The result is that School 1111 has 2 courses and School 2222 has 1 course.
I've tried using WITH and multiple subqueries, but the resulting values always duplicates. So it will say School 1111 has 16 courses and School 2222 has 16 courses (as an example).
Guidance would be much appreciated. Thank you!