Supervision 1 Questions

These are suggested questions that supervisors might want to use in their supervisions. They are meant to indicate the type of questions that will be on the tripos exam.

  1. Discuss the practical exercises for relational databases. Do you understand the queries and what they are doing?
  2. Discuss question 1.c from the tripos of June 2017, found here.
  3. At the very end of the graph tutorial we presented the solution to excercise2c from last years ticks. Our solution in Cypher is
match
  (liked:Movie)-[:HAS_KEYWORD]->(keyword:Keyword)<-[:HAS_KEYWORD]-(rec:Movie),
  (liked)<-[:ACTS_IN]-(actor:Person)-[:ACTS_IN]->(rec),
  (liked)-[:HAS_GENRE]->()<-[:HAS_GENRE]-(rec)
where liked.title = 'Skyfall (2012)'
with rec, count(distinct keyword) as common_keywords, count(distinct actor) as common_actors
return rec.title as title, 10*common_actors + common_keywords as score
order by score desc;

which produces the output:

+---------------------------------------------------------------+
| title                                                 | score |
+---------------------------------------------------------------+
| "Star Wars: Episode VII - The Force Awakens (2015)"   | 159   |
| "The Dark Knight (2008)"                              | 126   |
| "Casino Royale (2006)"                                | 105   |
| "Wonder Woman (2017)"                                 | 99    |
| "Mission: Impossible - Ghost Protocol (2011)"         | 85    |
| "Harry Potter and the Deathly Hallows: Part 2 (2011)" | 56    |
| "The Bourne Ultimatum (2007)"                         | 52    |
| "The Hurt Locker (2008)"                              | 46    |
| "No Country for Old Men (2007)"                       | 40    |
| "Argo (2012)"                                         | 25    |
+---------------------------------------------------------------+
Your task is to translate this query into SQL and verify that it produces the same result.
This will help you better appreciate the pattern matching constructs in Cypher!