0% found this document useful (0 votes)
7 views2 pages

Assignment Nosql

Uploaded by

hajeera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Assignment Nosql

Uploaded by

hajeera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT

1. Demonstrate the following operation in MongoDB.

Roll Name Age Section CSE3001 CSE3075 CSE3078 CSE3082


1001 Abhi 20 8CSE1 98 60 93 84
1002 Suraj 21 8CSE2 85 78 83 92
1003 Kavya 20 8CSE3 76 92 74 82
1004 Rohan 23 8CSE4 85 81 64 91
1005 Sheena 20 8CSE5 96 70 92 86
1006 Ritu 23 8CSE6 82 63 80 71
1007 Priya 23 8CSE6 45 90 72 84
1008 Sahil 21 8CSE6 96 74 91 70
1009 Ankith 22 8CSE6 83 93 74 87
1010 Lohit 21 8CSE5 72 66 69 63

Create a new MongoDB database named "StudentDB" and within it, create a collection
named "Students” and inserts the above records and execute the given below Queries:

a. Finds students who scored more than 90 in CSE3001 AND scored less than 90 in
CSE3075.
b. Increase the CSE3001 score by 5 marks for all students in section '8CSE6'.
c. Finds students with scores of 80 or less in subject CSE3082.
d. Create an index on age field
e. Find Maximum and Minimum Scores by Age Group
f. Delete all students in the "Students" collection whose age is below 21.
g. Remove the entire "Students" collection from the "StudentDB" database.
2. Demonstrate the following operation in MongoDB.

ID Name Age Score Course


1 Sneha 26 78 Maths
2 Komal 25 88 Science
3 Dhruti 29 83 CS
4 Shakti 26 95 IS
5 Mohan 26 92 EEE
6 Raju 24 88 ECE
7 Pinky 25 79 MEC
8 Sankalp 23 96 CIV
9 Anvesha 23 77 BBA
10 Lincy 25 97 Maths

Create a new MongoDB database named "Scholar" and within it, create a collection named
"Researcher” and inserts the above records and execute the given below aggregation Queries:

1. Match with name field to retrieve all documents starting with S.


2. Find researchers older than 25 and with a score greater than or equal to 80.
3. Find Maximum and Minimum Scores by Age Group.
4. Sort Documents by Age field in Ascending Order.
5. Find Maximum and Minimum Scores by Age Group.
6. Find students who have taken the course "Maths"

You might also like