Brief: you can repair tables by following the below tutorial, noting that in case you face any issue related to database tables, you have to solve it using the CMS control panel.
1- Login to Cpanel.
2- From side list, select (Tools) > then (Database Backup)as the below picture:
Firstly: repair/optimize tables:
1- press in front of the required table, or press (toggle all) to select all tables as shown below:
2- beneath this table, there is a form whether you want to optimize tables, repair tables, or both and press (continue) to proceed as shown below:
Secondly: Fix Unique Indexes:
If the unique indexes of your database are lost for any reason (mostly it happens due to importing a corrupted SQL), you may face infrequent issues, particularly when you use the language and template systems,
this system will attempt to solve the issue and rebuild your UNIQUE indexes.
Please ensure that the mysql-schema.php file is included in the (install folder) on your web server before continuing.
This process can be executed as shown in the below picture:
Thirdly: Fix Modules Contents Counter
For any reason, the contents counter can be corrupted (it may happen because of upgrading the Mysql server) as the content number is not shown correctly in the statistics block. This action is aiming at tackling this issue.
This process can be executed as shown in the below picture:
Fourthly: Fix Content ID Fields In Modules
For any reason, the contents counter can be corrupted (it may happen because of upgrading the Mysql server) and it returns an error stating that the content reached 255 and that you can't add any more content.
This process can be executed as shown in the below picture:
Fifthly: Fix Comments Counter:
If for whatever reason the comments counter in your database has been corrupted, This process can be executed as shown in the below picture: