db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
student_club
select t2.college from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t1.link_to_major = 'rec1n0upivly5esto' and t1.first_name = 'katy'
Question: please indicate the college of the person whose first name is katy with the link to the major 'rec1n0upivly5esto'. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
please indicate the college of the person whose first name is katy with the link to the major 'rec1n0upivly5esto'.
student_club
select t1.phone from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t2.major_name = 'business' and t2.college = 'college of agriculture and applied sciences'
Question: please list the phone numbers of the members who majored in business at the college of agriculture and applied sciences. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
please list the phone numbers of the members who majored in business at the college of agriculture and applied sciences.
student_club
select distinct t1.email from member as t1 inner join expense as t2 on t1.member_id = t2.link_to_member where date(substr(t2.expense_date, 1, 10)) between '2019-09-10' and '2019-11-19' and t2.cost > 20
Question: list emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019.
student_club
select count(t1.member_id) from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t1.position = 'member' and t2.major_name like '%education%' and t2.college = 'college of education & human services'
Question: how many members have education major in the college of education & human services? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
how many members have education major in the college of education & human services?
student_club
select cast(sum(case when remaining < 0 then 1 else 0 end) as real) * 100 / count(budget_id) from budget
Question: what is the percentage of the events that went over budget? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what is the percentage of the events that went over budget?
student_club
select event_id, location, status from event where date(substr(event_date, 1, 10)) between '2019-11-01' and '2020-03-31'
Question: give the event id, location, and status of events conducted from november 2019 to march 2020. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
give the event id, location, and status of events conducted from november 2019 to march 2020.
student_club
select expense_description from expense group by expense_description having avg(cost) > 50
Question: list the expenses that spend more than fifty dollars on average. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the expenses that spend more than fifty dollars on average.
student_club
select first_name, last_name from member where t_shirt_size = 'x-large'
Question: find the full name of members whose t-shirt size is extra large. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
find the full name of members whose t-shirt size is extra large.
student_club
select cast(sum(case when type = 'po box' then 1 else 0 end) as real) * 100 / count(zip_code) from zip_code
Question: calculate the percentage of zip codes that are po boxes. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
calculate the percentage of zip codes that are po boxes.
student_club
select distinct t1.event_name, t1.location from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event where t2.remaining > 0
Question: list the name and location of events that underspend its budget. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the name and location of events that underspend its budget.
student_club
select t1.event_name, t1.event_date from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event inner join expense as t3 on t2.budget_id = t3.link_to_budget where t3.expense_description = 'pizza' and t3.cost > 50 and t3.cost < 100
Question: find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars.
student_club
select distinct t1.first_name, t1.last_name, t2.major_name from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major inner join expense as t3 on t1.member_id = t3.link_to_member where t3.cost > 100
Question: what is the name and major of members who had to spend more than a hundred dollars on an expense? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what is the name and major of members who had to spend more than a hundred dollars on an expense?
student_club
select distinct t3.city, t3.county from income as t1 inner join member as t2 on t1.link_to_member = t2.member_id inner join zip_code as t3 on t3.zip_code = t2.zip where t1.amount > 40
Question: in the events with more than forty incomes, list the city and country in which the event is happening. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
in the events with more than forty incomes, list the city and country in which the event is happening.
student_club
select t2.member_id from expense as t1 inner join member as t2 on t1.link_to_member = t2.member_id inner join budget as t3 on t1.link_to_budget = t3.budget_id inner join event as t4 on t3.link_to_event = t4.event_id group by t2.member_id having count(distinct t4.event_id) > 1 order by sum(t1.cost) desc limit 1
Question: among the members who incurred expenses in more than one event, who paid the most amount? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
among the members who incurred expenses in more than one event, who paid the most amount?
student_club
select avg(t1.cost) from expense as t1 inner join member as t2 on t1.link_to_member = t2.member_id where t2.position != 'member'
Question: what is the average amount paid by students in a position other than a member? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what is the average amount paid by students in a position other than a member?
student_club
select t1.event_name from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event inner join expense as t3 on t2.budget_id = t3.link_to_budget where t2.category = 'parking' and t3.cost < (select avg(cost) from expense)
Question: list the name of events with less than average parking cost. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the name of events with less than average parking cost.
student_club
select sum(case when t1.type = 'game' then t3.cost else 0 end) * 100 / sum(t3.cost) from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event inner join expense as t3 on t2.budget_id = t3.link_to_budget
Question: what is the percentage of the cost for the game events? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what is the percentage of the cost for the game events?
student_club
select t2.budget_id from expense as t1 inner join budget as t2 on t1.link_to_budget = t2.budget_id where t1.expense_description = 'water, chips, cookies' order by t1.cost desc limit 1
Question: which budget allowed the most money for water, chips, and cookies? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
which budget allowed the most money for water, chips, and cookies?
student_club
select t3.first_name, t3.last_name from expense as t1 inner join budget as t2 on t1.link_to_budget = t2.budget_id inner join member as t3 on t1.link_to_member = t3.member_id order by t2.spent desc limit 5
Question: list the full name of the top five members who spend the most money in the descending order of spending. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the full name of the top five members who spend the most money in the descending order of spending.
student_club
select distinct t3.first_name, t3.last_name, t3.phone from expense as t1 inner join budget as t2 on t1.link_to_budget = t2.budget_id inner join member as t3 on t3.member_id = t1.link_to_member where t1.cost > ( select avg(t1.cost) from expense as t1 inner join budget as t2 on t1.link_to_budget = t2.budget_id inner join member as t3 on t3.member_id = t1.link_to_member )
Question: give the full name and contact number of members who had to spend more than average on each expense. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
give the full name and contact number of members who had to spend more than average on each expense.
student_club
select cast((sum(case when t2.state = 'maine' then 1 else 0 end) - sum(case when t2.state = 'vermont' then 1 else 0 end)) as real) * 100 / count(t1.member_id) as diff from member as t1 inner join zip_code as t2 on t2.zip_code = t1.zip
Question: calculate the difference in the percentage of members in maine and vermont. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
calculate the difference in the percentage of members in maine and vermont.
student_club
select t2.major_name, t2.department from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t1.first_name = 'garrett' and t1.last_name = 'gerke'
Question: what is the major of garrett gerke and which department does it belong to? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what is the major of garrett gerke and which department does it belong to?
student_club
select t2.first_name, t2.last_name, t1.cost from expense as t1 inner join member as t2 on t1.link_to_member = t2.member_id where t1.expense_description = 'water, veggie tray, supplies'
Question: write the full name of the member who spent money for water, veggie tray and supplies and include the cost of it. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
write the full name of the member who spent money for water, veggie tray and supplies and include the cost of it.
student_club
select t1.last_name, t1.phone from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t2.major_name = 'elementary education'
Question: list the last names of students under the elementary education major and include their phone numbers. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the last names of students under the elementary education major and include their phone numbers.
student_club
select t2.category, t2.amount from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event where t1.event_name = 'january speaker'
Question: what category was budgeted for the 'january speaker' event and how much was the amount budgeted for that category? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
what category was budgeted for the 'january speaker' event and how much was the amount budgeted for that category?
student_club
select t1.event_name from event as t1 inner join budget as t2 on t1.event_id = t2.link_to_event where t2.category = 'food'
Question: list the event names which were budgeted for the food. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
list the event names which were budgeted for the food.
student_club
select distinct t3.first_name, t3.last_name, t4.amount from event as t1 inner join attendance as t2 on t1.event_id = t2.link_to_event inner join member as t3 on t3.member_id = t2.link_to_member inner join income as t4 on t4.link_to_member = t3.member_id where t4.date_received = '2019-09-09'
Question: write the full names of students who received funds on the date of 9/9/2019 and include the amount received. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
write the full names of students who received funds on the date of 9/9/2019 and include the amount received.
student_club
select distinct t2.category from expense as t1 inner join budget as t2 on t1.link_to_budget = t2.budget_id where t1.expense_description = 'posters'
Question: which budget category does the expense 'posters' fall to? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
which budget category does the expense 'posters' fall to?
student_club
select t1.first_name, t1.last_name, college from member as t1 inner join major as t2 on t2.major_id = t1.link_to_major where t1.position = 'secretary'
Question: write the full name of the club member with the position of 'secretary' and list which college the club member belongs to. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
write the full name of the club member with the position of 'secretary' and list which college the club member belongs to.
student_club
select sum(t1.spent), t2.event_name from budget as t1 inner join event as t2 on t1.link_to_event = t2.event_id where t1.category = 'speaker gifts'
Question: calculate the total amount spent on speaker gifts and list the name of the event they were spent on. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
calculate the total amount spent on speaker gifts and list the name of the event they were spent on.
student_club
select t2.city from member as t1 inner join zip_code as t2 on t2.zip_code = t1.zip where t1.first_name = 'garrett' and t1.last_name = 'gerke'
Question: where is the hometown of garrett girke? | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
where is the hometown of garrett girke?
student_club
select t1.first_name, t1.last_name, t1.position from member as t1 inner join zip_code as t2 on t2.zip_code = t1.zip where t2.city = 'lincolnton' and t2.state = 'north carolina' and t2.zip_code = 28092
Question: which student has the hometown of lincolnton, north carolina with the zip code of 28092? list their full name and position. | Tables: event -> event_id, event_name, event_date, type, notes, location, status. major -> major_id, major_name, department, college. zip_code -> zip_code, type, city, county, state, short_state. attendance -> link_to_event, link_to_member. budget -> budget_id, category, spent, remaining, amount, event_status, link_to_event. expense -> expense_id, expense_description, expense_date, cost, approved, link_to_member, link_to_budget. income -> income_id, date_received, amount, source, notes, link_to_member. member -> member_id, first_name, last_name, email, position, t_shirt_size, phone, zip, link_to_major. | Joins: attendance.link_to_member = member.member_id, attendance.link_to_event = event.event_id, budget.link_to_event = event.event_id, expense.link_to_member = member.member_id, expense.link_to_budget = budget.budget_id, income.link_to_member = member.member_id, member.zip = zip_code.zip_code, member.link_to_major = major.major_id,
which student has the hometown of lincolnton, north carolina with the zip code of 28092? list their full name and position.
debit_card_specializing
select count(gasstationid) from gasstations where country = 'cze' and segment = 'premium'
Question: how many gas stations in cze has premium gas? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many gas stations in cze has premium gas?
debit_card_specializing
select cast(sum(iif(currency = 'eur', 1, 0)) as float) / sum(iif(currency = 'czk', 1, 0)) from customers
Question: what is the ratio of costumers who pay in eur against customers who pay in czk? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the ratio of costumers who pay in eur against customers who pay in czk?
debit_card_specializing
select t1.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.segment = 'lam' and t2.date between 201201 and 201212 group by t1.customerid order by sum(t2.consumption) asc limit 1
Question: in 2012, who had the least consumption in lam? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
in 2012, who had the least consumption in lam?
debit_card_specializing
select avg(t2.consumption) / 12 from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where substring(t2.date, 1, 4) = '2013' and t1.segment = 'sme'
Question: what was the average monthly consumption of customers in sme for the year 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what was the average monthly consumption of customers in sme for the year 2013?
debit_card_specializing
select t1.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.currency = 'czk' and t2.date between 201101 and 201112 group by t1.customerid order by sum(t2.consumption) desc limit 1
Question: which customers, paying in czk, consumed the most gas in 2011? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which customers, paying in czk, consumed the most gas in 2011?
debit_card_specializing
select count(*) from ( select t2.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.segment = 'kam' and substring(t2.date, 1, 4) = '2012' group by t2.customerid having sum(t2.consumption) < 30000 ) as t1
Question: how many customers in kam had a consumption of less than 30,000 for the year 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many customers in kam had a consumption of less than 30,000 for the year 2012?
debit_card_specializing
select sum(iif(t1.currency = 'czk', t2.consumption, 0)) - sum(iif(t1.currency = 'eur', t2.consumption, 0)) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where substring(t2.date, 1, 4) = '2012'
Question: what was the difference in gas consumption between czk-paying customers and eur-paying customers in 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what was the difference in gas consumption between czk-paying customers and eur-paying customers in 2012?
debit_card_specializing
select substring(t2.date, 1, 4) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.currency = 'eur' group by substring(t2.date, 1, 4) order by sum(t2.consumption) desc limit 1
Question: which year recorded the most gas use paid in eur? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which year recorded the most gas use paid in eur?
debit_card_specializing
select t1.segment from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid group by t1.segment order by sum(t2.consumption) asc limit 1
Question: which segment had the least consumption? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which segment had the least consumption?
debit_card_specializing
select substring(t2.date, 1, 4) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.currency = 'czk' group by substring(t2.date, 1, 4) order by sum(t2.consumption) desc limit 1
Question: which year recorded the most consumption of gas paid in czk? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which year recorded the most consumption of gas paid in czk?
debit_card_specializing
select substring(t2.date, 5, 2) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where substring(t2.date, 1, 4) = '2013' and t1.segment = 'sme' group by substring(t2.date, 5, 2) order by sum(t2.consumption) desc limit 1
Question: what was the gas consumption peak month for sme customers in 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what was the gas consumption peak month for sme customers in 2013?
debit_card_specializing
select cast(sum(iif(t1.segment = 'sme', t2.consumption, 0)) as float) / count(t1.customerid) - cast(sum(iif(t1.segment = 'lam', t2.consumption, 0)) as float) / count(t1.customerid) , cast(sum(iif(t1.segment = 'lam', t2.consumption, 0)) as float) / count(t1.customerid) - cast(sum(iif(t1.segment = 'kam', t2.consumption, 0)) as float) / count(t1.customerid) , cast(sum(iif(t1.segment = 'kam', t2.consumption, 0)) as float) / count(t1.customerid) - cast(sum(iif(t1.segment = 'sme', t2.consumption, 0)) as float) / count(t1.customerid) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.currency = 'czk' and t2.consumption = ( select min(consumption) from yearmonth ) and t2.date between 201301 and 201312
Question: what is the difference in the annual average consumption of the customers with the least amount of consumption paid in czk for 2013 between sme and lam, lam and kam, and kam and sme? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the difference in the annual average consumption of the customers with the least amount of consumption paid in czk for 2013 between sme and lam, lam and kam, and kam and sme?
debit_card_specializing
select cast((sum(iif(t1.segment = 'sme' and t2.date like '2013%', t2.consumption, 0)) - sum(iif(t1.segment = 'sme' and t2.date like '2012%', t2.consumption, 0))) as float) * 100 / sum(iif(t1.segment = 'sme' and t2.date like '2012%', t2.consumption, 0)), cast(sum(iif(t1.segment = 'lam' and t2.date like '2013%', t2.consumption, 0)) - sum(iif(t1.segment = 'lam' and t2.date like '2012%', t2.consumption, 0)) as float) * 100 / sum(iif(t1.segment = 'lam' and t2.date like '2012%', t2.consumption, 0)) , cast(sum(iif(t1.segment = 'kam' and t2.date like '2013%', t2.consumption, 0)) - sum(iif(t1.segment = 'kam' and t2.date like '2012%', t2.consumption, 0)) as float) * 100 / sum(iif(t1.segment = 'kam' and t2.date like '2012%', t2.consumption, 0)) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid
Question: which of the three segmentssme, lam and kamhas the biggest and lowest percentage increases in consumption paid in eur between 2012 and 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which of the three segmentssme, lam and kamhas the biggest and lowest percentage increases in consumption paid in eur between 2012 and 2013?
debit_card_specializing
select sum(consumption) from yearmonth where customerid = 6 and date between '201308' and '201311'
Question: how much did customer 6 consume in total between august and november 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how much did customer 6 consume in total between august and november 2013?
debit_card_specializing
select sum(iif(country = 'cze', 1, 0)) - sum(iif(country = 'svk', 1, 0)) from gasstations where segment = 'discount'
Question: how many more 'discount' gas stations does the czech republic have compared to slovakia? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many more 'discount' gas stations does the czech republic have compared to slovakia?
debit_card_specializing
select sum(iif(customerid = 7, consumption, 0)) - sum(iif(customerid = 5, consumption, 0)) from yearmonth where date = '201304'
Question: how much more was customer 7 consuming in april 2013 than customer 5? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how much more was customer 7 consuming in april 2013 than customer 5?
debit_card_specializing
select sum(currency = 'czk') - sum(currency = 'eur') from customers where segment = 'sme'
Question: is it true that more smes pay in czech koruna than in euros? if so, how many more? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
is it true that more smes pay in czech koruna than in euros? if so, how many more?
debit_card_specializing
select t1.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.segment = 'lam' and t2.date = '201310' and t1.currency = 'eur' group by t1.customerid order by sum(t2.consumption) desc limit 1
Question: which lam customer used the euro as their currency and had the highest consumption in october 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which lam customer used the euro as their currency and had the highest consumption in october 2013?
debit_card_specializing
select t2.customerid, sum(t2.consumption) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.segment = 'kam' group by t2.customerid order by sum(t2.consumption) desc limit 1
Question: who among kam's customers consumed the most? how much did it consume? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
who among kam's customers consumed the most? how much did it consume?
debit_card_specializing
select sum(t2.consumption) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t2.date = '201305' and t1.segment = 'kam'
Question: how much did the kam customers consume in total in may 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how much did the kam customers consume in total in may 2013?
debit_card_specializing
select cast(sum(iif(t2.consumption > 46.73, 1, 0)) as float) * 100 / count(t1.customerid) from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.segment = 'lam'
Question: how many percent of lam customer consumed more than 46.73? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many percent of lam customer consumed more than 46.73?
debit_card_specializing
select country , ( select count(gasstationid) from gasstations where segment = 'value for money' ) from gasstations where segment = 'value for money' group by country order by count(gasstationid) desc limit 1
Question: which country has more 'value for money' gas stations? please give a total number of 'value for money' gas stations in each country. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which country has more 'value for money' gas stations? please give a total number of 'value for money' gas stations in each country.
debit_card_specializing
select cast(sum(currency = 'eur') as float) * 100 / count(customerid) from customers where segment = 'kam'
Question: what percentage of kam customers pay in euros? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what percentage of kam customers pay in euros?
debit_card_specializing
select cast(sum(iif(consumption > 528.3, 1, 0)) as float) * 100 / count(customerid) from yearmonth where date = '201202'
Question: in february 2012, what percentage of customers consumed more than 528.3? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
in february 2012, what percentage of customers consumed more than 528.3?
debit_card_specializing
select cast(sum(iif(segment = 'premium', 1, 0)) as float) * 100 / count(gasstationid) from gasstations where country = 'svk'
Question: what percentage of slovakian gas stations are premium? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what percentage of slovakian gas stations are premium?
debit_card_specializing
select t1.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t2.date = '201309' group by t1.customerid order by sum(t2.consumption) desc limit 1
Question: which client id consumed the most in september 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which client id consumed the most in september 2013?
debit_card_specializing
select t1.segment from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t2.date = '201309' group by t1.customerid order by sum(t2.consumption) asc limit 1
Question: which client segment consumed the least in september 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which client segment consumed the least in september 2013?
debit_card_specializing
select t1.customerid from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t2.date = '201206' and t1.segment = 'sme' group by t1.customerid order by sum(t2.consumption) asc limit 1
Question: which sme customer consumed the least in june 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which sme customer consumed the least in june 2012?
debit_card_specializing
select sum(consumption) from yearmonth where substring(date, 1, 4) = '2012' group by substring(date, 5, 2) order by sum(consumption) desc limit 1
Question: what is the highest monthly consumption in the year 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the highest monthly consumption in the year 2012?
debit_card_specializing
select sum(t2.consumption) / 12 as monthlyconsumption from customers as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.currency = 'eur' group by t1.customerid order by monthlyconsumption desc limit 1
Question: what is the biggest monthly consumption of the customers who use euro as their currency? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the biggest monthly consumption of the customers who use euro as their currency?
debit_card_specializing
select t3.description from transactions_1k as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid inner join products as t3 on t1.productid = t3.productid where t2.date = '201309'
Question: please list the product description of the products consumed in september, 2013. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the product description of the products consumed in september, 2013.
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid inner join yearmonth as t3 on t1.customerid = t3.customerid where t3.date = '201306'
Question: please list the countries of the gas stations with transactions taken place in june, 2013. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the countries of the gas stations with transactions taken place in june, 2013.
debit_card_specializing
select distinct t3.chainid from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid inner join gasstations as t3 on t1.gasstationid = t3.gasstationid where t2.currency = 'eur'
Question: please list the chains of the gas stations with transactions in euro. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the chains of the gas stations with transactions in euro.
debit_card_specializing
select distinct t1.productid, t3.description from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid inner join products as t3 on t1.productid = t3.productid where t2.currency = 'eur'
Question: please list the product description of the products bought in transactions in euro. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the product description of the products bought in transactions in euro.
debit_card_specializing
select avg(amount) from transactions_1k where date like '2012-01%'
Question: what is the average total price of the transactions taken place in january, 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the average total price of the transactions taken place in january, 2012?
debit_card_specializing
select count(*) from yearmonth as t1 inner join customers as t2 on t1.customerid = t2.customerid where t2.currency = 'eur' and t1.consumption > 1000.00
Question: among the customers who paid in euro, how many of them have a monthly consumption of over 1000? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
among the customers who paid in euro, how many of them have a monthly consumption of over 1000?
debit_card_specializing
select t3.description from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid inner join products as t3 on t1.productid = t3.productid where t2.country = 'cze'
Question: please list the product descriptions of the transactions taken place in the gas stations in the czech republic. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the product descriptions of the transactions taken place in the gas stations in the czech republic.
debit_card_specializing
select distinct t1.time from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t2.chainid = 11
Question: please list the disparate time of the transactions taken place in the gas stations from chain no. 11. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
please list the disparate time of the transactions taken place in the gas stations from chain no. 11.
debit_card_specializing
select count(t1.transactionid) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t2.country = 'cze' and t1.price > 1000
Question: how many transactions taken place in the gas station in the czech republic are with a price of over 1000? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many transactions taken place in the gas station in the czech republic are with a price of over 1000?
debit_card_specializing
select count(t1.transactionid) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t2.country = 'cze' and strftime('%y', t1.date) >= '2012'
Question: among the transactions made in the gas stations in the czech republic, how many of them are taken place after 2012/1/1? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
among the transactions made in the gas stations in the czech republic, how many of them are taken place after 2012/1/1?
debit_card_specializing
select avg(t1.price) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t2.country = 'cze'
Question: what is the average total price of the transactions taken place in gas stations in the czech republic? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the average total price of the transactions taken place in gas stations in the czech republic?
debit_card_specializing
select avg(t1.price) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid inner join customers as t3 on t1.customerid = t3.customerid where t3.currency = 'eur'
Question: for the customers who paid in the euro, what is their average total price of the transactions? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for the customers who paid in the euro, what is their average total price of the transactions?
debit_card_specializing
select customerid from transactions_1k where date = '2012-08-25' group by customerid order by sum(price) desc limit 1
Question: which customer paid the most in 2012/8/25? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which customer paid the most in 2012/8/25?
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-25' order by t1.time desc limit 1
Question: which country's gas station had the first paid cusomer in 2012/8/25? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which country's gas station had the first paid cusomer in 2012/8/25?
debit_card_specializing
select t3.currency from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid inner join customers as t3 on t1.customerid = t3.customerid where t1.date = '2012-08-24' and t1.time = '16:25:00'
Question: what kind of currency did the customer paid at 16:25:00 in 2012/8/24? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what kind of currency did the customer paid at 16:25:00 in 2012/8/24?
debit_card_specializing
select t2.segment from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid where t1.date = '2012-08-23' and t1.time = '21:20:00'
Question: what segment did the customer have at 2012/8/23 21:20:00? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what segment did the customer have at 2012/8/23 21:20:00?
debit_card_specializing
select count(t1.transactionid) from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid where t1.date = '2012-08-26' and t1.time < '13:00:00' and t2.currency = 'eur'
Question: how many transactions were paid in eur in the morning of 2012/8/26? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
how many transactions were paid in eur in the morning of 2012/8/26?
debit_card_specializing
select t2.segment from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid order by date asc limit 1
Question: for the earliest customer, what segment did he/she have? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for the earliest customer, what segment did he/she have?
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-24' and t1.time = '12:42:00'
Question: for the deal happened at 2012/8/24 12:42:00, which country was it? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for the deal happened at 2012/8/24 12:42:00, which country was it?
debit_card_specializing
select t1.productid from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-23' and t1.time = '21:20:00'
Question: what was the product id of the transaction happened at 2012/8/23 21:20:00? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what was the product id of the transaction happened at 2012/8/23 21:20:00?
debit_card_specializing
select t1.customerid, t2.date, t2.consumption from transactions_1k as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.date = '2012-08-24' and t1.price = 124.05 and t2.date = '201201'
Question: for the customer who paid 124.05 in 2012/8/24, how much did he/she spend during the january of 2012? and what is the date and expenses exactly? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for the customer who paid 124.05 in 2012/8/24, how much did he/she spend during the january of 2012? and what is the date and expenses exactly?
debit_card_specializing
select count(t1.transactionid) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-26' and t1.time between '08:00:00' and '09:00:00' and t2.country = 'cze'
Question: for all the transactions happened during 8:00-9:00 in 2012/8/26, how many happened in cze? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for all the transactions happened during 8:00-9:00 in 2012/8/26, how many happened in cze?
debit_card_specializing
select t2.currency from yearmonth as t1 inner join customers as t2 on t1.customerid = t2.customerid where t1.date = '201306' and t1.consumption = 214582.17
Question: there's one customer spent 214582.17 in the june of 2013, which currency did he/she use? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
there's one customer spent 214582.17 in the june of 2013, which currency did he/she use?
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.cardid = '667467'
Question: which country was the card owner of no.667467 in? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which country was the card owner of no.667467 in?
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-24' and t1.price = 548.4
Question: what's the nationality of the customer who spent 548.4 in 2012/8/24? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what's the nationality of the customer who spent 548.4 in 2012/8/24?
debit_card_specializing
select cast(sum(iif(t2.currency = 'eur', 1, 0)) as float) * 100 / count(t1.customerid) from transactions_1k as t1 inner join customers as t2 on t1.customerid = t2.customerid where t1.date = '2012-08-25'
Question: what is the percentage of the customers who used eur in 2012/8/25? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the percentage of the customers who used eur in 2012/8/25?
debit_card_specializing
select cast(sum(iif(substring(date, 1, 4) = '2012', consumption, 0)) - sum(iif(substring(date, 1, 4) = '2013', consumption, 0)) as float) / sum(iif(substring(date, 1, 4) = '2012', consumption, 0)) from yearmonth where customerid = ( select t1.customerid from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.date = '2012-08-25' and t1.price = 634.8 )
Question: for the customer who paid 634.8 in 2012/8/25, what was the consumption decrease rate from year 2012 to 2013? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for the customer who paid 634.8 in 2012/8/25, what was the consumption decrease rate from year 2012 to 2013?
debit_card_specializing
select gasstationid from transactions_1k group by gasstationid order by sum(price) desc limit 1
Question: which gas station has the highest amount of revenue? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which gas station has the highest amount of revenue?
debit_card_specializing
select cast(sum(iif(country = 'svk' and segment = 'premium', 1, 0)) as float) * 100 / sum(iif(country = 'svk', 1, 0)) from gasstations
Question: what is the percentage of 'premium' against the overall segment in 'svk'? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the percentage of 'premium' against the overall segment in 'svk'?
debit_card_specializing
select sum(t1.price) , sum(iif(t3.date = '201201', t1.price, 0)) from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid inner join yearmonth as t3 on t1.customerid = t3.customerid where t1.customerid = '38508'
Question: what is the amount spent by customer '38508' at the gas stations? how much had the customer spent in january 2012? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
what is the amount spent by customer '38508' at the gas stations? how much had the customer spent in january 2012?
debit_card_specializing
select t2.description from transactions_1k as t1 inner join products as t2 on t1.productid = t2.productid order by t1.amount desc limit 5
Question: which are the top five best selling products? please state the full name of them. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which are the top five best selling products? please state the full name of them.
debit_card_specializing
select t2.customerid, sum(t2.price / t2.amount), t1.currency from customers as t1 inner join transactions_1k as t2 on t1.customerid = t2.customerid where t2.customerid = ( select customerid from yearmonth order by consumption desc limit 1 ) group by t2.customerid, t1.currency
Question: who is the top spending customer and how much is the average price per single item purchased by this customer? what currency was being used? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
who is the top spending customer and how much is the average price per single item purchased by this customer? what currency was being used?
debit_card_specializing
select t2.country from transactions_1k as t1 inner join gasstations as t2 on t1.gasstationid = t2.gasstationid where t1.productid = 2 order by t1.price desc limit 1
Question: which country had the gas station that sold the most expensive product id no.2 for one unit? | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
which country had the gas station that sold the most expensive product id no.2 for one unit?
debit_card_specializing
select t2.consumption from transactions_1k as t1 inner join yearmonth as t2 on t1.customerid = t2.customerid where t1.price / t1.amount > 29.00 and t1.productid = 5 and t2.date = '201208'
Question: for all the people who paid more than 29.00 per unit of product id no.5. give their consumption status in the august of 2012. | Tables: customers -> CustomerID, Segment, Currency. gasstations -> GasStationID, ChainID, Country, Segment. products -> ProductID, Description. transactions_1k -> TransactionID, Date, Time, CustomerID, CardID, GasStationID, ProductID, Amount, Price. yearmonth -> CustomerID, Date, Consumption. | Joins: yearmonth.CustomerID = customers.CustomerID,
for all the people who paid more than 29.00 per unit of product id no.5. give their consumption status in the august of 2012.