Exercise 6.3 reads as follows: “The results returned from the previous query returns the collection of movie titles with duplicates. That is because there are multiple actors per released year. Next, modify the query so that there is no duplication of the movies listed for a year.”
The solution (on page 8/15) is as follows:
WHERE m.released >= 1990 AND m.released < 2000
RETURN m.released, collect(DISTINCT m.title), collect(a.name)
In the output of the query, the movie titles are no longer duplicated. But it is no longer clear which actors acted in which movie. I just get a list of actors who played in movies that were released in a particular year. Now, if I would like to have a result entry for each year of release, with a list of the movies released in that year and then – for each of those movies – a list of the actors who acted in THAT particular movie. How should the query look like? Or are the requirements for this query incompatible in some way?
I hope my question is clear.