Program 7 AND 8
Program 7 AND 8
b. Calculate the total revenue generated from sales of products in the 'Electronics'
category.
SELECT SUM(Sales.Q_Sold * P.Uprice) AS total_revenue
FROM Sales S, Products P
Where Sales.product_id = Products.product_id and
Products.category = 'Electronics';
c. Retrieve the product_name and total_price from the Sales table, calculating the
total_price as quantity_sold multiplied by unit_price.
SELECT product_name, SUM(quantity_sold * unit_price) AS total_price
FROM Sales
JOIN Products ON Sales.product_id = Products.product_id
Group by Products.Pname;
BrID int ,
bookID int,
Check(Brwdate< Returndate));
FROM Borrowers br
Br.borrowdate> ‘2025-01-15’;
FROM Borrowers br
FROM Borrowers br
GROUP BY bk.BookID