Write SQL queries for sales analysis
Generate optimized SQL queries for comprehensive sales data analysis based on your specific tables and needs.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Je travaille avec une base de données [TYPE_BDD] (PostgreSQL / MySQL / BigQuery / Snowflake) contenant les tables suivantes :
- [TABLE_1] : [DESCRIPTION_TABLE_1] avec les colonnes [COLONNES_1]
- [TABLE_2] : [DESCRIPTION_TABLE_2] avec les colonnes [COLONNES_2]
- [TABLE_3] : [DESCRIPTION_TABLE_3] avec les colonnes [COLONNES_3]
J'ai besoin d'analyses sur [PERIODE] pour [OBJECTIF_ANALYSE].
Ecris les requêtes SQL pour :
- Le chiffre d'affaires total par [DIMENSION] avec variation vs période précédente
- Le top 10 des [ENTITE] (produits / clients / régions) par [METRIQUE]
- L'évolution mensuelle avec moving average sur [N] mois
- La cohorte de clients par mois d'acquisition et leur valeur cumulée
- La détection des anomalies (valeurs > 2 écarts-types de la moyenne)
- Un rapport récapitulatif avec toutes les métriques en une seule requête
Optimise les requêtes pour les performances et ajoute des commentaires explicatifs. Indique les index recommandés.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p>The prompt works because it specifies the exact database structure, enabling generation of directly usable queries. The request for optimization and comments ensures professional quality.</p>
Use Cases
Expected Output
6 commented SQL queries, optimized for performance, with index recommendations.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Astuce : pour la détection d’anomalies, remplacez la moyenne mobile par une médiane glissante + écart interquartile (plus robuste aux outliers). Utilisez `PERCENTILE_CONT` avec une fenêtre de 30 jours. Adaptez au SGBD (`NTILE` ou `APPROX_QUANT
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Jobs-to-be-Done analysis
Understanding the real job of the user
Write an executive summary of findings
Communicate results to executives
Evaluate a regression model
Evaluate regression model performance
Prompt Claude to Analyze User Feedback
Analyzing user feedback is a strategic lever for any company looking to improve its products and services. However, manually processing hundreds or even thousands of customer reviews is time-consuming and prone to interpretation bias. Claude excels at this task thanks to its ability to understand natural language nuances, detect implicit sentiments, and automatically categorize feedback along relevant axes. Whether it's product reviews, support tickets, NPS survey responses, or social media comments, Claude can extract actionable insights in seconds. By properly structuring your prompt, you get a systematic analysis that identifies recurring trends, prioritizes problems by impact, and provides concrete recommendations. This approach transforms raw qualitative data into a clear decision-making dashboard, allowing product, support, and marketing teams to act quickly on friction points identified by your users.