PYTHON 2
TS. NGUYỄN HOÀNG LONG
BỘ MÔN TIN HỌC TRẮC ĐỊA
0916666384
nguyenhoanglong@humg.edu.vn
BANK
10 triệu
= 20
10 triệu
LongBIDVACCOUNT
ISSUES
What will the devopers have to do if
the Bank have thousands of
customers’ accounts
What will the devopers have to do if
the Bank wants to store and manage
their customers’ information
What will the devopers have to do if
the Bank want to know which
accounts have more than 100 million
ISSUES
What will the devopers have to do if
the Bank want to know the total of
money in their Bank
What will the devopers have to do if
the Bank wants to know the number
of their customer living in Hanoi
What will the devopers have to do if
the Bank wants to know ….
DATABASE
• A database is an organized
collection of structured
information, or data, typically
stored electronically in a computer
system.
• A database is usually controlled by
a database management system
(DBMS).
POSTGRESQL
• PostgreSQL is a powerful, open source
object-relational database system.
• It has more than 15 years of active
development and a proven architecture that
has earned it a strong reputation for
reliability, data integrity, and correctness.
• PostgreSQL runs on all major operating
systems, including Linux, UNIX and
Windows.
DOWNLOAD POSTGRESQL
INSTALL POSTGRESQL
SETUP PASSWORD
START POSTGRESQL
PGADMIN GUI
CREATE NEW SERVER
CREATE NEW SERVER
CREATE NEW SERVER
CREATE NEW SERVER
CREATE A NEW DATABASE
CREATE DATABASE
CREATE DATABASE
DATA TABLE
• Tables are database objects that contain all the data
in a database. STT Mã sinh viên Họ và tên SV Ngày sinh SĐT
• In tables, data is logically organized in a row-and- 1 1821050756 Phạm Thế 14/08/2000 0868799158
2 1821050183 Nguyễn Tiến 27/08/2000 0376421411
column format similar to a spreadsheet. 3 1821050538 Nguyễn Tiến 10/10/2000
4 1821050467 Lê Tiến 12/09/2000 0987864852
• Each row represents a unique record, and each 5 1821050942 Cao Văn 16/09/2000 0338811658
column represents a field in the record 6 1821050479 Nguyễn Thị Mỹ 26/03/2000 0335366382
7 1821050714 Nguyễn Minh 27/06/2000 0967488027
• A table has a specified number of columns, but can
have any number of rows
• Users can Create, Read, Update and Delete
(CRUD) data in data table.
CREATE NEW TABLE
CREATE NEW TABLE
CREATE NEW TABLE
CREATE NEW TABLE
ADD DATA INTO TABLE
ADD DATA INTO TABLE