2,315 views
3 votes
3 votes
Q. Given the relational schema :

ENROLL (S#, C#, Section), S# is student number.

TEACH (Prof, C#, Section), C# is course number.

ADVISE (Prof, S#), Prof is Thesis advisor of S#

PRE-REQ (C#, pre-C#), pre-c# is prerequisite course.

GRADE (S#, C#, grade, year)

STUDENT (S#, Sname), Sname is student name.

Give queries expressed in SQL and tuple calculus.

(i) List of students taking courses with smith or jones.

(ii) List all students taking at least one course that their advisor teaches.

(iii) List those professors who teach more than one section of the same course.

(iv) List all students number and course number

(v) List the student number and course number who got grade A

1 Answer

0 votes
0 votes
1)select sname from student where In(select count(*) from enroll,teach where enroll.c#=teach.c# and teach.prof=smith or teach.prof=jones;

Related questions

1 votes
1 votes
2 answers
3
tarunmaganti asked Apr 15, 2018
776 views
If there are three tables to choose from -Sailors(sid,sname); Reserves(sid,bid); Boats(bid,color)Question is to choose a sailor who reserved a red boat.My question is wha...
0 votes
0 votes
0 answers
4
Tuhin Dutta asked Dec 10, 2017
704 views
What does the following tuple relational calculus query produce?• Student (Student_name, street, city)• Score (Student_name, Branch_name, marks)• Branch (Branch_nam...