0
0
Redisquery~10 mins

ZCARD for set size 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 get the number of elements in the sorted set named 'myzset'.

Redis
ZCARD [1]
Drag options to blanks, or click blank then click option'
Amyzset
Bmyset
Csortedset
Dset1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong key name.
Confusing sorted sets with regular sets.
2fill in blank
medium

Complete the code to get the size of the sorted set stored in the variable 'keyName'.

Redis
ZCARD [1]
Drag options to blanks, or click blank then click option'
Akeyname
BkeyName
Ckey_name
Dkey
Attempts:
3 left
💡 Hint
Common Mistakes
Changing the case of the key name.
Using a different variable name.
3fill in blank
hard

Fix the error in the command to correctly get the size of the sorted set 'players'.

Redis
ZCARD [1]
Drag options to blanks, or click blank then click option'
Aplayers
Bplayer
Cplayerz
Dplayrs
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the key name.
Using a singular form instead of plural.
4fill in blank
hard

Fill both blanks to get the size of the sorted set stored in variable 'setKey' and store the result in variable 'count'.

Redis
count = [1] [2] setKey
Drag options to blanks, or click blank then click option'
AZCARD
B=
C==
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '=' for assignment.
Using 'GET' which is not valid for sorted sets.
5fill in blank
hard

Fill all three blanks to write a Redis command that stores the size of the sorted set 'scores' into variable 'size', then prints it.

Redis
size [1] [2] scores
PRINT [3]
Drag options to blanks, or click blank then click option'
A=
BZCARD
Csize
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'GET' instead of 'ZCARD' to get size.
Printing the key name instead of the variable.