Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Summary

Samenvatting SQL

Document preview thumbnail
Preview 2 out of 7 pages

Samenvatting van het vak SQL voor HBO-ICT

Content preview

Samenvatting SQL


SELECT
SELECT is iets weergeven. SELECT beperkt het aantal kolommen in een resultaat.
Alles (*) selecteren: Kolommen selecteren: Rijen selecteren


SELECT * SELECT kolom1, kolom2 SELECT kolom1, kolom2,
FROM tabel FROM tabel FROM tabel
WHERE kolom1 = ‘waarde’



ORDER BY
ORDER BY sorteert het eindresultaat van je query.
Aflopend Oplopend


SELECT * SELECT *
FROM tabel FROM tabel
ORDER BY kolom DESC ORDER BY kolom ASC



INSERT
INSERT INTO bepaalt welke tabel gevuld gaat worden, dit moet precies één tabel zijn
Met VALUES geef je aan welke gegevens toegevoegd moeten worden


Voorbeeld:
Paul met docentcode VNP01 gaat SQL geven (ICT.P.SQL) aan klas ICTM1c


INSERT INTO les
VALUES (‘ICT.P.SQL’, ‘VNP01’, ‘ICTM1c’)

, Het kan zijn van het nog niet bekend is aan welke klas Paul les gaat geven, dus:
Optie 1: Optie 2:


INSERT INTO les INSERT INTO les (module, docent)
VALUES (‘ICT.P.SQL’, ‘VNP01’, NULL) VALUES (‘ICT.P.SQL’, ‘VNP01’)


Hier geef je geen waarde, dus NULL. Hier beperk je de kolommen wie je gaat
NULL = niks, geen waarde. (GEEN 0) invullen.



UPDATE
Met UPDATE geef je aan welke tabel gewijzigd gaat worden, dit moet precies één tabel zijn
Met SET geef je de nieuwe waarde aan voor een bepaalde kolom
WHERE beperkt het aantal rijen die gewijzigd moeten worden
Voorbeeld:
Paul met docentcode VNP01 gaat SQL geven (ICT.P.SQL) aan klas ICTM1h in plaats van
ICTM1c


UPDATE les
SET klas = ‘ICTM1h’
WHERE docent = ‘VNP01’




DELETE
Met DELETE FROM geef je aan in welke tabel je gegevens gaat verwijderen. Dit moet precies
één tabel zijn.
WHERE beperkt het aantal rijen die verwijderd moeten worden.
Voorbeeld:
Alle lessen van klas ICTM1h moeten worden verwijderd.


DELETE FROM les
WHERE klas = ‘ICTM1h’

Document information

Study
Uploaded on
May 25, 2016
Number of pages
7
Written in
2015/2016
Type
Summary
$4.79
Purchased by 17 students

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
PieterBrands
3.3
(23)
Sold
112
Followers
84
Items
1
Last sold
1 year ago


Reviews from verified buyers




Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions