Sorry for the delay in the response. I wanted to make sure I had time to write the length response that this was going to require.
Deleting a ticket and/or user at the sql level is a lot more involved than just deleting all tickets with a specific user id.
The problem is that there are a number of other tables that have entries based on the existence of that ticket or user.
the ost_form_entry_values might have data. the ost_thread, ost_thread_collaborator, ost_thread_entry, ost_thread_entry_email, ost_thread_event, and ost_thread_referral tables might also have entries. ost_user, ost_user__cdata, ost_user_account, and ost_user_email. All of those things would have to be purged also.
You can get the user id from ost_user. Then you can use that to delete information from:
ost_user__cdata (you could always just drop this table, it will be recreated)
ost_user_account
ost_user_email
With the ticket_id you then delete entries from the following:
ost_ticket
ost_thread,
ost_thread_collaborator,
ost_thread_entry,
ost_thread_entry_email,
ost_thread_event,
ost_thread_referral
summarize:
Use the id from ost_user to identify and deleted from ost_user__cdata (you could always just drop this table, it will be recreated), ost_user_account, ost_user_email
Use the ticket_id against the object_id and where object_type is equal to "T" from ost_thread to find the [thread] id, then delete the record from ost_thread
Then delete all entries in ost_thread_collaborator, ost_thread_entry, ost_thread_entry_email, ost_thread_event, and ost_thread_referral where the thread_id is equal to the ost_thread.id