I was successful in resolviong this issue locally:
but am now trying to duplicate the feat on Heroku and do not know how to access the database there. Can anyone guide me through the process?
You can open a PSQL session and use the same SQL you used locally:
heroku pg:psql [DATABASE]