Hey everyone! I’m working on a project that involves analyzing course data for different degree programs. I’ve got three main tables: Programs, Degrees, and Courses. Each program has a name and a list of courses. Degrees have a code, name, and type (either postgrad or undergrad). Courses have a code and name.
I’m trying to figure out how to identify courses that are only offered in one undergraduate degree program. Any ideas on how to approach this? I’m not sure if I should start by filtering the degrees or the courses.
Here’s a quick breakdown of my data structure:
Programs:
- Name
- Course List
Degrees:
- Code (unique)
- Name
- Type (postgrad/undergrad)
Courses:
- Code (unique)
- Name
Any tips or suggestions would be really helpful! Thanks in advance!
I have worked on similar projects and found that starting with the Courses table is a solid approach. A good method is to join the Courses table with the Programs and Degrees tables, then filter the data so that only undergraduate degrees remain. Next, group the results by course code and count the number of distinct degree codes associated with each course. Finally, select the courses that appear only once. It’s important to also consider any scenarios where a course might be shared within a single degree. I hope this insight proves useful in your project.
Hey Hugo_Storm! That’s a pretty cool project you’re working on there. 
I’m curious, have you thought about approaching this from the Courses angle? Maybe we could start by looking at all the courses and then tracing back to see which ones are only linked to a single undergrad program.
What kind of database are you using for this? SQL might be pretty handy here if that’s an option. You could potentially do some joins between your tables and then use GROUP BY and HAVING clauses to filter out the courses that show up in multiple programs.
Oh, and I’m wondering - are there any courses that might be shared across different types of degrees? Like, could an undergrad and postgrad program ever have the same course? That might be something to keep in mind too.
Have you run into any other interesting patterns or quirks in your data so far? I’d love to hear more about what you’ve discovered!
yo hugo, cool project! have u considered using a subquery? u could select courses that only appear once when joined with undergrad programs. might be easier than messing with group by and having clauses. just a thought. good luck with ur analysis bro!