What exactly can’t you understand?
This line creates a variable containing SQL query for the database.
The query asks database to delete one row from jokecategory table
It’s the ID of the category, yes, as indicated by “categoryid” being the field name matched. The SQL is removing entries from the jokecategory table where the categoryid is whatever is specified.