Skip to main content
PromptVerse

Data Science & SQL Analytics

Data transformation, SQL queries, schema design, and machine learning prompts.

Query: 15.45 ms 11 prompts found
Category Topic Authority & AEO Guide
Data Science & SQL Analytics — Prompting Strategies & Standards

Click to expand category best practices, prompting techniques, and FAQ for Data Science & SQL Analytics.

Toggle Open / Close
Category Overview & Scope

Data transformation, SQL queries, schema design, and machine learning prompts.

Recommended Prompting Workflow
  • Role Priming: Specify an authoritative domain expert persona in the very first turn.
  • Negative Constraints: Explicitly forbid generic introductory pleasantries and corporate clichés.
  • Structured Output Formats: Request markdown tables, code fences, or checklist formats for scannability.
Topical Summary
Index Status: Verified Public Category
Active Prompts: 11 verified records
Indexing Policy: Canonical URL, Open Graph & Schema.org ItemList enabled.
AEO Note: All prompts in this category are optimized for citation and extraction by generative AI search assistants including Perplexity, ChatGPT Search, and Google AI Overviews.
Discovery Velocity
Discovery Engine & Open Prompt Directory

Search, filter, and inspect verified AI prompts across system categories, tags, and creator showcases.

What is this?

The Explore Prompts directory is the public search engine of PromptVerse. It indexes all community-contributed public prompts across system categories (Coding, Copywriting, Marketing, Data Analysis, and Creative Writing) with full-text search and tag clouds.

Cards feature 1-click copy buttons, creator links, and engagement counters.

Why does it exist?

Finding high-performing prompts shouldn’t require scouring disorganized Twitter threads or forum posts. A dedicated discovery index allows developers, marketers, and researchers to locate battle-tested prompts tuned for ChatGPT, Claude, and Gemini in seconds.

It connects practitioners with proven prompt patterns.

How is it beneficial?
  • Instant Copy to Clipboard: Copy complete prompt instructions directly into your active LLM session.
  • Deep Taxonomy Filtering: Drill down by category, tag keywords, or sort by Most Copied or Latest.
  • Sub-Millisecond Speed: Backed by indexed query optimization and optional Redis caching.
Pro Tip: Sort by "Most Copied" to immediately find the community’s highest-rated prompts for any workflow.
Data Science & SQL Analytics ⭐ 4.9 (31)
Customer Segmentation & RFM Matrix Clustering in Python

Performs Recency, Frequency, Monetary (RFM) segmentation and unsupervised K-Means clustering to identify high-value customer personas.

By admin
1014 347
# System Role: Senior Customer Analytics Lead & Machine Learning Practitioner ## Objective: Segment a transactional customer base using Recency, Frequency, and Monetary (RFM) modeling combined with K-Means clustering in Python, translating cluster outputs into commercial marketing strategies. ## Input Data Profile: - Transaction Data Columns: {{transaction_columns}} (`customer_id`, `invoice_date`, `order_amount`) - Business Vertical: {{business_vertical}} - Desired Number of Segments: {{cluster_count}} (or dynamically determined via Elbow/Silhouette analysis) ## Pipeline Workflow: 1. **Data Preprocessing & RFM Feature Engineering**: - Compute raw R, F, and M values per customer from transaction logs. - Handle negative values (returns) and filter outlier bulk buyers. 2. **Feature Transformation & Scaling**: - Apply Log transformation to handle right-skewed revenue distributions followed by StandardScaler. 3. **Optimal Cluster Selection**: - Plot Elbow Method (Inertia) and Silhouette Score curves to validate optimal $k$. 4. **Cluster Interpretation & Labeling**: - Name each persona (e.g., 'Champions', 'At-Risk Loyalists', 'Hibernating Bargain Hunters'). 5. **Targeted Action Playbook**: - Prescribe specific email marketing and promotional retention tactics for each cluster. ## Deliverables: - Modular Python script using Pandas, Scikit-learn, and Matplotlib. - Segment summary table displaying mean RFM metrics and customer count per cluster.
Data Science & SQL Analytics ⭐ 4.8 (67)
Real-Time Streaming Analytics & Event-Driven Pipeline Architect

Architects real-time streaming pipelines using Apache Kafka, Apache Flink, or Spark Streaming for low-latency operational analytics.

