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

CSC10006_Chapter 1_Overview of DB Systems_II.2425

The document provides an overview of database systems, covering topics such as the definition of databases, their evolution, characteristics, and the role of Database Management Systems (DBMS). It discusses data models, database languages, and the database design process, emphasizing the importance of structured data and the functionalities of DBMS. Additionally, it highlights the advantages and disadvantages of database systems, including aspects like data abstraction, sharing, and multiuser access.

Uploaded by

minhtn23122005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

CSC10006_Chapter 1_Overview of DB Systems_II.2425

The document provides an overview of database systems, covering topics such as the definition of databases, their evolution, characteristics, and the role of Database Management Systems (DBMS). It discusses data models, database languages, and the database design process, emphasizing the importance of structured data and the functionalities of DBMS. Additionally, it highlights the advantages and disadvantages of database systems, including aspects like data abstraction, sharing, and multiuser access.

Uploaded by

minhtn23122005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

CSC10006 – Introduction to Database

Chapter 1
Overview of Database Systems
Instructor: Vũ Thị Mỹ Hằng, Ph.D. ([email protected])
Lab Assistants: Tiết Gia Hồng, M.Sc. ([email protected])
Lương Hán Cơ, M.Sc. ([email protected])

4.0
fit@hcmus
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

2
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

3
4.0
fit@hcmus
Databases: WHAT and WHY?

4
4.0
fit@hcmus
Databases: WHAT and WHY?

5
4.0
fit@hcmus
Databases: HOW
Real business &
application (marketing,
production, banking, …)
Database Design Process

Automate & support tasks


HOW can computers
understand the real-world
domain to digitize &
Develop

support automation?

Computers
6
4.0
fit@hcmus
Databases: HOW
Real business &
application (marketing,
production, banking, …)
Database Design Process

Analyze &
Design

Automate & support tasks


Data Functionalities, Interfaces
Develop

Implementation

DBMS
Computers
Database Application 7
4.0
fit@hcmus
Database Design Process

Database languages
SQL
Relational Algebra
HOW to represent data Relational Calculus
structures and their (& Integrity Constraints)
characteristics, relations,
constraints, etc.?

HOW to define,
Data models operate, and
Entity Relationship Model manipulate (relational)
Relational Model database?
Object-oriented Model z
Network Model

8
4.0
fit@hcmus
Definition

q Data: Stored representations of meaningful objects


and events.
§ Structured: numbers, text, dates.
§ Unstructured: images, video, documents.
q Information: Data processed and organized to
increase knowledge in the person using the data.
q Database: Collection of logically related data which
provides information relevant to a business/enterprise.

9
4.0
fit@hcmus
Example 1 – Course Management

10
4.0
fit@hcmus
Example 2 – Project Management
4.0
EMPLOYEE LName MName FName SSN BirthDate SuperSSN DNo
Tran Hong Quang 987987987 03/09/1969 987654321 4
Nguyen Thanh Tung 333445555 12/08/1955 888665555 5
Nguyen Manh Hung 666884444 09/15/1962 333445555 5
Tran Thanh Tam 453453453 07/31/1972 333445555 5

PROJECT PName PNumber PLocation DNum

San pham X 1 VUNG TAU 5


San pham Y 2 NHA TRANG 5
San pham Z 3 TP HCM 5
Tin hoc hoa 10 HA NOI 4

WORKS_ON SSN PNo Hours


123456789 1 32.5
123456789 2 7.5
666884444 3 40.0
453453453 1 20.0 11
4.0
fit@hcmus
Characteristics of Databases
q A logically coherent collection of data with some
inherent meaning.
§ Random assortment of data cannot correctly be a database.
q Is designed, built, and populated with data for a specific
purpose, for intended group of users or applications.
§ Example: University management, Hospital management
q Data is stored using a structure è structured database
§ Relational databases store data in two-dimensional tables.
q Other types of database: unstructured databases,
document databases, graph databases.

