STUDENT PROF COURSE ST-CRS PROF-CRS
S-Id P-Id Cno Sno Pno
Sname Pname Cname Cno Cno
Major Dept Txt-book Grade
GPA
1) Find names and GPAs for Information Systems Students
SELECT Sname, GPA
FROM STUDENT
WHERE Major =’IS’
2) Find the text-book used by the mathematics course
SELECT Txt-book
FROM COURSE
WHERE Cname =’mathematics’
3) List Student names sorted by their majors and within each
major sort Students by their GPAs
SELECT Sname, Major, GPA
FROM STUDENT
Order by Major, GPA
4) Find identification numbers for Students who have attend Course number “CS-
123”
SELECT Sno
FROM ST-CRS
WHERE C-no =’CS-123’
5) Find names of Students who attend Course number “CS-123”
SELECT Sname
FROM STUDENT, ST-CRS
WHERE C-no =’CS-123’
and
STUDENT.S_id =ST-CRS.Sno
1
6) Find names of Students who have attend the mathematics Course
SELECT Sname
FROM STUDENT, COURSE, ST-CRS
WHERE Cname =’Mathematics’
and
STUDENT.S_id =ST-CRS.Sno
And
COURSE.Cno =ST-CRS.Cno
7) Find names of Students who attended Course taught by Professor P10
SELECT Sname
FROM STUDENT, ST-CRS, COURSE, PROF-CRS
WHERE PROF-CRS.Pno ='P10'
And
STUDENT.S_Id =ST-CRS.Sno
And
COURSE.Cno =ST-CRS.Cno
And
COURSE.Cno =PROF-CRS.Cno
8) Find names of Students who attended a Course taught by Professor Ali
SELECT Sname
FROM STUDENT, ST-CRS, COURSE, PROF, PROF-CRS
WHERE PROF.Pname ='Ali'
And
STUDENT.S_Id =ST-CRS.Sno
And
COURSE.Cno =ST-CRS.Cno
And
COURSE.Cno =PROF-CRS.Cno
And
PROF.P_id=PROF-CRS.Pno
2
9) Find names of Students who attended a Course taught by a Professor works in
their department
SELECT Sname
FROM STUDENT, ST-CRS, COURSE, PROF, PROF-CRS
WHERE PROF.Pname ='Ali'
And
STUDENT.S_Id =ST-CRS.Sno
And
COURSE.Cno =ST-CRS.Cno
And
COURSE.Cno =PROF-CRS.Cno
And
PROF.P_id=PROF-CRS.Pno
And
STUDENT.Major=PROF.Dept