Deploy SQLtutor using Docker.
- Create
env
file:
POSTGRES_PASSWORD=20sqltutor21
SQLTUTOR_DATABASE=sqltutor
SQLTUTOR_WWW_USER=sqlquiz
SQLTUTOR_PASSWORD=sqlkrok
SQLTUTOR_WWW_EXEC=sqlexec
SQLTUTOR_PASSEXEC=sqlkrok
- Deyploy by
docker compose
:
docker compose up
Stop services:
docker compose down
Remove DB volume:
docker volume rm sqltutor-docker_db_data
Access DB:
docker compose exec db psql -U postgres sqltutor
Show questions and answers per session:
SELECT q.question,s.answer,s.correct
FROM sqltutor.sessions_questions AS s
JOIN sqltutor.questions AS q
USING (problem_id)
WHERE session_id = <session_id>;