Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the university database schema below. Find the id's of professors who work for the cs or ee departments. with (i)set operations, (ii) without set

Consider the university database schema below.

Find the id's of professors who work for the cs or ee departments. with (i)set operations, (ii) without set operations.

b) Find the ids of professors who have a joint appointment in CS and EE departments (work for both departments).

c) Find the names of professors who have a joint appointment in CS and EE departments (work for both departments).

d) Find the ids and names of CS professors or those who teach a CS course (use course code for string matching). (i) with set operations, (ii) without set operations.

e) Find the student ids and names of students who took all courses that were taught by all computer science (CS) professors.

f) Find the ids of professors who teach the maximum number of courses (different sections) in Spring 2019.

g) Find the pairs of professor ids who teach the same course in Spring 2019, outputting each pair only once

. h) Find the ids of professors, together with their names, who teach only one section of a course in Spring 2019

. i) Find the ids of courses that are

image text in transcribed

00:13 CS353 Spring 2019 Homework 2 Due: 6 March, Wednesday till 17:00 Q.1 (36 points) Consider the university database schema below STUDENT(s id, s name, address, status) PROFESSOR(p_id. p_name, deptid) COURSE(dept id, c code, c name, descr) TRANSCRIPT(-id. c-code. semester, year, grade) TEACHING(p id, c code, section, semester, year) Relational Algebra: Write the following queries in a) Find the id's of professors who work for the CS or EE departments. (i) with set operations b) c) d) e) Find the student id's and names of students who took all courses that were taught by all (ii) without set operations Find the id's of professors who have a joint appointment in CS and EE departments (work for both departments). Find the names of professors who have a joint appointment in CS and EE departments (work for both departments). Find the id's and names of CS professors or those who teach a CS course (use course code for string matching). ) with set operations, (ii) without set operations. computer science (CS) professors. Find the id's of professors who teach the maximum number of courses (different sections) in Spring 2019 Find the pairs of professor id's who teach the same course in Spring 2019, outputting each pair only once. g) h) Find the id's of professors, together with their names, who teach only one section ofa course in Spring 2019. Find the id's of courses that are taught by at least two different professors in Spring 2019 (without aggregate operators). Q.2 (20 points) Given two relations RI and R2, where RI contains NI tuples, and R2 contains N2 tuples, N2> NI>0, give the minimum and maximum number of tuples for the resulting relations produced by each of the following Relational Algebra expressions. Assume RI has attribute s and R2 has attributes s and t. In each case, state any assumptions about the schemas for R1 and R2 to make the expression meaningful (I)RI UR2; (2) RI n R2: (3)RI R2:(4) R2-R1: (5) RI x R2 Q.3 (14 points) Prove that, if R and S are union compatible, r s s where r and s are instances of the relations R and S, respectively. Assume tat R and S have attributes with the same names rl Q.4 (14 points) a) Division is not an essential operator in Relational Algebra Write an expression that corresponds to division using the basic Relational Algebra operations of cartesian product, set difference, and projection. Show the result of the division operations A/B1, A/B2. and AB3 for the following relations: b) B B3

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

Students also viewed these Databases questions