WEEK 9 - DATABASES AND ENTITY RELATIONSHIP DIAGRAMS (ERD) Flashcards

1
Q

Purpose of data modeling

A
  • ensure the business database operates correctly and efficiently
  • involves creating a data model, which serves as a “blueprint” for building the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define logical design in data modeling

A

models the database from a business perspective, focusing on the relationships and data flow

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

define physical design in data modeling

A

focuses on how data is organized and stored on physical storage media like hard disks

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

what is a data model

A
  • a diagram representing main items of interest (entities) and their relationships
  • entity-relationship diagrams (ERDs) are used for visualizing these models
  • common notation: Crow’s foot notation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

define entities

A
  • items of interest in the database, usually nouns (eg. students, courses)
  • represented as rectangles
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

define attributes

A
  • characteristics or properties of an entity (eg. student_name, student_address)
  • unique attributes form the primary key of the entity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

define records

A
  • groups of related fields, representing an instance of an entity (eg. a row in a table)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

define fields

A
  • individual pieces of data (eg. a single cell in a table)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

define foreign key

A
  • a field that links tables by referencing the primary key in another table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

define relationships

A
  • connections between entities, defined by business rules
  • represented as lines connecting entities in the ERD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

define cardinality

A
  • defines the number of entities in a relationship (minimum and maximum)
  • notation: single line (mandatory one), crow’s foot (many) and zero (optional)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

example of ERD components

A
  • entities: represented by rectangles (eg. lecturer, course)
  • attributes: characteristics of entities (eg. lecture ID, course name)
  • relationships: lines connecting entities with cardinality notation
    example:
  • lecturer teaches courses
  • one-to-many relationship: a lecturer can teach many courses, but a course is taught by one lecturer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

steps in building an ERD

A
  1. identify entities and relationships
  2. create a preliminary data model (without detailed attributes or data types)
  3. iterate and refine the model based on feedback and analysis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

example scenarios of building an ERD

A
  • English premier league: Players, Clubs, Sponsors etc
  • motor vehicle ownership: owners, vehicles, policies, claims etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

common relationship types

A
  • one-to-many: eg. customer places many orders
  • many-to-many: requires linking entity to resolve
  • one-to-one: a course has one lecturer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are domain entities

A
  • core elements of a database (eg. employee, course)
  • require careful linking to avoid may-to-many relationships
17
Q

what are linking entities

A
  • used to resolve many-to-many relationships
  • example: registration entity linking students to courses
18
Q

define lookup entities

A

complement domain entities and avoid NULL values

19
Q

define weak entities

A

depend on another entity for their existence
- example: media entity attributes for books, movies, magazines. Lookup entities prevent NULL values by separating unique attributes (eg. ISBN for books)

20
Q

example of ERD

A
  • a customer places many orders (one-to-many)
  • each order contains many products (many-to-many, resolved with orderLine entity)
  • each customer has one representative (one-to-many)