SlideShare a Scribd company logo
PostgreSQL Tutorial for Beginners | Edureka
TYPES OF DBMS
WHAT IS SQL?
WHAT IS POSTGRESQL?
FEATURES OF POSTGRESQL
SQL COMMAND CATEGORIES
INSTALL POSTGRESQL
www.edureka.co
www.edureka.co
Hierarchical
DBMS
Network
DBMS
Relational
DBMS
Object-
Oriented
DBMS
www.edureka.co
www.edureka.co
A standardized
programming language
which is used for
managing relational
databases.
With SQL, you can
modify databases, add,
update or delete rows of
data, retrieve subsets of
information from a
database and ,any more
Relational databases
like MySQL Databases,
oracle, Ms SQL Server,
Sybase etc use SQL.
Queries and other SQL
operations are written
as statements.
Example: select, insert,
add, update, delete,
create, alter, truncate.
www.edureka.co
www.edureka.co
PostgreSQLis an open-source object relational database
system with a 30+ years of active development in the industry.
World’s Most Advanced Open Source Relational Database
www.edureka.co
www.edureka.co
Data Types Data Integrity Performance
Reliability Security Extensibility
www.edureka.co
www.edureka.co
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co
.
Transaction Control
Language(TCL)
COMMIT, ROLLBACK,
SAVEPOINT
Data Control
Language(DCL)
GRANT, INVOKE
Data Manipulation
Language(DML)
SELECT, INSERT,
UPDATE, DELETE
CREATE, DROP, ALTER
Data Definition Language
(DDL)
Includes the commands which
mainly deal with the
transaction of database.
Includes commands which
mainly deals with the rights,
permissions and other controls
of the database system.
The SQL commands that deals
with the manipulation of data
present in database.
Consists of the commands that
can be used to define the
database schema.
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
Composite vs Simple
Single vs Multivalued
Stored vs Derived
Complex Attributes
ENTITY &
ATTRIBUTES
www.edureka.co
ENTITY &
ATTRIBUTES
Composite vs Simple
A composite attribute can be divided into smaller subparts. These subparts
represent individual basic attributes with their own meanings.
Attributes which are not divisible are simply known as simple or atomic
attributes.
Address
Street _address City State Zip
Number Street House_number
www.edureka.co
ENTITY &
ATTRIBUTES
Composite vs SimpleSingle vs Multivalued
Attributes having single value for a particular entity are known as single-
valued attributes.
A multivalued attribute may have lower and upper bounds to constrain the
number of values allowed for each individual entity.
www.edureka.co
ENTITY &
ATTRIBUTES
Composite vs SimpleSingle vs MultivaluedStored vs Derived
Attributes which are derived from the real entities are known as derived
attributes.
The stored attribute are such attributes which are already stored in the
database and from which the value of another attribute is derived is
called stored attribute.
Age Birth_date
www.edureka.co
ENTITY &
ATTRIBUTES
Composite vs SimpleSingle vs MultivaluedStored vs DerivedComplex Attributes
Attributes that can be represented by grouping composite attributes
between (), separating the components with commas, and by displaying the
multivalued attributes between [] are known as complex attributes.
{Address_phone({Phone(Area_code,Phone_number)},Address(Street_addre
ss{Number,Street, flat_number),City,State,Zip))}
www.edureka.co
www.edureka.co
Candidate
Key
Super
Key
Primary
Key
Alternate
Key
Foreign
Key
www.edureka.co
www.edureka.co
NOT NULL UNIQUE CHECK DEFAULT INDEX
www.edureka.co
Ensures that a NULL
value cannot be
stored in a column
This constraint
makes sure that all
the values in a
column are
different
This constraint
ensures that all the
values in a column
satisfy a specific
condition.
This constraint
consists of a set of
default values for a
column when no
value is specified.
This constraint is
used to create and
retrieve data from
the database very
quickly.
www.edureka.co
CONSTRAINTS IN DATABASE
www.edureka.co
A technique that organizes tables in such a way that redundancy and dependency of data is reduced.
BCNF
3 NF
2 NF
1 NF
www.edureka.co
Salutation Full Name Address Movies Rented Category
Ms. Alice Johnson 1st Street House No 3 Mission Impossible:
Fallout, Clash of Titans
Action, Action
Mr. David Allen 3rd Street 45 Interstellar, Edge Of
Tomorrow
Sci-Fi, Sci-Fi
Mr. David Allen 7th Avenue Mission Impossible:
Fallout
Action
www.edureka.co
NORMALIZATION
First Normal Form
2 NF
3 NF
BCNF
Each table cell should have a single value. So, basically all the records must be unique.
Salutation Full Name Address Movies Rented
Ms. Alice Johnson
1st Street House
No 3
Mission
Impossible: Fallout
Ms. Alice Johnson
1st Street House
No 3
Clash of Titans
Mr. David Allen 3rd Street 45 Interstellar
Mr. David Allen 3rd Street 45 Edge Of Tomorrow
Mr. David Allen 7th Avenue
Mission
Impossible: Fallout
www.edureka.co
NORMALIZATION
3 NF
BCNF
Database should be 1NF and should also have single column primary key.
1 NF
Second Normal Form
Salutation Full Name Address Movies_Rented
ID Salutation Full Name Address
1 Ms Alice
Johnson
1st Street
House No
3
2 Mr David Allen 3rd Street
45
3 Mr David Allen 7th Avenue
ID Movies_Rented
1 Mission Impossible:
Fallout
1 Clash of Titans
2 Interstellar
2 Edge Of Tomorrow
3 Mission Impossible:
Fallout
Table 1
Table 2
www.edureka.co
NORMALIZATION
BCNF
The database should be in 2NF and must not have any transitive functional dependencies.
1 NF
2 NF
Third Normal Form
ID Full Name Address Salutation_ID ID Movies_Rented
Salutation_ID Salutation
1 Mr.
2 Ms.
3 Mrs.
4 Dr.
Table 1 Table 2
Table 3
www.edureka.co
NORMALIZATION
1 NF
2 NF
3 NF
Boyce-Codd Normal
Form
If your database is in 3rd Normal Form, there would be some scenarios where anomalies
would be present, if you have more than candidate key. Then BCNF comes into role, where
you divide your tables further so that there would be only one candidate key present.
www.edureka.co
www.edureka.co
www.edureka.co
ARITHMETIC
OPERATORS
+, -, *, /, %
BITWISE
OPERATORS
&, |, ^
COMPARISON
OPERATORS
==, <, >, <=, >= <>
COMPOUND
OPERATORS
+=, *=, -=, /=,%=,
&=, ^-=, |*=
www.edureka.co
www.edureka.co
Nested queries are SQL queries which have an outer query and inner subquery. The subquery is a query nested within another
query such as SELECT, INSERT, UPDATE or DELETE.
SELECT lastname, firstname
FROM employees
WHERE addressCode IN (SELECT addressCode
FROM office
WHERE country = “INDIA”)
OUTER QUERY SUBQUERY OR INNER QUERY
www.edureka.co
www.edureka.co
UNION
Combines rows from both
the queries
INTERSECT
Keeps only those rows which
are common in both the
queries.
MINUS
Keeps rows from the left query
which are not included in the
right query
LEFT QUERY RIGHT QUERY FINAL RESULT
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
JOINSinSQLarecommandswhichareusedtocombinerowsfromtwoormoretables,basedonarelatedcolumn
betweenthosetables. Theyarepredominantlyusedwhenauseristryingtoextractdatafromtableswhichhaveone-
to-manyormany-to-manyrelationshipsbetweenthem.
WhatareJoins?
www.edureka.co
TYPES OF
JOINS
INNER JOIN
FULL JOIN
LEFT JOIN
RIGHT JOIN
www.edureka.co
www.edureka.co
A view in SQL is a single table, which is derived from other tables
Query
ROWS
VIEWS
COLUMNS
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co
www.edureka.co

