aherntech/sparc huggingface dataset:
Database: department_store
Question sequence:
Find the information about all the suppliers.
Sort them in the alphabetical order of their addresses.
Show the name and phone number of all suppliers in the alphabetical order of their addresses.
SQL query sequence:
SELECT * FROM Suppliers
SELECT * FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
Final question: List the name and phone number of all suppliers in the alphabetical order of their addresses.
Final SQL: SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
Database: department_store
Question sequence:
Show all the customers.
What are the phone numbers of all customers?
What are the phone numbers of all customers and suppliers?
SQL query sequence:
SELECT * FROM customers
SELECT customer_phone FROM customers
SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers
Final question: What are the phone numbers of all customers and suppliers?
Final SQL: SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers
Database: department_store
Question sequence:
Which products were ordered more than three times?
Which products were purchased for a total amount of more than 80000?
Find the ids of all products that were ordered more than three times or purchased for a total amount of more than 80000.
SQL query sequence:
SELECT * FROM Order_Items GROUP BY product_id HAVING count(*)  >  3
SELECT * FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000
SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*)  >  3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000
Final question: Return the ids of all products that were ordered more than three times or supplied more than 80000.
Final SQL: SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*)  >  3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000
Database: department_store
Question sequence:
What are the ids and names of all products?
How about those with a price lower than 600?
How about those with price above 600 or below 900?
SQL query sequence:
SELECT product_id ,  product_name FROM products
SELECT product_id ,  product_name FROM products WHERE product_price  <  600
SELECT product_id ,  product_name FROM products WHERE product_price  <  600 OR product_price  >  900
Final question: What are id and name of the products whose price is lower than 600 or higher than 900?
Final SQL: SELECT product_id ,  product_name FROM products WHERE product_price  <  600 OR product_price  >  900
Database: department_store
Question sequence:
What are the ids of all suppliers?
What is the average of total amount purchased?
Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.
SQL query sequence:
SELECT supplier_id FROM Product_Suppliers
SELECT avg(total_amount_purchased) FROM Product_Suppliers
SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased)  >  50000 OR avg(total_amount_purchased)  <  30000
Final question: Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.
Final SQL: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased)  >  50000 OR avg(total_amount_purchased)  <  30000
Database: department_store
Question sequence:
How many products does each suppler supply?
Which suppler supplies the most products? Give me the supplier id.
What are the average amount purchased and value purchased for this supplier.
SQL query sequence:
SELECT count(*) FROM Product_Suppliers GROUP BY supplier_id
SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1
SELECT avg(total_amount_purchased) ,  avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id  =  (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)
Final question: What are the average amount purchased and value purchased for the supplier who supplies the most products.
Final SQL: SELECT avg(total_amount_purchased) ,  avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id  =  (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)
Database: department_store
Question sequence:
Show all the customer codes.
What is the largest code among those?
Show me both the largest and smallest codes.
SQL query sequence:
SELECT customer_code FROM Customers
SELECT max(customer_code) FROM Customers
SELECT max(customer_code) ,  min(customer_code) FROM Customers
Final question: What is the largest and smallest customer codes?
Final SQL: SELECT max(customer_code) ,  min(customer_code) FROM Customers
Database: department_store
Question sequence:
Find the information for the product "keyboard".
Return all the distinct customers who bought a keyboard.
What are their names?
SQL query sequence:
SELECT * FROM products WHERE product_name  =  "keyboard"
SELECT DISTINCT *  FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id JOIN products AS T4 ON T3.product_id  =  T4.product_id WHERE T4.product_name  =  "keyboard"
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id JOIN products AS T4 ON T3.product_id  =  T4.product_id WHERE T4.product_name  =  "keyboard"
Final question: List the names of all the distinct customers who bought a keyboard.
Final SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id JOIN products AS T4 ON T3.product_id  =  T4.product_id WHERE T4.product_name  =  "keyboard"
Database: department_store
Question sequence:
Show the information for the product "red jeans".
Find all the distinct suppliers who supply red jeans.
What are their names and phone numbers?
SQL query sequence:
SELECT * FROM products WHERE product_name  =  "red jeans"
SELECT DISTINCT * FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN products AS T3 ON T2.product_id  =  T3.product_id WHERE T3.product_name  =  "red jeans"
SELECT DISTINCT T1.supplier_name ,  T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN products AS T3 ON T2.product_id  =  T3.product_id WHERE T3.product_name  =  "red jeans"
Final question: List the names and phone numbers of all the distinct suppliers who supply red jeans.
Final SQL: SELECT DISTINCT T1.supplier_name ,  T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN products AS T3 ON T2.product_id  =  T3.product_id WHERE T3.product_name  =  "red jeans"
Database: department_store
Question sequence:
What are the highest and lowest prices of products?
What are the highest and lowest prices of products, grouped by product type?
Sort the results by the product type.
SQL query sequence:
SELECT max(product_price) ,  min(product_price) FROM products
SELECT max(product_price) ,  min(product_price) ,  product_type_code FROM products GROUP BY product_type_code
SELECT max(product_price) ,  min(product_price) ,  product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code
Final question: What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?
Final SQL: SELECT max(product_price) ,  min(product_price) ,  product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code
Database: department_store
Question sequence:
Find customer orders whose status is "Cancelled".
List the order id, customer id for orders in Cancelled status.
Sort the results by the order date.
SQL query sequence:
SELECT * FROM customer_orders WHERE order_status_code  =   "Cancelled"
SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled"
SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
Final question: List the order id, customer id for orders in Cancelled status, ordered by their order dates.
Final SQL: SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
Database: department_store
Question sequence:
How many customers bought each product?
Which products were bought by at least two distinct customers?
What are the product names?
SQL query sequence:
SELECT COUNT (DISTINCT T1.customer_id) FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id
SELECT * FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
Final question: Find the names of products that were bought by at least two distinct customers.
Final SQL: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
Database: department_store
Question sequence:
Count the number of distinct products each customer ordered.
Find customers who have bought at least three distinct products.
What are their names?
SQL query sequence:
SELECT COUNT (T3.product_id) FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id
SELECT DISTINCT * FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
Final question: Find the names of customers who have bought at least three distinct products.
Final SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
Database: department_store
Question sequence:
What are the name and gender of each staff?
What about the staff that has been assigned the job of Sales Person?
What about the staff who has been assigned the job of Sales Person but never Clerical Staff?
SQL query sequence:
SELECT staff_name ,  staff_gender FROM staff
SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person"
SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person" EXCEPT SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Clerical Staff"
Final question: Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.
Final SQL: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person" EXCEPT SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Clerical Staff"
Database: department_store
Question sequence:
What are the id and name of each customer?
Only return those for customers whose address contains WY.
Find the ids and names of customers whose address contains WY state and do not use credit cards for payment.
SQL query sequence:
SELECT customer_id ,  customer_name FROM customers
SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%"
SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code != "Credit Card"
Final question: Find the id and name of customers whose address contains WY state and do not use credit card for payment.
Final SQL: SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code != "Credit Card"
Database: department_store
Question sequence:
Show me all the products.
What is the average price of all products?
What is the average price of all products whose type is Clothes.
SQL query sequence:
SELECT * FROM products
SELECT avg(product_price) FROM products
SELECT avg(product_price) FROM products WHERE product_type_code  =  'Clothes'
Final question: Find the average price of all product clothes.
Final SQL: SELECT avg(product_price) FROM products WHERE product_type_code  =  'Clothes'
Database: mountain_photos
Question sequence:
Find camera lens whose focal length is longer than 15 mm.
How many are there?
SQL query sequence:
SELECT * FROM camera_lens WHERE focal_length_mm  >  15
SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
Final question: How many camera lenses have a focal length longer than 15 mm?
Final SQL: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
Database: mountain_photos
Question sequence:
What are the brand and name of each camera lens?
Sort the results in descending order of the lens' maximum aperture.
SQL query sequence:
SELECT brand ,  name FROM camera_lens
SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
Final question: Find the brand and name for each camera lens, and sort in descending order of maximum aperture.
Final SQL: SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
Database: mountain_photos
Question sequence:
Give me the information for all photos.
List the id, color scheme, and name for each.
SQL query sequence:
SELECT * FROM photos
SELECT id ,  color ,  name FROM photos
Final question: List the id, color scheme, and name for all the photos.
Final SQL: SELECT id ,  color ,  name FROM photos
Database: mountain_photos
Question sequence:
What is the height of each mountain?
What is the maximum height?
Also show the average height.
SQL query sequence:
SELECT max(height) ,  avg(height) FROM mountain
SELECT max(height) FROM mountain
SELECT max(height) ,  avg(height) FROM mountain
Final question: What are the maximum and average height of the mountains?
Final SQL: SELECT height FROM mountain
Database: mountain_photos
Question sequence:
What is the prominence of each mountain?
What is the prominence of mountains in country 'Morocco'?
What is the average of them?
SQL query sequence:
SELECT prominence FROM mountain
SELECT prominence FROM mountain WHERE country  =  'Morocco'
SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
Final question: What are the average prominence of the mountains in country 'Morocco'?
Final SQL: SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
Database: mountain_photos
Question sequence:
Show all the mountains.
Which mountains do not belong to the range 'Aberdare Range'?
What are those mountains' name, height and prominence?
SQL query sequence:
SELECT * FROM mountain
SELECT * FROM mountain WHERE range != 'Aberdare Range'
SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
Final question: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
Final SQL: SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
Database: mountain_photos
Question sequence:
Show the id and name of all mountains.
Show the id and name of all the mountains that have photos.
What are the id and name of mountains that have photos and heights above 4000?
SQL query sequence:
SELECT id ,  name FROM mountain
SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id
SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
Final question: What are the id and name of mountains that have photos and height above 4000?
Final SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
Database: mountain_photos
Question sequence:
Show the ids and names of all mountains.
Show the ids and names of those that have photos.
Which ones have at least 2 photos?
SQL query sequence:
SELECT id ,  name FROM mountain
SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id
SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
Final question: What are the id and name of the mountains that have at least 2 photos?
Final SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
Database: mountain_photos
Question sequence:
Show the id of the camera lens that has taken picture of each mountain.
Which one has taken pictures of the most mountains.
What is the name of this camera?
SQL query sequence:
SELECT camera_lens_id FROM photos
SELECT camera_lens_id FROM photos GROUP BY camera_lens_id ORDER BY count(*) DESC LIMIT 1
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
Final question: What are the names of the cameras that have taken picture of the most mountains?
Final SQL: 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
Database: mountain_photos
Question sequence:
For each photo, show the id of the camera lens that has taken it.
Which photos were taken with the lens brand 'Sigma' or 'Olympus'?
Give me the photo names.
SQL query sequence:
SELECT camera_lens_id FROM photos
SELECT * FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
SELECT T2.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
Final question: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
Final SQL: SELECT T2.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
Database: mountain_photos
Question sequence:
What is the brand of each camera lens?
How many different kinds are there?
SQL query sequence:
SELECT brand FROM camera_lens
SELECT count(DISTINCT brand) FROM camera_lens
Final question: How many different kinds of lens brands are there?
Final SQL: SELECT count(DISTINCT brand) FROM camera_lens
Database: mountain_photos
Question sequence:
Show the id of all the camera lenses used for taking photos.
Which camera lenses were not used for taking any photos?
How many are there?
SQL query sequence:
SELECT camera_lens_id FROM photos
SELECT * FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
Final question: How many camera lenses are not used in taking any photos?
Final SQL: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
Database: mountain_photos
Question sequence:
Which mountains are in the country 'Ethiopia'?
Which camera lenses are used to take photos of these mountains? Return the camera lens ids.
How many distinct kinds of camera lenses are there, among these?
SQL query sequence:
SELECT * FROM mountain WHERE country  =  'Ethiopia'
SELECT T2.camera_lens_id FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
Final question: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
Final SQL: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
Database: mountain_photos
Question sequence:
Which mountains are in the range 'Toubkal Atlas'?
Find the brands of lenses that took a picture of mountains with range 'Toubkal Atlas'
Of these, which ones have also taken a picture of mountains with range 'Lasta Massif'
SQL query sequence:
SELECT * FROM mountain WHERE range  =  'Toubkal Atlas'
SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas'
SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Lasta Massif'
Final question: List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'
Final SQL: SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Lasta Massif'
Database: mountain_photos
Question sequence:
Which pictures are taken by a lens of brand 'Sigma'?
Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
SQL query sequence:
SELECT * FROM photos AS T2 JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
SELECT name ,  prominence FROM mountain EXCEPT SELECT T1.name ,  T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
Final question: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
Final SQL: SELECT name ,  prominence FROM mountain EXCEPT SELECT T1.name ,  T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
Database: mountain_photos
Question sequence:
Show the name of each camera lens.
Find the camera lens names containing substring "Digital".
SQL query sequence:
SELECT name FROM camera_lens
SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
Final question: List the camera lens names containing substring "Digital".
Final SQL: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"