Write a query to display the vendor ID, vendor name, brand name, and number of products…
Jump to turn (7)
- 1Write a query to display the vendor ID, vendor name, brand name, and number of p
- 2Msg 207, Level 16, State 1, Line 25416 Invalid column name 'VendorID'. Msg 207,
- 3--2.make date values appear as date: create table dates ([date] varchar(20)) ins
- 4Msg 241, Level 16, State 1, Line 66 Conversion failed when converting date and/o
- 5Msg 241, Level 16, State 1, Line 66 Conversion failed when converting date and/o
- 6it's not working
- 7Write a query to display the first name, last name, street, city, state, and zip
- User
Write a query to display the vendor ID, vendor name, brand name, and number of products of each brand supplied by each vendor. Sort the output by vendor name and then by brand name
- Assistant
SELECT V.VendorID, V.VendorName, B.BrandName, COUNT(P.ProductID) AS NumberOfProducts FROM Vendors V JOIN Brands B ON V.VendorID = B.VendorID JOIN Products P ON B.BrandID = P.BrandID GROUP BY V.VendorID, V.VendorName, B.BrandName ORDER BY V.VendorName, B.BrandName;
- User