Postgres is alive

This commit is contained in:
Stanislaw
2022-03-11 21:16:45 +01:00
parent 5d5efa884d
commit f2371974cd
7 changed files with 158 additions and 97 deletions

4
queries/badge_id.sql Normal file
View File

@@ -0,0 +1,4 @@
SELECT badges.badge_id + 1 AS new_id
FROM badges
ORDER BY badge_id
DESC LIMIT 1

5
queries/user_badges.sql Normal file
View File

@@ -0,0 +1,5 @@
SELECT badges.badge_id
FROM users
JOIN given_badges ON given_badges.user_id = users.user_id
JOIN badges ON given_badges.badge_id = badges.badge_id
WHERE users.user_id = 'JEBAĆ'