cancel
Showing results for 
Search instead for 
Did you mean: 
Community Articles
Dive into a collaborative space where members like YOU can exchange knowledge, tips, and best practices. Join the conversation today and unlock a wealth of collective wisdom to enhance your experience and drive success.
cancel
Showing results for 
Search instead for 
Did you mean: 

Genie SQL Quest: A Genie-Powered Arcade for Learning SQL

Chiku07
New Contributor II

🧞 What if learning SQL felt like a game?

SQL is one of the most valuable skills in data and AI, but most people still learn it from static tutorials or documentation. Chatbots can answer questions, but they rarely push learners to think through a problem, make mistakes, and try again. Genie SQL Quest changes that by turning SQL practice into a game — and it uses Databricks Genie as the intelligent coach behind every challenge.

I built this project for the Databricks Community Contest — Creative Thinking track to show that Genie can be more than a conversational analytics assistant. In Genie SQL Quest, Genie becomes a real-time tutor: it gives hints when you are stuck, explains why your answer is right or wrong, and makes the learning experience feel natural and conversational. The goal is to make SQL practice feel less like a lecture and more like a guided puzzle.


What Genie SQL Quest does

Genie SQL Quest is a browser-based learning game where players solve natural-language SQL challenges presented as flashcards.

  • Curated challenge categories: Players progress through Basics, Filtering, Aggregations, Sorting / Top-N, Joins, and Date logic. Each category is designed to build a specific SQL muscle.
  • Progressive difficulty: Every category contains multiple difficulty levels. Players must solve easier cards to unlock harder ones, which keeps the pacing adaptive and rewarding.
  • Boss Rounds: Once players master a category, they face a harder Boss Round that combines multiple concepts and tests deeper understanding.
  • XP, streaks, and progress tracking: Correct answers earn XP, streaks encourage daily practice, and the progress panel shows how far the player has come across every category.
  • Interactive schema panel: Players can inspect tables, columns, primary/foreign keys, sample rows, and relationships at any time. This removes the friction of memorizing a schema and lets players focus on writing good SQL.
  • Instant feedback: Every submission is checked against a gold answer in the question bank, so players immediately know if they are correct and see the canonical query.

While the game mechanics keep players engaged, the real intelligence comes from Genie.


🧠 How Genie is at the center

Databricks Genie is not a side feature in this project — it is the core reason the app feels intelligent and conversational. The backend calls the Databricks Genie Conversational API to bring the flashcards to life.

Capability How Genie powers the experience

Hints on demandWhen a player is stuck, Genie reads the current challenge and produces a short, context-aware hint. The hint points the player toward the right SQL concept without giving away the answer.
Personalized explanationsAfter a player submits an answer, Genie explains the key idea behind the correct SQL in one friendly sentence. The explanation can be tailored to whether the player's answer was correct or incorrect.
Boss-round narrationGenie can introduce or comment on Boss Round challenges, adding a narrative layer to the hardest part of the game.
Graceful fallbackIf Genie is not configured, the app falls back to static hints and explanations stored in the question bank, so the game is never broken.

The integration is implemented through a lightweight Python client that streams responses from the Genie API via Server-Sent Events and extracts the assistant's message. This makes every Genie interaction fast, simple, and focused on the current challenge.


🏗️ Architecture

AI Vision Framework for Gap-2026-08-31-220906.png

 

The application is split into three layers:

1. React + Vite Frontend

  • Category panel for picking challenge tracks and difficulty levels.
  • Flashcard play area with the prompt, SQL input, and submission flow.
  • Hint buttons that request Genie-powered guidance.
  • Progress panel showing XP, streaks, cards solved, and category completion.
  • Schema panel showing table definitions, columns, relationships, and sample rows.

2. FastAPI Backend

  • Serves the game API endpoints: drawing cards, submitting answers, requesting hints, and resetting progress.
  • Loads the question bank and schema from JSON files.
  • Evaluates player answers against canonical SQL.
  • Orchestrates calls to Databricks Genie for hints and explanations.

3. Databricks Genie

  • Provides natural-language hints when requested.
  • Explains SQL answers based on the player's attempt and the challenge prompt.
  • Acts as the conversational AI tutor that makes the app feel alive.

Key design decisions

  • Game-first, Genie-enhanced: The question bank provides deterministic scoring so feedback is instant and fair. Genie adds the conversational layer on top without slowing down challenge.
  • No ETL pipeline needed: The dataset is a curated JSON question bank, so the project is easy to run, extend, and deploy.
  • Resilient to missing credentials: If Genie is not configured, the app automatically uses static hints and explanations so development and demos are never blocked.
  • Databricks Apps ready: The app is packaged with an app.yaml and a single-entry run.py for straightforward deployment inside Databricks.

🛠️ Tech stack

  • Frontend: React, Vite, Tailwind CSS, Lucide icons
  • Backend: FastAPI (Python)
  • AI/BI layer: Databricks Genie Conversational API
  • Optional fallback: Databricks Model Serving endpoint (databricks-dbrx-instruct)
  • Deployment: Databricks Apps

🎯 Why Genie makes this work

Genie is the difference between a static SQL quiz and an adaptive learning experience. Without Genie, the app would only show pre-written hints. With Genie, the app becomes a tutor that understands the current challenge and the player's actual answer.

The three things that make Genie essential here are:

  1. Context-aware guidance: Genie reads the exact challenge the player is looking at, so every hint is relevant and timely.
  2. Personalized feedback: Genie can react to whether the player's answer was correct or incorrect, making the explanation more useful.
  3. Conversational learning: Because Genie responds in natural language, players feel like they are learning from a coach rather than grading against an answer key.

That combination — structured, level-based challenges plus Genie's conversational intelligence — is what turns SQL practice into something players actually want to come back to.

Built for the Databricks Community Contest. Feedback, forks, and questions welcome!

Eshwari (Chiku) - Building governed AI & Agentic systems | AI Engineer at Worldlink
0 REPLIES 0