ER Example with MySQL Workbench Flashcards

1
Q

What is an identifier or key?

A

Fully identifies an instance

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

What is a Partial Identifier?

A

Identifies an instance in conjunction with one or more partial identifiers

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

What are the attributes types?

A
  • Mandatory - NOT NULL (blue diamond)
  • Optional - NULL (empty diamond)
  • [Derived] - e.g [YearsEmployed]
  • {Multivalued} - e.g {Skill}
  • Composite - e.g Name (First, Middle, Last)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the definition of derived attributes?

A

Derived attributes imply that their values can be derived from some other attributes in the database.

Example: anything calculable - [Years employed]

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

What are the types of relationship cardinality?

A
  • One to One: Each entity will have exactly {0 or 1} related entity
  • One to Many: One of the entities will have {0, 1, or more} related entities, the other will have {0 or 1}
  • Many to Many: Each of the entities will have {0, 1, or more} related entities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is auto_increment?

A

tells mySQL to add one

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

What is ON Delete Restrict?

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

What is ON UPDATE CASCADE?

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

How to deal with Many-to-Many?

A

Based on business rules
- Depends if the business wants one email or multiple like amazon

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

What is the rule for dealing with One-to-One (Binary)

A

Rule: move the key from the one side to the other side

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

How to design unary relationships One to One?

A

Put a Foreign key in the relation

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

How to design Unary relationships One-to-Many

A

Put a Foreign key in the relation

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

How to design Unary relationships Many-to-Many?

A
  • Generate an Associative Entity
  • Put two Foreign keys in the Associative Entity
  • Need 2 different names for the Foreign keys
  • Both Foreign keys become the combined key of the Associative Entity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the definition of ternary relationships?

A

Relationships between three entities

- Generate an Associative Entity

- Three One-to-Many relationships

- Same rules then apply as One-to-Many
How well did you know this?
1
Not at all
2
3
4
5
Perfectly