2013-01-21 1 Silvia Stefanova, UDBL - IT - UU
DATABASE DESIGN I -
1DL300Spring 2013
An Introductory Course on Database Systems
http://www.it.uu.se/edu/course/homepage/dbastekn/vt13/
Uppsala Database Laboratory
Department of Information Technology, Uppsala University, Uppsala, Sweden
2013-01-21 2 Silvia Stefanova, UDBL - IT - UU
Introduction to Database Technology
Elmasri/Navathe ch 1-2 Padron-McCarthy/Risch ch 1
Sobhan Badiozamany Silvia Stefanova
Department of Information Technology Uppsala University, Uppsala, Sweden
2013-01-21 3 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 4 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Data models, categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 5 Silvia Stefanova, UDBL - IT - UU
Data Model ???
2013-01-21 6 Silvia Stefanova, UDBL - IT - UU
Data Model
• Data Model: A collection of concepts that can be used to describe the structure of database
• Data Model consists of
oSet of concepts: data types, relationships, constraints
oSet of basic operations for specifying retrievals and updates on the database
• Every database has a data model which makes it
possible to “hide” the physical representation of data
2013-01-21 7 Silvia Stefanova, UDBL - IT - UU
Categories of data models
• High-level (conceptual) : close to how users perceive data
oER (Entity-Relationship) model
• Low-level (physical): details of how data is stored on computers
• Representational (implementation): in between conceptual and physical
o Relational (ORACLE, DB2, SQL Server, MySQL, Mimer) o Object-oriented (ObjectStore, Objectivity, Versant, Poet) o Object-relational (Informix, Odapter, DB2)
o Hierarchical (IMS) o Network (IDMS)
2013-01-21 8 Silvia Stefanova, UDBL - IT - UU
What is the difference between
database and database description ?
2013-01-21 9 Silvia Stefanova, UDBL - IT - UU
Database Schema and Instances
• Database schema: the database description specified during the database design and not expected to change
• The actual data in the database may change frequently
• Database instance (state): the data in the database at a particular moment. Every change of data creates a new instance of the database.
oValid state: satisfies the structure and constraints in the database schema
oMeta-data: description of the schema (data about data)
2013-01-21 10 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 11 Silvia Stefanova, UDBL - IT - UU
Three-schema Architecture
Conceptual schema
Database instance Internal level Conceptual level
External level End users
view1
view2
… … …
viewn
Internal schema
2013-01-21 12 Silvia Stefanova, UDBL - IT - UU
Three-schema Architecture
• Internal level
oDescribed the physical storage structure of the database oUses a physical data model (internal schema)
• Conceptual level
oDescribes the structure of the whole database for community of users; describes entities, data types, relationships, user
operations
oUses a representation data model
• External (view) level
oDescribes the part of the database that a particular user group is interested in; hides the rest from that group
oHas a number of external schemas
2013-01-21 13 Silvia Stefanova, UDBL - IT - UU
What is the goal with
the three-schema architecture?
2013-01-21 14 Silvia Stefanova, UDBL - IT - UU
Data Independence
• Data Independence: The capacity to change the
schema at one level of a database system without
having to change at the next higher level
2013-01-21 15 Silvia Stefanova, UDBL - IT - UU
Data Independence
• Logical Independence: The capacity to change the conceptual schema without having to change the external schema
oExample: Add another field to a conceptual schema
• Physical Independence: The capacity to change the internal schema without having to change the
conceptual schema
oExample: Put an access path(index) to reorganize the files
2013-01-21 16 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 17 Silvia Stefanova, UDBL - IT - UU
Database Languages
• Database Language: Generic term for a class of
languages used for defining, communicating with or manipulating a database.
• Storage Definition Language (SDL) – to specify internal schema
• Data Definition Language (DDL) – to specify conceptual schema
• View Definition Language (VDL) – to specify user views
• Data Manipulation Language (DML) – to manipulate the data: insert, delete , update)
2013-01-21 18 Silvia Stefanova, UDBL - IT - UU
Database Languages
• In the DDL the database administrator define the
internal and conceptual schema and in this manner the database is designed. Subsequent modifications in the schema design is also made in DDL.
• The DML used by DB users and application programs retrieve, add, remove, or alter the information in the database.
• SQL represents a combination of DDL, VDL and DML
2013-01-21 19 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 20 Silvia Stefanova, UDBL - IT - UU
Classification of DBMS
• Criteria data model:
oRelational DBMS
oObject-oriented DBMS oObject-relational DBMS oGraph DBMS
• Criteria number of sites on which database is distributed
oCentralized DBMS oDistributed DBMS
2013-01-21 21 Silvia Stefanova, UDBL - IT - UU
Classification of DBMS
• Criteria number of users:
oSingle-user DBMS oMulti-user DBMS
• Criteria purpose
oGeneral purpose DBMS oSpecial-purpose DBMS
2013-01-21 22 Silvia Stefanova, UDBL - IT - UU
Outline
1. Data Model, Database Schema
• Categories of data models
• Database schemas and instances
2. Data Independence
• Three-schema architecture
• Logical independence
• Physical independence
3. Database Languages
4. Classification of DBMS 5. To Summarize
2013-01-21 23 Silvia Stefanova, UDBL - IT - UU
Summary
• Data model
• Database schema, database instance
• Data independence
2013-01-21 24 Silvia Stefanova, UDBL - IT - UU