Retrieve from DataBase
-
Hi, I have training Database which contains 3 tables, STUDENTS,COURSES and STUDENT_COURSE which contains the F.k for the Students and Courses tables. The STUDENT_COURSE Contains StudentID,CourseID as Primary Key I need to write Stored Procedure that Return All Students attends 'MCSE' and 'MCSD' Courses. The following are The Attributes of all 3 tables 1- Students A. StudentID P.K B. StudentName C. Mobile D.Address 2- Courses A. CourseID P.k B. CourseName 3- Student_Course A.StudentID P.k, F.k B.CourseID P.k, F.k regards
-
Hi, I have training Database which contains 3 tables, STUDENTS,COURSES and STUDENT_COURSE which contains the F.k for the Students and Courses tables. The STUDENT_COURSE Contains StudentID,CourseID as Primary Key I need to write Stored Procedure that Return All Students attends 'MCSE' and 'MCSD' Courses. The following are The Attributes of all 3 tables 1- Students A. StudentID P.K B. StudentName C. Mobile D.Address 2- Courses A. CourseID P.k B. CourseName 3- Student_Course A.StudentID P.k, F.k B.CourseID P.k, F.k regards
select students.*,Courses.*,Student_course.* from students,Courses,Student_Course where Student_Course.CourseID = Courses.CourseID and (Courses.CourseName = 'MCSE' or Courses.CourseName='MCSD')
I Love T-SQL "Don't torture yourself,let the life to do it for you."