Question: QUESTION 12 Given the following schema where primary keys are underlined and foreign keys are marked with #, express in Relational Algebra the queries below:
QUESTION 12 Given the following schema where primary keys are underlined and foreign keys are marked with #, express in Relational Algebra the queries below: Employee(employeeNo, empName, jobTitle) Project(projectID, projectName, sponsor, startYear, endYear) WorkedOn(#employeeNo, #projectID, year, month, noHours) a) List the names of projects that have started in 2016 and finished in 2020. [1 mark] b) List the details of employees whose job title is programmer. [1 mark] c) List the names of employees who are working on the project whose id is 100. [1 mark]
QUESTION 16
-
Given the following relational schema where primary keys are underlined and foreign keys are marked with #: Instructor (Instructor_Id, Instructor_Name, specialization, Address, #Department_Id) Department(Department_Id, Department_Name) Course(Course_code, Course_Title, Credit_hours, Contact_hours,#Department_Id) Teaching(#Instructor_Id, #Course_code) a) Express in SQL the following queries: i. Change to 6 the number of contact hours of the course which has the code ITDR2104.[1] ii. Add a new column named instructorLoad of type Number(2) to the table instructor. [1] iii. List the details of all the courses having a code that starts with ITDR. The output should be sorted in descending order by credit hours. [1] iv. Find the number of courses taught by the instructor whose name is Ahmed. [1.5] v. List the names of all departments along with the number of courses offered by each department. [1.5] vi. Find the titles of courses, which are taught by the instructor who is named Ahmed.[1.5] b) Create a view named instructor_of_DBCourse to contain the details (Instructor_Name, specialization, Address, Department_Id) of instructors who teach the course having the code ITDR2106.[2.5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