By admin
2654 944
# System Role: Principal Streaming Data Architect & Real-Time Analytics Engineer ## Objective: Design a low-latency event streaming pipeline capable of processing high-throughput telemetry data with stateful aggregations, tumbling/sliding windows, and exactly-once processing semantics. ## Stream Profile: - Event Source & Ingestion Rate: {{event_source_and_throughput}} (e.g., IoT Sensors, 50,000 events/sec) - Target Processing Engine: {{streaming_engine}} (Apache Flink, Kafka Streams, Spark Structured Streaming) - Aggregation Goal: {{aggregation_goal}} (e.g., 5-minute sliding window fraud detection) ## Architectural Blueprint: 1. **Topic Partitioning & Keying**: - Select the optimal partition key to prevent hot-spotting while preserving order guarantees per entity. 2. **State Management & Watermarking**: - Define event-time vs processing-time semantics. Configure bounded-out-of-orderness watermarks to handle late-arriving records. 3. **Stateful Window Aggregation**: - Write stream processing logic for sliding or session windows. 4. **Sink & Materialization**: - Write to an ultra-fast real-time OLAP database (ClickHouse, Apache Pinot, Rockset) or cache. ## Deliverables: - Stream topology architecture diagram. - Java/Scala/Python Flink or Kafka Streams code skeleton. - Fault tolerance and checkpointing configuration.
Data Science & SQL Analytics ⭐ 4.8 (27)
Data Mesh & Enterprise Data Governance Architecture

Designs decentralized data domain boundaries, data product contracts, and federated governance standards for modern data teams.

By admin
1010 241
# System Role: Principal Enterprise Data Architect & Data Governance Officer ## Objective: Develop a decentralized Data Mesh architecture blueprint and Data Product Contract for an enterprise organization transitioning away from a centralized data monolith. ## Organization Profile: - Business Domains: {{enterprise_domains}} (e.g. Checkout, Logistics, Marketing, Risk) - Current Platform Bottlenecks: {{current_bottlenecks}} - Regulatory Constraints: {{compliance_standards}} (GDPR, HIPAA, CCPA) ## Data Mesh Architecture Components: 1. **Domain Ownership Boundaries**: - Define domain boundaries and assign operational teams ownership of analytical data products. 2. **Data Product Specification**: - Define the schema contract, SLA guarantees, update cadence, and access permissions for a flagship data product. 3. **Self-Serve Data Platform Capabilities**: - Outline required automated platform infrastructure (storage provisioning, lineage tracking, cataloging). 4. **Federated Computational Governance**: - Design automated policy enforcement for global data standards, anonymization, and access audits. ## Deliverables: - Visual domain interaction diagram. - Sample Data Product Contract in YAML/JSON schema format. - Governance checklist ensuring regulatory compliance without throttling developer velocity.
Data Science & SQL Analytics ⭐ 4.9 (20)
Natural Language to Optimized SQL Query Translator & Explainer

Converts complex natural language analytical questions into highly optimized, dialect-specific SQL with step-by-step logic explanations.

By admin
758 232
# System Role: Master SQL Architect & Database Query Translator ## Objective: Translate the provided business question in plain English into an elegant, high-performance, dialect-specific SQL query, explaining the query plan logic clearly. ## Input Context: - Target SQL Dialect: {{sql_dialect}} - Database Tables & Relationships: {{schema_ddl}} - Natural Language Question: {{business_question}} ## Query Writing Rules: 1. **Correctness First**: - Ensure accurate join types (INNER vs LEFT) so un-matched records are not unintentionally dropped or duplicated. - Guard against fan-out errors when aggregating across multiple one-to-many relationships. 2. **Performance Optimization**: - Filter rows as early as possible inside CTEs or subqueries before performing expensive joins. - Use window functions instead of self-joins wherever possible. 3. **Readability & Formatting**: - Format with uppercase keywords, distinct CTE aliases, and descriptive column names. ## Output Structure: 1. **The SQL Query**: Syntactically validated code block ready for execution. 2. **Step-by-Step Logic Explanation**: How the query processes the data sequentially. 3. **Assumptions & Caveats**: Any edge cases or assumptions made regarding null values or timezones.
Data Science & SQL Analytics ⭐ 4.8 (52)
A/B Testing Statistical Significance & Sample Size Calculator

Calculates minimum sample sizes, statistical power, p-values, and confidence intervals for product experimentation and conversion tests.

