How would you add an element 'apple' to a set named 'fruits' in Redis?
LPUSH fruits apple
HSET fruits apple
SET fruits apple
SADD fruits apple
You set a key with EXPIRE mykey 10. What does the value '10' represent in this command?
EXPIRE mykey 10
Hours
Seconds
Minutes
Milliseconds
What is the correct syntax to set a key-value pair in Redis where the key is 'name' and the value is 'John'?
STORE name John
SET name John
CREATE name John
PUT name John
How can you check if a key, like 'product_name', exists in Redis?
CONFIRM product_name
VERIFY product_name
CHECK product_name
EXISTS product_name
What is the purpose of the 'RPUSH' command in Redis?
Remove an element from the tail 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 head of a list
What is the primary effect of renaming a key in Redis?
Changes how the key is referenced.
Changes the expiration time of the key.
Changes the data type of the key.
Changes the value associated with the key.
What type of data structures does Redis support?
Only key-value pairs
Strings, lists, sets, and hashes
Only strings
Exclusively JSON documents
What does the following redis-py code do: r.incr('mycounter')?
r.incr('mycounter')
Increments the numeric value stored at 'mycounter' by 1
Checks if the key 'mycounter' exists and creates it if not
Adds a new key 'mycounter' with the value 1
Retrieves the value at 'mycounter' and converts it to an integer
What does AOF stand for in the context of Redis persistence?
Asynchronous Operation Format
Append-Only File
Automatic Output Function
Advanced Object Formatting
You have a key with an expiration time set. If you overwrite this key with a new value using SET, what happens to the expiration?
SET
The expiration time is retained.
An error occurs because you cannot overwrite an expiring key.
The expiration time is removed, making the key persistent.
The expiration time is reset to its default value.