Skip to content

moshesham/Practic_Questions_Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SQL Practice Questions Platform

A comprehensive platform for practicing SQL queries with automated validation, user progress tracking, and AI-powered assistance.

πŸš€ Overview

This platform helps users learn and practice SQL at multiple difficulty levels with intelligent feedback, hints, and explanations powered by local Llama AI models.

✨ Features

Current Features

  • βœ… Automated SQL query validation
  • βœ… User progress tracking
  • βœ… Flexible question configuration
  • βœ… Logging and error tracking
  • βœ… YAML-based configuration

Roadmap Features

  • πŸ”„ Multi-Level Difficulty System (Beginner β†’ Expert)
  • πŸ”„ Local Llama AI Integration for intelligent hints
  • πŸ”„ RESTful API for platform integration
  • πŸ”„ Expanded Question Library (40+ questions)
  • πŸ”„ Advanced SQL Topics (Window Functions, CTEs, Recursive Queries)

πŸ“‹ Quick Start

Prerequisites

  • Python 3.10+
  • SQLite (included with Python)
  • (Optional) Docker for containerized usage
  • (Optional) Ollama for AI features

Installation

# Clone the repository
git clone https://github.com/your-org/Practic_Questions_Platform.git
cd Practic_Questions_Platform

# Install dependencies
pip install -r requirements.txt

# Generate test data (uses infra/config/config.yml)
python -m infra.DataGenerator

# Override at runtime if needed
python -m infra.DataGenerator --num-records 2000 --seed 123 --table attempts_run

# Solve a question
python SQl_answer.py sql_basic_select

🐳 Docker Usage

The platform can be run in Docker containers for easy setup and consistent environments.

Quick Start with Docker

# Build and run the platform
docker compose up --build

# Or run with Docker directly
docker build -t sql-practice-platform .
docker run --rm sql-practice-platform

Docker Commands

# Generate test data only
docker compose run --rm data-generator

# Run interactively (for development)
docker compose run --rm interactive

# Run with persistent data
docker compose up -d

# View logs
docker compose logs -f

# Clean up
docker compose down -v

Volume Mounts

The Docker setup supports persistent data through volume mounts:

  • ./output - Generated databases and CSV files
  • ./users - User progress tracking
  • ./logs - Application logs
  • ./Questions - Custom practice questions

πŸ“ Project Structure

Practic_Questions_Platform/
β”‚
β”œβ”€β”€ Questions/                    # SQL practice questions
β”‚   └── sql_basic_select/        # Question folder
β”‚       β”œβ”€β”€ question             # Problem description
β”‚       β”œβ”€β”€ example_solution.sql # Reference solution
β”‚       └── Sloutions/           # Note: typo to be fixed (see TASK-011)
β”‚           └── sloution_df.csv  # Expected output
β”‚
β”œβ”€β”€ infra/                        # Core infrastructure
β”‚   β”œβ”€β”€ AnswerValidator.py       # SQL validation logic
β”‚   β”œβ”€β”€ DataGenerator.py         # Test data generation
β”‚   β”œβ”€β”€ user.py                  # User management
β”‚   β”œβ”€β”€ logging_config.py        # Logging setup
β”‚   └── config/
β”‚       β”œβ”€β”€ config.yml           # Data generation config
β”‚       └── questions_config.yml # Questions config
β”‚
β”œβ”€β”€ docs/                         # Documentation
β”‚   β”œβ”€β”€ CODING_STANDARDS.md      # Coding guidelines
β”‚   β”œβ”€β”€ AI_INTEGRATION.md        # AI setup guide
β”‚   └── DIFFICULTY_LEVELS.md     # Level specifications
β”‚
β”œβ”€β”€ .github/
β”‚   └── ISSUE_TEMPLATE/          # Issue templates for AI agents
β”‚
β”œβ”€β”€ output/                       # Generated data
β”œβ”€β”€ logs/                         # Application logs
β”œβ”€β”€ users/                        # User progress files
β”‚
β”œβ”€β”€ Dockerfile                   # Docker image definition
β”œβ”€β”€ docker-compose.yml           # Docker services orchestration
β”œβ”€β”€ .dockerignore                # Docker build exclusions
β”œβ”€β”€ PRODUCT_ROADMAP.md           # Development roadmap
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ SQl_answer.py               # Main entry point
└── README.md                    # This file

πŸ“š Documentation

Document Description
PRODUCT_ROADMAP.md Complete development roadmap with AI agent tasks
docs/CODING_STANDARDS.md Coding standards and quality guidelines
docs/AI_INTEGRATION.md Local Llama AI integration guide
docs/DIFFICULTY_LEVELS.md SQL difficulty level specifications

🎯 Difficulty Levels

Level Topics Time Limit Hints
BEGINNER SELECT, WHERE, ORDER BY, LIMIT 5 min 5
INTERMEDIATE JOINs, GROUP BY, Aggregations, Subqueries 10 min 3
ADVANCED Window Functions, CTEs 15 min 2
EXPERT Recursive CTEs, Query Optimization 20 min 1

πŸ€– AI Integration

The platform supports local Llama AI for:

  • Progressive Hints: Context-aware hints that adapt to difficulty
  • Query Explanations: Natural language explanations of SQL
  • Error Analysis: AI-powered debugging assistance

Quick AI Setup (Ollama)

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull recommended model
ollama pull llama3.2:3b

# Verify installation
curl http://localhost:11434/api/tags

See docs/AI_INTEGRATION.md for complete setup guide.

πŸ› οΈ Development

For Contributors

  1. Review PRODUCT_ROADMAP.md for available tasks
  2. Follow docs/CODING_STANDARDS.md
  3. Use provided issue templates for task tracking

For AI Agents

This repository includes structured task delegation for AI agents:

  1. Task Definitions: See PRODUCT_ROADMAP.md for detailed task specifications
  2. Issue Templates: Use .github/ISSUE_TEMPLATE/ templates for creating tasks
  3. Coding Standards: Follow guidelines in docs/CODING_STANDARDS.md
  4. Quality Requirements: 80%+ test coverage, type hints, docstrings

πŸ§ͺ Testing

# Run tests (when implemented)
pytest tests/ -v --cov=infra

# Lint code
flake8 infra/

# Type check
mypy infra/

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests following the coding standards.


For detailed development tasks and AI agent instructions, see PRODUCT_ROADMAP.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors