Week 7 L1 Flashcards

1
Q

What do we mean by ad-hoc

A

When necessary or needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the downsides of relational relationships

A

need to define FK when using associative table
cannot add in ad-hoc way
recursive use of joins can be complex and slow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the fundamentals of graph dbs ?

A

They are schemaless
Each node can have different properties like document DBS
A node can have a relationship with any other node
node pairs can have one or more relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the key features of graph db relationships ?

A

Relationships have a type - any pair of nodes can have a relationship of any type
Relationships can have properties - relationships can be considered as nodes that join other nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do nodes represent

A

Nodes represent entities e.g. people in social networks, locations in distribution services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do edges represent

A

Edges represent relationships e.g. likes, plays, friends of , delivers to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do we mean by directional edges ?

A

Node to an edge is either incoming or outgoing for example A likes B does not mean B likes A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What do properties do to a relationship

A

They add meaning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What do nodes have ?

A

Lables and properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do edges have ?

A

Types and properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is relationship depth

A

Measured edges between one node and another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do we mean by graph traversal?

A

Means visiting nodes by following edges
Traversal starts with a chosen node.
Can follow incoming or outgoing nodes so travel in either direction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the different types of traversal

A

Depth first traversal- Follows as far as possible along each edge to its end node then backtracks and follows the next unvisited edge and so on
Breadth first traversal
Follows the neighbouring nodes first then follows the next depth of neighbours and so on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why would you use indexes in graph databases ?

A

Speeds up search for specific nodes or edges.
Useful for finding the starting nodes for traversal.
Without index whole graph might be scanned.
Index for types of nodes etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you do a “who likes me “query?

A

Traverse the incoming nodes to me to depth 1 with edge type like

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the most popular graph database and what is its query language?

A

Neo4j has declarative query language called Cypher which is SQL like

17
Q

How to make relational DB as Graph

A

Separate all rows from their tables while keeping all relationships.