Answered step by step
Verified Expert Solution
Question
1 Approved Answer
gg Part A first please 3. (b) Amend the SQL you wrote for part (a) so that it will only include lecturers who are NOT
gg
Part A first please
3. (b) Amend the SQL you wrote for part (a) so that it will only include lecturers who are NOT currently delivering any modules. Identify what the output should be when the SQL is executed for the data provided. Hint: Use an Outer join and think about how you restrict output from a select using GROUP BY (6 marks) 3. (e) Write the SQL needed to create a view called LecturerPayDetails which has the following columns Firstname, LastName, Modules Delivered, Salary and Bonus. You need to: Include the Firstname and lastname of the lecturer; Include ModulesDelivered which is the number of modules delivered by the Lecturer; Include Salary which is the lecturer salary; Include Bonus which is the lecturer bonus or 0 if bonus has no value; Include a row for each lecturer where the salary is less than 71000 or greater than 85000 Hint: Think UNION (6 marks) 3. Suppose the data in the Lecturer and ModuleDelivery tables is as shown below: Lecturer LECTURERID LASTNAME EMAIL FIRSTNAME SALARY BONUS 101 Byrne pb@techu.com Pat 75000 (null) 102 Smith ss@techu.com Sam 89000 7000 103 Dillon ad@techu.com Andrew 70000 7000 Module Delivery LECTURERNO MODULECODE 101 P101 101 D102 102 D102 102 P101 102 L103 (a) Write SQL to calculate for each lecturer the total number of modules they deliver and output this with their salary and bonus. You need to: Format your output to follow this template: Lecturer
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