Week 1 Notes


Databases Introduction

Date 09/06/2022
Topic Introduction
Professor John DeMastri
Week 1

Overview

Files, notes, to do list, patient records, play lists, etc.

DBMS

a database management system is a software package designed to store and manage databases

Files vs. DBMS

Why not just use files?

You can (and you are...) but:

Sharding

Breaking a data structure into multiple pieces

Why use a DBMS?

Why study Databases?

Why should YOU study Databases

Data models

Levels of abstraction

Example: Unitversity Database

Data Independence

Applications insulated from how data is structured and stored.

Concurrency Control

Transaction

Polyglot Persistence

Polyglot

Speaking, writing, written in, or composed of several languages.

Data Modeling Entity Relationship Model

Date 09/07/2022
Topic Entity Relationship Model
Professor John DeMastri
Week 1

Model Basics

Shape Meaning
Squares Entities
Diamonds Relationships
Ovals Attributes

Relationships can have attributes

Entity Relationship (ER) Model

ER Data Model

Purpose is to identify the specific data that has to be encompassed by a specific entity.

ER Model Basics

Entity

Entity Set:

They all fit into the same schema

Example entities

Entity:

Attribute Domains:

Constrain- the more clearly they are defined, the easier it is to make sure they are complete.

Relationship:

Relationship Set:

Relationships

Keys (ER Model)

Key

One or more attributes that uniquely identifies an entity instance. I.e., an individual entity in an entity set

[Student]

-> name

-> phone number

-> address

Keys as defined by the relational model

Key

set of entity attributes that identifies one or more entity instances within an entity set

Superkey

distinctly identifies a record, e.g. name + phone_number

Candidate keys

set of keys that are minimal (attributes) superkeys.

Primary key

candidate key selected as primary

Foreign key

Attribute of entity or relationship that references another entity. (e.g. address)

Key Constraints

The arity (or cardinality) of a relationship is defined with a key constraint.

works_in relationship (m to m):

manages relationship (1 to m):

Participant Constraints

Does Every department have a manager?

Weak Entities

Date 09/09/2022
Topic Weak Entities
Professor John DeMastri
Week 1

Recap

Key

set of entity attributes that identifies one or more entity instances within an entity set

Superkey

distinctly identifies a record, e.g. name + phone_number

Candidate keys

set of keys that are minimal (attributes) superkeys.

Primary key

candidate key selected as primary

Foreign key

Attribute of entity or relationship that references another entity. (e.g. address)

Weak Entity

An entity that cannot be uniquely identified by its attributes alone.

ISA ('isa') Hierarchies

Aggregation

Conceptual Design using ER Model

Constraints in ER Model

Entity versus attribute

Entity versus attribute - Issues?

Summary of Conceptual Design