Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Solutions like this is why I love this site. By seeing better ways to solve problems, I can improve my own solutions and sharpen my SQL skills.
This is exactly as my solution except i never us * as it is intensive on the server. I either use an abertary value to return or an actual colomn. good work!
becuase you are only intersted in two movies stars. the query has to have both stars in it.
very tidy
This is a terrible solution with a bunch useless steps which are absolutely unnecassary. For example: The "JOIN" part of the query... There was a helper table, called film_actor schema wich was instead of the "JOIN".
Why having count is equal 2?
This solution will run in limeted flavours of sql.In most flavours a group by on f.title is necessary
That is incorrect. You might be misunderstanding what the group by is doing in the query. Your scenario exists in the DVD Rental sample database and the test case passes on the query.
This would also return the titles where the same actor starred in 2 movies(film_actor primary key is actor_id,film_id). To fix it you need HAVING COUNT(DISTINCT film_id)=2.