暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

【Neo4j】Introduction to Cypher

506

Question 1

Suppose you have a graph that contains nodes representing customers and other business entities for your application. The node label in the database for a customer is Customer. Each Customer node has a property named email that contains the customer’s email address. What Cypher query do you execute to return the email addresses for all customers in the graph?

Select the correct answer.

  •  MATCH (n) RETURN n.Customer.email
  •  MATCH (c:Customer) RETURN c.email
  •  MATCH (Customer) RETURN email
  •  MATCH (c) RETURN Customer.email

Question 2

Suppose you have a graph that contains Customer and Product nodes. A Customer node can have a BOUGHT relationship with a Product node. Customer nodes can have other relationships with Product nodes. A Customer node has a property named customerName. A Product node has a property named productName. What Cypher query do you execute to return all of the products (by name) bought by customer 'ABCCO'.

Select the correct answer.

  •  MATCH (c:Customer {customerName: 'ABCCO'}) RETURN c.BOUGHT.productName
  •  MATCH (p:Product)←[:BOUGHT]-(:Customer 'ABCCO') RETURN p.productName
  •  MATCH (p:Product)←[:BOUGHT_BY]-(:Customer 'ABCCO') RETURN p.productName
  •  MATCH (p:Product)←[:BOUGHT]-(:Customer {customerName: 'ABCCO'}) RETURN p.productName

Question 3

Thus far, you have learned to use a simple MATCH clause to return values. When must you use a variable in a simple MATCH clause?

Select the correct answer.

  •  When you want to query the graph using a node label.
  •  When you specify a property value to match the query.
  •  When you want to use the node or relationship to return a value.
  •  When the query involves 2 types of nodes.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论