# Student Enrolment Delete

**URL:** <https://ask.gibbonedu.org/t/student-enrolment-delete/1602>\
**Category:** Administration\
**Created:** [January 5, 2018, 3:22pm UTC](https://ask.gibbonedu.org/t/student-enrolment-delete/1602 "2018-01-05T15:22:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpsal](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/g/c67d28/32.png) [@gpsal](https://ask.gibbonedu.org/u/gpsal)\
**Post date:** [January 5, 2018, 3:22pm UTC](https://ask.gibbonedu.org/t/student-enrolment-delete/1602/1 "2018-01-05T15:22:40Z")

</div>

Hi,  
I have accidentally enrolled students 2 times by using the Data Importer tool. This has meant that students have been enrolled into 2 form groups. Is there any way that i can delete all of the student enrolment without doing them individually.  
Thanks

---

<div class="post-metadata">

**Author:** ![sandra](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/sandra/32/5_2.png) [@sandra](https://ask.gibbonedu.org/u/sandra)\
**Post date:** [January 6, 2018, 7:26am UTC](https://ask.gibbonedu.org/t/student-enrolment-delete/1602/2 "2018-01-06T07:26:17Z")

</div>

Hi gpsal, sounds like a predicament. Yes it’s possible to use an SQL query to remove the imported entries.  
&nbsp;

```
`DELETE FROM gibbonStudentEnrolment WHERE gibbonSchoolYearID=(SELECT gibbonSchoolYearID FROM gibbonSchoolYear WHERE name='SCHOOL_YEAR_NAME');
`
```

This will delete ALL the enrolments for the year specified by name (replace SCHOOL_YEAR_NAME with the one you've imported to), which will clear things out letting you re-import the correct enrolments. If you already had other enrolments before the import mishap then the query will be a bit trickier, let me know if thats the case and I can put together and share a different SQL snippet.

With any major database change like running a query or import it's best to backup first, either with the snapshot tool in Data Admin or using a mysqldump/mysql export tool (but I've been here too, hindsight is always 20/20 :sweat_smile:).
```

---

<div class="post-metadata">

**Author:** ![gpsal](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/g/c67d28/32.png) [@gpsal](https://ask.gibbonedu.org/u/gpsal)\
**Post date:** [January 8, 2018, 7:23pm UTC](https://ask.gibbonedu.org/t/student-enrolment-delete/1602/3 "2018-01-08T19:23:50Z")

</div>

Great, Thanks i will try this
