TWO SQL Questions Here\'s schema questions: Administrators AdminlD EmailAddress
ID: 3754325 • Letter: T
Question
TWO SQL Questions
Here's schema
questions:
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 BillingAddressIDExplanation / Answer
If you have any doubts, please give me comment...
-- 1)
SELECT ProductName, ListPrice
FROM Products
WHERE ListPrice<(
SELECT AVG(ListPrice)
FROM Products
)
ORDER BY ListPrice DESC;
-- 2)
SELECT COUNT(*) no_of_categories
FROM Categories C
WHERE NOT EXISTS(
SELECT ProductID
FROM Products P
WHERE C.CategoryID = P.CategoryID
);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.