SQL prompts
SQL prompts work best when you share the schema and the question. These prompts help you write and explain queries, optimise slow ones, design tables and relationships, plan reporting queries, practise for interviews and review SQL for errors and risks. Provide table names, columns and the database you use, but not real data or credentials. Always read and test generated SQL on a copy or read-only environment before running it, especially anything that updates or deletes data. Learners can use the explanation prompts to understand why a query works, not only to copy the answer.
Prompts
-
SQL Query and Database Access Security Review
Check queries, permissions and sensitive columns.
-
SQL Migration Script Safety Review (Defensive)
Check a database change script before it is run.
-
SQL Query Performance Audit of a Reporting Workload
Find the queries that cost most and the common causes.
-
SQL Injection Risk Review of Query-Building Code (Defensive)
Check code that builds queries for unsafe patterns.
-
SQL Permissions and Access Review for a Reporting Database (Defensive)
Check accounts and grants for least privilege.
-
SQL Report Number Reconciliation Between Two Queries
Find why two queries disagree and which is right.
-
Slow Query Triage: What to Check Before You Add an Index
Work through causes of a slow query in a sensible order.
-
SQL Query Review Checklist for Correctness, Not Just Speed
Review a query for logic errors.
-
SQL Slowly Changing Data and History Table Audit
Check that history is captured and queried correctly.
-
SQL Join Fan-Out and Duplicate Row Audit
Find join logic that multiplies rows and inflates totals, with a test query plan and corrected pattern for each risky join.
-
SQL NULL Handling and Hidden Data Loss Audit
Review a SQL query for NULL traps in joins, filters, comparisons and aggregates that silently drop or distort rows.
-
SQL Execution Plan and Index Usage Reading Review
Interpret a pasted query plan in plain English, find scans, bad estimates and missing indexes, and list safe things to test.
-
SQL Injection Risk Review for Query-Building Code
Defensive review of your own application code that builds SQL, finding string concatenation, risky inputs and the safe parameterised fix.
-
SQL Date, Time Zone and Period Logic Audit
Check a SQL report for date boundary errors, time zone mix-ups, inclusive or exclusive ranges and period comparisons that quietly mislead.
-
SQL Readability, Naming and Style Audit
Review SQL for readable layout, clear aliases, consistent naming and comments, and get a rewritten version plus a team style guide.
-
SQL Report Totals Reconciliation Check
Build a set of reconciliation queries and a comparison table to prove a SQL report matches its source, with explanations for any gaps.
-
SQL Schema Constraints and Data Type Quality Review
Audit table definitions for missing keys, weak data types, absent constraints and naming problems that cause bad data later.
-
SQL Window Function and Aggregation Logic Audit
Verify GROUP BY, HAVING and window function logic in a SQL query with test data, so rankings and running totals are right.
-
SQL Migration and Bulk Update Script Safety Review
Check an UPDATE, DELETE or migration script for missing WHERE clauses, lock risk, rollback gaps and a safe dry-run and verification plan.
-
Data Analyst Interview: Metrics, SQL and Stakeholder Questions
Practise analytical reasoning aloud.
-
SQL Query Writer With Explanation
Write and explain queries from business questions.
-
Entity Relationship Design From a Business Description
Turn a business description into an entity relationship design: entities, attributes, relationships and cardinality to review.
-
Index Strategy Review for a Busy Table
Choose indexes that help reads without hurting writes.
-
Data Quality Rules and Constraints Design
Prevent bad data with constraints and validation checks.
-
Reporting Views and Summary Tables Design
Make reports fast and consistent without duplicating logic.
-
SQL to Pandas Translation Guide
Move queries between SQL and pandas correctly.
-
Business Question to SQL Translator
Convert a plain question into a correct query.
-
Window Functions Cookbook for My Schema
Learn analytic SQL with examples on your tables.
-
Query Review and Correctness Check
Find logic errors in an existing query.
-
Cohort Retention Analysis in SQL
Build retention tables from event data.
-
Data Modeling for Analytics: Star Schema Design
Design fact and dimension tables for reporting.
-
SQL Practice Problems With Hidden Solutions
Generate drills that match your skill level.
-
SQL Performance Tuning Walkthrough
Improve a slow query step by step.
-
Slowly Changing Data and History Tracking in SQL
Model and query changing records over time.
-
Data Quality Checks as SQL Tests
Write data quality checks as SQL tests, with automated assertions on a warehouse for nulls, duplicates and valid ranges.
-
Analytical SQL for Marketing and Product Funnels
Query funnels, attribution, and cohorts.
-
Recursive Queries for Hierarchies and Org Charts
Query trees and nested relationships correctly.
-
Pivoting and Unpivoting Data in SQL
Reshape tables without error.
-
Date Dimension and Calendar Queries
Handle fiscal calendars, gaps, and periods.
-
SQL Query Documentation and Naming Standards
Make queries readable and maintainable.
-
SQL Window Functions Explained With Worked Examples
Learn ranking, running totals and comparisons across rows.
-
SQL Query Readability Rewrite and Documentation
Turn a hard-to-read query into one a colleague can maintain.
-
SQL Schema Design From Requirements With Keys and Constraints
Design a SQL schema from written requirements, with tables, primary and foreign keys, constraints and reasons for each choice.
-
SQL Data Quality Check Queries for a New Dataset
Write checks for duplicates, nulls and impossible values.
-
SQL Reporting Query Set for Monthly Business Metrics
Write a reusable set of queries for standard metrics.
-
SQL Dialect Translation Notes Between Two Databases
Translate a query and list the differences to test.
-
SQL Execution Plan Reading Guide for a Slow Query
Interpret an explain plan and decide what to try first.
-
SQL Window Functions Explained With Examples From Your Data
Learn SQL window functions using your own tables, with ROW_NUMBER, RANK, running totals and LAG explained step by step with sample output.
-
SQL Window Function Query Builder for Rankings
Build a SQL window function query for rankings, running totals or period comparisons from your table description, with a line by line explanation.
-
SQL Window Function Query Review and Practice Scorecard
Review your window function queries for wrong frames, missing partitions and tie handling, then score your understanding from 1 to 5.
-
SQL Cohort Retention Query Walkthrough With a Worked Example
Build retention tables step by step.
-
SQL Data Mart Table Design for Reporting From an Operational Database
Design summary tables that make reports fast and consistent.
-
SQL Stored Query Library With Comments and Parameters
Organise reusable queries for a team.
-
SQL Practice Questions With Answers on Joins, Aggregation and Subqueries
Self-study set built on a small invented schema.
No prompts match those filters.