View the step-by-step solution to:

mysql> select * from student where gpa>3; +-----+-------+------+ | sid | sname | gpa | +-----+-------+------+ | 3|c | 5| | 4|d | 8| | 5|e | 9|...

Q2: Consider the following relational database:
STUDENT (SID, SName, GPA )
ENROLL (SID, CNo, Date )
COURSE (CNo, CTitle, Credits)
REQUIRE (CNo, Prerequisite)
Based on this relational database; give an expression in the relational algebra to
express each of the following queries:
a. Find the names of all students who have GPA greater than 3.
b. Find the ID of all students who did not enroll in course IT222.
c. Find the name of all students who enroll in both IT222 and IT221 courses.
d. Find the names and GPAs of all students who enrolled in Course IT222.
e. List the students ID, name, GPA, and course Number such that all students have GPA
greater than 3 . 5 and enrolled in a course in Jan 1, 2011.
f. List all students’ names with the title of courses they registered in.
g. List the details of all students and their course enrollment; along with the courses
prerequisites if they have one.
h. Find the details of all students who enrolled in all courses

mysql> select * from student where gpa>3; +-----+-------+------+ | sid | sname | gpa | +-----+-------+------+ | 3 | c | 5 | | 4 | d | 8 | | 5 | e | 9 | +-----+-------+------+ 3 rows in set (0.08 sec)
Background image of page 1

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question