Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. postgres=# SELECT imie, nazwisko, autorzy_290894.adres FROM autorzy_290894 INNER
  2. JOIN wydawnictwa_290894 ON autorzy_290894.adres = wydawnictwa_290894.adres;
  3.  
  4. postgres=# SELECT tytID, tytul, nazwa, wydawnictwa_290894.wydID FROM tytuly_2908
  5. 94 INNER JOIN wydawnictwa_290894 ON tytuly_290894.wydID = wydawnictwa_290894.wyd
  6. ID;
  7.  
  8. postgres=# SELECT imie, nazwisko, COUNT(tytul_autor_290894.tytID) FROM autorzy_2
  9. 90894 INNER JOIN tytul_autor_290894 ON autorzy_290894.auID = tytul_autor_290894.
  10. auID GROUP BY imie, nazwisko;
  11.  
  12. postgres=# SELECT tytul, cena*sprzedanych AS dochod, tytul_autor_290894.zaliczka
  13. FROM tytuly_290894 INNER JOIN tytul_autor_290894 ON tytuly_290894.tytID = tytul
  14. _autor_290894.tytID WHERE cena*sprzedanych > 10*zaliczka;
  15.  
  16. postgres=# SELECT tytul, COUNT(tytul_autor_290894.auID) FROM tytuly_290894 RIGHT
  17. JOIN tytul_autor_290894 ON tytuly_290894.tytID = tytul_autor_290894.tytID GROUP
  18. BY tytul HAVING COUNT(auID) > 1;
  19.  
  20. postgres=# SELECT imie, nazwisko FROM autorzy_290894 LEFT OUTER JOIN tytul_autor
  21. _290894 ON autorzy_290894.auID = tytul_autor_290894.auID WHERE tytul_autor_29089
  22. 4.tytID IS NULL;
  23.  
  24. postgres=# SELECT imie, nazwisko, tytuly_290894.tytul FROM autorzy_290894 LEFT O
  25. UTER JOIN tytul_autor_290894 ON autorzy_290894.auID = tytul_autor_290894.auID IN
  26. NER JOIN tytuly_290894 ON tytul_autor_290894.tytID = tytuly_290894.tytID;
  27.  
  28. postgres=# SELECT imie, nazwisko, tytuly_290894.tytul, wydawnictwa_290894.nazwa
  29. FROM autorzy_290894 LEFT OUTER JOIN tytul_autor_290894 ON autorzy_290894.auID =
  30. tytul_autor_290894.auID INNER JOIN tytuly_290894 ON tytul_autor_290894.tytID = t
  31. ytuly_290894.tytID INNER JOIN wydawnictwa_290894 ON tytuly_290894.wydID = wydawn
  32. ictwa_290894.wydID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement