Test #1 Flashcards
CRUD
Create, Read, Update, Delete
Analysis
Read world data needs -> conceptual model (ER model)
Design
ER model -> logical model (relational model)
For implementation with a specific DBMS
logical model -> physical model
Primary key
Primary (naturally belongs) spot where specific data is held (ex: prof id in prof info)
Foreign key
same field in another table (ex: prof id in class info)
Association between records in diff tables are kept:
FK -> PK
SQL
Declarative language, NOT procedural
SQL sub languages
Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL)
Data definition language (DDL)
used to define database objects
Data manipulation langage (DML)
Used to support CRUD operations
Data Control Language (DCL)
used to control access to data stored in the database
relation
set of tuples
tuple
row with fields
Why use multiple tables?
reduce redundancy
store one piece of info in only one place
Normal Forms
“good” forms that can reduce redundancy in tables/relations
- first normal form (1NF)
- second normal form (2NF)
- third normal form (3NF)
Normalization
- into 1NF: split into divisible parts
- into 3NF: split table into three narrower ones
anomalies
update, insertion, and deletion
first normal form (1NF)
atomic fields
second normal form
has a key
third normal form
non-key attributes intransitively depend on the key
Cross join
simply generate all possible combinations, most of them are bogus though
“joining condition”
goes in the where clause
usually FK = PK
problem with joining condition
its mixed with normal condition