DATABASE MANAGEMENT
Lecturer: PhD. Nguyễn Văn Lợi
Email: nvloi@[Link]
Phone: 0932.537.078
Course Overview
Course name Database Management
Duration 02 credits
Time allocation 38 periods (13 weeks)
Theory 23 periods
Course type Mandatory
Course position Basic knowledge
2
DATABASE MANAGEMENT
❑Why do you learn this course?
❑What will you learn in this course?
Database design process
3
DATABASE MANAGEMENT
❑What are the learning outcomes of the course?
▪Present database concepts, data models, and database
design processes.
▪Design and normalize relational databases.
▪Use SQL to manipulate and query databases on SQL
Server
4
Database System
Chapter 1
Introduction
Outline
1 Database
2 DBMS
3 Data Model
4 View of Data
6
Database Systems
❑What is Database?
❑What is Database Management System (DBMS) ?
7
What is Database?
❑How to manage a shop using a computer?
8
What is a database?
❑A database is a collection of data, contains
information relevant to an enterprise.
❑A database is an organized collection of data.
❑A database is a collection of information that is
organized so that it can easily be accessed,
managed, and updated.
9
What is a DBMS?
❑ Database management system (DBMS) is a special
software application that interacts with the user,
other applications, and the database itself to
capture and analyze data.
❑E.g: Some popular DBMS
10
DBMS purpose
❑ To store data properly
❑ To provide simultaneous access to the data for
many users
❑ To delimit the access to the data for different
users
❑ To prevent data from loss
❑ To provide a way to store and retrieve database
information that is both convenient and efficient.
11
Database systems
❑ Database systems are used to manage
collections of data that are:
▪ Highly valuable
▪ Relatively large
▪Accessed by multiple users and applications, often at
the same time.
❑A modern database system is a complex
software system whose task is to manage a
large, complex collection of data.
❑Databases touch all aspects of our lives
12
Database Applications Examples
❑Enterprise Information
▪ Sales: customers, products, purchases
▪ Accounting: payments, receipts, assets
▪ Human Resources: Information about employees, salaries, payroll
taxes.
❑Manufacturing: management of production, inventory,
orders, supply chain.
❑Banking and finance
▪ customer information, accounts, loans, and banking transactions.
▪ Credit card transactions
▪ Finance: sales and purchases of financial instruments (e.g., stocks
and bonds; storing real-time market data
❑Universities: registration, grades
13
Database Applications Examples
❑Airlines: reservations, schedules
❑Telecommunication: records of calls, texts, and data
usage, generating monthly bills, maintaining balances on
prepaid calling cards
❑Web-based services
▪ Online retailers: order tracking, customized recommendations
▪ Online advertisements
❑Document databases
❑Navigation systems: For maintaining the locations of
varies places of interest along with the exact routes of
roads, train systems, buses, etc.
14
Purpose of Database Systems
In the early days, database applications were built directly on top of
file systems, which leads to:
❑ Data redundancy and inconsistency: data is stored in multiple
file formats resulting in duplication of information in different
files
❑Difficulty in accessing data
▪ Need to write a new program to carry out each new task
❑Data isolation
▪ Multiple files and formats
❑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
15
Purpose of Database Systems (Cont.)
❑ 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
❑Concurrent access by multiple users
▪ Concurrent access needed for performance
▪ Uncontrolled concurrent accesses can lead to inconsistencies
• Ex: Two people reading a balance (say 100) and updating it by withdrawing
money (say 50 each) at the same time
❑Security problems
▪ Hard to provide user access to some, but not all, data
Database systems offer solutions to all
the above problems
16
University Database Example
❑Data consists of information about:
▪Students
▪Instructors
▪Classes
❑Application program examples:
▪Add new students, instructors, and courses
▪Register students for courses, and generate class rosters
▪Assign grades to students, compute grade point averages
(GPA) and generate transcripts
17
Data Models
❑Underlying the structure of a database is the data
model: a collection of conceptual tools for
describing
▪Data
▪Data relationships
▪Data semantics
▪Consistency constraints
18
Data Models
❑There are a number of different data models:
▪Relational model
▪Entity-Relationship data model (mainly for database
design)
▪Object-based data models (Object-oriented and Object-
relational)
▪Semi-structured data model (XML)
❑Other older models:
▪Network model
▪Hierarchical model
19
Relational Model
❑Example of tabular data in the relational model:
Columns
Rows
✓ The relational model uses a
collection of tables to represent
both data and the relationships
among those data.
✓ Each table has multiple columns,
and each column has a unique
name.
✓ Tables are also known as
relations.
20
View of Data
❑ Levels of data abstraction, to simplify users’
interactions with the system:
▪The three levels of data abstraction:
21
Data Abstraction
❑ Physical level: the lowest level of abstraction describes how
the data are actually stored.
❑ Logical level: describes what data are stored in the
database, and what relationships exist among those data. E.g:
Describe the type of a record instructor with 4 fields:
type instructor = record
ID : char(5);
name : char(20);
dept_name : char(20);
salary : numeric(8,2);
end;
❑ View level: The highest level of abstraction describes only
part of the entire database. The system may provide many
views for the same database. Views can also hide information
(such as an employee’s salary) for security purposes.
22
RDBMS
❑ RDBMS which stands for relational database
management system, is a program that lets users
create, update, and administer a relational
database.
❑ Are used in most commercial projects
23
RDBMS installation
❑Install RDBMS Server
▪Microsoft SQL Server 2022 Developer
❑Install client application for querying data
▪Microsoft SQL Server Management studio
24