Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

What is SQL ? SQL= Structure Query Language.

This is a programing language that is used


for managing data in a relational database. A relational database is a
collection of data items with pre-defined relationships between them. These
items are organized as a set of tables with columns and rows. SQL is mainly
use for:
Store
Retrieve
Manipulate (Update/ Delete)

2
Why SQL ?
SQL is used by many companies.

3
Why SQL ?
SQL is used by many companies.

3
Why SQL ?
SQL is in high demand for Data jobs

3
Why SQL ?
SQL is in high demand for Data jobs

3
Why SQL ?
SQL is one of the most popular language for
Data work in 2022

3
SQL Aggregations
SQL aggregation is the task of collecting a set of values to return a single value.
It is done with the help of aggregate functions:
1. COUNT: get how many rows in a column
2. SUM: get the total value of a numeric column
3. MIN and MAX : get the lowers and highest values in a column respectively
4. AVG: get the average of a group of selected values

3
Subqueries
A subquery is a query nested inside another query.
Subqueries can be used in many different locations inside a query:
1. From : to perform operation in multiple stages
2. Where: to use subquery in conditional logic
3. Join : Joining multiple subqueries
4. Union: Union multiple subqueries

3
Common Table Expression (CTE)
WITH name1 AS (
SQL statement for name1
), name2 AS (
SQL statement for name2
)

SQL Statment

You might also like