Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part A Consider the following relational schema: Student (student-id, student-name, department) Course (course-id, semester, location, enrolled_number, instructor, department) Faculty (faculty-id, faculty-name, department) Prerequisite (course-id, prereq-course-id)
Part A Consider the following relational schema: Student (student-id, student-name, department) Course (course-id, semester, location, enrolled_number, instructor, department) Faculty (faculty-id, faculty-name, department) Prerequisite (course-id, prereq-course-id) CourseScore (student-id, course-id, score) Assume that: All students and faculty members must major/work in one department; One course can have more than one prerequisites; Scores are numbers in [0,100] Instructor in Course table is a subset of faculty-id in Faculty table. Write each of the following queries using Query-by-Example (QBE). If you believe any one of the following is not expressible in QBE, informally explain why it cannot be expressed. 1. 2. (10 pts) Print all names of students who have taken both CS348 and CS252. (10 pts) Print all students with their ids and names who have more than the average score of all students of course id 'CS348' (10 pts) Print the course-ids of which have a prerequisite course of other departments. (10 pts) Print the name of the faculty member that teach most unique courses. (10 pts) Delete the courses that have average(over all semesters) enrolled number less than 5. 3. 4. 5. Part A Consider the following relational schema: Student (student-id, student-name, department) Course (course-id, semester, location, enrolled_number, instructor, department) Faculty (faculty-id, faculty-name, department) Prerequisite (course-id, prereq-course-id) CourseScore (student-id, course-id, score) Assume that: All students and faculty members must major/work in one department; One course can have more than one prerequisites; Scores are numbers in [0,100] Instructor in Course table is a subset of faculty-id in Faculty table. Write each of the following queries using Query-by-Example (QBE). If you believe any one of the following is not expressible in QBE, informally explain why it cannot be expressed. 1. 2. (10 pts) Print all names of students who have taken both CS348 and CS252. (10 pts) Print all students with their ids and names who have more than the average score of all students of course id 'CS348' (10 pts) Print the course-ids of which have a prerequisite course of other departments. (10 pts) Print the name of the faculty member that teach most unique courses. (10 pts) Delete the courses that have average(over all semesters) enrolled number less than 5. 3. 4. 5
Step 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