sql
sql
-- 2. Select the names and the prices of all the products in the store.
SELECT Name, Price FROM Products;
-- 3. Select the name of the products with a price less than or equal to $200.
SELECT Name FROM Products WHERE Price <= 200;
-- 4. Select all the products with a price between $60 and $120.
SELECT * FROM Products WHERE Price BETWEEN 60 AND 120;
-- 5. Select the name and price in cents (i.e., the price must be multiplied by
100).
SELECT Name, Price * 100 AS PriceInCents FROM Products;
-- 7. Compute the average price of all products with manufacturer code equal to 2.
SELECT AVG(Price) AS AveragePrice FROM Products WHERE Manufacturer = 2;
-- 8. Compute the number of products with a price larger than or equal to $180.
SELECT COUNT(*) AS NumberOfProducts FROM Products WHERE Price >= 180;
-- 9. Select the product name, price, and manufacturer name of all the products.
SELECT Products.Name, Products.Price, Manufacturers.Name AS ManufacturerName
FROM Products
JOIN Manufacturers ON Products.Manufacturer = Manufacturers.Code;