12
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

13
4.0
fit@hcmus
Evolution of Database Systems
4.0

14
4.0
fit@hcmus
Evolution of Database Systems
4.0

15
4.0
fit@hcmus
Disadvantages of File Processing
q Program-Data Dependence
q Duplication of Data
q Lack of Security and Limited Data Sharing
q Expensive and Lengthy Program Development
q Excessive Program Maintenance

16
4.0
fit@hcmus
Database Systems
4.0
q Central repositories of shared data
q Data is stored, processed, and managed in a suitable and
standardized manner
q Data is managed by a controlling agent
è Requires a Database Management System (DBMS)

17
4.0
fit@hcmus
Database Systems
Users/Programmers

Applications/Queries

DBMS
Query/Program
Processing

Data Accessing

Catalog Database
Database
Definition
DB system

18
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

19
4.0 Self-Describing
fit@hcmus (Meta-data)
q A catalog called “metadata” contains information such
as the structure of data, type and storage format of
data items, and constraints on the data.

20
4.0 Isolation
fit@hcmus
(Program-Data independence)
q The structure of data is stored in catalog separately
from the access programs.
Program Program
Catalog/metadata
Isolation Isolation
Catalog/metadata
Data Data

Program contains catalog data DBMS contains catalog data is


structure depends on program independent of program

J A little change in the structure happens.


J Application programs are rarely revised.

21
4.0 Data Abstraction
fit@hcmus
(Conceptual-Logical-Physical Levels)

q Hide the data structure


complexity from users through
several levels of data abstraction
to simplify users’ interaction with
the systems.
§ Physical level: HOW data is stored.
§ Logical level: WHAT data are stored
§ View level: PART of the entire
database for a specific USERS.

22
4.0 Data Abstraction
fit@hcmus
(Conceptual-Logical-Physical Levels)
q A DB has many users who may require a different
perspective or view of the database.
q Example of (user) views:
§ A subset of the database.
§ Aggregate data that are derived from the database.

Different views SV-CHINHQUI SV-HOANCHINH

Data SINHVIEN
23
4.0 Sharing Data
fit@hcmus
(Multiusers)
q A multiuser DBMS: Allows multiple users to access
the DB at the same time.
§ Data for many applications are integrated and maintained
in a single DB.
§ Using concurrency control mechanisms to access the
data reasonably
§ Ensure the data will always be valid when they are
accessed.

25
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

26
4.0
fit@hcmus
DBMS
q A collection of programs that enables users to
create, operate, and maintain a database.
§ Definition: Specifying the data types, structures, and
constraints for the data.
§ Construction: Storing the data itself on some storage
medium.
§ Manipulation: Querying the database to retrieve data,
updating the database to reflect changes, generating
reports from the data.
§ Sharing: Allowing multiple users/programs to access the
database concurrently.

27
4.0
fit@hcmus
DBMS Functions

q Data dictionary management


§ Data dictionary stores definitions of data elements and
their relationships (meta-data)
q Data storage management
§ Performance tuning ensures efficient performance of
the database in terms of storage and access speed
q Data transformation and presentation
§ Data is formatted to conform to required data
structures
q Security management
§ Enforces user security and data privacy
28

(Coronel and Morris, 2015) (Hoffer et al., 2019)


4.0
fit@hcmus
DBMS Functions

q Multiuser access control


§ Sophisticated algorithms ensure that multiple users
can access the database concurrently without
compromising its integrity.
q Backup and recovery management
§ Enables recovery of the database after a failure
q Data integrity management
§ Minimizes redundancy and maximizes consistency

29

(Coronel and Morris, 2015) (Hoffer et al., 2019)


4.0
fit@hcmus
DBMS Functions

q Database access languages and application


