Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following University Database schemas. Primary keys are underlined. Relational Schemas department (dcode, dname, chair) course (dcode, cno, title, units) prereq (dcode, cno, pcode,
Consider the following University Database schemas. Primary keys are underlined. Relational Schemas department (dcode, dname, chair) course (dcode, cno, title, units) prereq (dcode, cno, pcode, pno) class (class, dcode, cno, instr) Meaning and additional information Department identified by dcode is named dname and has department chair with ssn chair (this ssn must appear in the table faculty below) Course identified by (dcode,cno) has title and units (e.g., 3 units/credits) Course (dcode, cno) has a prerequisite course (pcode, pno) Class identified by class id is offered by department dcode, has course number cno, and is taught by instructor with ssn instr (this ssn must appear in the table faculty below) Faculty identified by ssn has a name and rank, and belongs to department dcode (which must appear in the table department) Student identified by ssn has a name, major and status. Student identified by ssn is enrolled in the class identified by class no (ssn must appear in the table student, and class must appear in the table class) Student identified by son took the course identified by (dcode, cno) and received the grade. Assume that the only grades available are A, B, C and F. faculty (ssn, name, dcode, rank) student (ssn, name, major, status) enrollment (class, ssn) transcript (dcode, cno, ssn, grade) Implement the following queries using: A. Tuple relational calculus B. Relational algebra C. SQL a. Find students (ssn, name, major, status) who have taken the course "cs530 (must be in transcripts) b. Find students (ssn, name, major, status) named "John (i.e., name = "John" in student who have taken the course "CS 530" (must be in transcripts) c. Find students (ssn, name, major, status) who satisfied all prerequisites of each class they are enrolled in. d. Find students (ssn, name, major, status) who are enrolled in a class for which they have not satisfied all its prerequisites. e. Find students (ssn, name, major, status) named John who are enrolled in a class for which they have not satisfied all its prerequisites. Consider the following University Database schemas. Primary keys are underlined. Relational Schemas department (dcode, dname, chair) course (dcode, cno, title, units) prereq (dcode, cno, pcode, pno) class (class, dcode, cno, instr) Meaning and additional information Department identified by dcode is named dname and has department chair with ssn chair (this ssn must appear in the table faculty below) Course identified by (dcode,cno) has title and units (e.g., 3 units/credits) Course (dcode, cno) has a prerequisite course (pcode, pno) Class identified by class id is offered by department dcode, has course number cno, and is taught by instructor with ssn instr (this ssn must appear in the table faculty below) Faculty identified by ssn has a name and rank, and belongs to department dcode (which must appear in the table department) Student identified by ssn has a name, major and status. Student identified by ssn is enrolled in the class identified by class no (ssn must appear in the table student, and class must appear in the table class) Student identified by son took the course identified by (dcode, cno) and received the grade. Assume that the only grades available are A, B, C and F. faculty (ssn, name, dcode, rank) student (ssn, name, major, status) enrollment (class, ssn) transcript (dcode, cno, ssn, grade) Implement the following queries using: A. Tuple relational calculus B. Relational algebra C. SQL a. Find students (ssn, name, major, status) who have taken the course "cs530 (must be in transcripts) b. Find students (ssn, name, major, status) named "John (i.e., name = "John" in student who have taken the course "CS 530" (must be in transcripts) c. Find students (ssn, name, major, status) who satisfied all prerequisites of each class they are enrolled in. d. Find students (ssn, name, major, status) who are enrolled in a class for which they have not satisfied all its prerequisites. e. Find students (ssn, name, major, status) named John who are enrolled in a class for which they have not satisfied all its prerequisites
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