1
Samenvatting RDDW (praktijk)
Hoofdstuk 1: SQL Review........................................................................................................................2
Select.................................................................................................................................................2
Joins...................................................................................................................................................4
Hoofdstuk 2: SQL Advanced...................................................................................................................5
Subqueries.........................................................................................................................................5
DML...................................................................................................................................................6
Views.................................................................................................................................................7
Common Table Expressions...............................................................................................................8
Recursive...........................................................................................................................................8
Hoofdstuk 3: Window Functions............................................................................................................9
OVER..................................................................................................................................................9
RANGE...............................................................................................................................................9
ROWS................................................................................................................................................9
, 2
Hoofdstuk 1: SQL Review
Select
Where
=, >, >=, <, <=, <>
(not) like ‘…’
o % 0, 1 of meerdere chars
o _ 1 char
o [abc] 1 van die chars
[abcde] = [a-e]
o [^abc] elk char behalve 1 van die
(not) in
o Where ID in (1,3,5) als ID 1, 3 of 5 is ist goed
is null
o where region is null
Order by
order by 1 ordert op de eerste kolom in de select
ASC (default)
DESC
Samenvatting RDDW (praktijk)
Hoofdstuk 1: SQL Review........................................................................................................................2
Select.................................................................................................................................................2
Joins...................................................................................................................................................4
Hoofdstuk 2: SQL Advanced...................................................................................................................5
Subqueries.........................................................................................................................................5
DML...................................................................................................................................................6
Views.................................................................................................................................................7
Common Table Expressions...............................................................................................................8
Recursive...........................................................................................................................................8
Hoofdstuk 3: Window Functions............................................................................................................9
OVER..................................................................................................................................................9
RANGE...............................................................................................................................................9
ROWS................................................................................................................................................9
, 2
Hoofdstuk 1: SQL Review
Select
Where
=, >, >=, <, <=, <>
(not) like ‘…’
o % 0, 1 of meerdere chars
o _ 1 char
o [abc] 1 van die chars
[abcde] = [a-e]
o [^abc] elk char behalve 1 van die
(not) in
o Where ID in (1,3,5) als ID 1, 3 of 5 is ist goed
is null
o where region is null
Order by
order by 1 ordert op de eerste kolom in de select
ASC (default)
DESC