Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select all feedback entries from the feedback table.
LangChain
SELECT [1] FROM feedback; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a specific column name when all columns are needed.
Leaving the SELECT clause empty.
✗ Incorrect
The asterisk (*) selects all columns from the table.
2fill in blank
mediumComplete the code to insert a new feedback comment into the feedback table.
LangChain
INSERT INTO feedback (user_id, comment) VALUES ([1], 'Great service!');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numeric values.
Inserting the comment text in place of user_id.
✗ Incorrect
The user_id is usually a number, so 123 is correct here.
3fill in blank
hardFix the error in the query to update a feedback comment by id.
LangChain
UPDATE feedback SET comment = 'Updated comment' WHERE id = [1];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numeric id inside quotes.
Using a string value that does not exist.
✗ Incorrect
The id is numeric, so it should not be in quotes.
4fill in blank
hardFill both blanks to select feedback comments with rating greater than 3.
LangChain
SELECT comment FROM feedback WHERE rating [1] [2];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of >.
Comparing rating to a column name instead of a number.
✗ Incorrect
The condition rating > 3 selects feedback with rating higher than 3.
5fill in blank
hardFill all three blanks to create a dictionary of user_id to comment for feedback with rating above 4.
LangChain
SELECT [1], [2] FROM feedback WHERE rating [3] 4;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting wrong columns.
Using incorrect comparison operator.
✗ Incorrect
Select user_id and comment where rating is greater than 4.