REAL WORLD MODEL Entity-Relationship (ER) Flashcards

(19 cards)

1
Q

database (DB)

Data

Mini-world

A

A collection of related data.

Known facts that can be recorded and have an implicit meaning

Some part of the real world about which data is stored in a database. For example, student grades and transcripts at a university.

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

Database Management System (DBMS)

Database System

A

A software package/ system to facilitate the creation and maintenance of a computerized database.

The DBMS software together with the data itself. Sometimes, the applications are also included.

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

Typical DBMS Functionality

A
  • Define* a particular database in terms of its data types, structures, and constraints
  • Construct* or Load the initial database contents on a secondary storage medium

Manipulating the database:
- Retrieval: Querying, generating reports
- Modification: Insertions, deletions and updates to its
content
- Accessing the database through Web applications

Processing and Sharing by a set of concurrent users and application programs - yet, keeping all data valid and consistent

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

Typical DBMS Functionality

Other features:

A
  • Protection/Security measures to prevent unauthorized access.
  • “Active” processing to take internal actions on data
  • Presentation and Visualization of data
  • Maintaining the database and associated programs over the lifetime of the database application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Overview of Database Design Process

Two main activities :

A
  1. Database design
    - To design the conceptual schema for a database
  2. Applications design
    - Focuses on the programs and interfaces that access the database
    - Generally considered part of software engineering
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Database Schema

A

A Database Schema is:
The description description of a database.

Includes descriptions of the:

  1. database structure
  2. data types
  3. constraints on the database.

!!It is common to give an illustrative display of (most aspects of) a database schema using a DATABASE SCHEMA DIAGRAM!!

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

ER Model Concepts

Entities and Atributes

A
  • Entities are specific objects or things in the mini-world that are represented in the database.
  • Attributes are properties used to describe an entity.
  • A specific entity will have a value for each of its attributes.
  • Each attribute has a value set (or data type) associated with it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Types of Attributes (1)

A

•Simple
Each entity has a single atomic value for the attribute. For example, SSN or Sex.

•Composite
The attribute may be composed of several components. For ex:
- Address(Apt#, House#, Street, City, State, ZipCode, Country), OR
- Name(FirstName, MiddleName, LastName).
- Composition may form a hierarchy where some components are themselves composite.

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

Types of Attributes (2)

A

•Multi-valued
An entity may have multiple values for that attribute. For example:
- Color of a CAR
- PreviousDegrees of a STUDENT
- Denoted as {Color} or {PreviousDegrees}.

!!!In general, composite and multi-valued attributes may be nested arbitrarily to any number of levels, although this is rare!!!!!!

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

Entity Types and Key Attributes (1)

A

Entities with the same basic attributes are grouped or typed into an entity type
-> For example, the entity type EMPLOYEE and PROJECT

An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type.
-> For example, SSN of EMPLOYEE.

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

Entity Types and Key Attributes (2)

A

A key attribute may be composite.
- VehicleTagNumber is a key of the CAR entity type with components (Number, State).

An entity type may have more than one key.

  • > The CAR entity type may have two keys:
  • VehicleIdentificationNumber (popularly called VIN)
  • VehicleTagNumber (Number, State), aka license plate number

Each key is underlined

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

Displaying an Entity type

A

In ER diagrams, an entity type is displayed in a rectangular box

Attributes are displayed in ovals

  • Each attribute is connected to its entity type
  • Components of a composite attribute are connected to the oval representing the composite attribute
  • Each key attribute is underlined
  • Multivalued attributes displayed in double ovals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Entity set

A

Each entity type will have a collection of entities stored in the database
•Called the entity set
•Previous slide shows three CAR entity instances in the entity set for CAR
•Same name (CAR) used to refer to both the entity type and the entity set

!!!Entity set is the current state of the entities of that type that are stored in the database!!!

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

Refining the initial design by introducing relationships

A

Some aspects in the requirements will be represented as relationships

ER model has three main concepts:
•Entities (and their entity types and entity sets)
•Attributes (simple, composite, multivalued)
•Relationships (and their relationship types and relationship sets)

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

Relationships and Relationship Types

A

A relationship relates two or more distinct entities with a specific meaning.
- For example, EMPLOYEE John Smith works on the ProductX PROJECT, or EMPLOYEE Franklin Wong manages the Research DEPARTMENT.

Relationships of the same type are grouped or typed into a relationship type.
- For example, the WORKS_ON relationship type in which EMPLOYEEs and PROJECTs participate, or the MANAGES relationship type in which EMPLOYEEs and DEPARTMENTs participate.

The degree of a relationship type is the number of participating entity types.
- Both MANAGES and WORKS_ON are binary relationships.

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

Relationship type vs. relationship set (1)

A

Relationship Type:
•Is the schema description of a relationship
•Identifies the relationship name and the participating entity types
•Also identifies certain relationship constraints

Relationship Set:
•The current set of relationship instances represented in the database
•The current state of a relationship type

17
Q

Relationship type vs. relationship set (2)

A

Each instance in the set relates individual participating
entities – one from each participating entity type

In ER diagrams, we represent the relationship type as
follows:
- Diamond-shaped box is used to display a relationship type
- Connected to the participating entity types via straight lines

18
Q

Recursive Relationship Type

A

Same entity type participates more than once in a relationship type
-Both participations are same entity type in different roles

Example: the SUPERVISION relationship

EMPLOYEE participates twice in two distinct roles:

  • supervisor (or boss) role
  • supervisee (or subordinate) role
19
Q

Notation for Constraints on Relationships

A

Cardinality ratio (of a binary relationship):
-Shown by placing appropriate numbers on the relationship
edges(1:1, 1:N, N:1, or M:N)

  • Participation constraint* (on each participating entity
    type) :
  • Total (called existence dependency) shown by double line
  • Partial shown by single line