'عبد الرحمن ديرية نظم 2'
'عبد الرحمن ديرية نظم 2'
'عبد الرحمن ديرية نظم 2'
Absolutely, here are the SQL queries for the e-commerce platform schema you
provided:
1. Retrieve all customers who registered after January 1, 2023:
SQL
SELECT *
FROM Customers
WHERE RegistrationDate > '2023-01-01';
3. Retrieve a list of orders along with the customer's first and last
name:
SQL
SELECT o.OrderID, o.OrderDate, o.TotalAmount, c.FirstName,
c.LastName
FROM Orders o
INNER JOIN Customers c ON o.CustomerID = c.CustomerID;
4. Get a list of products along with the total quantity ordered for each.
Only include products that have been ordered at least once:
SQL
SELECT p.ProductID, p.ProductName, SUM(od.Quantity) AS
TotalQuantityOrdered
FROM Products p
INNER JOIN OrderDetails od ON p.ProductID = od.ProductID
GROUP BY p.ProductID, p.ProductName
HAVING SUM(od.Quantity) > 0;