Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Use MyGuitarShop
- Select CategoryName, ProductName, ListPrice
- From Categories JOIN Products
- ON Products.CategoryID = Categories.CategoryID
- Order by CategoryName, ProductName Asc
- Select FirstName, LastName, Line1, City, [State], ZipCode
- From Customers JOIN Addresses
- On Customers.CustomerID = Addresses.CustomerID
- Where EmailAddress = 'tennaco@gmail.com'
- Select FirstName, LastName, Line1, City, [State], ZipCode
- From Customers JOIN Addresses
- On Customers.ShippingAddressID = Addresses.AddressID
- Select LastName, FirstName, OrderDate, ProductName, ItemPrice, DiscountAmount, Quantity
- From Customers JOIN Orders
- On Customers.CustomerID = Orders.CustomerID JOIN OrderItems
- On Orders.OrderID = OrderItems.OrderID JOIN Products
- On OrderItems.ProductID = Products.ProductID
- Where LastName Like '[M,F]%R'
- Order by LastName, OrderDate, ProductName
- Select LastName, FirstName, ProductName, ItemPrice, DiscountAmount, Quantity, (ListPrice - DiscountAmount )/100 As DiscountItemPrice, (ListPrice - DiscountAmount) /100 * Quantity As TotalItemPrice
- From Customers JOIN Orders
- On Customers.CustomerID = Orders.CustomerID JOIN OrderItems
- On Orders.OrderID = OrderItems.OrderID JOIN Products
- ON OrderItems.ProductID = Products.ProductID
- Where DiscountAmount = 0
- Order by LastName, ProductName
- Select CategoryName, ProductID
- From Categories Full JOIN Products
- On Categories.CategoryID = Products.CategoryID
- Select Count(ShipAmount) As [Number of Orders], Sum(TaxAmount) As [Sum of Tax Amount]
- From Orders
- Select Count(ProductId) As [Number of Products], AVG(ListPrice) AS [AVG Total], MIN(ListPrice) As [Min Total], Max(ListPrice) As [Max Total]
- From Products
- Select *
- From OrderItems
- Select Count (*) AS Quantity
- From OrderItems
- Where Quantity > 1
- Select Count (*) AS AmountofQuantity
- From OrderItems
- Where Quantity > 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement