11. Relational Database and ERD Flashcards

1
Q

in 3 points what is an

entity

A
  • this is an object that exists in a database such as a car, person, or bank account.
  • each of these is unique within a table althogh will share the same attributes
  • a table will hold many of them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are

attributes

A

these are given to entities so that each entity can hold its own charcteristics and be unique

example

a person entity might be given an age and name

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

describe a

table and structure

A

this will define an entity

  • it will contain columns and rows where
    • columns
      • define the attributes each entity can have
    • rows
      • each row is a record
      • each record is an entity instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

describe an

entity type

A

this is often the name of the table and is where we have a collection of entities that share the same attributes

example

an entity type of employees where each entity of the entity type would be an employees that all share the same attribute

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

how is an

entity type

represented

A

this is represented in a database as a table

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

what is an

enity instance

A

this is a record that has been placed inside a table and has been given attributes

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

what are the two

types of entities

A

these include:

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

describe a

tangible entity

A

this is something that exist in the real world physically and can be touched.

Example:

Person, car, etc.

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

describe an

intangible entity

A

this is something that exist only logically and has no physical existence.

Example:

Bank Account, job

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

what does the accronym

ERD

stand for

A

this accronym is

Entity Relationship Diagram (ERD)

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

what is an

Entity Relationship Diagram (ERD)

A

This is a diagram that shows the structure and the relationships of tables within a database.

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

what are two advantages of an

Entity Relationship Diagram (ERD)

A

these include:

Design - these are often created before the database as they help to foresee any issues and help plan what will be required within the database

Debugging - large databases with many tables can be hard to navigate and understand any connections. This can help identify problems by having a high level view of how the database has been designed

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

what 5 pieces of information will you find within an

Entity Relationship Diagram (ERD)

A

within this you will find information such as:

  • Tables and its entity
  • Attributes of an entity
  • Relationships between entities
  • Primary keys
  • Foreign keys
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is a

primary key

A

this is used so that each record / entity instance within an entity / table can be uniquely identified.

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

how many times can a

primary key

occur in a table

A

this can only occur once within a table.

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

what is a

foreign key

A

this is a reference to a primary key in another table

This is used so that we can form relationships between different tables.

By placing the primary key from one table into a different table it forms a relationship.

17
Q

what is

cardinality relationships

A

this describes how many time an instance in one table will relate to an instance in another table and vice versa

these are usually denoted in an Entity Relationship Diagram (ERD) as crows feet from one entity to another

18
Q

within an Entity Relationship Diagram (ERD) what are the 4

types of cardinality

A

these include:

  • 1:1 – one to one
  • 1:N – one to many
  • M:1 – many to one
  • M:N – many to many

notice

that 1:N and M:1 are the same and only differ in direction

this difference is only applicable on an ERD there are only really 3 of these