Library › Coding AI › College students
Make JOIN practice questions from a tiny sample database
Practice: Showing an example of what you want. About 5 minutes.
About this exercise
Make yourself 3 practice questions on the sample data, each 'How many rows does this return? `<query>`' with a one-line query in backticks: one INNER JOIN, one LEFT JOIN, and one LEFT JOIN ... WHERE e.student_id IS NULL. Then a line 'Answers' and 3 numbered answers like '3 rows - reason under 12 words'. No code blocks, under 140 words.
Common mistakes when you ask AI for this
- Random question types. The AI writes 'explain the difference' questions instead of the row-count ones your quiz uses. Try: Show it: "How many rows does this return? `SELECT ... FROM students s JOIN enrollments e ON ...`".
- Missing the join types. The AI may skip the anti-join, which the quiz will likely include. Try: Add: "One INNER JOIN, one LEFT JOIN, one LEFT JOIN ... WHERE e.student_id IS NULL."
- Answers without reasons. A bare number doesn't show why Ana appears twice. Try: Add: "Answers like '3 rows - reason under 12 words'."
- Too many, or code blocks. The AI writes 10 questions with SQL in code blocks. Try: Add: "Exactly 3 numbered questions, one-line queries in backticks, no code blocks."
What a strong prompt includes
- Sets the number of questions
- Shows the question shape
- Names the join types
- Asks for reasons
- Separates the answers
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)