db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
customers_and_invoices
select invoice_number , count(*) from financial_transactions group by invoice_number
Question: how many transactions correspond to each invoice number? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order...
how many transactions correspond to each invoice number?
customers_and_invoices
select t2.invoice_number , t2.invoice_date from financial_transactions as t1 join invoices as t2 on t1.invoice_number = t2.invoice_number group by t1.invoice_number order by count(*) desc limit 1
Question: what is the invoice number and invoice date for the invoice with most number of transactions? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders...
what is the invoice number and invoice date for the invoice with most number of transactions?
customers_and_invoices
select t2.invoice_number , t2.invoice_date from financial_transactions as t1 join invoices as t2 on t1.invoice_number = t2.invoice_number group by t1.invoice_number order by count(*) desc limit 1
Question: what is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_prov...
what is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?
customers_and_invoices
select count(*) from invoices
Question: how many invoices do we have? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed, order_details. Inv...
how many invoices do we have?
customers_and_invoices
select count(*) from invoices
Question: count the number of invoices. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed, order_details. Inv...
count the number of invoices.
customers_and_invoices
select t1.invoice_date , t1.order_id , t2.order_details from invoices as t1 join orders as t2 on t1.order_id = t2.order_id
Question: show invoice dates and order id and details for all invoices. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_...
show invoice dates and order id and details for all invoices.
customers_and_invoices
select t1.invoice_date , t1.order_id , t2.order_details from invoices as t1 join orders as t2 on t1.order_id = t2.order_id
Question: what are the invoice dates, order ids, and order details for all invoices? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, custo...
what are the invoice dates, order ids, and order details for all invoices?
customers_and_invoices
select order_id , count(*) from invoices group by order_id
Question: show the order ids and the number of invoices for each order. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_...
show the order ids and the number of invoices for each order.
customers_and_invoices
select order_id , count(*) from invoices group by order_id
Question: how many invoices correspond to each order id? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed, o...
how many invoices correspond to each order id?
customers_and_invoices
select t2.order_id , t2.order_details from invoices as t1 join orders as t2 on t1.order_id = t2.order_id group by t2.order_id having count(*) > 2
Question: what is the order id and order details for the order more than two invoices. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, cus...
what is the order id and order details for the order more than two invoices.
customers_and_invoices
select t2.order_id , t2.order_details from invoices as t1 join orders as t2 on t1.order_id = t2.order_id group by t2.order_id having count(*) > 2
Question: return the order ids and details for orderes with two or more invoices. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer...
return the order ids and details for orderes with two or more invoices.
customers_and_invoices
select t2.customer_last_name , t1.customer_id , t2.phone_number from orders as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) desc limit 1
Question: what is the customer last name, id and phone number with most number of orders? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, ...
what is the customer last name, id and phone number with most number of orders?
customers_and_invoices
select t2.customer_last_name , t1.customer_id , t2.phone_number from orders as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) desc limit 1
Question: return the last name, id and phone number of the customer who has made the greatest number of orders. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country...
return the last name, id and phone number of the customer who has made the greatest number of orders.
customers_and_invoices
select product_name from products except select t1.product_name from products as t1 join order_items as t2 on t1.product_id = t2.product_id
Question: show all product names without an order. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed, order_d...
show all product names without an order.
customers_and_invoices
select product_name from products except select t1.product_name from products as t1 join order_items as t2 on t1.product_id = t2.product_id
Question: what are the names of products that have never been ordered? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_o...
what are the names of products that have never been ordered?
customers_and_invoices
select t2.product_name , sum(t1.product_quantity) from order_items as t1 join products as t2 on t1.product_id = t2.product_id group by t2.product_name
Question: show all product names and the total quantity ordered for each product name. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, cus...
show all product names and the total quantity ordered for each product name.
customers_and_invoices
select t2.product_name , sum(t1.product_quantity) from order_items as t1 join products as t2 on t1.product_id = t2.product_id group by t2.product_name
Question: what are the different product names, and what is the sum of quantity ordered for each product? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orde...
what are the different product names, and what is the sum of quantity ordered for each product?
customers_and_invoices
select order_id , count(*) from order_items group by order_id
Question: show the order ids and the number of items in each order. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_orde...
show the order ids and the number of items in each order.
customers_and_invoices
select order_id , count(*) from order_items group by order_id
Question: how many order items correspond to each order id? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed...
how many order items correspond to each order id?
customers_and_invoices
select product_id , count(distinct order_id) from order_items group by product_id
Question: show the product ids and the number of unique orders containing each product. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, cu...
show the product ids and the number of unique orders containing each product.
customers_and_invoices
select product_id , count(distinct order_id) from order_items group by product_id
Question: how many distinct order ids correspond to each product? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_...
how many distinct order ids correspond to each product?
customers_and_invoices
select t2.product_name , count(*) from order_items as t1 join products as t2 on t1.product_id = t2.product_id join orders as t3 on t3.order_id = t1.order_id group by t2.product_name
Question: show all product names and the number of customers having an order on each product. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_...
show all product names and the number of customers having an order on each product.
customers_and_invoices
select t2.product_name , count(*) from order_items as t1 join products as t2 on t1.product_id = t2.product_id join orders as t3 on t3.order_id = t1.order_id group by t2.product_name
Question: what are teh names of the different products, as well as the number of customers who have ordered each product. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_provinc...
what are teh names of the different products, as well as the number of customers who have ordered each product.
customers_and_invoices
select order_id , count(distinct product_id) from order_items group by order_id
Question: show order ids and the number of products in each order. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order...
show order ids and the number of products in each order.
customers_and_invoices
select order_id , count(distinct product_id) from order_items group by order_id
Question: how many different products correspond to each order id? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order...
how many different products correspond to each order id?
customers_and_invoices
select order_id , sum(product_quantity) from order_items group by order_id
Question: show order ids and the total quantity in each order. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_pla...
show order ids and the total quantity in each order.
customers_and_invoices
select order_id , sum(product_quantity) from order_items group by order_id
Question: give the order ids for all orders, as well as the total product quantity in each. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id...
give the order ids for all orders, as well as the total product quantity in each.
customers_and_invoices
select count(*) from products where product_id not in ( select product_id from order_items )
Question: how many products were not included in any order? | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_placed...
how many products were not included in any order?
customers_and_invoices
select count(*) from products where product_id not in ( select product_id from order_items )
Question: count the number of products that were never ordered. | Tables: Customers -> customer_id, customer_first_name, customer_middle_initial, customer_last_name, gender, email_address, login_name, login_password, phone_number, town_city, state_county_province, country. Orders -> order_id, customer_id, date_order_pl...
count the number of products that were never ordered.
wedding
select count(*) from church where open_date < 1850
Question: how many churches opened before 1850 are there? | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.People_ID, we...
how many churches opened before 1850 are there?
wedding
select name , open_date , organized_by from church
Question: show the name, open date, and organizer for all churches. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.Peo...
show the name, open date, and organizer for all churches.
wedding
select name from church order by open_date desc
Question: list all church names in descending order of opening date. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.Pe...
list all church names in descending order of opening date.
wedding
select open_date from church group by open_date having count(*) >= 2
Question: show the opening year in whcih at least two churches opened. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people....
show the opening year in whcih at least two churches opened.
wedding
select organized_by , name from church where open_date between 1830 and 1840
Question: show the organizer and name for churches that opened between 1830 and 1840. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Ma...
show the organizer and name for churches that opened between 1830 and 1840.
wedding
select open_date , count(*) from church group by open_date
Question: show all opening years and the number of churches that opened in that year. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Ma...
show all opening years and the number of churches that opened in that year.
wedding
select name , open_date from church order by open_date desc limit 3
Question: show the name and opening year for three churches that opened most recently. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.M...
show the name and opening year for three churches that opened most recently.
wedding
select count(*) from people where is_male = 'f' and age > 30
Question: how many female people are older than 30 in our record? | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.Peopl...
how many female people are older than 30 in our record?
wedding
select country from people where age < 25 intersect select country from people where age > 30
Question: show the country where people older than 30 and younger than 25 are from. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male...
show the country where people older than 30 and younger than 25 are from.
wedding
select min(age) , max(age) , avg(age) from people
Question: show the minimum, maximum, and average age for all people. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.Pe...
show the minimum, maximum, and average age for all people.
wedding
select name , country from people where age < (select avg(age) from people)
Question: show the name and country for all people whose age is smaller than the average. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, weddin...
show the name and country for all people whose age is smaller than the average.
wedding
select t2.name , t3.name from wedding as t1 join people as t2 on t1.male_id = t2.people_id join people as t3 on t1.female_id = t3.people_id where t1.year > 2014
Question: show the pair of male and female names in all weddings after year 2014 | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID...
show the pair of male and female names in all weddings after year 2014
wedding
select name , age from people where is_male = 't' and people_id not in (select male_id from wedding)
Question: show the name and age for all male people who don't have a wedding. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = ...
show the name and age for all male people who don't have a wedding.
wedding
select name from church except select t1.name from church as t1 join wedding as t2 on t1.church_id = t2.church_id where t2.year = 2015
Question: show all church names except for those that had a wedding in year 2015. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_I...
show all church names except for those that had a wedding in year 2015.
wedding
select t1.name from church as t1 join wedding as t2 on t1.church_id = t2.church_id group by t1.church_id having count(*) >= 2
Question: show all church names that have hosted least two weddings. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.Pe...
show all church names that have hosted least two weddings.
wedding
select t2.name from wedding as t1 join people as t2 on t1.female_id = t2.people_id where t1.year = 2016 and t2.is_male = 'f' and t2.country = 'canada'
Question: show the names for all females from canada having a wedding in year 2016. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male...
show the names for all females from canada having a wedding in year 2016.
wedding
select count(*) from wedding where year = 2016
Question: how many weddings are there in year 2016? | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.People_ID, wedding....
how many weddings are there in year 2016?
wedding
select t4.name from wedding as t1 join people as t2 on t1.male_id = t2.people_id join people as t3 on t1.female_id = t3.people_id join church as t4 on t4.church_id = t1.church_id where t2.age > 30 or t3.age > 30
Question: show the church names for the weddings of all people older than 30. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = ...
show the church names for the weddings of all people older than 30.
wedding
select country , count(*) from people group by country
Question: show all countries and the number of people from each country. | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = peopl...
show all countries and the number of people from each country.
wedding
select count (distinct church_id) from wedding where year = 2016
Question: how many churches have a wedding in year 2016? | Tables: people -> People_ID, Name, Country, Is_Male, Age. church -> Church_ID, Name, Organized_by, Open_Date, Continuation_of. wedding -> Church_ID, Male_ID, Female_ID, Year. | Joins: wedding.Female_ID = people.People_ID, wedding.Male_ID = people.People_ID, wed...
how many churches have a wedding in year 2016?
theme_gallery
select count(*) from artist
Question: how many artists do we have? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_ID = exhibition.Exh...
how many artists do we have?
theme_gallery
select count(*) from artist
Question: count the number of artists. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_ID = exhibition.Exh...
count the number of artists.
theme_gallery
select name , age , country from artist order by year_join
Question: show all artist name, age, and country ordered by the yeared they joined. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exh...
show all artist name, age, and country ordered by the yeared they joined.
theme_gallery
select name , age , country from artist order by year_join
Question: what are the names, ages, and countries of artists, sorted by the year they joined? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Arti...
what are the names, ages, and countries of artists, sorted by the year they joined?
theme_gallery
select distinct country from artist
Question: what are all distinct country for artists? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_ID = ...
what are all distinct country for artists?
theme_gallery
select distinct country from artist
Question: return the different countries for artists. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_ID =...
return the different countries for artists.
theme_gallery
select name , year_join from artist where country != 'united states'
Question: show all artist names and the year joined who are not from united states. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exh...
show all artist names and the year joined who are not from united states.
theme_gallery
select name , year_join from artist where country != 'united states'
Question: what are the names and year of joining for artists that do not have the country 'united states'? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID ...
what are the names and year of joining for artists that do not have the country 'united states'?
theme_gallery
select count(*) from artist where age > 46 and year_join > 1990
Question: how many artists are above age 46 and joined after 1990? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Ex...
how many artists are above age 46 and joined after 1990?
theme_gallery
select count(*) from artist where age > 46 and year_join > 1990
Question: count the number of artists who are older than 46 and joined after 1990. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhi...
count the number of artists who are older than 46 and joined after 1990.
theme_gallery
select avg(age) , min(age) from artist where country = 'united states'
Question: what is the average and minimum age of all artists from united states. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibi...
what is the average and minimum age of all artists from united states.
theme_gallery
select avg(age) , min(age) from artist where country = 'united states'
Question: return the average and minimum ages across artists from the united states. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, ex...
return the average and minimum ages across artists from the united states.
theme_gallery
select name from artist order by year_join desc limit 1
Question: what is the name of the artist who joined latest? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibitio...
what is the name of the artist who joined latest?
theme_gallery
select name from artist order by year_join desc limit 1
Question: return the name of the artist who has the latest join year. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record...
return the name of the artist who has the latest join year.
theme_gallery
select count(*) from exhibition where year >= 2005
Question: how many exhibition are there in year 2005 or after? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibi...
how many exhibition are there in year 2005 or after?
theme_gallery
select count(*) from exhibition where year >= 2005
Question: count the number of exhibitions that happened in or after 2005. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_re...
count the number of exhibitions that happened in or after 2005.
theme_gallery
select theme , year from exhibition where ticket_price < 15
Question: show theme and year for all exhibitions with ticket prices lower than 15. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exh...
show theme and year for all exhibitions with ticket prices lower than 15.
theme_gallery
select theme , year from exhibition where ticket_price < 15
Question: what are the theme and year for all exhibitions that have a ticket price under 15? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artis...
what are the theme and year for all exhibitions that have a ticket price under 15?
theme_gallery
select t2.name , count(*) from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id group by t1.artist_id
Question: show all artist names and the number of exhibitions for each artist. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibiti...
show all artist names and the number of exhibitions for each artist.
theme_gallery
select t2.name , count(*) from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id group by t1.artist_id
Question: how many exhibitions has each artist had? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_ID = e...
how many exhibitions has each artist had?
theme_gallery
select t2.name , t2.country from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id group by t1.artist_id order by count(*) desc limit 1
Question: what is the name and country for the artist with most number of exhibitions? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, ...
what is the name and country for the artist with most number of exhibitions?
theme_gallery
select t2.name , t2.country from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id group by t1.artist_id order by count(*) desc limit 1
Question: return the name and country corresponding to the artist who has had the most exhibitions. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artis...
return the name and country corresponding to the artist who has had the most exhibitions.
theme_gallery
select name from artist where artist_id not in (select artist_id from exhibition)
Question: show names for artists without any exhibition. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_record.Exhibition_I...
show names for artists without any exhibition.
theme_gallery
select name from artist where artist_id not in (select artist_id from exhibition)
Question: what are the names of artists that have not had any exhibitions? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_r...
what are the names of artists that have not had any exhibitions?
theme_gallery
select t1.theme , t2.name from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id where t1.ticket_price > (select avg(ticket_price) from exhibition)
Question: what is the theme and artist name for the exhibition with a ticket price higher than the average? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID...
what is the theme and artist name for the exhibition with a ticket price higher than the average?
theme_gallery
select t1.theme , t2.name from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id where t1.ticket_price > (select avg(ticket_price) from exhibition)
Question: return the names of artists and the themes of their exhibitions that had a ticket price higher than average. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibitio...
return the names of artists and the themes of their exhibitions that had a ticket price higher than average.
theme_gallery
select avg(ticket_price) , min(ticket_price) , max(ticket_price) from exhibition where year < 2009
Question: show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID =...
show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.
theme_gallery
select avg(ticket_price) , min(ticket_price) , max(ticket_price) from exhibition where year < 2009
Question: what are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artis...
what are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009?
theme_gallery
select theme , year from exhibition order by ticket_price desc
Question: show theme and year for all exhibitions in an descending order of ticket price. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_I...
show theme and year for all exhibitions in an descending order of ticket price.
theme_gallery
select theme , year from exhibition order by ticket_price desc
Question: what are the themes and years for exhibitions, sorted by ticket price descending? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist...
what are the themes and years for exhibitions, sorted by ticket price descending?
theme_gallery
select t2.theme , t1.date , t1.attendance from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t2.year = 2004
Question: what is the theme, date, and attendance for the exhibition in year 2004? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhi...
what is the theme, date, and attendance for the exhibition in year 2004?
theme_gallery
select t2.theme , t1.date , t1.attendance from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t2.year = 2004
Question: return the themes, dates, and attendance for exhibitions that happened in 2004. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_I...
return the themes, dates, and attendance for exhibitions that happened in 2004.
theme_gallery
select name from artist except select t2.name from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id where t1.year = 2004
Question: show all artist names who didn't have an exhibition in 2004. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibition_recor...
show all artist names who didn't have an exhibition in 2004.
theme_gallery
select name from artist except select t2.name from exhibition as t1 join artist as t2 on t1.artist_id = t2.artist_id where t1.year = 2004
Question: what are the names of artists who did not have an exhibition in 2004? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibit...
what are the names of artists who did not have an exhibition in 2004?
theme_gallery
select t2.theme from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance < 100 intersect select t2.theme from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance > 500
Question: show the theme for exhibitions with both records of an attendance below 100 and above 500. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = arti...
show the theme for exhibitions with both records of an attendance below 100 and above 500.
theme_gallery
select t2.theme from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance < 100 intersect select t2.theme from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance > 500
Question: which themes have had corresponding exhibitions that have had attendance both below 100 and above 500? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Arti...
which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?
theme_gallery
select count(*) from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance > 100 or t2.ticket_price < 10
Question: how many exhibitions have a attendance more than 100 or have a ticket price below 10? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Ar...
how many exhibitions have a attendance more than 100 or have a ticket price below 10?
theme_gallery
select count(*) from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id where t1.attendance > 100 or t2.ticket_price < 10
Question: count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artis...
count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.
theme_gallery
select t3.name from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id join artist as t3 on t3.artist_id = t2.artist_id group by t3.artist_id having avg(t1.attendance) > 200
Question: show all artist names with an average exhibition attendance over 200. | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artist_ID, exhibit...
show all artist names with an average exhibition attendance over 200.
theme_gallery
select t3.name from exhibition_record as t1 join exhibition as t2 on t1.exhibition_id = t2.exhibition_id join artist as t3 on t3.artist_id = t2.artist_id group by t3.artist_id having avg(t1.attendance) > 200
Question: what are the names of artist whose exhibitions draw over 200 attendees on average? | Tables: artist -> Artist_ID, Name, Country, Year_Join, Age. exhibition -> Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price. exhibition_record -> Exhibition_ID, Date, Attendance. | Joins: exhibition.Artist_ID = artist.Artis...
what are the names of artist whose exhibitions draw over 200 attendees on average?
epinions_1
select i_id from item where title = 'orange'
Question: find the id of the item whose title is 'orange'. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = user...
find the id of the item whose title is 'orange'.
epinions_1
select * from item
Question: list all information in the item table. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct.u_id...
list all information in the item table.
epinions_1
select count(*) from review
Question: find the number of reviews. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct.u_id,
find the number of reviews.
epinions_1
select count(*) from useracct
Question: how many users are there? | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct.u_id,
how many users are there?
epinions_1
select avg(rating) , max(rating) from review
Question: find the average and maximum rating of all reviews. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = u...
find the average and maximum rating of all reviews.
epinions_1
select min(rank) from review
Question: find the highest rank of all reviews. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct.u_id,
find the highest rank of all reviews.
epinions_1
select count(distinct u_id) from review
Question: how many different users wrote some reviews? | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct...
how many different users wrote some reviews?
epinions_1
select count(distinct i_id) from review
Question: how many different items were reviewed by some users? | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id =...
how many different items were reviewed by some users?
epinions_1
select count(*) from item where i_id not in (select i_id from review)
Question: find the number of items that did not receive any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_...
find the number of items that did not receive any review.
epinions_1
select name from useracct where u_id not in (select u_id from review)
Question: find the names of users who did not leave any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id =...
find the names of users who did not leave any review.
epinions_1
select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rating = 10
Question: find the names of goods that receive a rating of 10. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = ...
find the names of goods that receive a rating of 10.