YouTube Link: https://youtu.be/-VO7YjQeG6Y
** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **
This Edureka PPT on PostgreSQL Tutorial For Beginners (blog: http://bit.ly/33GN7jQ) will help you learn PostgreSQL in depth. You will also learn how to install PostgreSQL on windows. The following topics will be covered in this session:
What is DBMS
What is SQL?
What is PostgreSQL?
Features of PostgreSQL
Install PostgreSQL
SQL Command Categories
DDL Commands
ER Diagram
Entity & Attributes
Keys in Database
Constraints in Database
Normalization
DML Commands
Operators
Nested Queries
Set Operations
Special Operators
Aggregate Functions
Limit, Offset & Fetch
Joins
Views
Procedures
Triggers
DCL Commands
TCL Commands
Export/ Import Data
UUID Datatype
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
6. 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
8. 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
13. .
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
18. Composite vs Simple
Single vs Multivalued
Stored vs Derived
Complex Attributes
ENTITY &
ATTRIBUTES
www.edureka.co
19. 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
20. 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
21. 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
22. 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
26. 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
28. 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
29. 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
30. 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
31. 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
32. 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
33. 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
38. 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
40. 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
46. JOINS in SQL are commands which are used to combine rows from two or more tables, based on a related column
between those tables. They are predominantly used when a user is trying to extract data from tables which have
one-to-many or many-to-many relationships between them.
What are Joins?
www.edureka.co