Skip to content
Advertisement

how to single out certain names in sql

So I have this problem in SQL where the question is this: List the sId and name of students that applied to “WSU” But not “U of O”. and my attempt was this:

However this does not do the trick as it doesn’t catch that some of the students had already applied to U of O. MRE:

And then of course the function at the end that i am trying to work on:

what i get:

expected:

The relation above what i am trying to accomplish should very nicely list all of the schools and majors the students applied to.

Advertisement

Answer

You don’t need a join. You want to see students? So, select from the students table. They shall meet criteria? Use a where clause. Straight-forward with IN clauses:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement