MONGODB Questions (NOSQL)
Task 9: Describe a scenario and write a query that uses any two of these functions: $concat, $substr, $toLower, $toUpper
Scenario:
Task 10: Describe a scenario and write a query that uses any two of these functions: $add, $divide, $mod, $multiply, $subtract
Scenario:
Task 11: Describe a scenario and write a query that uses $redact, $$descend and $$prune command
Scenario:
Task 9:
Scenario: Consider that we have a student database which contains student name, age, class, ect. Consider we have different student name in the database such as john, mike, miller. We need to perform some of the SQL functions.
The SQL query to convert the name mike into lowercase is as follows,
SELECT name from student
WHERE LOWER (First_name) = 'mike';
The SQL query to convert the name john into uppercase is as follows,
SELECT name from student
WHERE UPPER (First_name) = 'john';
Get Answers For Free
Most questions answered within 1 hours.