More Related Content

PPTX
PostgreSQL Database Slides
PDF
Postgresql tutorial
PDF
PostgreSQL Tutorial For Beginners | Edureka
PPTX
PostgreSQL.pptx
PDF
Backup and-recovery2
PDF
Mule caching strategy with redis cache
PPTX
Sqlmap
PDF
Get to know PostgreSQL!
PostgreSQL Database Slides
Postgresql tutorial
PostgreSQL Tutorial For Beginners | Edureka
PostgreSQL.pptx
Backup and-recovery2
Mule caching strategy with redis cache
Sqlmap
Get to know PostgreSQL!

What's hot (20)

PDF
SQL Joins With Examples | Edureka
ODP
OpenGurukul : Database : PostgreSQL
PPTX
PDF
PDF
Triggers in SQL | Edureka
PPTX
Trigger in mysql
PDF
Spring Security
PPTX
Oracle Data Redaction
PPT
Mysql Ppt
PPSX
Oracle Advanced SQL
PDF
Postgresql database administration volume 1
PPTX
Query logging with proxysql
PPTX
Sql operator
PDF
Enterprise Manager: Write powerful scripts with EMCLI
PDF
Microservices Design Patterns | Edureka
PDF
Automation with ansible
PDF
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
PDF
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PDF
PostgreSQL Replication High Availability Methods
PDF
How to Analyze and Tune MySQL Queries for Better Performance
SQL Joins With Examples | Edureka
OpenGurukul : Database : PostgreSQL
Triggers in SQL | Edureka
Trigger in mysql
Spring Security
Oracle Data Redaction
Mysql Ppt
Oracle Advanced SQL
Postgresql database administration volume 1
Query logging with proxysql
Sql operator
Enterprise Manager: Write powerful scripts with EMCLI
Microservices Design Patterns | Edureka
Automation with ansible
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PostgreSQL Replication High Availability Methods
How to Analyze and Tune MySQL Queries for Better Performance
Ad

Similar to PostgreSQL Tutorial for Beginners | Edureka (20)

PPTX
T-SQL Overview
PPTX
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
PPTX
Dbms and sqlpptx
PPTX
structured query language elmarsi and navathe edition 7th SQL Chapter06.pptx
PPT
Sql server building a database ppt 12
PDF
Lecture05sql 110406195130-phpapp02
PPT
Chapter06.ppt
PDF
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
PPTX
Relational Database Management System
PPTX
PDF
dbms final.pdf
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
PPTX
Advance Sqlite3
PPT
D B M S Animate
PPTX
fundamentals-of-database.pptx hehehehehe
PPTX
Chapter 1 introduction to sql server
PPTX
Relational Database Design
PPTX
SQL-queries-for-Data-Analysts-Updated.pptx
PPT
Using ddl statements to create and manage tables
PPTX
Database Basics
T-SQL Overview
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
Dbms and sqlpptx
structured query language elmarsi and navathe edition 7th SQL Chapter06.pptx
Sql server building a database ppt 12
Lecture05sql 110406195130-phpapp02
Chapter06.ppt
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
Relational Database Management System
dbms final.pdf
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Advance Sqlite3
D B M S Animate
fundamentals-of-database.pptx hehehehehe
Chapter 1 introduction to sql server
Relational Database Design
SQL-queries-for-Data-Analysts-Updated.pptx
Using ddl statements to create and manage tables
Database Basics
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
PDF
Top 5 Trending Business Intelligence Tools | Edureka
PDF
Tableau Tutorial for Data Science | Edureka
PDF
Python Programming Tutorial | Edureka
PDF
Top 5 PMP Certifications | Edureka
PDF
Top Maven Interview Questions in 2020 | Edureka
PDF
Linux Mint Tutorial | Edureka
PDF
How to Deploy Java Web App in AWS| Edureka
PDF
Importance of Digital Marketing | Edureka
PDF
RPA in 2020 | Edureka
PDF
Email Notifications in Jenkins | Edureka
PDF
EA Algorithm in Machine Learning | Edureka
PDF
Cognitive AI Tutorial | Edureka
PDF
AWS Cloud Practitioner Tutorial | Edureka
PDF
Blue Prism Top Interview Questions | Edureka
PDF
Big Data on AWS Tutorial | Edureka
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
PDF
Kubernetes Installation on Ubuntu | Edureka
PDF
Introduction to DevOps | Edureka
What to learn during the 21 days Lockdown | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Tableau Tutorial for Data Science | Edureka
Python Programming Tutorial | Edureka
Top 5 PMP Certifications | Edureka
Top Maven Interview Questions in 2020 | Edureka
Linux Mint Tutorial | Edureka
How to Deploy Java Web App in AWS| Edureka
Importance of Digital Marketing | Edureka
RPA in 2020 | Edureka
Email Notifications in Jenkins | Edureka
EA Algorithm in Machine Learning | Edureka
Cognitive AI Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Blue Prism Top Interview Questions | Edureka
Big Data on AWS Tutorial | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Kubernetes Installation on Ubuntu | Edureka
Introduction to DevOps | Edureka

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
KodekX | Application Modernization Development
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
KodekX | Application Modernization Development
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx

PostgreSQL Tutorial for Beginners | Edureka