Introduction
Database Applications:
◦ Banking System,
◦ Stock Market,
◦ Transportation,
◦ Social Network,
◦ Marine Data Analysis,
◦ Criminal Analysis and Control,
◦ Now, BIG DATA....
14
Introduction
Intelligent Transportation Business Services Natural Disasters
Public Health Modern Military Tourism Development
15
Introduction
16
Databases: Important Themes
The field of databases deals with:
◦ data ... representing application scenarios
◦ relationships ... amongst data items
◦ constraints ... on data and relationships
◦ redundancy ... one source for each data item
◦ data manipulation ... declarative, procedural
◦ transactions ... multiple actions, atomic effect
◦ concurrency ... multiple users sharing data
◦ scale ... massive amounts of data
17
Volume
• Petabytes
• Records
• Transactions
Big
Data
Variety Velocity
• Structured
• Batch
• Unstructured
• Real time
• Semi-
• Streaming
structured
18
Introduction(cont)
Effectively organize data
(database design).
Develop a good database
Efficiently execute users'
system: queries (transaction
management).
Huge unstructured
These are even more information is available in
important in modern the internet.
applications, e.g. internet: Must access the information
efficiently and effectively
19
Item Type of Stored as
What is data?
data
Data - (Elmasri/Navathe):
Family String Character ◦ known facts that can be recorded and
name strings? have explicit meaning . . .
Birthdate Date 3 integers? Example - a student records
database:
Weight Real Floating point
number number? Contents - Information identifying
students, courses they are enrolled
… in, results from past courses . . .
20
What is a database?
Elmasri/Navathe:
◦ . . . a collection of related data . . .
Data items alone are relatively useless.
We need the data to have some structure.
Database can be manipulated by a database management system.
21
What is a database management system (DBMS)?
Elmasri/Navathe:
◦ DBMS: . . . a collection of programs that enables users to create and maintain
a database . . .
◦ Database system: . . . The database and DBMS together . . .
22
Database requirements
Database system provides facilities to:
◦ Define a database - specifying the data items to be stored and their types,
◦ Construct a database - loading the data items and storing them on some
storage medium (usually disk),
◦ Manipulate a database
◦ querying - i.e. retrieving relevant data,
◦ updating - i.e. adding, deleting or modifying data items:
◦ from one “correct” state to another “correct” state,
◦ reporting
23
Database requirements (cont)
Database system must be
◦ Timely - e.g. an airline database (fast response), a CAD system (must be interactive),
◦ Multi-user - e.g. trading system,
◦ Modifiable - must be able to be extended or reorganised, e.g. to cope with new laws,
requirements, business conditions,
◦ Secure - different classes of users may need different levels of access,
◦ No redundancy,
◦ Robust - e.g. power failure during an update - must be able to recover to a consistent
state.
24
Database requirements (cont)
A database system must address these issues and provide
solutions - DBMS:
◦ a special purpose DBMS,
◦ a general DBMS.
25
Database personnel
Database Administrator(DBA) - This person is responsible for the
centralised control of the database:
◦ authorising access
◦ monitoring usage,
◦ recovery,
◦ identifying the data,
◦ choosing appropriate structures to represent and store the data,
◦ managing definitions of views . . .
26
Database personnel (cont)
End user - People requiring access to the database for querying,
updating, reporting etc.
◦ Naive (parametric) user - typically use the database via “canned transactions”
- standardised queries and updates, often through a menu system of some
kind,
◦ Online user - has an understanding of the database system. May be capable of
designing their own queries etc.
27
Database personnel (cont)
Systems analyst:
◦ determine end users requirements,
◦ develop specifications for canned transactions and reports,
◦ may also take part in database design.
Application programmer - Implements the specifications given by
analyst:
◦ tests,
◦ debugs,
◦ maintains the resulting programs.
28
DBMS concepts
Data model: a set of concepts that is used to describe the allowed
structure of a database. i.e. the structure of the meta-data.
May be classified as:
◦ High-level or conceptual (e.g. ER model – concerns entities, attributes and
relationships)
◦ Implementation or record-based (e.g. Relational, Network, Hierarchical -
suggests a physical implementation)
◦ Low-level or physical (concerns record formats, access paths etc)
29
DBMS concepts (cont)
Database Schema: An instance of a data model, that is, a description of the structure
of a particular database in the formalism of the data model. (Intention)
Database Instance (or State): The data in the database at a particular time.
(Extension)
In these terms:
◦ We define a database by specifying its schema.
◦ The state is then an empty instance of the schema.
◦ To create the initial instance we load in data.
◦ After this, each change in state is an update.
30
ANSI-SPARC three level architecture
ANSI: American National Standard Institute.
SPARC: Standards Planning and Requirements Committee.
ANSI-SPARC three level architecture (1975-1977):
◦ The external or view level includes a number of external schemas or user
views.
◦ The conceptual level has a conceptual schema, which describes the structure
of the whole database for a community of users.
◦ The internal level has an internal schema, which describes the physical
storage structure of the database.
31
EXTERNAL VIEW EXTERNAL VIEW EXTERNAL VIEW
1 1 1
EXTERNAL_TO_CONCEPTUAL
MAPPINGS
CONCEPTUAL
VIEW
CONCEPTUAL_TO_INTERNAL
MAPPINGS
INTERNAL VIEW
32
ANSI-SPARC three level architecture (cont)
3 levels of abstraction => 2 levels of data independence:
◦ logical data independence: the ability to change the conceptual schema
without changing external views. Must change the external-to-conceptual
mapping though.
◦ physical data independence: the ability to change physical storage paths and
access structures without changing the conceptual view. Must change the
conceptual-to-internal mapping though.
33
Database languages
In the three level architecture:
◦ Data definition language (DDL): used to define the conceptual schema.
◦ View definition language (VDL): used to define external schemas.
◦ Storage definition language (SDL): used to define the internal schemas.
In DBMS where conceptual and internal levels are mixed up, DDL is
used to define both schemas.
34
Database languages (cont)
Data manipulation language (DML): used to construct retrieval requests
(queries) and update requests:
◦ Low-level or procedural
◦ embedded in a general purpose language,
◦ record at a time
◦ High-level or non-procedural
◦ interactive and/or embedded
◦ set at a time/ set oriented.
In most current DBMSs, a comprehensive integrated language is used; for
example SQL.
35
Database components
Run-time database processor - Receives retrieval and update requests and carries them out
with the help of the stored data manager.
Stored data manager or file manager - Controls access to the DBMS information stored on
disk:
◦ may use the OS for disk access,
◦ controls other aspects of data transfer, such as handling buffers.
Pre-compiler - Extracts DML commands from the host language program.
◦ These are compiled by the DML compiler, the rest is compiled by the host language compiler, then
they are linked to produce executable code with calls to the data manager.
Query processor (or Complier) - Parses high-level queries and converts them into calls to
be executed by the data manager.
36
Component modules of a DBMS and their interactions.
37
Learning Outcomes:
- Introduction of the course
- General understanding of terms in databases, details will be
found in later part of the course.
38