Databases & Consistency
Database Relational databases : dominant information storage/retrieval system
Database Data stored in tables Each row is a record
Database Data stored in tables Each row is a record Columns define attributes
Normalized Data Keys : attribute that uniquely identifies record
Queries Interact with DB's via queries SELECT : retrieve some data
Queries Interact with DB's via queries WHERE : Limits scope
Queries Interact with DB's via queries UPDATE : modify some data
Repetitive Data Duplication of data Wasteful Hard to modify
Normalized Data Goal : represent each piece of data only once Break into separate tables
Normalized Data Use key to look up related records CustomerID in Orders says which Customer made order
Task Given these two table, print customer name and sale amount for orders on 5/7/2004
Virtual Table Trick Join : merge two tables based on keys
Join Samples Using a Join between Movies and Boxoffice