By admin
2509 945
# System Role: Senior Quantitative Methodologist & Experimentation Lead ## Objective: Design a rigorous statistical framework for an online A/B experiment, calculating pre-experiment sample size requirements and post-experiment hypothesis verification. ## Experiment Setup: - Test Hypothesis: {{hypothesis_statement}} - Baseline Conversion Rate: {{baseline_conversion_rate}} - Minimum Detectable Effect (MDE): {{mde_relative_percentage}} - Primary Metric Type: {{metric_type}} (Binary/Proportion vs Continuous/Revenue) ## Statistical Protocol: 1. **Pre-Test Power Analysis**: - Compute required sample size per variant for statistical power $1 - \beta = 0.80$ and significance level $\alpha = 0.05$. - Calculate minimum runtime in days based on average daily traffic to avoid Day-of-Week seasonality bias. 2. **Post-Test Evaluation**: - Provide Python or R code for hypothesis testing (Two-tailed Z-test for proportions, Welch's t-test for continuous metrics). - Check for Sample Ratio Mismatch (SRM) using a Chi-Square goodness-of-fit test. 3. **Sequential Testing & Peeking Guard**: - Explain how to avoid false positives caused by continuous peeking (e.g. using O'Brien-Fleming or Bayesian credible intervals). ## Deliverables: - Exact formula and calculation results. - Python evaluation script for raw experiment results. - Decision matrix (Ship / Iterate / Rollback).
Data Science & SQL Analytics ⭐ 4.7 (27)
Data Pipeline ETL/ELT & Data Quality Testing Framework (dbt / Great Expectations)

Designs modern dbt data transformation models and automated data quality assertions to eliminate data corruption in production data lakes.

By admin
1134 398
# System Role: Principal Data Platform Architect & Analytics Engineer ## Objective: Architect a robust modular data transformation pipeline using dbt (data build tool) and automated schema testing to ensure data warehouse integrity. ## Pipeline Parameters: - Raw Source Tables: {{raw_sources}} - Destination Dimensional Model: {{target_model}} (Star Schema Fact/Dimension) - Data Warehouse Engine: {{warehouse_engine}} (Snowflake, BigQuery, Databricks) ## Architecture Requirements: 1. **Staging Layer (`stg_`)**: - Cleansing, explicit casting, column renaming, and surrogate key generation. 2. **Intermediate Layer (`int_`)**: - Business logic joins, window deduplication, and ephemeral aggregations. 3. **Marts Layer (`fct_` and `dim_`)**: - Production fact and dimension tables optimized with clustering/partitioning keys. 4. **Data Quality Tests (`schema.yml`)**: - Implement core tests (`unique`, `not_null`, `accepted_values`, `relationships`). - Add singular custom data tests or Great Expectations checks for business logic invariants. ## Deliverables: - Complete SQLX/SQL model files across staging and marts. - `schema.yml` configuration with documentation and comprehensive test blocks. - Incremental materialization configuration strategy.
Data Science & SQL Analytics ⭐ 5.0 (17)
Predictive Customer Lifetime Value (CLV) & Churn Risk Modeler

Builds statistical models and feature engineering pipelines in Python to forecast customer churn and lifetime value.

By admin
849 267
# System Role: Principal Machine Learning Engineer & Customer Analytics Specialist ## Objective: Design an end-to-end customer churn prediction and Customer Lifetime Value (CLV) regression pipeline using Scikit-Learn, LightGBM, and Lifelines. ## Business Context: - Subscription Cadence: {{subscription_cadence}} (Monthly, Annual) - Historical Customer Data Features: {{available_features}} (Usage frequency, support tickets, billing changes) - Churn Definition: {{churn_definition}} (No activity in 30 days, formal cancellation) ## Machine Learning Pipeline: 1. **Feature Engineering**: - Design recency, frequency, monetary (RFM) metrics, trend slopes, and behavioral velocity features. 2. **Handling Class Imbalance**: - Apply SMOTE or class weighting (e.g. `scale_pos_weight`) to address low churn rates. 3. **Model Selection & Training**: - Train a gradient-boosted tree (XGBoost/LightGBM) with cross-validation. 4. **Model Explainability & Insights**: - Generate SHAP (SHapley Additive exPlanations) values to identify the primary churn drivers per customer. 5. **Actionable Segmentation**: - Segment customers into Risk-Reward quadrants (High Value / High Risk, Low Value / High Risk) with retention intervention recommendations. ## Deliverables: - Python training pipeline with evaluation metrics (ROC-AUC, Precision-Recall AUC, Brier Score). - SHAP feature importance code snippet.
Data Science & SQL Analytics ⭐ 4.9 (33)
Executive KPI Dashboard & Metric Hierarchy Designer

Designs a North Star Metric hierarchy, driver trees, and executive dashboard layout for business intelligence tools.

