SQL Basics Handwritten
SQL Basics Handwritten
Page
BASIESOF SOL DE
Basics dot
A Colobase most Ofen Oontains one O
m r e a b leg. ach able identiey name
(e Customer, stUden+) b
SQL Cte8tademen
SyniaxK C uloO
SELECT Columnf, Colum)2,
FRom table-name
wHERE Condition
Date
Page
Comment
39L Comment3 ae usedtoGdd
Dote +o oUT CO0de
examplc a
This s a comment.
Oule),m90
LoGical OfeTaioxS t . / 7
AnOD opeato
The AnD operador disploys aecord
Patluthe Gonditions emeted by AnD
OeTRUE'O ron 5U
AND 64ntox:
OR operador
n e oP Operadon disploy a ecoTd 1any
ortne coldition 8eprated by OR S TRuE
OR 84ntax
nO7 Opesatox .
3
S4ntay
SELECT columnf, Column 2..
PRom Hable-name
WHERE emdiry!, NOT Con diton
example
d
Syntax
SeLecT column-nameS)
Ro able-ngme
whERE Colum-name w
(volve',^Nalue2). . .
U-3dot
Date
Page
6undax:
6ELECT Column-ngmes)
FRoM able-name
wHERE Columo-name BETwEeN Vave Anp
Valve2
6 LTKE Opeado
SOL JOTNS
brou)i
he SoLDJoin calusse Hake TECOsd S
Foom twomOd more tables in a databasSe
and combines togtnes.
TG 26r n
Arnsti Standod S0L define S TyP of Joins
inne3 Joìn
2ef+ outes Join
3 ignOUtennJoin
Pufutl oute Join
SC00SS Jointn Totnr
i n n e s Join
table +able 2
=inne Join
2) LETT JOin
Sytax
6ELECT Columnname (e)
FRom table U
LEETJOIN ahle 2
ON TABLE1 Column-name 4able2. »lumo
name
.
able able
etJain 3/12
3RIGH1 JOIN a.
table Hobie-20
Risht Join
8imax
name;
2 FULL JOTN
oble Sable
Pull Join
CUmoUS- PooJammes.
6untaX.
column-namc(s)
SELECT
PRoM able
PULL OUTER JonN table2
onN tebel column-namc +able2 column-i
D
name
wHERE Condion;