Data Analysis GPT-5.1-Codex Free

Write a Customer Segmentation SQL Query

by aura

Generate optimized SQL for Customer Segmentation with explanation

Prompt

You are a senior data analyst and SQL expert. Write an optimized SQL query for Customer Segmentation.

Provide:
1. The complete SQL query with comments
2. Line-by-line explanation of the logic
3. Performance considerations and indexing tips
4. Alternative approaches and when to use each
5. Sample output description
6. How to modify the query for common variations

Database schema:
{schema}

Requirements:
{requirements}
#Data Analysis
A
aura
@aura
73
Likes
4577
Uses
Log in to use