0% found this document useful (0 votes)
2 views

DBMS

The document outlines a MongoDB assignment involving the insertion of employee data into the EmployeeDB. It includes problem statements requiring the use of Map-Reduce functions to analyze employee salaries and counts by department, total price per customer from an Orders collection, total salaries for the computer department, and city-wise population for cities in New York state. The assignment emphasizes practical application of database operations and data aggregation techniques.

Uploaded by

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

DBMS

The document outlines a MongoDB assignment involving the insertion of employee data into the EmployeeDB. It includes problem statements requiring the use of Map-Reduce functions to analyze employee salaries and counts by department, total price per customer from an Orders collection, total salaries for the computer department, and city-wise population for cities in New York state. The assignment emphasizes practical application of database operations and data aggregation techniques.

Uploaded by

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

Assignment 10

test> use EmployeeDB

switched to db EmployeeDB

EmployeeDB> db.employees.insertMany([

... { _id: 1, name: "Rohan", department: "HR", salary: 50000 },

... { _id: 2, name: "Piyush", department: "IT", salary: 70000 },

... { _id: 3, name: "Kunal", department: "HR", salary: 55000 },

... { _id: 4, name: "Aditya", department: "IT", salary: 72000 },

... { _id: 5, name: "Chaitanya", department: "Computer", salary: 80000 },

... { _id: 6, name: "Amit", department: "Computer", salary: 85000 }

... ]);

...

acknowledged: true,

insertedIds: { '0': 1, '1': 2, '2': 3, '3': 4, '4': 5, '5': 6 }

}
Problem Statements:

Using Map-Reduce function comply the following requirements

Q1. Display the salary of employees department wise

Ans :-

Q2. Display the count of employees departmentwise

Ans :-

Q3. Consider the collection “Orders “ with the following types of doccuments

_id: ObjectId("50a8240b927d5d8b5891743c"),

cust_id: "abc123",

status: 'A',

price: 25,

}
Return the Total Price Per Customer

Ans :-

Q4. Display the total salary of employees working in computer department.

Ans :-

Q5. Consider each document in the zipcode collection has the following form:

"_id": "10280",

"city": "NEW YORK",

"state": "NY",

"pop": 5574,

}
Return the city wise population of the cities in the NY state.

Ans :-

You might also like