1.Database Management System (DBMS)
DBMS contains:
Collection of interrelated data (Database)
Set of programs to access data
2.Three Abstraction Levels of Data
Physical level
- describes how data is actually stored
- Database developers use this level
Logical level
- describes what data are stored in the database, and what relationships exist among those data
- Database administrators and application programmers use this level
View level
- simplifies the interaction with the system. Views can also hide information for security purposes
- Computer users use this level
3.Instances and Schemas
Schema – the logical structure of the database
Instance – the actual content of the database at a particular point in time
Physical schema: describes database design at the physical level
Logical schema: describes database design at the logical level
Subschema: describes views at the view level
4.Data Models
A collection of conceptual tools for describing data
5.Relational Model
6.Entity-Relationship Model
Database Languages: DML & DDL
1.Data Manipulation Language (DML) 数据操纵语言
Language for data retrieval, insertion, deletion, modification
通常有两类基本的数据操纵语言:
过程化DML(procedural DML)要求用户指定需要什么数据以及如何获得这些数据。例如:Relational-Algebra
声明式DML(declarative DML)(也称为非过程化DML)只要求用户指定需要什么数据,而不指明如何获得这些数据。例如:SQL
SQL与Relational Algebra的联系和区别
SQL语句的执行一般是先翻译为关系代数再被执行的(能有效提高执行速度),所以我们有必要了解关系代数与SQL语句间的对应关系。关系代数有五个基础运算符,这五个基础运算符能派生出其他组合运算符。它们分别是:选择(σ, selection)、投影(π,projection)、叉乘(x, cross-product)、差(-, set-difference)和并(υ, union)
2.Data Definition Language (DDL)
目的:for defining the database schema and constraints
Database schema
E.g. USER_OBJECTS, USER_TABLES, USER_VIEWS
Integrity constraints
E.g. USER_CONSTRAINTS
3.Database Design
Requirement Analysis
Conceptual Design
Logical Design
Physical Design