student(sid, sname, sex, age, year, gpa) dept(dname, numphds) prof(pname, dname)
ID: 3747104 • Letter: S
Question
student(sid, sname, sex, age, year, gpa)
dept(dname, numphds)
prof(pname, dname)
course(cno, cname, dname)
major(dname, sid)
section(dname, cno, sectno, pname)
enroll(sid, grade, dname, cno, sectno)
Explanation / Answer
1. select sname, gpa from student, enroll where student.sid=enroll.sid and cno=312;
2. select name from student where age = (select max(age) from student);
3. select student.sname, course.cname from student, enroll, course where student.sid = enroll.sid and enroll.cno = couse.cno and cname like '%Artificial Intelligent%';
4. (select name from student, enroll, course where student.sid = enroll.sid and enroll.cno = course.cno and course.dname = "Computer Sciences") intersect (select name from student, enroll, course where student.sid = enroll.sid and enroll.cno = course.cno and course.dname = "Chemical Engineering");
5. select count(*) from stduent, major where sid in (select count(*), sid from student, major where student.sid = majo.sid);
6. select max(age), sname from student where sid in (select * from student where year = 1)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.