SQL
" whot is sQL 2
SQL (Structured Queny Language) is a programming
language desiged for managing dota in relati onal
database.SqL has a Variety oo 4anctions that
allow ds useng to read, manipulate, and chang e
data. Though sqL is commonly used by engineers
in seft ware devolopment, its also popula uilh
data analysts for afeaw reason :
"H% semantiolly eagy to understand md let.
Becauge it Can be used to access lange
amounts of data dineetly uhene tts slored,
aralysts don't have to copy data into olhen
aplicat'ons.
Compared to speread shet tools, ata
analysis done in SQL is easy to audit ond
Peplicate. or omaly etg,this means
meanS no more
looking for the aell euith he typo in the Brmula.
" SELECT* Example.
statement seleete all !he
Ihe lolouing sqLalestable:
Column.s from the
EXample - SELECT * FROM Sales;
,"select columhs uise
Example - SELECI year,
month
west.
FROM Sales
Rename Qolumns
Example SELECT cuest AS "west Region"
FRoM Sales
" LIMIT Clause
Ihe LIMIT elause is used to spect'y the number
o records to petun
Example- SELECT*
FROM Sales
LIMIT 100
WHERE Clause
The wHERE clause is used to ken reconds.
If is uged to extraet only those reconds lhat
fulf:ll a specifted eonattion.
Example- SELECT *
FROM Sales
WHERE Country " Canoda;
, " Comppison Operatong on numepical dota
The most basie any toftlter data te uting
Companison. operators. lhe easiect eway to
bndenstond
of them:
them is lo stant by loking at a ltst
Equal to
Not equal to
Ghreater than
Less than
Greaten thon or equal to =
Less than on equal tO
to
Exemple- . SELECT *
FROM Sales
WHERE City = kolkata";
SELECT *
FROM Sales
WHERE city != "kolkata" ;
SELECT *
FROM Saleg
WHERE Month >"Jonuany";
SELECT *
FROM Soles
WHERE Saleomount < 50000
" whot is sQL 2
SQL (Structured Queny Language) is a programming
language desiged for managing dota in relati onal
database.SqL has a Variety oo 4anctions that
allow ds useng to read, manipulate, and chang e
data. Though sqL is commonly used by engineers
in seft ware devolopment, its also popula uilh
data analysts for afeaw reason :
"H% semantiolly eagy to understand md let.
Becauge it Can be used to access lange
amounts of data dineetly uhene tts slored,
aralysts don't have to copy data into olhen
aplicat'ons.
Compared to speread shet tools, ata
analysis done in SQL is easy to audit ond
Peplicate. or omaly etg,this means
meanS no more
looking for the aell euith he typo in the Brmula.
" SELECT* Example.
statement seleete all !he
Ihe lolouing sqLalestable:
Column.s from the
EXample - SELECT * FROM Sales;
,"select columhs uise
Example - SELECI year,
month
west.
FROM Sales
Rename Qolumns
Example SELECT cuest AS "west Region"
FRoM Sales
" LIMIT Clause
Ihe LIMIT elause is used to spect'y the number
o records to petun
Example- SELECT*
FROM Sales
LIMIT 100
WHERE Clause
The wHERE clause is used to ken reconds.
If is uged to extraet only those reconds lhat
fulf:ll a specifted eonattion.
Example- SELECT *
FROM Sales
WHERE Country " Canoda;
, " Comppison Operatong on numepical dota
The most basie any toftlter data te uting
Companison. operators. lhe easiect eway to
bndenstond
of them:
them is lo stant by loking at a ltst
Equal to
Not equal to
Ghreater than
Less than
Greaten thon or equal to =
Less than on equal tO
to
Exemple- . SELECT *
FROM Sales
WHERE City = kolkata";
SELECT *
FROM Sales
WHERE city != "kolkata" ;
SELECT *
FROM Saleg
WHERE Month >"Jonuany";
SELECT *
FROM Soles
WHERE Saleomount < 50000