Advertisement
ksieradzinski

Untitled

Feb 26th, 2025
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.48 KB | None | 0 0
  1. -- Pobieram wszystkie dane z tabeli scores
  2. SELECT * FROM scores;
  3.  
  4. -- Ograniczam wyswietlanie tylko do okreslonych kolumn
  5. SELECT firstName, lastName, score FROM scores;
  6.  
  7. -- Tylko wyniki powyzej 90 procent
  8. SELECT firstName, lastName, score, subject FROM scores WHERE score >= 90;
  9.  
  10. --
  11. SELECT
  12.   firstName AS first_name,
  13.   lastName AS last_name,
  14.   MAX(score) AS max_score,
  15.   MIN(score) AS min_score,
  16.   AVG(score) AS avg_score
  17. FROM
  18.   scores
  19. GROUP BY firstName, lastName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement