Chap 4 Exc - *ex4-1 SELECT CategoryName ProductName...

This preview shows page 1 out of 1 page.

/*ex4-1 */ SELECT CategoryName, ProductName, ListPrice FROM Products AS c1 JOIN Categories a1 ON c1.ProductID=a1.CategoryID /*ex4-2 Getting Error Message: Msg 245, Level 16, State 1, Line 7 Conversion failed when converting the varchar value '[email protected]' to data type int. SELECT FirstName, LastName, Line1, City, State, ZipCode FROM Customers AS c1 JOIN Addresses a1 ON c1.CustomerID=a1.CustomerID WHERE c1.EmailAddress=a1.AddressID */ /*ex4-3*/ SELECT FirstName, LastName, Line1, City, State, ZipCode FROM Customers AS c1 JOIN Addresses a1 ON c1.CustomerID=a1.CustomerID WHERE c1.ShippingAddressID=a1.AddressID /*ex4-4 I could not figure out which JOIN to use in the exercise to proceed*/ SELECT LastName, FirstName, OrderDate, ProductName, ItemPrice, DiscountAmount,
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

Unformatted text preview: Quantity FROM Customers, Orders, OrderItems, Products /*ex4-5 I am totally confused on this exercise. I got lost on the FROM clause??? SELECT DISTINCT ProductName, ListPrice FROM Products AS c1 JOIN Products a1 ON c1.ProductName = a1.ListPrice */ /*ex4-6*/ SELECT CategoryName, ProductID FROM Categories LEFT JOIN Products ON Categories.CategoryName=Products.ProductName ORDER BY ProductID /*ex4-7* This was as far as I got on exercise 7. I just wasnt sure if it this is correct */ SELECT 'SHIPPED' AS ShipStatus, OrderID, OrderDate FROM Orders UNION SELECT 'NOT SHIPPED' AS ShipStatus, OrderID, OrderDate FROM Orders ORDER BY OrderDate...
View Full Document

  • Fall '14

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern