How product website relation are stored in catalog_product_website table Magento 2?

Magento catalog_product_website is used to store relations between a product and its associated websites.

If your Magento runs with multiple websites and the product is assigned to multiple websites, its relation with the website is stored in the catalog_product_website table.

Table catalog_product_website has two columns.

      • product_id — Foreign key with catalog_product_entity
      • website_id — Foreign key with store_website

If the Product item is associated with 2 websites, Let’s consider product ID is 10 and website IDs are 1 and 2, There will be two different entries available in the catalog_product_website table to keep the relation between multiple websites for a product.

You can directly check the database table and find a product ID to check how many websites are associated with the given item.