0
0
Redisquery~10 mins

Key naming conventions (colons for namespacing) in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a Redis key for user 123's name using colons for namespacing.

Redis
SET user[1]123[2]name "Alice"
Drag options to blanks, or click blank then click option'
A:
B-
C_
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using dashes or underscores instead of colons can make keys less clear.
Not using any separator can make keys hard to read.
2fill in blank
medium

Complete the code to get the value of the Redis key for product 456's price using proper namespacing.

Redis
GET product[1]456[2]price
Drag options to blanks, or click blank then click option'
A-
B_
C:
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dots instead of colons.
Leaving out separators, which makes keys confusing.
3fill in blank
hard

Fix the error in the Redis key naming by replacing the wrong separator with the correct one.

Redis
SET session[1]789[2]token "abc123"
Drag options to blanks, or click blank then click option'
A:
B-
C_
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using dashes or underscores instead of colons.
Mixing different separators in one key.
4fill in blank
hard

Fill both blanks to create a Redis key for order 321's status using proper namespacing.

Redis
GET order[1]321[2]status
Drag options to blanks, or click blank then click option'
A:
B-
C_
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing different separators in one key.
Using dashes or underscores instead of colons.
5fill in blank
hard

Fill all four blanks to set a Redis key for blog post 555's comment 42's text using proper namespacing.

Redis
SET blog[1]555[2]comment[3]42[4]text "Nice post!"
Drag options to blanks, or click blank then click option'
A:
B-
C_
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using different separators in the same key.
Using dashes, underscores, or dots instead of colons.