My new book is out. It holds the 100 AI interview questions data interviewers ask now, with answers short enough to say out loud. Six of those questions are in this post, free. Find out where you stand before you buy anything.
A query that ran perfectly and was 28 times wrong
While writing chapter 6, I asked an assistant for sales by territory. It wrote a clean query. It joined the header table to the detail table and summed the header total.
On AdventureWorks2025, the Northwest territory has 2,061 orders. The query reported 7,775. Its 2024 total went from 6,763,100.58 to 190,392,567.96.
About 28 times too big. No error, no warning, no red text. A number that would have gone straight into a slide.
That’s the job now. The code compiles, the query runs, the answer is confident, and somebody has to be the person who checks.
Answer these six out loud. Thirty seconds each
These are real questions from the book. Say each answer aloud, the way you would in the room. Out loud matters, because thinking “yeah, I know that” is not the same skill.
- Is a token the same as a word, and why does AI struggle to count letters?
- Why does AI invent table and column names?
- Why can AI-written code be correct and still slow?
- Does masking data in the database protect what AI sees?
- How can your own documents carry a prompt injection?
- What is LLM-as-a-judge, and when can you trust it?
Number one is a Starter question. Number six gets asked of senior candidates. If all six came out clean and quick, you don’t need my book.
If two of them made you pause, that pause is what an interviewer hears. The book is 100 of these, sorted so you can find your level and see the one above it.
What an answer looks like
Every answer has the same four parts. Here’s question 21, trimmed a little.
21. What is a hallucination? Starter
The Short Answer. A hallucination is an answer that sounds right and contains something the model made up. The model invents a fact, a function or a column name, and states it as plainly as a true one. It happens because the model predicts likely text, and likely isn’t the same as true.
Why It Matters. In data work, hallucinations look like real syntax. A made-up function or a column that doesn’t exist reads fine until the query fails. The worse case is a query that runs and returns believable wrong numbers.
What the Interviewer Is Listening For. That you explain the cause, not only the symptom.
Watch Out. Calling every wrong answer a hallucination. A model repeating a real but outdated fact is a different problem with a different fix.
Read that last part again. Knowing the word gets you a nod. Knowing where the word stops applying gets you the job.

The Watch Out lines are the best part
Anyone can define a term. The money is in knowing where the neat answer breaks. Three from the book, whole:
On invented column names. Don’t blame the model alone. If your columns are named col1 and flag2, a new team member would guess wrong too.
On masked data. Dynamic masking isn’t encryption. Clever queries against a masked column can sometimes reveal the real values. Treat it as one layer of several.
On agents. Keep agents that read outside text away from tools that send, write or delete. An agent that reads the internet shouldn’t also hold the keys to production.
Say any one of those in an interview and the tone of the conversation changes. That’s what I was aiming at on every page.
The ten chapters
Ten chapters, ten questions each, numbered 1 to 100. Every question is marked Starter, Working or Senior.
- The Four Circles. AI basics, and what the words mean.
- The Window. Tokens, context and prompts.
- Sure and Wrong. When AI gets it wrong, and how to catch it.
- The Map of Meaning. Embeddings and vectors.
- The Open Book. Search, RAG and fine-tuning.
- The Fast Junior. AI writing code and queries.
- Keys to the Building. Agents, tools and security.
- What Leaves the Room. Privacy and sensitive data.
- Garbage In, Confidence Out. Data quality and prep.
- The Long Game. AI at work and your career.
Chapter 6 ends with the line I’d put on a code review if that were allowed. AI writes the first draft. You sign the last one.

Take one exercise with you, free
Every chapter has a five-minute Try It that works in any AI assistant. Here’s the one from chapter 6. Do it today.
Paste this into your assistant:
Write a SQL Server query for total sales and order count by territory for 2024. Use Sales.SalesOrderHeader and include product detail from Sales.SalesOrderDetail.
Then check the reply. Did it join the detail table and still count orders from the header? If so, every order now counts once per line item.
Ask it: does this join repeat any rows? Watch whether it fixes the mistake or defends it. That reaction tells you more than the first answer did.
One fix to distrust, by the way. SUM(DISTINCT TotalDue) looks clever and is wrong. Two orders can have the same total, and DISTINCT throws one away.
Then there’s the mock interview
The back of the book is a thirty-minute mock interview with scoring. Sit with a colleague, or read it aloud to yourself and keep time.
The score matters less than the fumbles. Each one points at a chapter to reread on the way to work.
What this book is not
It isn’t a SQL book. There’s SQL in it, because I can’t help myself, but the questions work for any database.
It doesn’t name a single AI product. Tools change every quarter and these answers shouldn’t. When a chapter says “your AI assistant”, it means whichever one your company pays for.
And it won’t get you a job you can’t do. It gives you words for what you already know, which is a smaller and more honest promise.
Which one should you buy
Get the paperback if you have an interview coming. 148 pages, and you’ll want to write in the margins and fold corners.
Get the Kindle if you want it searchable on your phone in the ten minutes before the call. It’s free to read if you have Kindle Unlimited.
Get the audiobook if you commute. Three hours and twenty-eight minutes, which is about a week of driving. It uses Amazon’s virtual voice, so sample it first and see whether that suits you.
Why I wrote it
I published my first SQL Server interview questions series in 2007. People still write to me about it, nineteen years on.
That series worked because it respected the reader’s time. Short answers, no padding, and the honest bit at the end of each one. I’ve done the same thing here for the subject every data interview has now adopted.
If an answer in this book doesn’t survive a real interview, write to me and tell me which one. That’s how the 2007 series got better, and it took years.
I also write about the human side of all this in AI: Nobody’s in There. But we’re still in here. All thirty essays are free to read online, and the paperback is on Amazon.
An interview answer is not a definition, it is the shortest true thing you can say out loud.
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.

