AI solution design · Databases and data

Ask your database

Managers ask a question in plain English and get a table from the SQL Server database, with the query and an explanation shown.

Talk about something like this

The situation

Managers wait for IT or an analyst every time they want a figure that is not on an existing report. "How many orders over £5,000 shipped late in September, by customer?" is a ten-minute question for someone who knows the schema and a two-day wait for everyone else.

How it works

Step by step

  1. 1

    Describe the data properly

    Not the raw tables. A small set of views with business names, descriptions and a few example questions each. This step does most of the work.

  2. 2

    Turn the question into SQL

    The model is given the question and only those view descriptions, and writes a query against them.

  3. 3

    Check before running

    The query is validated: only approved views, SELECT statements only, a row limit and a timeout. Anything else is rejected.

  4. 4

    Run it as the person asking

    The query runs through a read-only login with row-level security, so people only see the rows they are entitled to.

  5. 5

    Show the working

    The answer is a table, with the query and a plain-English description of how it was worked out. Questions that fail are reviewed and become new examples.

What it is built from

SQL Server
The existing database, exposed through governed views and a read-only login
Azure OpenAI
Writes the query and describes it
.NET API
Validates the SQL, applies limits, runs it and logs it
Angular or Teams front end
The question box and results
Power BI (optional)
Lets users pin a useful answer to a dashboard

Safeguards

  • Read-only: the model never has a login that can change data
  • Allow-list of views, with sensitive columns left out unless the user's role permits them
  • Row and time limits so a careless question cannot slow the database
  • Every question, query and result count is logged

What you end up with

  • A question box for managers, on the web or in Teams
  • A documented set of business views over your data
  • A query log, and a review list of questions that failed
  • Fewer ad hoc report requests reaching IT

Where to start

Pick one area, such as sales orders, and spend the first stage building the views and example questions. The AI part is quick once the data is described well.

  • SQL Server
  • Azure OpenAI
  • .NET
  • Angular
  • Power BI

Ready to talk?

Whether it is an AI idea, a project, extra people or a course, tell us what you are after and we will tell you honestly how we could help.

Discuss Your Project