Skylar Gordon7,234 Points
What does this return, if it doesn't return all sales to female customers?
So, I am being told by the computer that this is not correct, as it does not return all columns of the rows in the Sale table that have Customer IDs that belong to female customers. If it doesn't return that, what does it return? Since the challenges won't show you what you queried unless you got it right, I can't actually problem solve this until I have that information. (I did a very similar query in the SQL playground for the last task, and got what I thought I'd get, so not being able to see what this queries is the only reason I can't figure this out.)
SELECT s.* FROM Sale AS s INNER JOIN (SELECT CustomerID FROM Customer WHERE Gender = 'F') AS c ON c.CustomerID = s.CustomerID;
KRIS NIKOLAISENPro Student 51,852 Points
Although your query may return the same results the task specifically asks Use a subquery along with IN to list all sales to female customers . It is similar to the previous two tasks.
Josh Gabel8,261 Points
Not sure if you found a solution or not but the challenge appears to be worded incorrectly. It specifically says:
Select all columns from the Sale table only.
However the accepted result is all columns of the Sale table and the result of the derived table. This query will work:
SELECT s.*, c.CustomerID FROM Sale AS s INNER JOIN (SELECT CustomerID FROM Customer WHERE Gender = 'F') AS c ON c.CustomerID = s.CustomerID;