PostgresSQL
A new thing to learn
Table of contents
01 02
PostgreSQL Install
What is PostgreSQL ? How to install PostgreSQL
03 04
Get started Caution
Practice with some line Cautions
of code
Whoa!
Getting start right away
01
PostgreSQL
What is PostgreSQL ?
About Post
PostgreSQL is a powerful, open source object-relational
database system
They’re
● uses and extends the SQL language combined with
many features
● safely store and scale the most complicated data
workloads
And the most important thing: PostgreSQL is easy to use
Various features in PostgreSQL
Data Types
Primitives: Integer, Numeric, String, Boolean
Structured: Date/Time, Array, Range / Multirange, UUID
Document: JSON/JSONB, XML, Key-value (Hstore)
Geometry: Point, Line, Circle, Polygon
Customizations: Composite, Custom Types
UNIQUE, NOT NULL Data Integrity
Primary Keys
Foreign Keys
Exclusion Constraints
Explicit Locks, Advisory Locks
“PostgreSQL support SQL and
NoSQL and alot of advance
features.”
Some special
What new ?
Mercury
It’s the closest planet to the Sun and the smallest one
Venus
Venus is the second planet from the Sun
Mars
Despite being red, Mars is actually a cold place
02
Childhood
You can describe the topic
of the section here
“Just follow some video on
youtube step by step.”
—Youtube
03
Get started
Practice with some line of
code
create table users(
id int primary key,
name varchar(20),
age int,
address varchar(126)
);
Syntax is similar to
Oracal or MySQL insert into users(id, name, age, address) values (1,
'duc', 21, 'hanoi');
select * from users;
04
Caution
Some spectial of PostgreSQL
Create a table
If user don’t have a new schema and
create a table, that table will save in
public schema
Create Schema
A schema likes a database in
MySQL. It can save list of table
and support user to select data
from that table
To create new schema, use: create schema <schema_name>;
Get data from new schema
If user not config schema in query, schema public will be
used. To get data from another schema, use:
“select * from <schema_name>.<table_name>;”
About new database
failwall world random
Database still is a User can switch bettwen Only one database can
database multiple database by use be use at time
“\c <database_name>”