题目
COMP4338 COMP5338 (NE) Out of Class Quiz -- Week 7
多项选择题
Which queries find people who both acted in and directed the same movie in neo4j's sample Movie Graph? Select all that apply.
选项
A.MATCH (p:Person)-[DIRECTED]->(m:Movie)
WHERE (p)-[:ACTED_IN]->(m)
RETURN p.name, m.title;
B.MATCH (p:Person), (m:Movie)
WHERE (p)-[:ACTED_IN]->(m) AND (p)-[:DIRECTED]->(m)
RETURN p.name, m.title;
C.MATCH (p:Person)-[:ACTED_IN]->(m:Movie)<-[:DIRECTED]-(p)
RETURN p.name, m.title;
D.MATCH (p:Person)-[:ACTED_IN]->(m:Movie)
WHERE (p)-[:DIRECTED]->(m)
RETURN p.name, m.title;
查看解析
标准答案
Please login to view
思路分析
Let’s break down what the question is asking: identify queries that return people who both acted in and directed the same movie in the Movie Graph. Each option will be assessed on whether it enforces that p is the same person for both acting and directing a given movie m.
Option 1: MATCH (p:Person)-[DIRECTED]->(m:Movie) WHERE (p)-[:ACTED_IN]->(m) RETURN p.name, m.title;
This starts by finding a person p who directed a movie m, and......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
Which of the following queries could return the same person–movie pair more than once, even if the dataset guarantees that there is at most one PRODUCED relationship and at most one REVIEWED relationship between any person and movie
In a consumer society, many adults channel creativity into buying things
Economic stress and unpredictable times have resulted in a booming industry for self-help products
People born without creativity never can develop it
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!