Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

In a car database there is a Sale table with columns, SaleID, CarID, CustomerID, LocationID, SalesRepID, SaleAmount and

In a car database there is a Sale table with columns, SaleID, CarID, CustomerID, LocationID, SalesRepID, SaleAmount and SaleDate. The database also has a SalesRep table with columns, SalesRepID, FirstName, LastName, SSN, PhoneNumber, StreetAddress, City, State and ZipCode.

Show all SaleDate, SaleAmount, and SalesRep First and Last name from Sale and SalesRep. Make sure that all Sales appear in results even if there is no SalesRep associated to the sale.

My answer:

SELECT s.SaleDate, s.SaleAmount, sr.FirstName||" "||sr.LastName FROM SalesRep AS sr LEFT OUTER JOIN Sale AS s ON sr.SalesRepID = s.SalesRepID

Bummer! Your query didn't select the SaleDate, SaleAmount, FirstName and LastName!! I Have selected all of them!!!! What Am I missing here?

1 Answer

Steven Parker
Steven Parker
231,128 Points

You didn't provide a link to the challenge for confirmation, but it looks like the challenge is expecting the fields to be individually selected and not concatenated together.

Yepp, I just had to select the fields individually! I thought I had tried that out already, but apparently not. Thank you, Steven!