As data practitioners, we’re always looking for ways to make working with data more accessible and faster. Lately, AI has been opening up exciting new possibilities. What if you could use AI to query your data warehouse quickly, even if you’re not a SQL expert? You can do it with a bit of help from a friendly AI assistant named Claude.
Here’s a simple technique to try:
Step 1: Export your data model
Start by exporting your data warehouse schema or ERD to a PDF. Most data modeling tools have an export option. This PDF will help Claude understand your data’s structure.
Step 2: Create a project in Claude and add your data model
In Claude, create a new project. Upload your data model PDF to the project. This will be Claude’s reference for understanding your tables and columns.
Step 3: Add supporting documentation
If you have a business glossary, data dictionary, or other documents that explain what your data means, add those to the project, too. The more context Claude has, the better it can interpret your data.
Step 4: Ask Claude to write a query
Now for the fun part! In plain English, ask Claude to write a query to pull the needed data. For example: “Can you write a query to get the total sales by product category for the last 30 days?” Claude will generate the appropriate SQL based on your request and data model.
That’s it! In just a few minutes, you’ve got a working query without having to rack your brain to remember SQL syntax.
Considerations and Caveats
This AI-assisted query approach has a lot of potential, but it’s not a complete replacement for data experts. Here are a few things to keep in mind:
– It doesn’t fully automate the process. You still need to provide the data model and ask for what you want.
– Claude has a lot of general knowledge, but it may not grasp all your business-specific context and nuance.
– Complex queries may need a few iterations to get right.
– It’s always wise to validate query results, especially when trying a new technique.
Putting AI to Work
As powerful as this technique is, it’s just a taste of what AI can do for data work. I encourage you to keep experimenting. Try feeding Claude sample data and seeing if it can derive insights. See if it can help outline a data strategy or suggest metrics worth tracking.
The future of data and AI is wide open and full of possibilities. We’re entering an exciting time when we can achieve more with data while spending less time in the weeds of code and queries. This simple “query-by-AI” trick is a great example of how we can start using AI for our purposes today.
I hope this inspires you to try it out and see what other doors AI can open. Stay curious and keep exploring!