daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE DATABASE Wypadki
  2. USE Wypadki
  3.  
  4.  
  5. --1
  6. SELECT Count(marka) as 'Liczba w marce', marka
  7. FROM auta
  8. GROUP BY marka
  9. Having Count(marka) > 20
  10.  
  11. --2
  12. SELECT COUNT(typ_miejsc) as 'Liczba osób', typ_miejsc
  13. FROM osoby
  14. GROUP BY typ_miejsc
  15.  
  16. --3
  17. SELECT TOP 3 SUM(odszkodowanie) as 'Kwota odszkodowań', nr_rej
  18. FROM wypadki
  19. GROUP BY nr_rej
  20. ORDER BY 'Kwota odszkodowań' DESC
  21.  
  22. --4
  23. SELECT COUNT(nr_rej) as Liczba_samochodów
  24. FROM auta
  25. WHERE rok_prod BETWEEN 2000 AND 2005
  26.  
  27. --5
  28. SELECT SUM(odszkodowanie) as 'Suma w 2006'
  29. FROM wypadki
  30. WHERE data Like '2006%'
  31.  
  32. --6
  33. SELECT TOP 1 COUNT(rok_prod) as Liczba, rok_prod
  34. FROM auta
  35. GROUP BY rok_prod
  36. ORDER BY 'Liczba' ASC
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top