Magento showing wrong product count in category in admin

After importing or updrading database, you may face this problem.

To fix this, you need to run following sql query:

Kindly, take database backup before running query to prevent accident deletes.

DELETE FROM catalog_category_product where product_id NOT IN (SELECT entity_id FROM (catalog_product_entity))