Question: open the hosted north wind database hosted at https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all (Links to an external site.) Execute the SQL statements below and observe the result. Try to
open the hosted north wind database hosted at
- https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all (Links to an external site.)
Execute the SQL statements below and observe the result. Try to guess what each SQL statement does and explain it . Also mention how many records each SQL statement generates

Part 2
Consider the Northwind sample database posted available at
https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all (Links to an external site.)
Write the following Queries:
Q7 List all cities from the customer table (we want to know what cities are there in the customer table ). How many cities are there?
Q8 List the customers who are from Germany but not from city Brandenburg
Q9 List all the products whose price is more than 10 but less than or equal to 20 (display the result in descending order ( based on the product price)
Q10 List all the product names which are ordered for quantity of more than 10. the result set (resulting table) has to include the following column ( Note: Just list unique product names . That means do not repeat a product name multiple times)
ProductName (updateL no need to list quantities)
You only need to list such products that were in an orderDetails row with quantity of more than 10 (each product name to appear only once)
Q11 List all the product names which are ordered for quantity of more than 10 by customers from USA the result set has to include the following columns
| CustomerName, | ProductName, | Quantity |
|---|
--1 SELECT * FROM [Customers] --2 SELECT Country FROM Customers --3 SELECT DISTINCT(Country) FROM Customers --4 SELECT COUNT(CustomerID), Country FROM Customers GROUP BY Country --5 SELECT Country, COUNT (CustomerID) as numberOfCustomers FROM Customers GROUP BY Country ORDER BY numberOfCustomers --6 SELECT * FROM Customers, Orders WHERE Customers. CustomerID = Orders.CustomerID
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
