human
Schema:
mountain (id, name, Height, Prominence, Range, Country)
camera_lens (id, brand, name, focal_length_mm, max_aperture)
photos (id, camera_lens_id, mountain_id, color, name)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the id of the camera lens that has taken picture of each mountain.
assistant
SELECT camera_lens_id FROM photos;
human
Which one has taken pictures of the most mountains.
assistant
SELECT camera_lens_id FROM photos GROUP BY camera_lens_id ORDER BY COUNT( * ) DESC LIMIT 1;
human
What is the name of this camera?
assistant
SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY COUNT( * ) DESC LIMIT 1 ;