Files are in wp-content/uploads/
In the database:
The highlighted images are saved in the
postmeta
table with
meta_key
_wp_attached_file
and related to
meta_key
of
_thumbnail_id
The images within the post has the name saved in the
posts
table together with the content in
post_content
An example query to list the posts with the highlighted image is:
select *, (select p.guid from wp_postmeta pm, wp_posts p where pm.meta_key="_thumbnail_id" and pm.post_id=post.id and p.ID=pm.meta_value) as imagem_destacada from wp_posts post where post_status='publish' and post_type="post";