Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DATABASE SYSTEM 2. Consider the following database of a university in which several schools offer courses for students school (school-name, school-street) course (course#, course-name, school-name)
DATABASE SYSTEM
2. Consider the following database of a university in which several schools offer courses for students school (school-name, school-street) course (course#, course-name, school-name) enroll (studentID, course#, mark, semester, year) student (studentID, name-first, name-last, phone, student-street) Write SQL for the following: (a) List the course# of all the courses for which more than 50 students are enrolled (5 Marks) (b) Find the studentID of all the students who are enrolled in at least one course offered by School of Humanity and are not enrolled in any courses offered by School of Psychology (5 Marks) (c) Find the studentID of all the students who are enrolled in the maximum number of courses. (For example, the school offers 11 courses and a student is allowed to be enrolled in at most 7 courses. 150 students are enrolled in 3 courses. 170 students are enrolled in 4 courses. 230 students are enrolled in 5 courses. No students are enrolled in 6 courses or more. Your query should return the studentID of those 230 students who are enrolled in 5 courses.) (5 Marks) (d) List the names of students who are enrolled in only courses offered by (5 Marks) schools located in the same streets in which the students live (e) List the schools of courses with maximum marks above 90Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started