programming interfaces
§ Query language: lets the user specify what must be
done without having to specify how
§ Structured Query Language (SQL): a structured
query language and data access standard supported
by the majority of DBMS vendors
q Database communication interfaces
§ Accept end-user requests via multiple, different
network environments

30

(Coronel and Morris, 2015) (Hoffer et al., 2019)


4.0
fit@hcmus
DBMS Disadvantages

q Increased costs
q Management complexity
q Maintaining currency
q Vendor dependence
q Frequent upgrade/replacement cycles

31

(Coronel and Morris, 2015) (Hoffer et al., 2019)


4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

32
4.0
fit@hcmus
Recall: DB Design Process

Database languages
SQL
Relational Algebra
HOW to represent data Relational Calculus
structures and their (& Integrity Constraints)
characteristics, relations,
constraints, etc.?

HOW to define,
Data models operate, and
Entity Relationship Model manipulate (relational)
Relational Model database?
Object-oriented Model z
Network Model

33
4.0 Recall: DB Design Process
fit@hcmus
HOW to represent data structures and their
characteristics, relations, constraints, etc.?

DATA MODEL
Real s
e
world Data Modeling it liz
u

DBMS

Conceptual Logical Physical


Easy to understand Understood by users Understood and
for users but not too far from executed by computers
physical organization
ER Model Relational Data Model
(Mô hình thực thể-kết hợp) (Mô hình dữ liệu quan hệ)

34
4.0 Data Models
fit@hcmus

Data model
Mô hình dữ liệu

Is described by

Specific
domain Database schema
Lược đồ CSDL

Is described by

Database instance
(Một thể hiện của) CSDL

35
4.0 Data Models
fit@hcmus

q A collection of concepts used to describe the


structure of a DB (data types, relationships, and
constraints, etc.)
q Including a set of basic operations for specifying
retrievals and updates on the DB.
q Example:
§ ER model: entity, relationships, cardinality constraints, etc.
§ Relational (data) model: relations, primary keys, etc.

36
4.0 Data Models
fit@hcmus

q Categories:
§ High-level (or conceptual) models: Provide concepts that
are close to the way (business) users perceive data (ER
model, object-oriented model, etc.).
§ Implementation (or logical) data models: Provide concepts
that are understood by end users, but not too far from the
way data is organized within the computer (relational
model, network model, etc.).
§ Low-level (or physical) data models: Provide concepts that
describe the details of how data is stored in the computer.

37
4.0 Examples of Data Models
fit@hcmus

q Entity Relationship Diagram


Entity type Atrribute
Relationship

q Network data model


Record type
Relationship 1:N

38
4.0 Database Schema
fit@hcmus
Data model
Mô hình dữ liệu

Is described by

Specific
domain Database schema
Lược đồ CSDL

Is described by

Database instance
(Một thể hiện của) CSDL

q Description of the structure and constraints on the


database about a particular domain (banking,
education, marketing, etc.) based on a data model.
39
4.0 Example of ER Database Schema
fit@hcmus
(ER Diagram)

40
4.0 Example of (Relational) Database
fit@hcmus
Schema

41
4.0 Example of Object-Oriented
fit@hcmus
Database Schema
Student
Name Course
Grade study
Name
Major
1..* 0..* Number
planSchedule()
printReoord() 1

Mark
LabMark open
LectureMarrk
ProjectMark
0..*
UpdateMark()
Subject
Name
+pre
Faculty
NoOfCredits 0..*
UpdateCredit()
0..* Constraint
+post

42
4.0 Example of Network Database
fit@hcmus
Schema

Student Subject

PreSubject

Subject_Open

PostSubject
Student_Mark
Course Constraint

Result_Course

Result

43
Example of Hierarchical Database
Schema
Result
Level 1: LabMark LectureMark

Course Student
Level 2: Name Grade Major
Name Number

Subject
Level 3:
Name Faculty NoOfCredits

44
4.0 Database Instances
fit@hcmus
Data model
Mô hình dữ liệu

