The Prompt Library
CodingSQL

Explain a SQL Query

Break down what a SQL query does, step-by-step.

Select Model:

Prompt:

I need help understanding the following SQL query. Please break it down and explain what it does in clear, simple terms. SQL Query: ```sql [PASTE QUERY HERE] ``` Please provide: 1. OVERALL PURPOSE * A simple explanation of what this query is designed to accomplish * The business question or problem it's trying to solve * The expected output and how it would be used 2. STEP-BY-STEP BREAKDOWN * Explanation of each part of the query in sequence * What each clause (SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY) is doing * How the different parts work together * The flow of data through the query 3. TABLE RELATIONSHIPS * Explanation of the tables involved * How these tables are related to each other * What the join conditions mean in business terms * Any implicit relationships not explicitly joined 4. KEY CONDITIONS AND FILTERS * Breakdown of the WHERE clause conditions * What specific data is being filtered and why * How the conditions affect the result set * Explanation of any complex conditions or expressions 5. RESULTS INTERPRETATION * How to read and understand the results * What each output column represents * Any calculations or transformations performed * How to interpret aggregations if present Please explain everything in plain language, avoiding overly technical jargon, as if you're teaching someone who understands basic SQL but needs help with this specific query.

Related Prompts

Other prompts you might find useful

CodingSQL

Write a SQL Query

Generate a SELECT query with filters, joins, and sorting.

6 models availableView details
CodingSQL

Explain a SQL Query

Break down what a SQL query does, step-by-step.

6 models availableView details
CodingSQL

Create a Table Schema

Define a SQL table schema with columns, types, and constraints.

6 models availableView details
CodingSQL

Optimize a SQL Query

Refactor a SQL query for performance, indexing, or simplicity.

6 models availableView details