SQL JOIN Helper
By casey w · Published · Updated
Figure out exactly which SQL JOIN to use and generate the query.
Tags: sql, data, coding
Prompt template
## Introduction Generate correct SQL JOIN statements to combine your database tables. ## Table Details - Table 1 Name: [text: E.g., users] - Table 2 Name: [text: E.g., orders] - What do they share? (Foreign Key): [text: E.g., users.id = orders.user_id] ## Desired Outcome - What data do you want?: [dropdown: ALL records from both (Full Outer), Only matching records (Inner), All from Table 1 (Left), All from Table 2 (Right)] - Additional filtering (WHERE clause): [textarea: E.g., only orders greater than $50] - Database Engine: [dropdown: PostgreSQL, MySQL, SQL Server] --- **Goal**: Output the precise SQL query and explain how the chosen JOIN works.