Is described by

Specific
domain Database schema
Lược đồ CSDL

Is described by

Database instance
(Một thể hiện của) CSDL

q The data stored in a database at a particular moment


of time is called an instance of the database.

45
4.0 Example of a (Relational) DB Instance
fit@hcmus
The (relational) database
schema of the database
Student Management
Is described by

An instance of the database Student Management


(at a moment t)

46
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

47
4.0
fit@hcmus
Databases Design Process

Database languages
SQL
Relational Algebra
HOW to represent data Relational Calculus
structures and their (& Integrity Constraints)
characteristics, relations,
constraints, etc.?

HOW to define,
Data models operate, and
Entity Relationship Model manipulate (relational)
Relational Model database?
Object-oriented Model z
Network Model

48
4.0
Data Languages
fit@hcmus (for Relational Model)
q High-level (practical) language
§ Entered interactively from a display monitor/terminal or
embedded in a general-purpose programming language.
§ E.g.: SQL Standard (extension: T-SQL, PL/SQL).

q Low-level (formal) language


§ Embedded in a general-purpose programming language.
§ Offer the fundamental principles for the practical language.
§ E.g.: Relational Algebra, Relation Calculus

49
4.0 SQL Standard
fit@hcmus

q DDL – Data Definition Language


§ Identify descriptions of the schema constructs and store
them in the DBMS catalog.
q DML – Data Manipulation Language
§ Provide a set of operations including retrieval, insertion,
deletion and modification of the data.
q SDL – Storage Definition Language
§ Specify the internal schema and the mappings between two
schemas.
q VDL – View Definition Language.
§ Specify user views and their mapping to the conceptual
schema.
50
4.0 Example of SQL DDL
fit@hcmus
CREATE TABLE GIAOVIEN (
MAGV CHAR(9) PRIMARY KEY,
HOTEN NVARCHAR(50) NOT NULL,
LUONG INT DEFAULT (1000),
PHAI CHAR(3) CHECK (PHAI IN(‘Nam’, ‘Nu’)),
NGAYSINH DATETIME,
SONHA NVARCHAR(10),
DUONG NVARCHAR(50),
QUAN NVARCHAR(50),
THANHPHO NVARCHAR(50),
GVQLCM CHAR(9),
MABM CHAR(9)
)
51
4.0
Example of SQL DML
fit@hcmus (Create – Read – Update - Delete)

C INSERT INTO THAMGIADT VALUES(’002', ‘001', 2, 1.2, NULL)

R SELECT MAKHOA, TENKHOA, PHONG FROM KHOA


WHERE PHONG='I53’ AND NAMTL = '1995'

U UPDATE GIAOVIEN SET LUONG=LUONG*1.1

D DELETE FROM GIAOVIEN WHERE MAGV = 'GV001'

52
4.0
fit@hcmus
Content

q Introduction of databases
q Evolution of database systems
q Characteristics of the database approach
q Database management systems (DBMS)
q Data models
q Database languages
q Database users

53
4.0 Database Administrator
fit@hcmus

q Many people use the same resources


§ Need a chief administrator to oversee and manage

q Responsibility
§ Administering the DB
§ Authorizing access to the DB
§ Coordinating and monitoring the use of DB
§ Acquiring software and hardware resources as needed

54
4.0 Database Designer
fit@hcmus

q Responsibility
§ Identifying the data to be stored in the DB
§ Choosing appropriate structures to represent and store
the DB
§ Communicating with all DB users to understand their
requirements, to produce a design that meet the
requirements.

q Can be
§ Staff of the DBA
§ Other staffs taking responsibilities after the DB
designed is completed

55
4.0 End User
fit@hcmus

q People whose jobs require to access to the DB


§ Querying, updating, generating reports

q Categories
§ Casual end user
§ Naïve or parametric end user
§ Sophisticated end user

56
4.0
fit@hcmus

57

You might also like