Chat with us, powered by LiveChat Assignemntinstructions.docx - STUDENT SOLUTION USA

Unit Outcome:

· Use advanced SQL statements to manage and interact with data from more than one table.

Course Outcome:

IT234-4: Discover more advanced SQL such as security commands and logins.

Purpose

You created a relational database so that you could maximize the ability to retrieve data in a variety of ways. By relating the tables through the use of foreign keys, you ensured that you could pull meaningful data from more than one table. This enhances an organization’s data analytics ability. In this unit, you will use joins, subqueries, and union statements to retrieve data from more than one table.

Assignment Instructions

Before completing the Assignment, please watch the Unit 8 videos covering facets associated with advanced querying.

Navigate to the Academic Tools area of this course and select Library then Required Readings to access your texts and videos.

Generate SQL statements to address the problems below using the SQL Server Management Studio query window. You will be creating advanced SQL statements to extract data from more than one table.

You will use the Northwind database for this assignment. Leverage the following database design diagram as a guide in forming your statements:

·

Your assignment submittal needs to show both the generated SQL statements and confirmatory screenshots verifying task completion.

Problem 1: Create a report of “seafood” and “produce” products, showing ProductID, ProductName, and CategoryName. Incorporate an inner join condition for this query.

Expected Output

The expected query output showing the ProductID, ProductName, and Category Name of 'seafood' and 'produce' products.

Problem 2: List the last name, first name, title, and salary of company employees with salaries above the company average. Use a non-correlated subquery in the SQL statement.

Expected Output

The expected query output showing the last name, first name, title, and salary of company employees with salaries above the company average.

Problem 3: List the average salaries for employees in Seattle and London. The averages need to be calculated on a per city basis. Use a union operation to generate the results. (Hint: Use one SQL statement to calculate the average salary for one city and another almost identical SQL statement to calculate the average salary for the other city.)

Expected Output

The expected query output showing the average salaries of Seattle and London employees.

Problem 4: Show the product names for products that have been ordered in quantities equal to or exceeding 120. Use a non-correlated subquery in the SQL statement.

Expected Output

The expected query output listing the products that have been ordered in quantities equal to or exceeding 120.

Problem 5: List the supplier names and cities for suppliers that reside in the same cities as Northwind employees. Use a non-correlated subquery in the SQL statement.

Expected Output

The expected query output listing the supplier names and cities for suppliers residing in the same cities as Northwind employees.

Problem 6: Display the names of Northwind employees that manage territories located in the Western region. Use inner joins in the SQL statement linking the Employees, EmployeeTerritories, Territories, and Region tables. Do not show duplicate employee names in the result set.

Expected Output

The expected query output listing the names of Northwind employees that manage territories in the Western region.

Problem 7: Display customer names, cities, and order IDs for customers residing in Madrid or Paris. Show all customers regardless of whether they have placed orders or not. Use an outer join in the SQL statement.

Expected Output

The expected query output listing the customer names, cities, and order IDs for customers residing in Madrid or Paris.

Problem 8: Display a combined list of supplier and shipper names along with their phone numbers. Use a union operation in the SQL statement. Present the results in alphabetical order based on CompanyName.

Expected Output

The expected query output displaying a combined list of supplier and shipper names along with their phone numbers.

Problem 9: Show the employee names, salaries, and countries for employees that have salaries above the average salary within their respective countries. Use a correlated subquery in the SQL statement.

Expected Output

The expected query output showing the employee names, salaries, and countries for employees that have salaries above the average salary within their respective countries.

Problem 10: Display the names of products supplied by vendors in the USA and Norway. Show the product country in the result set. Present the results in alphabetical order by product name. Use an inner join in the SQL statement.

Expected Output

The expected query output displaying the names of products supplied by vendors in the USA and Norway.

Assignment Requirements

Microsoft SQL Server Express and SQL Server Management Studio (SSMS) MUST be installed to complete this Assignment.

Compose your Assignment in a Word document and be sure to identify yourself, your class, and unit Assignment at the top of your paper. Embed the screenshots of your SQL statements and confirmatory output (e.g., table structure definitions) into the Word document.

image5.png

image6.png

image7.png

image8.png

image9.png

image10.png

image1.jpeg

image2.png

image3.png

image4.png

error: Content is protected !!