Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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 Datalog. If you believe any one of the following is not expressible in Datalog, informally explain why it cannot be expressed. 6. (10 pts) Find all direct and indirect prerequisites of course CS348, i.e. if CS2XX is prerequisite of CS348, and CS1XX is prerequisite of CS2XX, then CS1XX is an indirect prerequisite of CS348. 7. (10 pts) Find the students who have taken at least one course in the CS Department but have never taken any courses in the Statistics Department. 8. (10 pts) For each student, find the courses in which the student has received his/her highest scores. That is, if a student has taken 3 courses and got 60,70,80 correspondingly, then the course in which he/she got 80 is the course with the highest personal score. Show transcribed data 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, courseid, 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions