Given two relations:
Students = (St-Id, Name, Address, CourseNo, Cgpa)
Courses = (CourseN0, CourseName, Credits)
where primary keys are St-Id and CourseNo. CourseNo in Students relation is a foreign key references Courses relation.
Assume the following queries are frequent:
Question: What are the courses (CourseNo and CourseName) studied by each student?
SELECT Students.Name, Courses.CourseName, Course.CourseNO
FROM Students
INNER JOIN Courses
ON Students.CourseNo=Course.CourseNo;
Is that the right query by using join operation?
It's a a primary index because of course number. Can we consider it as rule to say courseNo is a primary index? It's also clustering? What is the difference between clustering and primary index?
Question: What is the Cgpa for each student?
Answer : Select Cgpa and name from students