Introduction
•	Definition
•	Three Schema Architecture
•	Consistency
•	Databases vs. Files
•	Process
Definition
•	Database : collection of related data (Elmasri)
•	Usually persistent -- when program ends, data is saved
•	Highly structured data -- related data objects share same structure
•	Ex: Student record, Account, Transaction
Databases vs. Object-oriented
•	Many databases support objects
•	But most features treat all data the same
•	Focus on data vs. operations
•	Focus on data aggregates (records, tables)
Three Schema Architecture
•	Schema : description of something (the database)
•	Storage schema: the actual data
•	Conceptual schema: organizes data
•	View : what user sees
•	different users ==> different views
•	derived data
Advantages of multiple schemas
•	Example of a layered architecture
•	Can attack each layer separately
•	Adding new views does not require modifying storage/conceptual
Database goals
•	The 3 C's: consistency, consistency, consistency
•	Consistency should not be affected by:
•	Normal access of data
•	Multiple users
•	Crashes
Examples of consistency problems
•	You change your name
•	payment not credited to you
•	company can't find your record
•	Someone listed as both male and female
Examples of consistency problems
•	Transfer between accounts
•	Like withdrawal + deposit
•	If machine crashes, can money be lost?
Examples of consistency problems
•	2 interleaved deposits
•	Balance = Balance + Deposit1
•	Balance = Balance + Deposit2
•	What could go wrong?
Sample data organization
•	Where are the problems in this data organization?
Database and Programming Design
•	Description of each common type of data object (Student, Product, etc.) stored in database
•	Example of metadata -- data describing other data
•	Class definitions are a kind of metadata
Design goals
•	Maximize cohesion
•	Attributes (ex: LastName, Price) of each type should belong together
•	Minimize coupling
•	Minimize dependencies on other types
Databases vs. files
•	Files do not support consistency automatically
•	Data types not enforced
•	Access not controlled
Database development process
•	Customer requirements
•	Extract business rules -- requirements specific to application
•	Ex: an employee must be assigned to a single department
•	Develop entity-relationship model of data
•	Convert to appropriate implementation model (usually relational)
Database development
•	Implement application-specific code (often unnecessary)
•	Test database
•	Customer requirements must be testable