KeeJayBe

mySQL oef statistische functies

Nov 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.20 KB | None | 0 0
  1. /* 16 */
  2.     select count(*) as 'aantal planten' from planten
  3. /* 17 */
  4.     select count(*) from planten where kleurid is not null
  5. /* 18 */
  6. select count(*) from bestellingen where besteldatum is not null
  7. /* 19 */
  8. select count(*) from bestellingen where leverdatum is not null
  9. /* 20 */
  10. select count(distinct artcode) from offertes
  11. /* 21 A */
  12. select count(naam), woonplaats from leveranciers group by woonplaats
  13. /* 21 B */
  14. select avg(hoogte), sum(hoogte) /count(hoogte) from planten
  15. /* 22 */
  16. select levcode, count(artcode), levertermijn from offertes where levertermijn < 17 group by levcode having count(artcode)>=20 order by count(artcode) desc
  17. /* 23 */
  18. select bestelnr, aantal from bestellijnen group by bestelnr
  19. /* 24 */
  20. select min(offerteprijs) from offertes where artcode = 123
  21. /* 25 */
  22. select count(artcodelev) from offertes where artcodeLev = 'B111'
  23. /* 26 */
  24. select artcode, min(offerteprijs), max(offertePrijs) from offertes group by artcode
  25. /* 27 */
  26. select levertermijn, min(offerteprijs) from offertes group by levertermijn
  27. /* 28 */
  28. select naam from planten order by naam asc limit 1
  29. /* 29 */
  30. select count(*), woonplaats from leveranciers group by woonplaats having count(*)>=2 order by woonplaats
Add Comment
Please, Sign In to add comment