Crud
Crud
use schoolDB
db.students.insertMany([
{ student_id: "S001", name: "Joy", age: 21, track: "Web" },
{ student_id: "S002", name: "Kevin", age: 19, track: "Python" },
{ student_id: "S003", name: "Zahara", age: 22, track: "AI" },
{ student_id: "S004", name: "Brian", age: 23, track: "DevOps" },
{ student_id: "S005", name: "Lilian", age: 20, track: "MERN" }
])
db.students.updateMany({}, {
$set: {
contact: { email: "user@example.com", phone: "07000111222"},
emergency: { name: "Parent", relation: "Mother", phone: "07111222333"}
}
})
db.mentors.insertMany([
{ mentor_id: "M001", name: "Mr. Kasongo", specialty: "Wantam" },
{ mentor_id: "M002", name: "Mr. WiggyG", specialty: "Truthful" },
{ mentor_id: "M003", name: "Mr. Dedan", specialty: "AI" }
])
db.courses.insertMany([
{ course_id: "C101", title: "Lyingtology", duration_weeks: 5, mentor_id: "M001"
},
{ course_id: "C102", title: "Poet", duration_weeks: 2, mentor_id: "M002" },
{ course_id: "C103", title: "AI for beginners", duration_weeks: 3, mentor_id:
"M003" }
])
db.enrollments.insertMany([
{ student_id: "S001", course_id: "C101", status: "in-progress", score: 88 },
{ student_id: "S002", course_id: "C102", status: "completed", score: 92 },
{ student_id: "S004", course_id: "C101", status: "in-progress", score: 78 },
{ student_id: "S005", course_id: "C103", status: "completed", score: 85 }
])