You cannot delete Shelf Locations if they are being used in item templates. This SQL will show you which item templates are using which Shelf Locations for a particular LIBRARY (not BRANCH) orgid.
SELECT
it.ItemTemplateID as templateid,
it.name AS templatename,
sl.Description AS shelflocation
FROM
Polaris.polaris.ItemTemplates it
JOIN
polaris.Polaris.ShelfLocations sl ON sl.ShelfLocationID = it.ShelfLocationID
JOIN
polaris.polaris.Organizations orgs on orgs.OrganizationID = sl.OrganizationID
WHERE
orgs.ParentOrganizationID = 6 and ---enter LIBRARYID here
sl.OrganizationID = it.AssignedBranchID
ORDER BY
sl.Description
You can also use this Item Template Find Tool SQL to find all templates where the Shelf Location matches a particular description:
SELECT ItemTemplateID from polaris.polaris.ItemTemplates
where ShelfLocationID in (
select ShelfLocationID from polaris.polaris.ShelfLocations where Description like '%Easter%')