Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Mistake in question
On the final step of the final quiz of this course, it asks you to select all the columns from the Sale table, but it only accepts an answer that includes all columns from both columns
Here is the exact question:
In a car database there is a Sale table with columns, SaleID, CarID, CustomerID, LocationID, SalesRepID, SaleAmount and SaleDate and a Customer table with columns, CustomerID, FirstName, LastName, Gender and SSN. Use a subquery as a derived table to show all sales to female ('F') customers. Select all columns from the Sale table only.
Your answer is for the first step of the quiz. I wrote
select Sale.* from Sale inner join (select CustomerID from Customer where Gender = 'F') as women on Sale.CustomerID = women.CustomerID
and it returned this error:
Your query didn't return all columns from the Sale table for who's CustomerIDs belong to people who identify as female!.
I wrote Sale.* and it successfully returned all the Sale columns, so something is messed up there.
Then I put in this query:
select * from Sale inner join (select CustomerID from Customer where Gender = 'F') as women on Sale.CustomerID = women.CustomerID.
This succeeded, but it shouldn't have, because the question says "Sale table only".
Chris Seals4,506 Points
The query that I wrote that it took looks like this:
SELECT ModelName FROM Model WHERE ModelID IN (SELECT ModelID FROM Car WHERE StickerPrice > 30000);
What query did you write that it accepted all columns back?