Chapter 5 - Data Processing

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

TRƯỜNG CÔNG NGHỆ VÀ THIẾT KẾ

KHOA CÔNG NGHỆ THÔNG TIN KINH DOANH

Chapter 5

DATA PROCESSING

Giảng viên: ThS. Bùi Xuân Huy


Email: huybx@ueh.edu.vn
AGENDA

• What Is the Purpose of a


Q1 Database?

• What Is a Database?
Q2

• What Is a Database Management


Q3 System (DBMS)?

13/10/2022 Môn học: Hệ thống thông tin quản lý 2


AGENDA

• How Do Database Applications Make


Q4 Databases More Useful?

• How Are Data Models Used for


Q5 Database Development?

• How Is a Data Model Transformed into


Q6 a Database Design?

13/10/2022 Môn học: Hệ thống thông tin quản lý 3


Q1. What Is the Purpose of a
Database?

13/10/2022 Môn học: Hệ thống thông tin quản lý 4


What Is the Purpose of a
Database?
 It keeps track of things.
 A spreadsheets can do it also, but they still
have disadvantages

13/10/2022 Môn học: Hệ thống thông tin quản lý 5


What Is the Purpose of a
Database?

Có giới hạn số lượng dòng


1.048.576 hàng với 16.384 cột
Spreadsheet: Order

13/10/2022 Môn học: Hệ thống thông tin quản lý 6


What Is the Purpose of a
Database?
 Problems with spreadsheets
 Duplicated trùng lặp

 Inconsistency ko nhất quán trong dữ liệu

 Intergity ko tích hợp

 Inefficiency

13/10/2022 Môn học: Hệ thống thông tin quản lý 7


What Is the Purpose of a
Database?

Database: Global Superstore

13/10/2022 Môn học: Hệ thống thông tin quản lý 8


What Is the Purpose of a
Database?
 General rule
 Lists of data involving a single theme can
be stored in a spreadsheet
 lists that involve data with multiple
themes require a database

 The purpose of a database is to keep track


of things that involve more than one theme.

13/10/2022 Môn học: Hệ thống thông tin quản lý 9


Q2. What Is a Database?

13/10/2022 Môn học: Hệ thống thông tin quản lý 10


Database

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 11


Database

 A database is a self-describing collection of


integrated records
 a byte is a character of data
 Bytes are grouped into columns called
fields
 Each row, the collection of data for all
columns called records
 A group of similar rows or records is called
a table or a file
13/10/2022 Môn học: Hệ thống thông tin quản lý 12
Database

Source: Textbook[1]
13/10/2022 Môn học: Hệ thống thông tin quản lý 13
Components of a Database

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 14


Relationships Among Rows

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 15


Relationships Among Rows

 Key: A column or group of columns that


identifies a unique row in a table (Every table
must have a key).
 Foreign keys: These are keys of a different
(foreign) table than the table in which they
reside.
 Relational databases: Relationships among
tables are created by using foreign keys.
 Relation: Formal name for a table

13/10/2022 Môn học: Hệ thống thông tin quản lý 16


Metadata

 Metadata: data that describes data

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 17


Q3. What Is a Database
Management System (DBMS)?

13/10/2022 Môn học: Hệ thống thông tin quản lý 18


Database Management
System (DBMS)
 A database management system
(DBMS): a program used to create, process,
and Phân
administer a database
quyền, có bản backup restore.

 Licensed from vendors: IBM (DB2), Microsoft


(Access and SQL Server), Oracle (Oracle
Database), …
 Open source: MySQL

13/10/2022 Môn học: Hệ thống thông tin quản lý 19


Database Management
System (DBMS)
 Creating the database and its structures:
create tables, relationships, and other
structures in the database
 Processing the database: Read, Insert,
Modify, Delete data

13/10/2022 Môn học: Hệ thống thông tin quản lý 20


Database Management
System (DBMS)
 Administering the database:
 Sset up a security system involving user
accounts, passwords, permissions, and
limits for processing
 backing up database data, adding
structures to improve the performance of
database applications, removing data that
are no longer wanted or needed, and
similar tasks.

13/10/2022 Môn học: Hệ thống thông tin quản lý 21


Q4. How Do Database
Applications Make Databases
More Useful?

13/10/2022 Môn học: Hệ thống thông tin quản lý 22


Database Applications

Elements Functions
View data;, insert new, update existing, and
Forms
delete existing data

Structured presentation of data using sorting,


Reports
grouping, filtering, and other operations

Search based upon data values provided by


Queries
the user
Provide security, data consistency, and special
Application
purpose processing, e.g., handle out-of-stock
Programs
situations

13/10/2022 Môn học: Hệ thống thông tin quản lý 23


Database Applications

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 24


Database Applications

13/10/2022 Môn học: Hệ thống thông tin quản lý 25


Q5. How Are Data Models Used for
Database Development?

13/10/2022 Môn học: Hệ thống thông tin quản lý 26


Components of the Entity-
Relationship Data Model

• Something users want to track


Entities
• Ex: Order, customer, salesperson, item, …

• Describe characteristics of an entity


Attributes • Ex: orderDate, customerID, itemName

• Uniquely identifies one entity instance


Identifier from other instances
• Ex: StudentID, ProductID, EmployeeID, …

13/10/2022 Môn học: Hệ thống thông tin quản lý 27


Components of the Entity-
Relationship Data Model

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 28


Components of the Entity-
Relationship Data Model

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 29


Components of the Entity-
Relationship Data Model

Source: Textbook[1]

13/10/2022 Môn học: Hệ thống thông tin quản lý 30


Q6. How Is a Data Model
Transformed into a Database
Design?

13/10/2022 Môn học: Hệ thống thông tin quản lý 31


Database Design

 Database design is the process of converting


a data model into tables, relationships, and
data constraints

13/10/2022 Môn học: Hệ thống thông tin quản lý 32


Database Design

13/10/2022 Môn học: Hệ thống thông tin quản lý 33


EXERCISE

13/10/2022 Môn học: Hệ thống thông tin quản lý 34


Khoá chính ko rỗng ko trùng phải có cho mỗi bảng
Thiết lập bảng hai biến trùng lặp merge hai ô thành khóa chính
[ truy vấn có tham số ]

Cột mới design/build


Cột chuỗi & cột cuỗi

Q&A

13/10/2022 Môn học: Hệ thống thông tin quản lý 35

You might also like