[INST] Given a table of student grades with columns StudentID, CourseID, and Grade, write a SQL query to find the average grade for each course, rounded to the nearest integer./n [/INST]  ###Response: Here's the SQL query to find the average grade for each course:

```
SELECT CourseID, ROUND(AVG(Grade))
FROM student_grades
GROUP BY CourseID;
```

This query calculates the average grade for each course by first grouping the grades by CourseID using the GROUP BY statement. The AVG function is used to calculate the average for each group, and the ROUND function is used to round the result to the nearest integer. The resulting table will have two columns: CourseID and the rounded average grade.