Malik Shahroze Malik Shahroze - 25 days ago 12
MySQL Question

Comparing and extrating data from two tables in sql

I am working on a project and I need to write a query in which I can list all courses that have "Database System Principles" as prerequisite
There are two tables one is by name course and other is by name prereqs which contain information about courses that which course has how many and which pre-requisites

5. please click to check the two tables here

Answer

Try this

Select * from Course as c JOIN prereqs on c.course_ID = prereqs.course_ID WHERE c.name = "Database System Principles"
Comments