A shared tag with AI prompts and code snippets
From workspace: Replit
Team: AI Prompts
Total snippets: 3
3 snippets
Explain how this SQL query joins and filters the data.
Explain this SQL query step by step. Include: – What the JOIN is doing – How WHERE affects the result – Final output rows Query: SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id WHERE o.total > 100;
List test cases to validate behavior of SQL logic for edge input.
You are testing the following SQL query. List: – Input scenarios to test (e.g. totals = 100, NULLs) – Edge logic that may fail – Verification method for expected results Query: SELECT * FROM orders WHERE total > 100 AND status = 'confirmed';
Fix SQL join that returns more rows than expected.
This SQL query returns more rows than expected. Investigate: – Is there a join mismatch or missing constraint? – Are duplicates introduced via many-to-one? Rewrite the query to fetch only distinct user-order pairs. Query: SELECT users.name,...