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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Joins In SQL
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Types of join in SQL?
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
The FULL OUTER JOIN helps to fetch all the records from both the table whether there is
a match or not
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
SELF JOIN
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Group By
Most of the
weslian1223@gmail.com
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 weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Order By
order
weslian1223@gmail.com
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 weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Subquery in SQL
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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?
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
How many parts are there in a
subquery?
Subquery
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
How subquery executes?
weslian1223@gmail.com
KIXVJDEPYZ
result
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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 weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
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.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
Introduction to Python
weslian1223@gmail.com
KIXVJDEPYZ
High level Interpreted
Object oriented
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com 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 weslian1223@gmail.com 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 weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Installing Python
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Popular IDE for Python: Pycharm
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent.
file © Great Learning.
is meant All Rights
for personal useReserved.
byRightsUnauthorized use or distributiononly.
weslian1223@gmail.com 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
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.
Popular IDE for Python: Google colab
weslian1223@gmail.com
KIXVJDEPYZ
Proprietary
Thiscontent.
file © Great Learning.
is meant All Rights
for personal useReserved.
byRightsUnauthorized use or distributiononly.
weslian1223@gmail.com 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.
weslian1223@gmail.com
KIXVJDEPYZ
Sharing or publishing the contents in part or full is liable for legal action.
weslian1223@gmail.com
KIXVJDEPYZ
Thank You
Proprietary
Thiscontent. © Great Learning.
file is meant All Rights
for personal useReserved. Unauthorized use or distributiononly.
by weslian1223@gmail.com prohibited.
Sharing or publishing the contents in part or full is liable for legal action.