100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Handige SQL Samenvatting / cheatsheet

Rating
5.0
(1)
Sold
-
Pages
5
Uploaded on
26-02-2021
Written in
2020/2021

Handige SQL Samenvatting / cheatsheet

Institution
Module









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
February 26, 2021
Number of pages
5
Written in
2020/2021
Type
Summary

Subjects

Content preview

Hoofdstuk 8: select enzo




 Select: welke kolommen (bv klantID)
o Distinct: alle rijen uniek
o Aliassen: bv tblKlant as klanten
 From: welke tabel (bv tblKlant)
 Where: voorwaarden (bv klantID = 54)
o (not) like  bv klantNaam like ‘%anton%’
o Or, and, not  bv klantNaam like ‘%anton%’ and klantID = 5
o (not) between x and y  bv productnummer between 5 and 10
o (not) in  bv productnummer in (1,3,5)  1, 3 of 5
o Is (not) null  bv region is not null
 Group by: groeperen van gegevens
o Having: groepje waar x=2
 Order by: sorteren
o Bv porductname desc



Functies

 Now()  yyyy-mm-dd hh:mm:ss
 Round, floor, ceiling, …

 Case
o When price is null then ‘yeet’
o When price <10 then ‘blabla’
o …
 End

, Hoofdstuk 9: group by en joins
Functies

 Sum(…)
 Avg (…)
 Min(…)
 max(…)
 count(…)



group by (eerst rijen filteren dan in de groep)

 bv select categorie, count(productID) from producten where stock<5 group by categorie
 per categorie het aantal producten waar de stock<5



having (eerst groep maken en dan de groepen filteren)

 bv select categorie, count(productID) from producten group by categorie having
count(productID) >10
 per categorie die >10 producten bevat het aantal producten



joins

 zie samenvatting
 inner
 left / right / full outer



union

 select name, city, postcode from employees
union
select companyname, city, postcode from customers
£4.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Reviews from verified buyers

Showing all reviews
1 year ago

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
easyIT Hogeschool Gent
Follow You need to be logged in order to follow users or courses
Sold
77
Member since
4 year
Number of followers
30
Documents
23
Last sold
5 days ago

4.0

5 reviews

5
2
4
1
3
2
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions