Commit 82072b34 by Patryk Czarnik

Poprawki w SQL

parent 29574c42
...@@ -644,6 +644,8 @@ SELECT avg(salary), stddev(salary), variance(salary) FROM employees; ...@@ -644,6 +644,8 @@ SELECT avg(salary), stddev(salary), variance(salary) FROM employees;
SELECT every(length(street_address) > length(city)) FROM locations; SELECT every(length(street_address) > length(city)) FROM locations;
SELECT * FROM locations WHERE length(street_address) <= length(city);
SELECT string_agg(city, '; ') FROM locations; SELECT string_agg(city, '; ') FROM locations;
SELECT json_agg(city) FROM locations; SELECT json_agg(city) FROM locations;
...@@ -901,8 +903,7 @@ SELECT * FROM locations; ...@@ -901,8 +903,7 @@ SELECT * FROM locations;
-- z odpowiadającymi im rekordami z innej tabeli. -- z odpowiadającymi im rekordami z innej tabeli.
-- Można we FROM podać więcej niż jedną tabelę: -- Można we FROM podać więcej niż jedną tabelę:
SELECT * SELECT * FROM employees, jobs;
FROM employees, jobs;
-- W takiej sytuacji baza danych zwraca wszystkie możliwe kombinacje rekordów z jednej tabeli z rekordami z drugiej tabeli -- W takiej sytuacji baza danych zwraca wszystkie możliwe kombinacje rekordów z jednej tabeli z rekordami z drugiej tabeli
-- To jest tzw. "iloczyn kartezjański". -- To jest tzw. "iloczyn kartezjański".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment