A friend was asking for help with some data analysis. This was in PowerBI, and the source data was PII. I asked them to mask the data for me to work with but realized that’s a chore. I could mock it myself with AI.
This is part of a series of experiments with AI systems.
The Process
I started by building a table. It’s what I often do to solve problems. I could have asked the AI, but I wasn’t sure what I wanted and across 5 minutes or so I was thinking about the problem and what data was needed.
This is a subset. The original table and model had many more columns, but after thinking for a couple of minutes, I realized these would let me model the report someone wanted. At least enough to see if the requirements might be correct and the code work or not work.
CREATE TABLE MarketData ( UserID INT , ContactDate DATETIME , ContactType VARCHAR(10) , ContactDesc VARCHAR(30) ) GO
Once I had the code, I jumped over to Claude to give this a try. You can see the prompt below, but it was this: I need sample data for this schema. Duplicate some customerIDs across various dates, and duplicate contacttype for each customer (from 1 to 5), but randomly mix these in across dates. Not every customer needs every contact type. Make this for 10 customers across two years
I could then move on to another task, since I was getting going in the am and answering emails around this task. As it generated, I realized this wasn’t quite what I needed. So I addd this prompt.
I got a bunch of data.
This wasn’t perfect, and I actually went back and asked for more users with only a “1” and got the data altered.
I could have done this, but I’ve also found myself sometimes spending as much time mocking an environment as I did writing a query to solve a problem. I can use this to answer questions on SQL Server Central and even quickly strip code out of poorly asked questions.
It’s amazing. Don’t be afraid of AI. Give it a try. Keep trying. If it fails after a few prompts, just do the work you’re do, but go back and try again later.
I’ve got a video walkthrough of this below.