Академический Документы
Профессиональный Документы
Культура Документы
Concepts
What is a Database
DATABASE SYSTEM
REALITY
• structures MODEL
data modeling
• processes
runs efficiently
Database Terminology
Data Models
Keys
Integrity
Triggers & Stored Procedures
Null Values
Surrogates
Normalization
Data Model
expressing:
Data Structures
Integrity Constraints
Operations
Data Model - Data
Structures
All data models have notation for defining:
entity types
attribute types
relationship types
FLIGHT-SCHEDULE DEPT-AIRPORT
FLIGHT-SCHEDULE DEPT-AIRPORT
FLIGHT-SCHEDULE DEPT-AIRPORT
Integrity:
– does model reflect reality well?
– is model without internal conflicts?
a FLIGHT# in FLIGHT-SCHEDULE cannot be null because it models
existence of an entity in real world
a FLIGHT# in DEPT-AIRPORT must exist in FLIGHT-SCHEDULE
because it doesn’t make sense for a non-existing FLIGHT-SCHEDULE
entity to have a DEPT-AIRPORT
FLIGHT-SCHEDULE DEPT-AIRPORT
FLIGHT-SCHEDULE DEPT-AIRPORT
reality
name custom# customer
customer custom# name addr
customer addr
surrogate-based representation
seat#
Hierarchical
Model
flight-sched
flight#
relation name
attribute names
flight-schedule
flight#: airline: weekday: price:
domain names
Relational Model -
Integrity Constraints
Primary Keys
Entity Integrity
Referential Integrity
flight-schedule customer
flight# customer# customer name
p p
reservation
flight# date customer#
Relational Model -
Operations
Powerful query languages
Procedural; describes how to compute a query;
operators like JOIN, SELECT, PROJECT
Declarative; describes desired result, e.g. SQL,
QBE
insert, delete, & update capabilities
Object-Oriented
Model
based on object-oriented paradigm,
e.g., Simula, Smalltalk, C++, Java
area is in a state of flux
Clarity
DBMS Requirements
Normalization
Step-by-step decomposition of
complex records into simple
records
Reduces redundancy
Non-loss decomposition
– To avoid inconsistencies
– Update anomalies
Clinical Db
Normalization
Tall Skinny Vs Short Fat
Normalized Vs Non-normalized
Fewer Columns & More Rows
Efficient Access & Storage
Reducing the Size of Data
Groupings or Records
Does not apply to CRF Image Db
Short Fat
1001 2 1 120 72
1001 2 2 118 70
1001 2 3 117 68
Short Fat Vs Tall
Skinny
Short Fat
– Data Cleaning Checks for variables
within a single visit is easy
– Missing Values easily detected
Tall Skinny
– Easy Creation of Structures &
Associated Checks
– Data Querying is easier
Thank You