Professional Documents
Culture Documents
Lecture 1: Introduction
CSE Program
The School of EE & Computing
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Introduction
INDEX
▶ Databases
• Database System consists
Intro. • Database Management System (DBMS) and
Applications
Purpose • Database which contains raw facts and data about
▶ View of Data
the structure of tables
Data Abstraction.
Instances and Schemas • Both are interdependent
Data Models
▶ Languages • Database management system (DBMS)
• Collection of programs
DDL
DML
SQL
▶ DB Design
• Manages structure and controls access to data
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Introduction
INDEX
▶ Databases
• Data are usually stored in a database.
Intro.
Applications
• To implement a database and to manage its
Purpose
▶ View of Data
contents, you need a
Data Abstraction. database management system (DBMS).
Instances and Schemas
Data Models • The DBMS serves as the intermediary
▶ Languages
DDL between the user and the database.
• The database contains the data you have
DML
SQL
▶ DB Design
▶ DB Engine
collected and “data about data,” known as
Storage Manager metadata.
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Database Applications
INDEX
▶ Databases
• Examples
Intro. • Banking: transactions
•
Applications
Purpose
Airlines: reservations, schedules
▶ View of Data • Universities: registration, grades
Data Abstraction.
Instances and Schemas • Sales: customers, products, purchases
Data Models
▶ Languages
• Online retailers: order tracking, customized
DDL recommendations
DML
SQL
• Manufacturing: production, inventory, orders, supply
▶ DB Design chain
▶ DB Engine • Human resources: employee records, salaries, tax
Storage Manager
Query Processing
deductions
Transaction Manager
▶ DB • Databases can be very large.
Architecture
▶ DB Users
▶ History • Databases touch all aspects of our lives
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
University Database
INDEX
▶ Databases
• Application program examples
Intro. • Add new students, instructors, and courses
Applications
Purpose • Register students for courses, and generate class
▶ View of Data
rosters
Data Abstraction.
Instances and Schemas • Assign grades to students, compute grade point
Data Models
▶ Languages
averages (GPA) and generate transcripts
DDL
DML
• In the early days, database applications were
SQL built directly on top of file systems
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Levels of Abstraction
INDEX
▶ Databases
• Physical level: describes how a record (e.g.,
Intro. instructor) is stored.
Applications
Purpose • Logical level: describes data stored in database,
▶ View of Data
Data Abstraction.
and the relationships among the data.
Instances and Schemas type instructor = record
Data Models
▶ Languages
ID : string;
DDL name : string;
DML dept_name : string;
SQL
▶ DB Design
salary : integer;
▶ DB Engine end;
Storage Manager
Query Processing
• View level: application programs hide details of
Transaction Manager data types. Views can also hide information (such
▶ DB
Architecture
▶ DB Users as an employee’s salary) for security purposes.
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Architecture
INDEX
▶ Databases
Intro.
Applications
Purpose
▶ View of Data
Data Abstraction.
Instances and Schemas
Data Models
▶ Languages
DDL
DML
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Data Models
INDEX • A collection of tools for describing
▶ Databases
Intro.
• Data
Applications • Data relationships
Purpose
• Data semantics
▶ View of Data
Data Abstraction.
• Data constraints
Instances and Schemas
Data Models
• Relational model
▶ Languages
• Entity-Relationship data model (mainly for database
DDL
DML design)
• Object-based data models (Object-oriented and
SQL
▶ DB Design
▶ DB Engine Object-relational)
Storage Manager
Query Processing • Semi structured data model (XML)
• Other older models:
Transaction Manager
▶ DB
Architecture
▶ DB Users • Network model
▶ History • Hierarchical model
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Relational Model
INDEX
▶ Databases
• All the data is stored in various tables.
Intro.
Applications
• Example of tabular data in the relational
Columns
Purpose
▶ View of Data
model
Data Abstraction.
Instances and Schemas
Data Models Rows
▶ Languages
DDL
DML
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
SQL
INDEX
▶ Databases
• The most widely used commercial language
Intro.
Applications
• SQL is NOT a Turing machine equivalent
Purpose
▶ View of Data
language
Data Abstraction.
Instances and Schemas
• To be able to compute complex functions SQL
Data Models is usually embedded in some higher-level
▶ Languages
DDL language
• Application programs generally access
DML
SQL
▶ DB Design
▶ DB Engine
databases through one of
Storage Manager • Language extensions to allow embedded SQL
Query Processing
Transaction Manager • Application program interface (e.g., ODBC/JDBC)
▶ DB
Architecture
▶ DB Users
which allow SQL queries to be sent to a database
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Database Design
INDEX
▶ Databases
• Logical Design – Deciding on the database
Intro. schema. Database design requires that we find a
Applications
Purpose
“good” collection of relation schemas.
▶ View of Data • Business decision – What attributes should we
Data Abstraction.
Instances and Schemas
record in the database?
Data Models • Computer Science decision – What relation schemas
▶ Languages
DDL
should we have and how should the attributes be
DML distributed among the various relation schemas?
• Physical Design – Deciding on the physical layout
SQL
▶ DB Design
▶ DB Engine
Storage Manager
of the database
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Database Design
INDEX
▶ Databases
• Is there any problem with this relation?
Intro.
Applications
Purpose
▶ View of Data
Data Abstraction.
Instances and Schemas
Data Models
▶ Languages
DDL
DML
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Design Approaches
INDEX
▶ Databases
• Need to come up with a methodology to
Intro. ensure that each of the relations in the
Applications
Purpose database is “good”
▶ View of Data
Data Abstraction. • Two ways of doing so:
Instances and Schemas
Data Models
• Entity Relationship Model (Chapter 7)
▶ Languages • Models an enterprise as a collection of entities and
DDL
relationships
DML
SQL • Represented diagrammatically by an entity-relationship
▶ DB Design diagram:
▶ DB Engine
Storage Manager
• Normalization Theory (Chapter 8)
Query Processing • Formalize what designs are bad, and test for them
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Database Engine
INDEX
▶ Databases
• Storage manager
Intro.
Applications
• Query processing
• Transaction manager
Purpose
▶ View of Data
Data Abstraction.
Instances and Schemas
Data Models
▶ Languages
DDL
DML
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Storage Management
INDEX
▶ Databases
• Storage manager is a program module that
Intro. provides the interface between the low-level
Applications
Purpose
data stored in the database and the application
▶ View of Data
Data Abstraction.
programs and queries submitted to the system.
Instances and Schemas
Data Models
• The storage manager is responsible to the
▶ Languages following tasks:
DDL
DML
• Interaction with the OS file manager
SQL
• Efficient storing, retrieving and updating of data
▶ DB Design
▶ DB Engine • Issues:
Storage Manager
Query Processing • Storage access
Transaction Manager
▶ DB • File organization
Architecture
▶ DB Users
▶ History
• Indexing and hashing
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Query Processing
INDEX
▶ Databases
1. Parsing and translation
Intro.
Applications
2. Optimization
Purpose
▶ View of Data 3. Evaluation
Data Abstraction.
Instances and Schemas
Data Models
▶ Languages
DDL
DML
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Query Processing
INDEX
▶ Databases
• Alternative ways of evaluating a given query
Intro. • Equivalent expressions
Applications
Purpose • Different algorithms for each operation
▶ View of Data
Data Abstraction. • Cost difference between a good and a bad
Instances and Schemas
Data Models
way of evaluating a query can be enormous
▶ Languages
DDL • Need to estimate the cost of operations
DML
SQL
• Depends critically on statistical information about
▶ DB Design relations which the database must maintain
▶ DB Engine
Storage Manager
• Need to estimate statistics for intermediate
Query Processing results to compute cost of complex expressions
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Transaction Management
INDEX • What if the system fails?
▶ Databases
Intro. • What if more than one user is concurrently updating
Applications
Purpose the same data?
▶ View of Data
Data Abstraction.
• A transaction is a collection of operations that
Instances and Schemas performs a single logical function in a database
Data Models
▶ Languages
application
DDL
DML
• Transaction-management component ensures that
SQL the database remains in a consistent (correct) state
▶ DB Design
▶ DB Engine
despite system failures (e.g., power failures and
Storage Manager
operating system crashes) and transaction failures.
Query Processing
Transaction Manager
• Concurrency-control manager controls the
▶ DB
Architecture
▶ DB Users
interaction among the concurrent transactions, to
▶ History ensure the consistency of the database.
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
Database Architecture
INDEX
▶ Databases
• The architecture of a database systems is
Intro. greatly influenced by the underlying computer
Applications
Purpose system on which the database is running:
▶ View of Data
Data Abstraction.
• Centralized
Instances and Schemas • Client-server
Data Models
▶ Languages • Parallel (multi-processor)
DDL
DML
• Distributed
SQL
▶ DB Design
▶ DB Engine
Storage Manager
Query Processing
Transaction Manager
▶ DB
Architecture
▶ DB Users
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
History of DB Systems
INDEX
▶ Databases
• 1950s and early 1960s:
Intro. • Data processing using magnetic tapes for storage
Applications
• Tapes provided only sequential access
Purpose
▶ View of Data • Punched cards for input
Data Abstraction.
Instances and Schemas • Late 1960s and 1970s:
Data Models
▶ Languages
• Hard disks allowed direct access to data
DDL • Network and hierarchical data models in widespread
DML
SQL
use
▶ DB Design • Ted Codd defines the relational data model
▶ DB Engine
• Would win the ACM Turing Award for this work
Storage Manager
Query Processing
• IBM Research begins System R prototype
Transaction Manager • UC Berkeley begins Ingres prototype
▶ DB
Architecture
▶ DB Users
• High-performance (for the era) transaction processing
▶ History
Course CSE 3207: Database Systems Lesson Introduction to Database Systems
History of DB Systems
INDEX • 1980s:
▶ Databases
Intro.
• Research relational prototypes evolve into commercial systems
Applications • SQL becomes industrial standard
Purpose • Parallel and distributed database systems
▶ View of Data
• Object-oriented database systems
Data Abstraction.
Instances and Schemas • 1990s:
Data Models
▶ Languages
• Large decision support and data-mining applications
DDL • Large multi-terabyte data warehouses
DML • Emergence of Web commerce
SQL
▶ DB Design • Early 2000s:
▶ DB Engine • XML and XQuery standards
Storage Manager
• Automated database administration
Query Processing
Transaction Manager • Later 2000s:
▶ DB
Architecture
▶ DB Users
• Giant data storage systems
▶ History • Google BigTable, Yahoo PNuts, Amazon, ..