Skip to content
Advertisement

Tag: join

Find IDs and names of students who took CS-101 and did not take CS-319

Can someone help with this homework problem: Find IDs and names of students who took CS-101 and did not take CS-319. These are the two tables that I can use for this assignment: I tried this but was unable to successfully exclude the students who who took “CS-319” Answer There are at least three separate ways to solve this problem

I have 3 table and need exclusive left join

Table_1: Table_2: Table_3: Using 2 left joins I got this: But I do group over the first column and 8 is accumulated twice, I wish to get: I also wish to avoid UNION ALL because my first table is actually a complex query, I wish to avoid its recalculation. https://dbfiddle.uk/?rdbms=postgres_12&fiddle=d6012e281e3ba43487b1bfec85fd886c Answer I am not sure if that works without UNION

Join the records with sql?

I have a table with those 5 rows. code | type_id | status —–+——–+——– 123 | 123456 | DONE 123 | 456789 | DONE 321 | 654321 | DONE 321 | 897321 | DONE 456 | 999888 | DONE 456 | …

Advertisement