Mongodb Test
Mongodb Test
1. **Create a Database**
- Create a database named `School`.
2. **Create Collections**
- Create a collection named `Students` with the following fields:
- `StudentID` (Integer, unique)
- `FirstName` (String)
- `LastName` (String)
- `DateOfBirth` (Date)
---
---
---
---
31. **Triggers**
- Write a trigger to automatically update a student's enrollment count upon a new enrollment.
- Write a trigger to log changes in the `Courses` collection.
32. **Cursors**
- Write a query to declare a cursor for retrieving student names.
- Write a query to use the cursor to fetch and print student names.
---
---