0
0
Redisquery~10 mins

Redis data model (key-value) - 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 key named 'user:1' with the value 'Alice'.

Redis
SET user:1 [1]
Drag options to blanks, or click blank then click option'
Auser
BAlice
C1
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key name as the value
Using a number instead of the name
2fill in blank
medium

Complete the code to get the value stored at key 'session:123'.

Redis
GET [1]
Drag options to blanks, or click blank then click option'
Auser:123
Bsession
Csession:123
D123
Attempts:
3 left
💡 Hint
Common Mistakes
Using only part of the key
Using a value instead of a key
3fill in blank
hard

Fix the error in the command to delete the key 'cache:item'.

Redis
DEL [1]
Drag options to blanks, or click blank then click option'
Acache:item
Bcacheitem
Ccache_item
Dcache-item
Attempts:
3 left
💡 Hint
Common Mistakes
Replacing colon with dash or underscore
Using partial key names
4fill in blank
hard

Fill both blanks to set a key 'product:45' with value 'Book' and then retrieve it.

Redis
[1] product:45 Book
[2] product:45
Drag options to blanks, or click blank then click option'
ASET
BGET
CDEL
DEXPIRE
Attempts:
3 left
💡 Hint
Common Mistakes
Using DEL instead of GET to retrieve
Using EXPIRE instead of SET to store
5fill in blank
hard

Fill all three blanks to set a key 'order:100' with value 'Pending', update it to 'Shipped', and then get the updated value.

Redis
[1] order:100 Pending
[2] order:100 Shipped
[3] order:100
Drag options to blanks, or click blank then click option'
ADEL
BSET
CGET
DEXPIRE
Attempts:
3 left
💡 Hint
Common Mistakes
Using DEL to update a key
Using EXPIRE instead of SET
Trying to GET before setting a value