Prompt Library

AI Prompts to Convert Business Questions into Database Queries

Stop wrestling with complex SQL syntax. Our curated AI prompts help you instantly translate everyday business questions into precise database queries. Get the data you need, faster, and empower your team to make data-driven decisions without being a SQL expert. With ChatBoost, you can run these prompts in one click.

Add ChatBoost to ChromeSave these prompts into ChatBoost and reuse them with Alt+P.

Prompt Library (27)

27 PromptsFree

Top 10 Customers by Revenue

Find your most valuable customers based on total purchase amount over a specific period.

Act as a senior data analyst. Convert the following business question into an optimized PostgreSQL query. Provide only the SQL code. Business Question: "Who were our top 10 customers by total revenue last quarter?"...

Monthly Recurring Revenue (MRR)

Calculate the MRR from your subscriptions table for a specific month.

Act as a BI developer. Convert the following business question into an optimized T-SQL query for SQL Server. Provide only the SQL code. Business Question: "What was our Monthly Recurring Revenue (MRR) for last month?"...

New vs. Returning Customers

Compare the number of new and returning customers for the last quarter.

Act as a data analyst. Convert the following business question into an optimized MySQL query. Provide only the SQL code. Business Question: "How many new vs. returning customers did we have last quarter? A new customer is one whose first order was in that quarter."...

Product Sales by Region

Generate a query to see which products are selling best in different geographical regions.

Act as a data analyst. Convert the following business question into an optimized PostgreSQL query. Provide only the SQL code. Business Question: "What are the top 3 selling products in each sales region for the current year?"...

User Churn Rate for Last Month

Calculate the percentage of users who cancelled their subscription last month.

Act as a data scientist. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What was our customer churn rate last month? Churn is defined as active subscribers at the start of the month who cancelled during the month."...

Average Order Value (AOV)

Find the average amount spent per order over a specific time period.

Act as a data analyst. Convert the following business question into an optimized MySQL query. Provide only the SQL code. Business Question: "What was the Average Order Value (AOV) for the month of May?"...

Marketing Campaign ROI

Write a query to determine the return on investment for a specific marketing campaign.

Act as a marketing analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What was the ROI for our 'Summer Sale 2023' campaign? The campaign cost was $5000."...

Daily Active Users (DAU)

Count the number of unique users who logged in each day for the past 30 days.

Act as a product analyst. Convert the following business question into an optimized PostgreSQL query. Provide only the SQL code. Business Question: "What was our Daily Active Users (DAU) count for each day over the past 30 days?"...

Slow-Moving Inventory

Identify products that have not been sold in the last 90 days.

Act as an operations analyst. Convert the following business question into an optimized T-SQL query. Provide only the SQL code. Business Question: "Which products in our inventory have not had any sales in the last 90 days?"...

Customer Lifetime Value (LTV)

Create a simplified query to estimate the LTV of customers acquired in a specific cohort.

Act as a data scientist. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What is the average lifetime value (LTV) of customers who made their first purchase in Q1 of last year?"...

Sales Funnel Conversion Rate

Calculate the conversion rate between stages in your sales funnel.

Act as a sales operations analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What is the conversion rate from 'Lead' to 'Opportunity' and from 'Opportunity' to 'Closed-Won' for leads created last month?"...

Most Common Support Ticket Issues

Find the top 5 most frequently reported issues from your customer support tickets.

Act as a support manager. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What were the top 5 most common categories for support tickets created last month?"...

Average User Session Duration

Calculate the average session duration for users on your platform yesterday.

Act as a product analyst. Convert the following business question into an optimized PostgreSQL query. Provide only the SQL code. Business Question: "What was the average user session duration in minutes for yesterday?"...

Employee Sales Performance

Rank sales representatives by their total sales revenue for the current quarter.

Act as a sales manager. Convert the following business question into an optimized T-SQL query. Provide only the SQL code. Business Question: "Rank our sales representatives by their total sales revenue for the current quarter."...

High-Value Unsubscribed Users

Find users who unsubscribed but had a total purchase value over a certain threshold.

Act as a marketing analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "Generate a list of customers who unsubscribed from our mailing list but have a total lifetime spending of over $1000."...

Product Affinity Analysis

Find pairs of products that are most frequently purchased together in the same order.

Act as a data scientist. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What are the top 10 pairs of products most frequently bought together?"...

Website Traffic by Source

Summarize website sessions by traffic source for the last week.

Act as a digital marketing analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "Show me a breakdown of our website sessions by traffic source (e.g., 'Google', 'Facebook', 'Direct') for the last 7 days."...

Accounts Receivable Aging Report

Categorize outstanding invoices by age (e.g., 0-30, 31-60 days).

Act as an accountant. Convert the following business question into an optimized T-SQL query. Provide only the SQL code. Business Question: "Generate an accounts receivable aging report, categorizing unpaid invoices into 0-30, 31-60, 61-90, and 90+ day buckets."...

Feature Adoption Rate

Calculate the percentage of active users who have used a specific new feature.

Act as a product manager. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What percentage of our monthly active users have used the 'new_dashboard' feature since it launched on June 1st?"...

Server Downtime Calculation

Query server logs to calculate the total downtime in minutes for the last 24 hours.

Act as a DevOps engineer. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What was the total server downtime in minutes over the last 24 hours?"...

Customer Segmentation (RFM)

Write a query to segment customers based on Recency, Frequency, and Monetary value.

Act as a data analyst. Convert the following business question into an optimized PostgreSQL query using window functions. Provide only the SQL code. Business Question: "Segment our customers into quartiles based on Recency, Frequency, and Monetary (RFM) scores."...

Forecast Next Month's Sales

Generate a query using a window function for a simple moving average sales forecast.

Act as a business analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "Calculate the 3-month moving average of our total monthly sales to create a simple forecast."...

Identify Duplicate Customer Records

Write a query to find potential duplicate customer records based on email and name.

Act as a data steward. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "Find all customer records that are potential duplicates, based on having the same email address but different customer IDs."...

A/B Test Result Analysis

Query A/B test results to compare conversion rates between variant A and variant B.

Act as a product analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "For the 'new_checkout_flow' A/B test, what was the conversion rate for the control and variant groups?"...

Geospatial Customer Density

Find the top 5 zip codes with the highest number of customers.

Act as a business intelligence analyst. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What are our top 5 zip codes with the highest concentration of customers?"...

API Usage by Endpoint

Count the number of API calls made to each endpoint in the last hour from API logs.

Act as a software engineer. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "What is the total count of API calls per endpoint over the last hour?"...

Project Task Overdue Report

Generate a list of all project tasks that are past their due date and are not yet completed.

Act as a project manager. Convert the following business question into an optimized SQL query. Provide only the SQL code. Business Question: "Which project tasks are currently overdue and what project do they belong to?"...

Turn these prompts into a reusable workspace

Save your favourite prompts once, reuse them with Alt+P, keep a live Table of Contents of long chats, and export conversations when you're done.

Add ChatBoost to Chrome — It's free

Related Prompt Packs