Question: Please give me the right code for the questions. And give me the code that fits the questions. And please use the names next to

Please give me the right code for the questions. And give me the code that fits the questions. And please use the names next to the table on the create table.

for example

select instructor_id, department_id, count(distinct course_id) as course count

from course_ sections

If you see the screenshot I attached in the form I showed you as an example above, please use the same name next to the create table. Please don't change the names next to the create table.

Questions

2. Find the ID and name of the instructors who taught at least one course in their own departments but did not teach any courses in other departments. Remove duplicates in the result.

3. Find the instructors who earn the second lowest salary in their own departments. Display the name, department name, and salary of these instructors in the alphabetical order of instructor name.

4. Find the course(s) taken by the fewest students in the year 2006. The result should display the course title and the number of students. If a student has taken the same course more than once, this student should be counted only once.

5. Find the department(s) with the fourth lowest number of students. Display the department name and the number of students in the department (give a proper column name) in the result.

6. Update the salaries of the instructors as follows.

a.) Increase salary by 6% for the instructors who taught at least 3 different courses (different course_id);

b.) Increase salary by 4% for the instructors who taught exactly 2 different courses;

c.) Increase salary by 2% for other instructors (including the instructors who did not teach).

Please use BEGIN TRAN and ROLLBACK properly (CREATE VIEW is not allowed to use; you may use the WITH clause within BEGIN TRAN and ROLLBACK). You must use the CASE expression.

Please give me the right code for the questions. And give methe code that fits the questions. And please use the names nextto the table on the create table. for example select instructor_id, department_id,count(distinct course_id) as course count from course_ sections If you see thescreenshot I attached in the form I showed you as an example

nofnam vau (T) Masiagas Connenjs concleted spocesstu11?. Do Quick Launch (Ctrl I Q) = File Edit View Query Project Tools Window Help Maskiagas Conmends concleted soctessevil? Masisings Connands concleted soctesstu11:. Query executed successfully. Quick Launch (Ctrl I Q) = File Edit View Query Project Tools Window Help

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!