What does the following redis-py code do: r.incr('mycounter')?
r.incr('mycounter')
Adds a new key 'mycounter' with the value 1
Checks if the key 'mycounter' exists and creates it if not
Retrieves the value at 'mycounter' and converts it to an integer
Increments the numeric value stored at 'mycounter' by 1
Which persistence option in Redis creates point-in-time snapshots of your data?
Redis Protocol
AOF
RDB
Replication
Which command adds a new element to the beginning of a list in Redis?
ZADD
SADD
LPUSH
RPUSH
What does the TTL command return for a key that doesn't expire?
TTL
-1
-2
An error message
0
What type of data structures does Redis support?
Strings, lists, sets, and hashes
Exclusively JSON documents
Only strings
Only key-value pairs
What is the purpose of the SADD command in Redis?
Adds an element to the beginning of a list.
Adds an element to a sorted set.
Retrieves a value from a hash.
Adds an element to a set only if it doesn't already exist.
What is a potential drawback of using only RDB snapshots for persistence in Redis?
High memory usage
Potential data loss between snapshots
Complex configuration
Slow write speeds
What is the purpose of the 'RPUSH' command in Redis?
Remove an element from the head of a list
Add an element to the tail of a list
Add an element to the head of a list
Remove an element from the tail of a list
How do you delete a key-value pair in Redis where the key is 'city'?
REMOVE city
DROP city
DELETE city
ERASE city
What will Redis return if you execute 'GET score' and the 'score' key does not exist?
False
Null
Error