Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 1 */
- select sum(verkoopprijs) as 'totaal factuurbedrag'
- from factuurregel fr join factuur f on fr.factuurnr = f.factuurnr join klant k on k.klantnr = f.klantnr
- where provincie = 'ovl'
- /* 2 */
- select count(artikelnr) as 'aantal artikelen', naam from artikel a, soort s where a.soortnr=s.soortnr group by 2 order by 1
- /* 3 */
- select p.productgroepnr, productnaam, count(naam) as 'aantal soorten' from productgroep p, soort s where p.productgroepnr=s.productgroepnr group by 2
- /* 4 */
- select naam, voorraad from soort s, artikel a where s.soortnr=a.soortnr and voorraad>100 group by naam
- /* 5 */
- select naam, kleur, case
- when alcoholperc>=40 then 'heel sterk'
- when alcoholperc>=20 and alcoholperc<40 then 'redelijk sterk'
- else 'drinkbaar'
- end as sterkte
- from soort where kleur='Kleurloos'
- /* 6a */
- update artikel set jaar=1900 where jaar is null
- /* 6b */
- delete from artikel where jaar=1900 and soortnr=1210
Add Comment
Please, Sign In to add comment