use EduEnrolment
// Create collections
db.createCollection("departments")
db.createCollection("instructors")
db.createCollection("modules")
db.createCollection("students")
db.createCollection("enrolments")
// Insert records into departments
db.departments.insertMany([
{ departmentID: "ASC01", name: "Applied Science" },
{ departmentID: "BIM02", name: "Biomedicine" },
{ departmentID: "COL03", name: "Commerce and Law" },
{ departmentID: "HAA04", name: "Humanities and Arts" },
{ departmentID: "TEC05", name: "Technology" }
])
// Insert records into instructors
db.instructors.insertMany([
{ instructorID: "I001", name: "Mark Langa", departmentID: "HAA04" },
{ instructorID: "I002", name: "Sam Nhlapo", departmentID: "TEC05" },
{ instructorID: "I003", name: "Trudie Lotz", departmentID: "ASC01" },
{ instructorID: "I004", name: "Norette Jobert", departmentID: "COL03" },
{ instructorID: "I005", name: "Raleigh Reddy", departmentID: "BIM02" }
])
// Insert records into modules
db.modules.insertMany([
{ moduleID: "M001", name: "Mathematics 1A", moduleCode: "MAT01", instructorID: "I003" },
{ moduleID: "M002", name: "Database Systems", moduleCode: "DAT01", instructorID: "I002" },
{ moduleID: "M003", name: "Business English", moduleCode: "BUS01", instructorID: "I001" },
{ moduleID: "M004", name: "Economics", moduleCode: "ECO01", instructorID: "I004" },
{ moduleID: "M005", name: "Physics", moduleCode: "PHY01", instructorID: "I005" },
{ moduleID: "M006", name: "Accounting", moduleCode: "ACC01", instructorID: "I004" }
])
// Insert records into students
db.students.insertMany([
{ studentID: 2201, name: "Anna Williams", year: 3 },
{ studentID: 2202, name: "Kagiso Jiyane", year: 2 },
{ studentID: 2203, name: "Thato Mokoena", year: 1 },
{ studentID: 2204, name: "Phillip Malan", year: 1 },
{ studentID: 2205, name: "Werner De Kock", year: 2 }
])
// Insert records into enrolments
db.enrolments.insertMany([
{ studentID: 2201, moduleID: "M005" },
{ studentID: 2201, moduleID: "M001" },
{ studentID: 2202, moduleID: "M002" },
{ studentID: 2203, moduleID: "M003" },
{ studentID: 2203, moduleID: "M001" },
{ studentID: 2204, moduleID: "M003" },
{ studentID: 2204, moduleID: "M004" },
{ studentID: 2204, moduleID: "M006" },
{ studentID: 2205, moduleID: "M002" },
{ studentID: 2205, moduleID: "M001" },
])
To embed this project on your website, copy the following code and paste it into your website's HTML: