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,440 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?