I have five tables that are connected with each other using joins:
department
vscourse
-- one to manycourse
vsclasses
-- one to manyclasses
vssection
-- many to many
I want to retrieve the sections the belong to a particular course. I have tried inner join to achieve this but I can not get good results, I get all the sections instead.
select sectionname from Section
inner join Classes on classid=sectionid
inner join Course on courseid=Classes.fk_course_courseid;
Data contained in the table as shown below. I want to retrieve all the sections the belong to courseid = 1
or department id = 1
.
(CREATE TABLE blah (field_1 type_1,...);
and your data as standard SQL DML(INSERT INTO blah VALUES (...);)
. Either provide it here or in the form of a fiddle - that would be great. Help us to help you! :-) My profile has a few articles on how to ask questions here - you might want to look?