Skip to content
All projects
Data AnalyticsGenerative AIDemo not connected

AI-Assisted SQL Analysis

A structured workflow for generating SQL with ChatGPT, then validating every query against business logic in MySQL.

Problem

LLMs can write SQL quickly, but plausible-looking queries are often subtly wrong for the business question being asked.

Approach

Designed a prompt framework to generate queries from natural-language business questions, ran them in MySQL, compared outputs against expected logic, and iteratively refined prompts where results were inaccurate.

Key features

  • 01Reusable prompt structure for business-question → SQL generation
  • 02Validation of multi-level grouping, nested aggregations and conditional filters
  • 03Iterative prompt refinement when outputs diverged from expected logic
  • 04A reproducible, AI-augmented analysis workflow

Demo

A working deployment hasn't been connected for this project yet. It will appear here once a hosted link is added.

Next project

Netflix Data Analysis