Magento – Magento 2: Get Product URL and SKU using SQL Query

magento-2.1querysql

How can I get all SKUs and Product URLs using only SQL Query?

Best Answer

Magento does not save product URLs completely in database tables. It saves only URL key, so you can get SKU and URL key directly from tables.

SKU is saved in catalog_product_entity table.

By default product's URL key is an attribute which is of type varchar, so its value is saved in catalog_product_entity_varchar table. By default attribute id of product's URL key is 124.

Please let me know if you want more detail.