Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

: Consider the following University Database relations (tables), with the common sense interpretation: Department (D-code, D-Name, Chair-SSN) Course (D-code, C-no, Title, Units) Prereq (D-code, C-no,

: Consider the following University Database relations (tables), with the common sense interpretation: Department (D-code, D-Name, Chair-SSN) Course (D-code, C-no, Title, Units) Prereq (D-code, C-no, P-code, P-no) Class (Class-no, D-code, C-no, Instructor-SSN) Faculty (SSN, F-Name, D-Code, Rank) Student (Ssn, S-Name, Major, Status) Enrollment (Class-no, Student-Ssn) Transcript (Student-Ssn, D-Code, C-no, Grade) The primary keys are underlined. The meaning of the primary key is that there cannot be two different tuples in the relation with identical values for the primary key. Some explanations of attributes (variable names) are as follows. Chair-Ssn in Department refers to SSN in Faculty table. Instructor-SSn refers to Ssn in Faculty table, and Student-Ssn refers to Ssn in Student table. Class-no is a unique ID for each offering of a course. For example, a class with class-no='12020' may be an offering of CS 330, in which case, we may have a tuple like <12020, CS,330, 100009399> in the Class table. in Prereq table refers to in the Course table, i.e., they refer to courses. A example row in Prereq table is , which means that CS 450 needs CS 330 as a prerequisite course. Other foreign keys and meanings of the tables should be obvious. Consider each of these table names (Department, Course, etc.) as predicates, with the interpretation that the predicate returns TRUE for a tuple if and only if this tuple is in the database table. For example, Enrollment(Class-SSN, Student-SSN) will now represent a predicate that evaluates to TRUE if the pair (Class-SSN,Student-SSN) is in the corresponding relation, and FALSE otherwise. Problem 1. Write predicate logic sentences that describe the following university rules: 1. The number of units for a course can not exceed 6 . 2. Everyone who is enrolled in a class (in Enrollment) must be a student (in Student) 3. For courses with C-no <= 400, the possible grades are A,B,C, D and F. 4. The instructor for a course offered by a department, must be a faculty in that department 5. Students majoring in CS must be enrolled in a class titled Vacation in Hawaii 6. Courses with C-no between 300 and 399 must have at least one prerequisites; and courses with C-no between 400 and 499 must have at least two prerequisites 7. Students enrolled in a class must have taken (in Transcript) all prerequisites of the corresponding course with the grade of B or better. 8. Students majoring in CS are allowed to enroll only in classes offered by the History department (D-code = History) 9. The chair of a department must be a faculty in that department

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions