Guest User

Untitled

a guest
Sep 16th, 2019
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT COUNT(waluta) AS ilosc, waluta FROM pozyczka GROUP BY waluta;
  2. SELECT SUM(kwota) AS ilosc, waluta FROM pozyczka GROUP BY waluta;
  3. SELECT MIN(kwota) AS mini, MAX(kwota) AS maxi, waluta FROM pozyczka GROUP BY waluta;
  4. SELECT AVG(kwota) AS ilosc, waluta FROM pozyczka GROUP BY waluta;
  5. SELECT count(id) AS data FROM pozyczka WHERE termin_splaty < "2016-05-01";
  6. SELECT id, klient_id AS Klient FROM pozyczka WHERE kwota = splacono;
  7. SELECT AVG(kwota), waluta FROM pozyczka WHERE termin_splaty < "2016-01-01" GROUP BY waluta;
  8. SELECT COUNT(DISTINCT(waluta)) AS ile FROM pozyczka;
  9. SELECT COUNT(id), waluta FROM pozyczka WHERE kwota > 6000 GROUP BY waluta;
  10. SELECT count(id) AS ile, oprocentowanie from pozyczka GROUP BY oprocentowanie;
  11. SELECT COUNT(*) AS ILEP, klient_id FROM pozyczka GROUP BY klient_id;
  12. SELECT COUNT(*), waluta, oprocentowanie FROM pozyczka GROUP BY oprocentowanie, waluta;
  13. SELECT * FROM pozyczka WHERE WALUTA = "PLN" AND kwota > 5000 OR waluta = "GBP" AND kwota < 4000;
  14. SELECT COUNT(waluta), waluta FROM pozyczka WHERE waluta = "GBP" OR waluta = "PLN" GROUP BY waluta;
  15. SELECT count(waluta), waluta FROM pozyczka WHERE kwota > splacono AND waluta = "EUR" OR waluta = "PLN" GROUP BY waluta;
  16. SELECT AVG(kwota) as SREDNIAPOZYCZEK FROM pozyczka WHERE termin_splaty < "2016-01-01" AND termin_splaty > "2015-01-01";
  17. SELECT * FROM pozyczka ORDER BY kwota ASC, waluta DESC;
  18. SELECT * FROM pozyczka ORDER BY kwota ASC LIMIT 5 OFFSET 14;
  19. SELECT * FROM pozyczka INNER JOIN klient ON klient.id = pozyczka.klient_id WHERE waluta = "GBP";
  20. SELECT max(kwota), waluta FROM pozyczka GROUP BY waluta;
  21. SELECT COUNT(*), monthname(termin_splaty) FROM pozyczka GROUP BY monthname(termin_splaty);
  22. SELECT * FROM pozyczka INNER JOIN klient ON klient.id = pozyczka.klient_id WHERE klient.nazwisko = "Dudek";
  23. SELECT imie, nazwisko FROM klient WHERE (YEAR(NOW()) - YEAR(od_kiedy_konto)) > 5
  24. SELECT imie, nazwisko FROM klient WHERE DATEDIFF(now(), od_kiedy_konto) > 1825;
  25. SELECT klient.imie, klient.nazwisko, waluta, COUNT(*) FROM konto INNER JOIN klient ON konto.klient_id = klient.id GROUP BY nazwisko, waluta;
  26.  
  27. //25 zadan
RAW Paste Data