Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help needed two sql questions Schema: Administrators AdminlD EmailAddress Passwo

ID: 3754329 • Letter: H

Question

Help needed two sql questions

Schema:

Administrators AdminlD EmailAddress Password FirstName LastName Orderltems ItemID OrderID ProductiD temPrice DiscountAmount Products ProductiD CategoryID ProductName Description ListPrice DiscountPercent DateAdded Orders Addresses OrderlD CustomerlD OrderDate ShipAmount TaxAmount ShipDate ShipAddressID AddresSID CustomeriD Line1 Line2 Customers CustomerID EmailAddress Password FirstName State ZipCode ShippingAddressID BillingAddressID Categories CategoryID CategoryName CardNumber CardExpires BillingAddressID

Explanation / Answer

If you have any doubts, please give me comment...

-- 3)

SELECT ProductName, COUNT(DISTINCT DiscountPercent)

FROM Products

GROUP BY ProductName;

-- 4)

SELECT CONCAT(FirstName,' ', LastName) FullName, EmailAddress, OrderID, OrderDate

FROM Customers C, Orders O

WHERE C.CustomerID = O.CustomerID AND O.OrderDate = (

SELECT MIN(OrderDate)

FROM Orders

WHERE C.CustomerID = CustomerID

);