What file extension is typically used for Redis's Append-Only File?
.log
.aof
.rdb
.redis
How do you delete a key-value pair in Redis where the key is 'city'?
DROP city
ERASE city
DELETE city
REMOVE city
How does Redis differ from a traditional relational database like MySQL?
Redis is not suitable for storing persistent data, while MySQL is
Redis is primarily disk-based, while MySQL is in-memory
Redis is optimized for complex joins and queries, while MySQL is not
Redis is schema-less, while MySQL enforces a strict schema
What does the following redis-py code do: r.incr('mycounter')?
r.incr('mycounter')
Retrieves the value at 'mycounter' and converts it to an integer
Adds a new key 'mycounter' with the value 1
Increments the numeric value stored at 'mycounter' by 1
Checks if the key 'mycounter' exists and creates it if not
Which command is used to decrease the value of a key by 1 in Redis?
MINUS
SUB
DECR
DECREMENT
What does the TTL command return for a key that doesn't expire?
TTL
0
An error message
-1
-2
What Redis data type is best suited for storing a user profile with attributes like name, email, and age?
String
Hash
List
Set
What is the default port on which the Redis server listens for connections?
80
27017
3306
6379
What type of data structures does Redis support?
Strings, lists, sets, and hashes
Only key-value pairs
Only strings
Exclusively JSON documents
What is the correct way to set a key-value pair named 'mykey' with the value 'myvalue' using redis-py?
r.insert('mykey', 'myvalue')
r.put('mykey', 'myvalue')
r.assign('mykey', 'myvalue')
r.set('mykey', 'myvalue')