0% found this document useful (0 votes)
28 views

01 Introduction To Database-SCD

1. Database management systems (DBMS) allow for the storage and retrieval of large amounts of valuable data in an organized way. They provide functions like data storage, security, redundancy control and more. 2. A relational database represents data as tables with relationships represented by common fields. It uses languages like SQL for data definition and manipulation. 3. The design of a database involves conceptual, logical and physical phases to model the data independently and then consider implementation details. This provides an abstract view of the data for users.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

01 Introduction To Database-SCD

1. Database management systems (DBMS) allow for the storage and retrieval of large amounts of valuable data in an organized way. They provide functions like data storage, security, redundancy control and more. 2. A relational database represents data as tables with relationships represented by common fields. It uses languages like SQL for data definition and manipulation. 3. The design of a database involves conceptual, logical and physical phases to model the data independently and then consider implementation details. This provides an abstract view of the data for users.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

1

01 Introduction to Database
CRI2E4 Basis Data
2

Learning Outcomes
Students can explain and understand database system overview,
View of Data and history of DB, DB relational overview, DB
Language DB design, level of abstraction, DB modeling and data
storage, transaction overview, database architecture, DB user
Outline
3

Overview Database Management System


Basic Concepts and Definition
View of Data
Relational Database
Database Language
Database Design
Database Engine
Database Architecture
Database Users and Administrators
History of Database
4

Overview Database
Management System
5

Database Management System (DBMS)


DBMS contains information about a particular enterprise
• Definition: Collection of interrelated data and a Set of programs to access the data
• Primary Goal: to provide a way to store and retrieve database information that is
both convenient and efficient.
• Function: used to manage collections of data that: are highly valuable, are relatively
large, and are accessed by multiple users and applications, often at the same time.

Database Applications Examples:


• Banking: Loans, banking transactions, credit card transactions
• Airlines: reservations, schedule information
• Universities: student information, course registration, grades
• Sales: customers, products, purchases information
• Online retailers: order tracking, customized recommendations
• Manufacturing: tracking production of items, inventory, orders, supply chain
• Human resources: employee records, salaries, payroll taxes

Databases can be very large.


Purpose of Database System
6

Controlling Redundancy Restricting Unauthorized


and Inconsistency Access

Providing Storage
Providing Persistent
Structures and Search
Storage for Program
Techniques for Efficient
Objects
Query Processing

Providing Backup and Providing Multiple User


Recovery Interfaces
Purpose of Database System (cont.)
7

Representing Complex Relationships among Data

Enforcing Integrity Constraints

Permitting Inferencing and Actions Using Rules and Triggers

Potential for Enforcing Standards.

Additional Implications of Using Reduced Application Development Time.


Flexibility.
the Database Approach Availability of Up-to-Date Information.
Economies of Scale
8

Basic Concepts and


Definition
9

Data
Information
Database
DEFINITION
10

• Data
• Facts concerning objects and events that could be recorded and stored on
computer media
• Stored representations of objects and events that have meaning and
importance in the user’s environment.
• Information
• Data that have been processed in such a way as to increase the
knowledge of the person who uses the data.
• Database
• An organized collection of logically related data.
Examples
11

• List of facts

Data

• Data in context

Useful information to some


users, such as the course
instructor and the registrar’s
office.

Figure 1. Data in context


Examples (2)
12

• Summarized Data

Data presented as graphical


information.
This information could be used as a
basis for deciding whether to add
new courses or to hire new faculty
members.

Figure 2. Summarized Data


Metadata
13

• Data that describe the properties or characteristics of end-user data and the
context of those data.
14

View of Data
15

A major purpose of a database system is to provide users with an


abstract view of the data.
• Data models
• A collection of conceptual tools for describing data, data
relationships, data semantics, and consistency constraints.
• Data abstraction
• Hide the complexity of data structures to represent data in the
database from users through several levels of data abstraction.
Data Models
16

• Data models is a collection of conceptual tools for describing data, data


relationships, data semantics, and consistency constraints.
• The data models can be classified into four different categories:

Entity-Relationship
Relational Model
Model

Semi-Structured Object-based Data


Data Model Model
Example of Data Model
17

Figure 4. Segment of Figure 5. Segment of a project data model


an enterprise data model
Data Abstraction
18

• The data abstraction can be classified into three levels:


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

describes data stored in database, and the


relationships among the data.
type customer = record
ID : string;
name : string;
address : string;
age : integer;
end;

describes how a record (e.g., customer, product) is


stored.
19

Relational Database
Relational Database
20

• Relational database is a database that represents data as a


collection of tables in which all data relationships are represented
by common values in related tables.

• Relational databases establish the relationships between entities


by means of common fields included in a file, called a relation
21

Example of
Relational
Database
22

Database Language
23

Database Language

• Data-Definition Language
DDL
• to specify the database schema

• Data-Manipulation Language
DML
• to express database queries and updates
24

Database Design
Phase of Database Design 25

Conceptual Database Distributed Database Physical Database


Logical Database Design
Design Design Design

• Process of constructing • Process of constructing • (optional) Process of • Description of the


