Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:10:41+00:00 2026-06-12T23:10:41+00:00

I need to create a SQL query to export my Magento site products in

  • 0

I need to create a SQL query to export my Magento site products in XML format.

I can’t figure where are attribute values and product images stored.

By now my query is this:

SELECT cpe.entity_id, cpe.sku, csi.qty, eav_color.value, eav_talla.value
FROM catalog_product_entity AS cpe
JOIN cataloginventory_stock_item AS csi ON csi.product_id = cpe.entity_id
JOIN catalog_product_entity_int AS eav_color ON eav_color.entity_id = cpe.entity_id
AND eav_color.attribute_id =85
JOIN catalog_product_entity_int AS eav_talla ON eav_talla.entity_id = cpe.entity_id
AND eav_talla.attribute_id =127
WHERE csi.qty >0
AND csi.is_in_stock
AND cpe.type_id =  'simple'
LIMIT 0 , 30

But I am getting attributes ids (I think). My query returns this:

entity_id           sku                 qty value   value
6000            0121011000-RED-L    2.0000     66       5

I am getting 66 as value for column attribute and value 5 for “talla” attribute.. But those values must be “RED” and “L”. I don’t understand in wich table are those values stored.

And on the other hand I need to get the product images but I can’t figure in where table are stored.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:10:42+00:00Added an answer on June 12, 2026 at 11:10 pm

    Although there is EAV attribute for image it is actually stored in two tables.

    The first one is catalog_product_entity_media_gallery with columns:

    • value_id – id for the current table
    • attribute_id – id of an attribute in eav_attribute table
    • entity_id – id of a product from catalog_product_entity table
    • value – path to the file

    The second is catalog_product_entity_media_gallery_value with columns:

    • value_id – id of the catalog_product_entity_media_gallery row
    • store_id – id of a store
    • label – label of an image
    • position – position in list of images
    • disabled – disable the image for the store

    So catalog_product_entity_media_gallery defines images for products and catalog_product_entity_media_gallery_value handles settings for different store views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble creating a query. I need to create a SQL query where
I need to generate a ms-word document from a pl/sql query to export a
I need to create native SQL query with couple of unions and subqueries. It'll
I need to create an sql query inside a ruby on rails application. I
I need to create an SQL query to insert some data into a table
I am new to SQL and databases.. I need to create an SQL query
We need to create several SQL reports, each of which depends upon the results
i am trying to create sql procedure or function that need to find duplicate
I use MS SQL 2008 R2, I need create a Table with a CHECK
I need to create an entirely new Sql Server 2008 database and want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.