From e33bfff4db95586a3140b5e71a7d3dba2c72f694 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 6 Sep 2025 00:32:03 +0900
Subject: feat(backend): add admin page for problems

---
 backend/query.sql | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

(limited to 'backend/query.sql')

diff --git a/backend/query.sql b/backend/query.sql
index 4a06ee7..9f272b1 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -194,3 +194,26 @@ SELECT submission_id FROM submissions;
 
 -- name: ListGameStateIDs :many
 SELECT game_id, user_id FROM game_states;
+
+-- name: ListProblems :many
+SELECT * FROM problems
+ORDER BY problem_id;
+
+-- name: GetProblemByID :one
+SELECT * FROM problems
+WHERE problem_id = $1
+LIMIT 1;
+
+-- name: CreateProblem :one
+INSERT INTO problems (title, description, language, sample_code)
+VALUES ($1, $2, $3, $4)
+RETURNING problem_id;
+
+-- name: UpdateProblem :exec
+UPDATE problems
+SET
+    title = $2,
+    description = $3,
+    language = $4,
+    sample_code = $5
+WHERE problem_id = $1;
-- 
cgit v1.3.1

