Question

The category name and a count of the number of products within each category. The listing...

The category name and a count of the number of products within each category. The listing should be sorted by category name.

A listing of the customer name, last name of employee who accepted the order, and the shipper for all orders from customers based in North America and shipped through either United Package or Federal Shipping. The listed must be sorted alphabetically by customer name.

Please use https://www.w3schools.com/sql/

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

Question 1:

SQL query :

SELECT CategoryName,count(ProductID) as 'number of products'
FROM Categories, Products
where
Categories.CategoryID=Products.CategoryID
group by CategoryName
order by CategoryName;

Explanation :This SQL query will join two tables Categories, Products based on the CategoryID and will return the result.

**********************************

Question 2:

SQL query :

SELECT CustomerName,LastName,ShipperName FROM Customers,Orders,Employees,Shippers where
Customers.CustomerID=Orders.CustomerID and
Orders.EmployeeID=Employees.EmployeeID and
Orders.ShipperID=Shippers.ShipperID and
country in ('Mexico','Canada','USA') and
ShipperName in ('United Package','Federal Shipping');

Explanation :The SQL query given above will join four tables Customers,Orders,Employees,Shippers and will return the result.

**********************************

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
The category name and a count of the number of products within each category. The listing...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT