Relationships and Entity-Relationship diagrams Flashcards

1
Q

What is an entity-relationship diagram?

A

A layout, wireview, of the database to plan it before coding.

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

What does the ERD include?

A

entities, relationships, attributes, keys, types of relationships.

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

How do you draw an entity symbol on an ERD?

A

A rectangle with a horizontal line at the top. Above the line is the entity name, below the line is the attributes, beginning with the primary key.

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

How do you indicate a primary key when hand drawing an ERD?

A

underlining, starring with * before the name, bolding, marking PK after the attribute name, coloring it differently.

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

How are foreign keys denoted in a hand drawn ERD?

A

sometimes in italics, but normally the traditional naming convention.

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

Name some of the different syntaxes used to describe an ERD.

A

Access, Chen, UML, Booch, Yourdon, etc.

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

How do you denote a relationships between entities in an ERD?

A

a line between the two. From the primary key to the foreign key as closely as possible.

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

How is a one to many relationship denoted in ERD?

A

The primary key side gets a single line, but the foreign key side shows crows feet to denote the many side of the relationship.

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

What is a one-to-one relationship and how is it shown on the ERD?

A

A one to one relationship is one record type can only have one of another record type. These are rare. They are shown by a single bar on both sides of the line.

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

What is a many to many relationship and how is it denoted on an ERD?

A

A many to many relationship is one record type being able to have many of another record type and vice versa. A good example is a student can have many courses and a course can have many students. Shown with crows feet on both sides of the ERD relationship line. Must be converted to two one to many relationships using a junction table on the ERD.

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

How is a junction table formed?

A

Must include at least the primary keys of the two parent tables. If a combination of the two primary keys is unique it can be used as the table’s primary key. However, if duplicates can occur you would have to create a unique artificial key or use more information as a composite key.

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