SQL For Data Science
SQL For Data Science
com
KIXVJDEPYZ
SQL Tutorial
Sharing or publishing the contents in part or full is liable for legal action.
Alias in SQL
Alias concept is used in SQL to give temporary name to the table or the column of the
table
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Joins In SQL
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
What is join in SQL?
A JOIN concept which is basically a clause used to combine rows from different tables
based on a condition
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Types of join in SQL
INNER JOIN
01
Types of join in SQL LEFT JOIN
02
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Types of join in SQL?
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
INNER JOIN
The INNER JOIN helps to select the matching records from the both tables
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
LEFT JOIN
The LEFT JOIN helps to fetch all records from the left table and the matching records
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
RIGHT JOIN
The RIGHT JOIN helps to fetch all records from the right table and the matched records
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
The FULL OUTER JOIN helps to fetch all the records from both the table whether there is
a match or not
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
SELF JOIN
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Group By
Most of the
[email protected]
KIXVJDEPYZ time group by function is used
with aggregate function like: count, MAX,
MIN etc.
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Having Clause
Having clause has an important role in SQL when we use any aggregate function we can
not use where clause and instead of that we use having clause
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Order By
order
[email protected]
By default
KIXVJDEPYZ order by sorts the data into ascending
order
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Subquery in SQL
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
How to handle two or
more queries at a
time?
Do I need to write
two separate query?
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
What is subquery?
Subquery is a SQL command which is nothing but select query that contain another
query inside
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
How many parts are there in a
subquery?
Subquery
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
How subquery executes?
[email protected]
KIXVJDEPYZ
result
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Types of subquery
inner SELECT query and then with the returning values executes
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Subquery Vs join
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Introduction to Python
[email protected]
KIXVJDEPYZ
High level Interpreted
Object oriented
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
History of Python
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Why should you learn Python?
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Installing Python
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Popular IDE for Python: Pycharm
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent.
file © Great Learning.
is meant All Rights
for personal useReserved.
byRightsUnauthorized use or distributiononly.
[email protected] prohibited.
Proprietary content. ©Great Learning. All Reserved. Unauthorized use or distribution prohibited
Sharing or publishing the contents in part or full is liable for legal action.
Popular IDE for Python: Anaconda
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Popular IDE for Python: Google colab
[email protected]
KIXVJDEPYZ
Proprietary
Thiscontent.
file © Great Learning.
is meant All Rights
for personal useReserved.
byRightsUnauthorized use or distributiononly.
[email protected] prohibited.
Proprietary content. ©Great Learning. All Reserved. Unauthorized use or distribution prohibited
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
KIXVJDEPYZ
Thank You
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by [email protected] prohibited.
Sharing or publishing the contents in part or full is liable for legal action.