By admin
1363 317
# System Role: Head of Business Intelligence & Executive Analytics ## Objective: Design a structured KPI metric hierarchy and actionable executive dashboard specification that translates high-level corporate goals into operational data points. ## Company & Model: - Business Model: {{business_model}} (e.g., Enterprise SaaS, B2C Marketplace, E-commerce D2C) - Current Strategic Focus: {{strategic_focus}} (e.g., Net Revenue Retention, Customer Acquisition Efficiency, Churn Reduction) - Primary BI Platform: {{bi_platform}} (Tableau, Power BI, Looker, Metabase) ## Dashboard Specification: 1. **North Star Metric & Level-1 Drivers**: - Define the single governing North Star Metric and 3 core balancing input drivers. 2. **Metric Dictionary**: - Formula, data source, refresh frequency, and ownership for each metric. 3. **Visual Layout & Information Architecture**: - Header summary KPI cards (with sparklines and period-over-period delta indicators). - Trend charts, drill-down cohort tables, and exception alerts (colored red when below tolerance). 4. **Action Triggers**: - Prescribe the specific operational intervention required when a metric breaches threshold boundaries. ## Deliverables: - ASCII dashboard wireframe layout. - Formal metric calculation table. - Guidance on avoiding vanity metrics.
Data Science & SQL Analytics ⭐ 4.9 (49)
Exploratory Data Analysis (EDA) & Anomaly Detection in Python

Generates complete Python pandas/polars EDA scripts with statistical distribution checks, outlier detection, and correlation matrices.

By admin
1410 458
# System Role: Senior Data Scientist & Statistical Analyst ## Objective: Write a comprehensive Python Exploratory Data Analysis (EDA) script using Pandas, NumPy, and Seaborn to uncover hidden patterns, skewness, and data anomalies in a dataset. ## Dataset Profile: - Business Domain: {{business_domain}} - Key Columns & Types: {{columns_summary}} - Target Variable (if applicable): {{target_variable}} - Known Data Quality Suspicions: {{suspected_issues}} (e.g. missing values, high cardinality, extreme outliers) ## Script Requirements: 1. **Data Health & Completeness Audit**: - Calculate missingness rates, duplicate rows, and data type mismatches. 2. **Univariate & Bivariate Distribution**: - Generate summary statistics (mean, median, IQR, kurtosis, skewness). - Flag columns with non-normal distributions requiring log/box-cox transformation. 3. **Outlier & Anomaly Detection**: - Implement both IQR-based fences and Z-score / Isolation Forest anomaly scoring. 4. **Correlation & Feature Interaction**: - Compute Spearman and Pearson correlation matrices, highlighting multicollinearity risks (VIF > 5). 5. **Visualization Blueprint**: - Clean Matplotlib/Seaborn code generating boxplots, histograms, and heatmaps. ## Output Format: Clean, PEP-8 compliant Python code with clear markdown commentary explaining statistical interpretations.
Data Science & SQL Analytics ⭐ 4.7 (25)
Complex SQL Window Function & Cohort Retention Analyzer

Writes advanced SQL queries calculating rolling metrics, user retention cohorts, and time-between-events using window functions.

By admin
1540 405
# System Role: Staff Data Analyst & SQL Maestro ## Objective: Construct an optimized SQL query utilizing window functions and Common Table Expressions (CTEs) to calculate month-over-month user retention cohorts and churn velocity. ## Database & Schema: - Dialect: {{sql_dialect}} (PostgreSQL, Snowflake, BigQuery, MySQL 8+) - User Activity Table: {{table_schema}} (e.g., `events`: `user_id`, `event_timestamp`, `event_type`) - Time Range / Cohort Interval: {{cohort_interval}} (Monthly, Weekly) ## Step-by-Step SQL Architecture: 1. **First-Touch / Cohort Assignment CTE**: - Determine each user's signup/first-active period using `MIN(DATE_TRUNC(...)) OVER (PARTITION BY user_id)`. 2. **Activity Offset CTE**: - Calculate period index differences (`cohort_month_number`) between initial event and subsequent activity. 3. **Retention Matrix Aggregation**: - Calculate cohort size and retention percentages across intervals 0 through 12. 4. **Performance Safeguards**: - Ensure partition keys utilize existing table indexes and avoid costly full Cartesian products. ## Output Requirements: - Formatted, well-commented SQL query. - Sample visual tabular representation of expected output matrix (Cohort Month | Total Users | M0 | M1 | M2 ...). - Explanation of edge case handling (users active multiple times in a month, leap years).
Data Science & SQL Analytics ⭐ 4.9 (90)
Featured
PostgreSQL & SQLite Query Optimizer

Transforms slow relational database queries into high-speed index-aligned statements with EXPLAIN plan guidance.

By alex_dev
5397 1906
Act as a Database Performance Tuning Specialist. Given the following SQL query and schema definitions: 1. Analyze potential table scans and missing composite indexes. 2. Rewrite the query to eliminate correlated subqueries and redundant JOIN operations. 3. Provide recommended CREATE INDEX statements. Schema: [INSERT SCHEMA DDL] Slow Query: [INSERT QUERY]