From 328d0cd912dfa5dbda53a09ecdfeaeb93504b560 Mon Sep 17 00:00:00 2001
From: Daniel Hader <dhader96@gmail.com>
Date: Wed, 3 Jun 2026 22:32:09 -0500
Subject: submission logic and fetching submissions

---
 src/database/sql/fetch_display_submissions.sql | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 src/database/sql/fetch_display_submissions.sql

(limited to 'src/database/sql/fetch_display_submissions.sql')

diff --git a/src/database/sql/fetch_display_submissions.sql b/src/database/sql/fetch_display_submissions.sql
new file mode 100644
index 0000000..5e836b3
--- /dev/null
+++ b/src/database/sql/fetch_display_submissions.sql
@@ -0,0 +1,10 @@
+SELECT
+submission.id AS id,
+user.username AS username,
+submission.language AS language,
+submission.details AS details,
+submission.code AS code
+FROM submission JOIN user
+ON user.id = submission.user_id
+WHERE submission.problem_id = ?1
+ORDER BY length(submission.code);
-- 
cgit v1.2.3

