SQL
x
USE commonswiki_p;
SET @images_count = (SELECT COUNT(*)
FROM image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND image.img_name = page.page_title
AND categorylinks.cl_to = 'Images_from_Wiki_Loves_Monuments_2016_in_France'
);
SET @percent_5 = (@images_count * 0.95);
PREPARE STMT FROM 'SELECT *
FROM image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND image.img_name = page.page_title
AND categorylinks.cl_to = \'Images_from_Wiki_Loves_Monuments_2016_in_France\'
ORDER BY (image.img_width * image.img_height) ASC
LIMIT ?, 1
;';
EXECUTE STMT USING @percent_5;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.