All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Use ecommerce db.customer.insertMany([{_id:1,"name":"Ganesh","age":23,"city":"amalapuram","type":"premium","cust_id":501},{_id:2,"name":"Bala","age":22,"city":"Vizag","type":"premium","cust_id":502},{_id:3,"name":"Manotej","age":20,"city":"Hyderabad","type":"Non-premium","cust_id":503}]); db.products.insertMany([{Men:["shirts","Jeans","Trousers"],Brand:"Puma"},{Women:["Kurtas","Dresses","Jeans"],Brand:"Gucci"},{Kids:["Infants","Toys","Sets"],Brand:"Roadster"}]);…
Gorle Balaram
updated on 01 Dec 2022
Use ecommerce
db.customer.insertMany([
{_id:1,"name":"Ganesh","age":23,"city":"amalapuram","type":"premium","cust_id":501},
{_id:2,"name":"Bala","age":22,"city":"Vizag","type":"premium","cust_id":502},
{_id:3,"name":"Manotej","age":20,"city":"Hyderabad","type":"Non-premium","cust_id":503}
]);
db.products.insertMany([
{Men:["shirts","Jeans","Trousers"],Brand:"Puma"},
{Women:["Kurtas","Dresses","Jeans"],Brand:"Gucci"},
{Kids:["Infants","Toys","Sets"],Brand:"Roadster"}
]);
db.seller.insertMany([
{_id:201,"name":"Mohan","age":33,"city":"Chennai"},
{_id:202,"name":"John","age":50,"city":"Indore"},
{_id:203,"name":"Musk","age":28,"city":"Delhi"}
]);
db.admin.insertMany([
{_id:301,"name":"George","age":40,"city":"Paris"},
{_id:302,"name":"Gates","age":55,"city":"USA"}
]);
db.Billing.insertMany([
{"_id":501,"Payment_status":"Yes","order_place":"calcutta","orders":300},
{"_id":502,"Payment_status":"No","order_place":"Kochi","orders":1900},
{"_id":503,"Payment_status":"Yes","order_place":"Pune","orders":700}
]);
1.db.Billing.aggregate(
[
{
$group:
{
"_id": "_id",
AverageValue: { $avg: "$orders" }
}
}
]
)
2.db.getCollection('Billing').aggregate([{
$lookup:
{
from: 'customer',
localField: 'cust_id',
foreignField: '_id',
as: 'orderdetails'
}
},
{
$group: {
"_id":"_id",
Totalorders: { $sum: "$orders"}
}
}
]);
3.db.Billing.aggregate([
{
$group: {
"_id": "_id",
Totalorders: { $sum: "$orders"}
}
}
])
4.db.customer.aggregate([
{
"$group": {
"_id": "$name"
}
},
{
"$group": {
"_id": 1,
"city":"$city",
"count": { "$sum": 1 }
}
}
]);
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 2
Use ecommerce db.customer.insertMany([{_id:1,"name":"Ganesh","age":23,"city":"amalapuram","type":"premium","cust_id":501},{_id:2,"name":"Bala","age":22,"city":"Vizag","type":"premium","cust_id":502},{_id:3,"name":"Manotej","age":20,"city":"Hyderabad","type":"Non-premium","cust_id":503}]); db.products.insertMany([{Men:["shirts","Jeans","Trousers"],Brand:"Puma"},{Women:["Kurtas","Dresses","Jeans"],Brand:"Gucci"},{Kids:["Infants","Toys","Sets"],Brand:"Roadster"}]);…
01 Dec 2022 12:49 PM IST
Project 2
done
22 Nov 2022 04:29 AM IST
Project 1
Task 1 and Task 2 : CREATE DATABASE project_1;USE project_1; CREATE TABLE Register(RegisterId…
21 Nov 2022 05:11 AM IST
Project 1
done
19 Nov 2022 04:38 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.