SQL Test
SQL Test
1. **Create a Database**
- Create a database named `School`.
2. **Create Tables**
- Create a table named `Students` with the following columns:
- `StudentID` (Primary Key, Integer)
- `FirstName` (VARCHAR(50))
- `LastName` (VARCHAR(50))
- `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` table.
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.
---
---
---