I have 3 tables.
Faculty. I'm trying to assign the faculty to a specific class, e.g. I'm assigning "John Doe" to the section "Section1" where this "Section1" exists in the
Student table column.
StudentID Name Section 1 user1 Section1 2 user2 Section1 3 user3 Section2
FacultyID Name Subject 1 Faculty1 Subject ABC 2 Faculty2 Subject DEF
ClassListID StudentID FacultyID ModifiedDate
My insert statement is like this:
INSERT INTO ClassList VALUES ( ( SELECT Student.StudentID FROM Student WHERE Student.Section = 'Section1' ), ( SELECT Faculty.FacultyID FROM Faculty WHERE Faculty.FirstName = @FacultyName OR Faculty.LastName = @FacultyName ), GETDATE() );
I know that the select statement in the
Student table returning a lot so I'm wondering if there's a way to add all the return query of it into