NOSQL Assignment: March 16, 2026
1. Store this sentence in a string: "This is Database Systems."
2. Display the length of the string
3. Add the sentence "The course code is NDBS742" to the end of the string so it reads as
"This is Database Systems. The course code is NDBS742."
4. Automatically delete the string from the database in 60 seconds.
This -2 seconds shows that it has expired 2 seconds ago.
NOSQL Assignment: March 23, 2026
Questions
Q1. Create a key username with value "your_name".
Perform the following operations:
a) Set expiry of 20 seconds
b) Find the length of the value
c) Append " your_surname" to it
d) Retrieve the final value
Q2. Insert the following key-value pairs (name, city, course, year):
a) Display all keys
b) Delete the key city
c) Display remaining keys and their values
Q3. Create a key marks = 50. Perform:
a) Increment by 1
b) Increment by 10
c) Decrement by 5
d) Display final value
Q4. Using MSET, insert multiple key-value pairs.
a) Append a string to one of the keys
b) Find the length of the updated value
c) Retrieve all values
Q5. Create a hash student:1 with fields: name, age, branch.
a) Retrieve all fields
b) Check if field email exists
c) Delete field branch
d) Display updated hash
Q6. Create two hashes student:1 and student:2 with fields: name, age, branch.
a) Retrieve both student records
b) Update age of student:2
c) Delete one field from student:1
Q7. Create a list numbers and perform:
a) Insert values 5, 10, 15, 20
b) Display all elements
c) Remove first element
d) Find length of list
e) Retrieve element at index 2
Q8. Create a list with elements [1,2,3,4,5]. Perform:
a) Insert 100 before 3
b) Insert 200 after 4
c) Display final list
Q9. Create set A with elements: 1,2,3,4,4,2. Create set B with elements: 3,4,5,6.
Perform:
a) Display elements of set A
b) Find difference (A − B)
c) Store result in set C
d) Perform union of A and B
Q10. Perform the following sequence:
a) Create string key project = "redis"
b) Create a hash project:1 with fields name and status
c) Create a list of tasks and add 3 elements
d) Create a set of team members
e) Display all created data structures