Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Class, Do the following tasks in SSMS: Load the MurachCollegeDB ( unless already loaded ) . See the SQL Scripts Module. Select the MurachCollege DB
Class,
Do the following tasks in SSMS:
Load the MurachCollegeDB unless already loaded See the SQL Scripts Module.
Select the MurachCollege DB in the Object Explorer
Open the query text window via the New Query Tool.
New Query
Add Comments to your script to include your Name, class, and Assignment Name.
Create the following SQL queries using Select in the query window. Comment each step in the script. Each task must use a subquery.
Plant the code below in your script commented as A
SELECT DISTINCT LastName, FirstName
FROM Instructors i JOIN Courses c
ON iInstructorID cInstructorID
ORDER BY LastName, FirstName ;
Write a SELECT statement Commented as A that returns the same result set as this SELECT statement, but dont use a join. Instead, use a subquery in a WHERE clause that uses the IN keyword.
Write a SELECT statement that answers this question:
Which instructors have an annual salary thats greater than the average annual salary for all instructors?
Display the Last Name, First Name, and Annual Salary columns for each Instructor. Order in descending Annual Salary.
Write a SELECT statement that returns the LastName and FirstName columns from the Instructors table.
Return one row for each instructor that doesnt have any courses in the Courses table. To do that, use a subquery introduced with the NOT EXISTS operator.
Sort the result set by LastName and then by FirstName.
Run your created script.
Save the displayed results partial data OK in a Screen shot.
Save the SqlQuery using SSMS into as a sql file.
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