a model of the a model of the deciding about the implementation of the
information used in an information used in an placement of data database on secondary
enterprise independent enterprise based on a across the sites of a storage. It describes
of all physical specific data model but computer network the storage structures
considerations independent of a • Involves designing the and access methods for
• e.g. identify entity particular DBMS or any network itself, as well efficient access.
types, identify other physical as distribution of • Design physical
relationship types, considerations DBMS Software, DB representations
determine attribute • e.g. Normalization, applications, and data (analyze transactions,
domains, determine validate model against choose file
candidate and primary user transactions, draw organizations,
key, draw ER-D. ER-D, define integrity secondary indexes),
constraints. design security
mechanism, monitor,
and tune operational
system
26

Database Engine
Database Engine
27

• A database system is partitioned


into modules that deal with each
of the responsibilities of the
overall system.
• The functional components of a
database system can be divided
into:
• The storage manager,
• The query processor component,
• The transaction management
component.
Storage Manager
28

• A program module that provides the interface between the low-


level data stored in the database and the application programs
and queries submitted to the system.
• The storage manager is responsible to the following tasks:
• Interaction with the OS file manager
• Efficient storing, retrieving and updating of data
Components of Storage Manager
29

Authorization and integrity manager


• which tests for the satisfaction of integrity constraints and checks the authority of
users to access data.

Transaction manager
• which ensures that the database remains in a consistent (correct) state despite
system failures, and that concurrent transaction executions proceed without
conflicting.

File manager
• which manages the allocation of space on disk storage and the data structures used
to represent information stored on disk.

Buffer manager
• which is responsible for fetching data from disk storage into main memory and
deciding what data to cache in main memory. The buffer manager is a critical part of
the database system, since it enables the database to handle data sizes that are
much larger than the size of main memory.
Data Structure used by Storage Manager
30

• The storage manager implements several data structures as part of the


physical system implementation:
• Data files, which store the database itself.
• Data dictionary, which stores metadata about the structure of the database,
in particular the schema of the database.
• Indices, which can provide fast access to data items. A database index
provides pointers to those data items that hold a particular value. For
example, we could use an index to find the instructor record with a particular
ID,or all instructor records with a particular name
• Hashing is an alternative to indexing that is faster in some but not all cases.
Data Structure used by Storage Manager
31

• The storage manager implements several data structures as part of the


physical system implementation:

Data files which store the database itself.

Data which stores metadata about the structure of the database, in particular the schema of
the database.
dictionary
Indices which can provide fast access to data items. A database index provides pointers to those
data items that hold a particular value. For example, we could use an index to find the
instructor record with a particular ID, or all costumer records with a particular name

Hashing is an alternative to indexing that is faster in some but not all cases.
Query Processor
32

The query processor components include:


• DDL interpreter, which interprets DDL statements and records the
definitions in the data dictionary.
• DML compiler, which translates DML statements in a query language into an
evaluation plan consisting of low-level instructions that the query evaluation
engine understands
• A query can usually be translated into any of a number of alternative evaluation plans
that all give the same result. The DML compiler also performs query optimization; that is,
it picks the lowest cost evaluation plan from among the alternatives.
• Query evaluation engine, which executes low-level instructions generated
by the DML compiler
Query Processing
33

1. Parsing and translation


2. Optimization
3. Evaluation
Transaction Management
34

• A transaction is a collection of operations that performs a single logical


function in a database application
• Transaction-management component ensures that the database remains in a
consistent (correct) state despite system failures (e.g., power failures and
operating system crashes) and transaction failures.
• Concurrency-control manager controls the interaction among the
concurrent transactions, to ensure the consistency of the database.
35

Database Architecture
Database Architecture
36

Centralized databases Client-server Parallel databases Distributed databases


One to a few cores, shared One server machine Many core shared memory Geographical distribution
memory executes work on behalf of Shared disk Schema/data heterogeneity
multiple client machines.
Shared nothing
Database Application Architecture
37
38

Database Users and


Administrators
Database Users
39

Application programmers Sophisticated Users Specialized users


interact with system through form requests in a database write specialized database
DML calls query language applications that do not fit into
the traditional data processing
framework

Naïve users Database Administrator


Invoke one of the permanent
application programs that have
been written previously
E.g. people accessing database
over the web, bank tellers,
clerical staff
Database Administrator
40

• A person who has central control over the system is called a database
administrator (DBA).
• Functions of a DBA include:
• Schema definition
• Storage structure and access-method definition
• Schema and physical-organization modification
• Granting of authorization for data access
• Routine maintenance
• Periodically backing up the database
• Ensuring that enough free disk space is available for normal operations, and upgrading
disk space as required
• Monitoring jobs running on the database
41

History of Database
42
43

References

[1] Silberschatz, Korth, and Sudarshan. Database System Concepts – 7th


Edition. McGraw-Hill. 2019.
[2] Slides adapted from Database System Concepts Slide.
Source: https://db-book.com/slides-dir/index.html
[3] Ali Davoudian, Liu Chen, and Mengchi Liu. 2018. A Survey on NoSQL Stores.
ACM Comput. Surv. 51, 2, Article 40 (April 2018), 43 pages.
Questions
44

You might also like