Set a cron job to delete a specific database table table every midnight

The sql command for dropping a table would be something like:

DROP TABLE IF EXISTS X51g_myCRED_log

That would drop (delete) the table ‘X51g_myCRED_log’.

You can accomplish this with WP CLI:

wp db query "DROP TABLE IF EXISTS X51g_myCRED_log".

Be careful, I havent tested this, but this should point you in the right direction