Compare commits
2 Commits
fed7e0adb1
...
37fc21421d
Author | SHA1 | Date | |
---|---|---|---|
37fc21421d | |||
34a507522a |
@ -6,7 +6,7 @@
|
||||
> Use Employee database created in Assignment B-01 and perform following aggregation operation
|
||||
> Refer [Queries-B1](https://git.kska.io/sppu-te-comp-content/DatabaseManagementSystems/src/branch/main/Practical/Assignment-B1/Queries-B1.md)
|
||||
|
||||
1. Return Designation with Total Salary Above 200000:
|
||||
1. Return Designation with Total Salary Above 20000:
|
||||
```mongodb
|
||||
db.Employee.aggregate([
|
||||
{
|
||||
@ -17,18 +17,18 @@ db.Employee.aggregate([
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
TotalSalary: { $gt: 200000 }
|
||||
TotalSalary: { $gt: 20000 }
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
```
|
||||
|
||||
2. Find Employee with Total Salary for Each City with Designation "DBA":
|
||||
2. Find Employee with Total Salary for Each City with Designation "Developer":
|
||||
```mongodb
|
||||
db.Employee.aggregate([
|
||||
{
|
||||
$match: { Designation: "DBA" }
|
||||
$match: { Designation: "Tester" }
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
@ -40,11 +40,11 @@ db.Employee.aggregate([
|
||||
|
||||
```
|
||||
|
||||
3. Find Total Salary of Employee with Designation "DBA" for Each Company:
|
||||
3. Find Total Salary of Employee with Designation "Tester" for Each Company:
|
||||
```mongodb
|
||||
db.Employee.aggregate([
|
||||
{
|
||||
$match: { Designation: "DBA" }
|
||||
$match: { Designation: "Tester" }
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
@ -94,11 +94,11 @@ db.Employee.aggregate([
|
||||
|
||||
```
|
||||
|
||||
7. Return Separate Value in the Expertise Array Where Name of Employee is "Swapnil":
|
||||
7. Return Separate Value in the Expertise Array Where Name of Employee is "Aditya":
|
||||
```mongodb
|
||||
db.Employee.aggregate([
|
||||
{
|
||||
$match: { "Name.FName": "Swapnil" }
|
||||
$match: { "Name.FName": "Aditya" }
|
||||
},
|
||||
{
|
||||
$unwind: "$Expertise"
|
||||
@ -192,7 +192,7 @@ db.Employee.reIndex()
|
||||
|
||||
6. Drop Index on Remove Specific Index:
|
||||
```mongodb
|
||||
db.Employee.dropIndex("empIndex")
|
||||
db.Employee.dropIndex("Designation_1")
|
||||
|
||||
```
|
||||
|
||||
|
BIN
Practical/Assignment-B2/Softcopy-B2.pdf
Normal file
BIN
Practical/Assignment-B2/Softcopy-B2.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user