I need to export all products and images but I don’t know which table the images are in

All images is stored in the wp_posts table with a post_type set to attachment e.g:

SELECT ID, post_type, guid FROM wp_posts WHERE post_type="attachment"

+------+------------+-------------------------------------------------------------------------------------------+
| ID   | post_type  | guid                                                                                      |
+------+------------+-------------------------------------------------------------------------------------------+
| 3507 | attachment | http://localhost:8000/wp/wp-content/uploads/2016/04/965299442994c85c_org.jpg              |
| 3485 | attachment | http://localhost:8000/wp/wp-content/uploads/2017/10/ab7c1762d9245ea3_org.jpg              |
| 3483 | attachment | http://localhost:8000/wp/wp-content/uploads/2017/11/a5e7f0092e77337d_org.png              |
| 3465 | attachment | http://localhost:8000/wp/wp-content/uploads/2018/05/9213e34085be43c7_org.png              |
| 3463 | attachment | http://localhost:8000/wp/wp-content/uploads/2018/05/acf63925ab2b7214_org.png              |
| 3459 | attachment | http://localhost:8000/wp/wp-content/uploads/2018/06/aa72b09f84f61ebe_org.png              |
| 3073 | attachment | http://localhost:8000/wp/wp-content/uploads/2022/07/200811_164630923592737_4578052_n.jpeg |
| 3727 | attachment | http://localhost:8080/wp/wp-content/uploads/2022/08/woocommerce-placeholder.png           |
+------+------------+-------------------------------------------------------------------------------------------+

As you can see the guid is an URL pointing to where the image is located in your uploads directory.