Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to perfect answer for the question 1 to 17 Using the university database, give the following queries in SQL (SQL Server 2019). 1.

I want to perfect answer for the question 1 to 17image text in transcribed

Using the university database, give the following queries in SQL (SQL Server 2019). 1. Find the ID and name of each student who did not take any courses before year 2018. 2. Find the ID of each student who took at least one course with the instructor named Katz; remove duplicates in the result. 3. Find the total number of (distinct) students who took at least one course with the instructor with ID 10101. 4. Find the departments with the budget higher the average budget of all departments. 5. Find the departments whose payroll (the total of all instructors' salaries in the department) is greater than the average payroll of all departments. 6. Find the department(s) with the lowest maximum salary among all departments. The result should display the department name and the maximum salary within the department. 7. Find the course sections (course_id and sec_id) with the maximum enrollment (number of enrolled students) in Fall 2017. 8. Find the name of each student who did not take any courses. 9. Find the title of each course that was not taught by any instructors. 10. Find the ID and name of each instructor who earns more than the average salary of her or his department. 11. Create a view for the enrollment of each section that was offered in Fall 2017. 12. Find the average number of sections taught by each instructor who taught at least one course. Insert, Delete, and Update (use BEGIN TRAN ... ROLLBACK) 13. Create a new course "CS-001", titled "Weekly Seminar", with 0 credits. 14. Increase the salary of each instructor in the Comp. Sci. department by 10%. 15. Insert every student whose tot_cred attribute is greater than 100 as an instructor in the same department, with a salary of 30,000 . 16. Delete all rows in the instructor table for those instructors associated with a department located in the Watson building. 17. Increase salaries of instructors whose salary is over $90,000 by 3%, and all others by 5%

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

Recommended Textbook for

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions