How to get products name and sku and url key using sql query in magento 2?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite













How to get products name and sku and url key using sql query in magento 2 ?











share|improve this question





























    up vote
    1
    down vote

    favorite













    How to get products name and sku and url key using sql query in magento 2 ?











    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite












      How to get products name and sku and url key using sql query in magento 2 ?











      share|improve this question
















      How to get products name and sku and url key using sql query in magento 2 ?








      magento2 database sql programmatically






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago

























      asked 1 hour ago









      hitesh balpande

      1508




      1508




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          SQL QUERY:



          SELECT nametable.value, 
          nametable.store_id,
          catalog_product_entity.sku
          FROM `catalog_product_entity_varchar` AS nametable
          LEFT JOIN catalog_product_entity
          ON nametable.entity_id = catalog_product_entity.entity_id
          WHERE nametable.attribute_id = (SELECT attribute_id
          FROM `eav_attribute`
          WHERE `entity_type_id` = 4
          AND `attribute_code` LIKE 'name')


          As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar




          As Magento support multi-store data, So for single SKU, multiple row
          can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId







          share|improve this answer





























            up vote
            1
            down vote













            You can use directly sql queries in magento2 as shown on this link -



            using object manager (not recommended)




            https://webkul.com/blog/magento2-write-custom-mysql-query/




            Without object manager (recommended)




            How to call Direct SQL Queries and join to collection In Magento2




            To get SKU, you need to use table catalog_product_entity



            and to get product name, need to use table catalog_product_entity_varchar






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248007%2fhow-to-get-products-name-and-sku-and-url-key-using-sql-query-in-magento-2%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote



              accepted










              SQL QUERY:



              SELECT nametable.value, 
              nametable.store_id,
              catalog_product_entity.sku
              FROM `catalog_product_entity_varchar` AS nametable
              LEFT JOIN catalog_product_entity
              ON nametable.entity_id = catalog_product_entity.entity_id
              WHERE nametable.attribute_id = (SELECT attribute_id
              FROM `eav_attribute`
              WHERE `entity_type_id` = 4
              AND `attribute_code` LIKE 'name')


              As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar




              As Magento support multi-store data, So for single SKU, multiple row
              can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId







              share|improve this answer


























                up vote
                2
                down vote



                accepted










                SQL QUERY:



                SELECT nametable.value, 
                nametable.store_id,
                catalog_product_entity.sku
                FROM `catalog_product_entity_varchar` AS nametable
                LEFT JOIN catalog_product_entity
                ON nametable.entity_id = catalog_product_entity.entity_id
                WHERE nametable.attribute_id = (SELECT attribute_id
                FROM `eav_attribute`
                WHERE `entity_type_id` = 4
                AND `attribute_code` LIKE 'name')


                As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar




                As Magento support multi-store data, So for single SKU, multiple row
                can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId







                share|improve this answer
























                  up vote
                  2
                  down vote



                  accepted







                  up vote
                  2
                  down vote



                  accepted






                  SQL QUERY:



                  SELECT nametable.value, 
                  nametable.store_id,
                  catalog_product_entity.sku
                  FROM `catalog_product_entity_varchar` AS nametable
                  LEFT JOIN catalog_product_entity
                  ON nametable.entity_id = catalog_product_entity.entity_id
                  WHERE nametable.attribute_id = (SELECT attribute_id
                  FROM `eav_attribute`
                  WHERE `entity_type_id` = 4
                  AND `attribute_code` LIKE 'name')


                  As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar




                  As Magento support multi-store data, So for single SKU, multiple row
                  can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId







                  share|improve this answer














                  SQL QUERY:



                  SELECT nametable.value, 
                  nametable.store_id,
                  catalog_product_entity.sku
                  FROM `catalog_product_entity_varchar` AS nametable
                  LEFT JOIN catalog_product_entity
                  ON nametable.entity_id = catalog_product_entity.entity_id
                  WHERE nametable.attribute_id = (SELECT attribute_id
                  FROM `eav_attribute`
                  WHERE `entity_type_id` = 4
                  AND `attribute_code` LIKE 'name')


                  As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar




                  As Magento support multi-store data, So for single SKU, multiple row
                  can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 49 mins ago

























                  answered 55 mins ago









                  Amit Bera♦

                  55.3k1368162




                  55.3k1368162






















                      up vote
                      1
                      down vote













                      You can use directly sql queries in magento2 as shown on this link -



                      using object manager (not recommended)




                      https://webkul.com/blog/magento2-write-custom-mysql-query/




                      Without object manager (recommended)




                      How to call Direct SQL Queries and join to collection In Magento2




                      To get SKU, you need to use table catalog_product_entity



                      and to get product name, need to use table catalog_product_entity_varchar






                      share|improve this answer
























                        up vote
                        1
                        down vote













                        You can use directly sql queries in magento2 as shown on this link -



                        using object manager (not recommended)




                        https://webkul.com/blog/magento2-write-custom-mysql-query/




                        Without object manager (recommended)




                        How to call Direct SQL Queries and join to collection In Magento2




                        To get SKU, you need to use table catalog_product_entity



                        and to get product name, need to use table catalog_product_entity_varchar






                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          You can use directly sql queries in magento2 as shown on this link -



                          using object manager (not recommended)




                          https://webkul.com/blog/magento2-write-custom-mysql-query/




                          Without object manager (recommended)




                          How to call Direct SQL Queries and join to collection In Magento2




                          To get SKU, you need to use table catalog_product_entity



                          and to get product name, need to use table catalog_product_entity_varchar






                          share|improve this answer












                          You can use directly sql queries in magento2 as shown on this link -



                          using object manager (not recommended)




                          https://webkul.com/blog/magento2-write-custom-mysql-query/




                          Without object manager (recommended)




                          How to call Direct SQL Queries and join to collection In Magento2




                          To get SKU, you need to use table catalog_product_entity



                          and to get product name, need to use table catalog_product_entity_varchar







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 1 hour ago









                          Shashank Kumrawat

                          1,1441238




                          1,1441238



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248007%2fhow-to-get-products-name-and-sku-and-url-key-using-sql-query-in-magento-2%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              White Anglo-Saxon Protestant

                              BuddyTV

                              Conflict (narrative)