Challenge - 5 Problems
Feedback Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Retrieve all feedback entries submitted in the last 7 days
Given a feedback database table with columns id, user_id, comment, and submitted_at, which query returns all feedback submitted in the last 7 days?
Attempts:
2 left
💡 Hint
Think about how to select dates from the recent past, not the future.
✗ Incorrect
Option B correctly selects feedback where the submission date is within the last 7 days by subtracting 7 days from the current date. Other options either select future dates or dates older than 7 days.
🧠 Conceptual
intermediate1:30remaining
Understanding the purpose of a feedback table's user_id column
Why is the user_id column important in a user feedback collection database?
Attempts:
2 left
💡 Hint
Think about how to connect feedback to the person who gave it.
✗ Incorrect
The user_id column connects each feedback entry to the specific user who submitted it, which helps in tracking and responding to feedback personally.
📋 Factual
advanced1:30remaining
Identify the syntax error in this feedback insertion query
Which option contains a syntax error when inserting a new feedback entry with user_id 5 and comment 'Great app!'?
Attempts:
2 left
💡 Hint
Check the syntax for specifying columns in an INSERT statement.
✗ Incorrect
Option D is missing parentheses around the column names, which is required syntax in SQL INSERT statements.
❓ optimization
advanced2:00remaining
Optimize query to count feedback per user efficiently
Which query efficiently counts the number of feedback entries per user?
Attempts:
2 left
💡 Hint
Think about grouping results by user to get counts per user.
✗ Incorrect
Option A correctly groups feedback by user_id and counts entries per user. Option A lacks GROUP BY, C returns counts but no user_id, and D filters but misses grouping.
🔍 Analysis
expert2:30remaining
Find the cause of missing feedback entries in query result
A query to select feedback with comments containing 'bug' returns no rows, but there are entries with 'Bug' and 'BUG'. What is the cause?
No-Code
SELECT * FROM feedback WHERE comment LIKE '%bug%';Attempts:
2 left
💡 Hint
Consider how SQL handles text matching and case sensitivity.
✗ Incorrect
The LIKE operator is case-sensitive in many databases, so it misses entries with different letter cases. Using case-insensitive search or functions can fix this.