Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --1--
- SELECT SUM(UnitPrice) AS 'TOTAL_PRICE' From Product
- Where SupplierID=(Select SupplierID from Supplier where SupplierName = 'Fresh Hut')
- --2--
- SELECT top 3 UnitPrice AS 'TOP3_PRICE', ProductName from Product
- where SupplierID=(Select SupplierID from Supplier where SupplierName = 'Fresh Hut')
- Order By UnitPrice Desc
- --3--
- SELECT ProductID, ProductName, UnitPrice, Quantity, CategoryID, SupplierID From Product
- where CategoryID=(Select CategoryID from Category where CategoryName = 'Sweet & Junk Food')
- and
- SupplierID=(Select SupplierID from Supplier where SupplierName = 'Deli Cream')
- --4--
- Select*From Purchase
- Where CustomerID IN (Select CustomerID From Customer where FirstName = 'Lydia')
- and
- PurchaseQuantity >= 2
- --5--
- Select*From Purchase
- where CustomerID IN (Select CustomerID From Customer where City = 'Cyberjaya')
- --6--
- Select COUNT(PurchaseQuantity) AS 'TOTAL_PURCHASE', PurchaseDate From Purchase
- Where PurchaseDate > '2018-04-09'
- and CustomerID IN (Select CustomerID From Customer Where LastName like '%a%')
- Group By PurchaseDate
- having COUNT(CustomerID) > 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement