Vous êtes sur la page 1sur 6

Introduction

n Purpose of Database Systems

n Database Languages

n Relational Databases

n Database Design

n Data Models

n Database Internals

n Database Users and Administrators

n Overall Structure

n History of Database Systems

Database Management System (DBMS)

n DBMS contains information about a particular enterprise

l Collection of interrelated data

l Set of programs to access the data

l An environment that is both convenient and efficient to use

n Database Applications:

l Banking: all transactions

l Airlines: reservations, schedules

l Universities: registration, grades

l Sales: customers, products, purchases

l Online retailers: order tracking, customized recommendations

l Manufacturing: production, inventory, orders, supply chain

l Human resources: employee records, salaries, tax deductions

1
n Databases touch all aspects of our lives

Purpose of Database Systems

n In the early days, database applications were built directly on top of file systems

n Drawbacks of using file systems to store data:

l Data redundancy and inconsistency

 Multiple file formats, duplication of information in different files

l Difficulty in accessing data

 Need to write a new program to carry out each new task

l Data isolation — multiple files and formats

l Integrity problems

 Integrity constraints (e.g. account balance > 0) become “buried” in program


code rather than being stated explicitly

 Hard to add new constraints or change existing ones

n Drawbacks of using file systems (cont.)

l Atomicity of updates

 Failures may leave database in an inconsistent state with partial updates carried
out

 Example: Transfer of funds from one account to another should either complete
or not happen at all

l Concurrent access by multiple users

 Concurrent accessed needed for performance

 Uncontrolled concurrent accesses can lead to inconsistencies

n Example: Two people reading a balance and updating it at the same


time

l Security problems

 Hard to provide user access to some, but not all, data

n Database systems offer solutions to all the above problems

2
Levels of Abstraction

n Physical level: describes how a record (e.g., customer) is stored.

n Logical level: describes data stored in database, and the relationships among the data.

type customer = record

customer_id : string;
customer_name : string;
customer_street : string;
customer_city : string;

end;

n View level: application programs hide details of data types. Views can also hide information
(such as an employee’s salary) for security purposes.

View of Data\\\

An architecture for a database system

Instances and Schemas

n Similar to types and variables in programming languages

n Schema – the logical structure of the database

l Example: The database consists of information about a set of customers and accounts
and the relationship between them)

l Analogous to type information of a variable in a program

3
l Physical schema: database design at the physical level

l Logical schema: database design at the logical level

n Instance – the actual content of the database at a particular point in time

l Analogous to the value of a variable

n Physical Data Independence – the ability to modify the physical schema without changing the
logical schema

l Applications depend on the logical schema

In general, the interfaces between the various levels and components should be well defined so that
changes in some parts do not seriously influence others

Data Models

n A collection of tools for describing

l Data

l Data relationships

l Data semantics

l Data constraints

n Relational model

n Entity-Relationship data model (mainly for database design)

n Object-based data models (Object-oriented and Object-relational)

n Semistructured data model (XML)

n Other older models:

l Network model

l Hierarchical model

Data Manipulation Language (DML)

n Language for accessing and manipulating the data organized by the appropriate data model

4
l DML also known as query language

n Two classes of languages

l Procedural – user specifies what data is required and how to get those data

l Declarative (nonprocedural) – user specifies what data is required without specifying


how to get those data

n SQL is the most widely used query language

Data Definition Language (DDL)

n Specification notation for defining the database schema

Example: create table account (


account_number char(10),

branch_name char(10),

balance integer)

n DDL compiler generates a set of tables stored in a data dictionary

n Data dictionary contains metadata (i.e., data about data)

l Database schema

l Data storage and definition language

 Specifies the storage structure and access methods used

l Integrity constraints

 Domain constraints

 Referential integrity (e.g. branch_name must correspond to a valid branch in the


branch table)

l Authorization

Relational Model

n Example of tabular data in the relational model

5
6

Vous aimerez peut-être aussi