If you want to fetch the friendly URL for the product and an URL for the image through MySQL, you can do something like this (I tested it with PrestaShop 8.1.1):
SELECT
concat('https://example.com/', cl.link_rewrite, '/', p.id_product, '-', pl.link_rewrite, '.html') AS 'product_url',
concat('https://example.com/img/p/',mid(im.id_image,1,1),'/', if (length(im.id_image)>1,concat(mid(im.id_image,2,1),'/'),''),if (length(im.id_image)>2,concat(mid(im.id_image,3,1),'/'),''),if (length(im.id_image)>3,concat(mid(im.id_image,4,1),'/'),''),if (length(im.id_image)>4,concat(mid(im.id_image,5,1),'/'),''), im.id_image, '.jpg') AS 'image_url'
FROM ps_product p
INNER JOIN ps_product_lang pl ON p.id_product = pl.id_product
INNER JOIN ps_category_lang cl ON p.id_category_default = cl.id_category
LEFT JOIN ps_image im ON p.id_product = im.id_product
WHERE p.active = 1;
NOTE: Remember to replace "https://example.com/" with the URL of your webshop :)