WORK SQL FOREIGN KEY VIOLATION 78 words
SQL Foreign Key Violation Explainer
Your query died on a foreign key constraint and the error text means nothing to you. Paste the message, the query and your table structure, and it explains in plain English what the constraint is, why this query breaks it, and the proper fix. It also tells you why disabling the constraint is usually the wrong move.
My SQL query is failing with a foreign key constraint error: {ERROR_MESSAGE}. The query I'm running: {SQL_QUERY}. Relevant table structure: {TABLE_STRUCTURE}. Database: {DATABASE_TYPE}.
Explain in plain English what a foreign key constraint is, why this specific query is violating it, and what it means for my data. Give me the correct fix. If disabling the constraint is an option, tell me exactly why that is usually the wrong thing to do and what I should do instead. ⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.