db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
cookbook | select count(t1.title) from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id order by t2.total_fat - t2.sat_fat desc limit 1 | Question: how many servings does the recipe with the highest unsaturated fat have? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fa... | how many servings does the recipe with the highest unsaturated fat have? |
cookbook | select t1.title from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t1.source = 'national potato board' order by t2.calories desc limit 1 | Question: among the recipes whose source is the national potato board, which recipe has the highest calories? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protei... | among the recipes whose source is the national potato board, which recipe has the highest calories? |
cookbook | select t2.recipe_id, t1.prep_min + t1.cook_min + t1.stnd_min from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id group by t2.recipe_id order by count(t2.ingredient_id) desc limit 1 | Question: which recipe has the highest number of ingredients? calculate the said recipe's total time of cooking. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, pro... | which recipe has the highest number of ingredients? calculate the said recipe's total time of cooking. |
cookbook | select t1.name, cast(count(t2.ingredient_id) as float) * 100 / ( select count(t2.ingredient_id) from ingredient as t1 inner join quantity as t2 on t2.ingredient_id = t1.ingredient_id ) as 'percentage' from ingredient as t1 inner join quantity as t2 on t2.ingredient_id = t1.ingredient_id group by t2.ingredient_id order ... | Question: which ingredient appeared the most in recipes? calculate its amount of appearance in percentage. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, ... | which ingredient appeared the most in recipes? calculate its amount of appearance in percentage. |
cookbook | select t1.title, t1.prep_min + t1.cook_min + t1.stnd_min from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id order by t2.total_fat desc limit 1 | Question: provide the title and total time of the recipe which has the highest possibility of gaining weight. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protei... | provide the title and total time of the recipe which has the highest possibility of gaining weight. |
cookbook | select t1.title from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t3.name = 'almond extract' | Question: which recipes contain almond extract? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, sodium, iron... | which recipes contain almond extract? |
cookbook | select t3.name from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t1.title = 'tomato-cucumber relish' | Question: list the ingredients in tomato-cucumber relish. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, so... | list the ingredients in tomato-cucumber relish. |
cookbook | select count(*) from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id where t1.title = 'idaho potato supreme' | Question: how many ingredients are needed to prepare idaho potato supreme? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_f... | how many ingredients are needed to prepare idaho potato supreme? |
cookbook | select t1.name from ingredient as t1 inner join quantity as t2 on t1.ingredient_id = t2.ingredient_id inner join nutrition as t3 on t3.recipe_id = t2.recipe_id where t2.max_qty = t2.min_qty order by t3.carbo desc limit 1 | Question: provide the ingredients that are rationed in the recipe with the highest carbohydrate content. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, ca... | provide the ingredients that are rationed in the recipe with the highest carbohydrate content. |
cookbook | select t1.title from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t2.iron > 20 | Question: name the recipes which can lead to constipation. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, s... | name the recipes which can lead to constipation. |
cookbook | select t1.name from ingredient as t1 inner join quantity as t2 on t1.ingredient_id = t2.ingredient_id inner join nutrition as t3 on t3.recipe_id = t2.recipe_id order by t3.vitamin_a desc limit 1 | Question: describe the ingredients in the recipe with the highest vitamin that helps vision in dim light. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, c... | describe the ingredients in the recipe with the highest vitamin that helps vision in dim light. |
cookbook | select t3.name, t2.max_qty from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t1.servings = 7 | Question: provide the ingredients and maximum quantities of the recipe which can serve 7 people. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alc... | provide the ingredients and maximum quantities of the recipe which can serve 7 people. |
cookbook | select cast(sum(case when t2.sodium < 5 then 1 else 0 end) as real) * 100 / count(*) from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t1.source = 'the california tree fruit agreement' | Question: among the recipes from the california tree fruit agreement, calculate the percentage of sodium-free recipes. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_i... | among the recipes from the california tree fruit agreement, calculate the percentage of sodium-free recipes. |
cookbook | select t1.name from ingredient as t1 inner join quantity as t2 on t1.ingredient_id = t2.ingredient_id where t2.unit = 'slice(s)' | Question: list the ingredients which measure in slices. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, sodi... | list the ingredients which measure in slices. |
cookbook | select count(*) from ingredient as t1 inner join quantity as t2 on t1.ingredient_id = t2.ingredient_id where t1.category = 'canned dairy' | Question: how many recipes can be made with canned dairy? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, so... | how many recipes can be made with canned dairy? |
cookbook | select t1.title, t1.prep_min + t1.cook_min + t1.stnd_min from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t3.name = 'lima beans' | Question: provide the title and total time of the recipe which can be made with only lima beans. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alc... | provide the title and total time of the recipe which can be made with only lima beans. |
cookbook | select cast(sum(case when t1.servings >= 10 then 1 else 0 end) as real) * 100 / count(*) from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t3.name = 'sea bass steak' | Question: among the recipes with sea bass, how many percent of recipes can serve 10 people and above? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo... | among the recipes with sea bass, how many percent of recipes can serve 10 people and above? |
cookbook | select t2.total_fat from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t1.title = 'raspberry chiffon pie' | Question: how much fat does the raspberry chiffon pie have? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, ... | how much fat does the raspberry chiffon pie have? |
cookbook | select pcnt_cal_prot from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t1.title = 'raspberry chiffon pie' | Question: what is the percentage calories protein of raspberry chiffon pie? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_... | what is the percentage calories protein of raspberry chiffon pie? |
cookbook | select count(*) from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t1.title = 'raspberry chiffon pie' | Question: how many ingredients are required to make the raspberry chiffon pie? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, s... | how many ingredients are required to make the raspberry chiffon pie? |
cookbook | select t1.title from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t2.alcohol = 0 | Question: list the names of alcohol free recipes. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, sodium, ir... | list the names of alcohol free recipes. |
cookbook | select avg(t1.vitamin_c) from nutrition as t1 inner join recipe as t2 on t2.recipe_id = t1.recipe_id where t2.title like '%cake%' | Question: what is the average vitamin c amount of all cakes? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl,... | what is the average vitamin c amount of all cakes? |
cookbook | select count(*) from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t3.category = 'dairy' and t1.servings > 10 | Question: how many dairy recipes can serve more than 10 people? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholest... | how many dairy recipes can serve more than 10 people? |
cookbook | select t1.title from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id where t2.iron > 20 | Question: list the names of recipes that can lead to constipation. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, chol... | list the names of recipes that can lead to constipation. |
cookbook | select t1.title from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id order by t2.calories desc limit 1 | Question: which recipe has the highest calories? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, sodium, iro... | which recipe has the highest calories? |
cookbook | select count(t2.recipe_id) from ingredient as t1 inner join quantity as t2 on t2.ingredient_id = t1.ingredient_id inner join nutrition as t3 on t3.recipe_id = t2.recipe_id where t1.category not like '%dairy%' | Question: how many recipes are non-dairy? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestrl, sodium, iron, vita... | how many recipes are non-dairy? |
cookbook | select t3.name, t3.category from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id where t1.title = 'apricot yogurt parfaits' | Question: list all the ingredients of apricot yogurt parfaits. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, cholestr... | list all the ingredients of apricot yogurt parfaits. |
cookbook | select t1.title from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id where t2.max_qty <> t2.min_qty | Question: identify recipes with different maximum and minimum quantities. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fa... | identify recipes with different maximum and minimum quantities. |
cookbook | select t3.name from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id order by t1.cook_min desc limit 1 | Question: what ingredients does the longest cooking time recipe have? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, protein, carbo, alcohol, total_fat, sat_fat, c... | what ingredients does the longest cooking time recipe have? |
cookbook | select cast(sum(case when t1.cook_min < 20 and t2.cholestrl = 0 then 1 else 0 end) as real) * 100 / count(*) from recipe as t1 inner join nutrition as t2 on t1.recipe_id = t2.recipe_id | Question: calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes. | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. N... | calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes. |
cookbook | select cast(sum(case when t4.calories > 200 then 1 else 0 end) as real) * 100 / count(*) from recipe as t1 inner join quantity as t2 on t1.recipe_id = t2.recipe_id inner join ingredient as t3 on t3.ingredient_id = t2.ingredient_id inner join nutrition as t4 on t4.recipe_id = t1.recipe_id where t3.category = 'cheese' | Question: among all recipes containing cheese, what is the percentage of recipes with calories greater than 200? | Tables: Ingredient -> ingredient_id, category, name, plural. Recipe -> recipe_id, title, subtitle, servings, yield_unit, prep_min, cook_min, stnd_min, source, intro, directions. Nutrition -> recipe_id, pro... | among all recipes containing cheese, what is the percentage of recipes with calories greater than 200? |
human_resources | select firstname, lastname from employee order by salary desc limit 1 | Question: which employee has the highest salary? please give his or her full name. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, perform... | which employee has the highest salary? please give his or her full name. |
human_resources | select count(*) from employee where performance = 'good' | Question: how many emplyees have a good job performance? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, location... | how many emplyees have a good job performance? |
human_resources | select ssn from employee where gender = 'm' and cast(replace(substr(salary, 4), ',', '') as real) > 70000 | Question: please list the social security numbers of the male employees with a salary of over $70,000 a year. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hireda... | please list the social security numbers of the male employees with a salary of over $70,000 a year. |
human_resources | select educationrequired from position where positiontitle = 'regional manager' | Question: what is the required education for the position of regional manager? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance... | what is the required education for the position of regional manager? |
human_resources | select positiontitle from position where positiontitle = 'account representative' or positiontitle = 'trainee' order by minsalary asc limit 1 | Question: which position has a lower minimum salary, account representative or trainee? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, pe... | which position has a lower minimum salary, account representative or trainee? |
human_resources | select t2.locationcity from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.lastname = 'adams' and t1.firstname = 'sandy' | Question: in which city's office does sandy adams work at? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locati... | in which city's office does sandy adams work at? |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.state = 'ny' and t1.performance = 'good' | Question: among the employees working at the office in new york, how many of them have a good job performance? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hired... | among the employees working at the office in new york, how many of them have a good job performance? |
human_resources | select t2.officephone from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.lastname = 'adams' and t1.firstname = 'sandy' | Question: what is the office phone number of the location at which sandy adams works? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, perf... | what is the office phone number of the location at which sandy adams works? |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.address = '450 peachtree rd' and t1.gender = 'm' | Question: how many male employees work at the address 450 peachtree rd? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, posit... | how many male employees work at the address 450 peachtree rd? |
human_resources | select count(*) from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.positiontitle = 'account representative' | Question: how many employees work as an account representative? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, l... | how many employees work as an account representative? |
human_resources | select cast(replace(substr(t1.salary, 4), ',', '') as real) - cast(replace(substr(t2.minsalary, 4), ',', '') as real) as diff from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.lastname = 'johnson' and t1.firstname = 'james' | Question: how much higher is james johnson's salary from the minimum salary of his title? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, ... | how much higher is james johnson's salary from the minimum salary of his title? |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'trainee' and t2.state = 'ny' | Question: among the employees who are trainees, how many of them work in new york? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, perform... | among the employees who are trainees, how many of them work in new york? |
human_resources | select t1.firstname, t1.lastname from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.positiontitle = 'trainee' | Question: please list the full names of the employees who are working as a trainee. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, perfor... | please list the full names of the employees who are working as a trainee. |
human_resources | select t1.firstname, t1.lastname from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where (t1.lastname = 'adams' and t1.firstname = 'sandy') or (t1.lastname = 'rodriguez' and t1.firstname = 'jose') order by t2.educationrequired desc limit 1 | Question: which employee's job position requires a higher education level, jose rodriguez or sandy adams? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, ... | which employee's job position requires a higher education level, jose rodriguez or sandy adams? |
human_resources | select t2.zipcode from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.gender = 'm' and t1.performance = 'good' | Question: please list the zip codes of the offices where all the male employees with a good job performance work at. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname,... | please list the zip codes of the offices where all the male employees with a good job performance work at. |
human_resources | select t1.ssn from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.state = 'ca' | Question: please list the social security numbers of all the employees who work in california. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gen... | please list the social security numbers of all the employees who work in california. |
human_resources | select count(*) from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where cast(replace(substr(t1.salary, 4), ',', '') as real) > 20000 and t2.positiontitle = 'trainee' | Question: among the employees who work as a trainee, how many of them have a salary of over &20,000 a year? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate... | among the employees who work as a trainee, how many of them have a salary of over &20,000 a year? |
human_resources | select avg(cast(replace(substr(t1.salary, 4), ',', '') as real)) as avg from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.positiontitle = 'trainee' | Question: what is the average salary of the employees who work as a trainee? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, ... | what is the average salary of the employees who work as a trainee? |
human_resources | select 100 * (avg(cast(replace(substr(t1.salary, 4), ',', '') as real)) - cast(replace(substr(t2.minsalary, 4), ',', '') as real)) / cast(replace(substr(t2.minsalary, 4), ',', '') as real) as per from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.positiontitle = 'trainee' | Question: by what percentage is the average salary of trainees higher than the minimum salary of this postion? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hired... | by what percentage is the average salary of trainees higher than the minimum salary of this postion? |
human_resources | select count(*) from employee where gender = 'f' | Question: give the number of female employees. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locationID. | Join... | give the number of female employees. |
human_resources | select t2.locationcity from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.firstname = 'jose' and t1.lastname = 'rodriguez' | Question: state the name of the city where jose rodriguez works. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, ... | state the name of the city where jose rodriguez works. |
human_resources | select t2.state from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.firstname = 'emily' and t1.lastname = 'wood' | Question: in which state does emily wood work? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locationID. | Join... | in which state does emily wood work? |
human_resources | select t2.educationrequired from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'david' and t1.lastname = 'whitehead' and t1.gender = 'm' | Question: what is the education required for david whitehead to reach his current position? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender... | what is the education required for david whitehead to reach his current position? |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.locationcity = 'miami' | Question: how many employees are there in the 'miami' office? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, loc... | how many employees are there in the 'miami' office? |
human_resources | select t1.firstname, t1.lastname from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.locationcity = 'boston' order by t1.salary desc limit 1 | Question: who is the highest paid employee in 'boston'? give the full name. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, p... | who is the highest paid employee in 'boston'? give the full name. |
human_resources | select t1.firstname, t1.lastname, t1.ssn from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.locationcity = 'new york city' and t1.performance = 'good' | Question: who is the employee in new york city with a good performance? give the social security number of the employee. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstn... | who is the employee in new york city with a good performance? give the social security number of the employee. |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'account representative' and t2.locationcity = 'chicago' and t1.performance = 'good' | Question: how many 'account representatives' are there in chicago with a good performance? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender,... | how many 'account representatives' are there in chicago with a good performance? |
human_resources | select t2.positiontitle from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'kenneth' and t1.lastname = 'charles' | Question: what is kenneth charles's position title? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locationID. |... | what is kenneth charles's position title? |
human_resources | select t2.address from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'manager' order by t1.salary desc limit 1 | Question: give the full address of the office of the highest paid manager. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, po... | give the full address of the office of the highest paid manager. |
human_resources | select t2.maxsalary from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'tracy' and t1.lastname = 'coulter' | Question: what is the max salary for 'tracy coulter' if he/she stays on his/her position? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, ... | what is the max salary for 'tracy coulter' if he/she stays on his/her position? |
human_resources | select 100 * (cast(replace(substr(t2.maxsalary, 4), ',', '') as real) - cast(replace(substr(t1.salary, 4), ',', '') as real)) / cast(replace(substr(t1.salary, 4), ',', '') as real) as per from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'jose' and t1.lastname = 'rodr... | Question: if jose rodriguez tried his best, how many percentage can his salary raise without changing his position? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, ... | if jose rodriguez tried his best, how many percentage can his salary raise without changing his position? |
human_resources | select count(*) from employee where performance = 'poor' and cast(replace(substr(salary, 4), ',', '') as real) > 50000 | Question: how many employees whose performance is poor have a salary of over $50,000 per year? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gen... | how many employees whose performance is poor have a salary of over $50,000 per year? |
human_resources | select firstname, lastname from employee where cast(replace(substr(salary, 4), ',', '') as real) = ( select max(cast(replace(substr(salary, 4), ',', '') as real)) from employee ) | Question: who is the employee with the highest salary? specify his/her full name. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performa... | who is the employee with the highest salary? specify his/her full name. |
human_resources | select count(*) from position where cast(replace(substr(maxsalary, 4), ',', '') as real) < 100000 | Question: how many positions have a maximum salary of no more than us$1000,000? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performanc... | how many positions have a maximum salary of no more than us$1000,000? |
human_resources | select salary from employee order by hiredate asc limit 1 | Question: how much is the salary of the first ever employee that was hired? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, p... | how much is the salary of the first ever employee that was hired? |
human_resources | select minsalary from position order by educationrequired desc limit 1 | Question: how much is the minimum salary given to the position with the most complex work? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender,... | how much is the minimum salary given to the position with the most complex work? |
human_resources | select t2.address, t2.locationcity, t2.state, t2.zipcode from employee as t1 inner join location as t2 on t1.locationid = t2.locationid group by t2.address, t2.locationcity, t2.state, t2.zipcode order by count(*) desc limit 1 | Question: what is the full office location address where most of the employees work at? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, pe... | what is the full office location address where most of the employees work at? |
human_resources | select avg(cast(replace(substr(t1.salary, 4), ',', '') as real)) from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.educationrequired = '2 year degree' | Question: what is the average salary of all employees with a 2 year degree position? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, perfo... | what is the average salary of all employees with a 2 year degree position? |
human_resources | select count(*) from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.positiontitle = 'regional manager' and t1.gender = 'm' | Question: how many male regional managers are there? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locationID. ... | how many male regional managers are there? |
human_resources | select t2.positiontitle from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.performance = 'poor' group by t2.positiontitle order by count(t2.positiontitle) desc limit 1 | Question: which position has the highest amount of poor performing employees? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance,... | which position has the highest amount of poor performing employees? |
human_resources | select t2.positiontitle from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t2.educationrequired = '2 year degree' and t1.gender = 'f' group by t2.positiontitle order by count(t2.positiontitle) desc limit 1 | Question: which position has the highest number of female employees with a 2 year degree? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, ... | which position has the highest number of female employees with a 2 year degree? |
human_resources | select count(*) from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'account representative' and t1.performance = 'good' and t2.state = 'il' | Question: how many account representatives are there in illinois with satisfying performance? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gend... | how many account representatives are there in illinois with satisfying performance? |
human_resources | select avg(cast(replace(substr(t1.salary, 4), ',', '') as real)) from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.performance = 'poor' and t2.positiontitle = 'manager' | Question: what is the average salary of the worst performing managers? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positi... | what is the average salary of the worst performing managers? |
human_resources | select t2.state from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'account representative' and t1.performance = 'good' group by t2.state order by count(t2.state) desc limit 1 | Question: in which state can you find the highest amount of good performing account representatives? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salar... | in which state can you find the highest amount of good performing account representatives? |
human_resources | select firstname, lastname, performance from employee order by salary asc limit 1 | Question: mention the employee's full name and performance status who got the lowest in salary per year. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, s... | mention the employee's full name and performance status who got the lowest in salary per year. |
human_resources | select locationcity from location where state in ('co', 'ut', 'ca') | Question: list the location cities in the western states. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locatio... | list the location cities in the western states. |
human_resources | select locationcity, address from location where zipcode > 90000 | Question: which city and address has zip code of above 90000? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, loc... | which city and address has zip code of above 90000? |
human_resources | select positiontitle from position where educationrequired = '4 year degree' | Question: which positions are suitable with 4 years degree education? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positio... | which positions are suitable with 4 years degree education? |
human_resources | select maxsalary from position where positiontitle = 'trainee' | Question: what is the maximum salary of position 'trainer'? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positionID, locat... | what is the maximum salary of position 'trainer'? |
human_resources | select t1.firstname, t1.lastname, t1.ssn from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.performance = 'average' | Question: list the full name and social security number of the account representative with average performance. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hire... | list the full name and social security number of the account representative with average performance. |
human_resources | select t1.hiredate, t2.positiontitle, t1.salary from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'emily' and t1.lastname = 'wood' | Question: when was emily wood hired? mention her position and salary. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, performance, positio... | when was emily wood hired? mention her position and salary. |
human_resources | select t2.maxsalary, t2.minsalary, t2.positiontitle from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.firstname = 'bill' and t1.lastname = 'marlin' | Question: what are the maximum and minimum salary range and position title of bill marlin? | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender,... | what are the maximum and minimum salary range and position title of bill marlin? |
human_resources | select t1.firstname, t1.lastname, t1.gender, t3.positiontitle from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t2.locationcity = 'new york city' | Question: list the full names, gender and positions who's location is in new york city. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, hiredate, salary, gender, pe... | list the full names, gender and positions who's location is in new york city. |
human_resources | select t1.firstname, t1.lastname, t1.hiredate, t1.performance from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t2.state = 'ut' | Question: mention the full name, hired date and performance status of the employee whose location is in utah state. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, ... | mention the full name, hired date and performance status of the employee whose location is in utah state. |
human_resources | select t1.firstname, t1.lastname, t2.locationcity, t2.address, t2.zipcode from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t3.positiontitle = 'manager' and t1.performance = 'poor' | Question: among the employees with poor performance, provide the managers' full names, location city, address and its zip code. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname,... | among the employees with poor performance, provide the managers' full names, location city, address and its zip code. |
human_resources | select t2.educationrequired, t1.firstname, t1.lastname, t1.salary from employee as t1 inner join position as t2 on t1.positionid = t2.positionid where t1.performance = 'poor' and t2.positiontitle = 'account representative' | Question: what is the education required to be account representative? mention account representative full name and salary who got poor in performance status. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsal... | what is the education required to be account representative? mention account representative full name and salary who got poor in performance status. |
human_resources | select t1.firstname, t1.lastname, t2.state, t2.locationcity from employee as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.ssn = '767-74-7373' | Question: write down the full name, performance status and located city of the employee who's social security number is '767-74-7373'. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, la... | write down the full name, performance status and located city of the employee who's social security number is '767-74-7373'. |
human_resources | select t1.firstname, t1.lastname, t3.positiontitle, t2.locationcity, t2.officephone from employee as t1 inner join location as t2 on t1.locationid = t2.locationid inner join position as t3 on t3.positionid = t1.positionid where t2.state = 'co' | Question: describe the employees' full name, positions, located city and office phone number within colorado state. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, lastname, firstname, ... | describe the employees' full name, positions, located city and office phone number within colorado state. |
human_resources | select sum(cast(replace(substr(t1.salary, 4), ',', '') as real)) / 12 as avg, t1.firstname, t1.lastname , t2.positiontitle, t3.locationcity from employee as t1 inner join position as t2 on t1.positionid = t2.positionid inner join location as t3 on t1.locationid = t3.locationid where cast(replace(substr(t1.salary, 4)... | Question: calculate the monthly average salary of the employee with highest salary. mention his name, position title and location city. | Tables: location -> locationID, locationcity, address, state, zipcode, officephone. position -> positionID, positiontitle, educationrequired, minsalary, maxsalary. employee -> ssn, l... | calculate the monthly average salary of the employee with highest salary. mention his name, position title and location city. |
bike_share_1 | select start_station_name, end_station_name from trip where duration = ( select max(duration) from trip ) | Question: which trip had the longest duration? state the start and end station. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name,... | which trip had the longest duration? state the start and end station. |
bike_share_1 | select cast(count(subscription_type) as real) * 100 / ( select count(subscription_type) from trip ) from trip where subscription_type = 'subscriber' | Question: what is the percentage of the trip were done by a subscriber? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_sta... | what is the percentage of the trip were done by a subscriber? |
bike_share_1 | select t2.end_station_id, t1.city from station as t1 inner join trip as t2 on t1.name = t2.end_station_name where t2.bike_id = 13 order by t2.end_date desc limit 1 | Question: state the final station of bike id 13. which city was it at? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_stat... | state the final station of bike id 13. which city was it at? |
bike_share_1 | select distinct t1.city from station as t1 inner join trip as t2 on t2.start_station_name = t1.name where substr(cast(t2.start_date as text), instr(t2.start_date, '/') + 1) - substr(cast(t2.start_date as text), instr(t2.start_date, ' ') - 5) <> substr(cast(t2.end_date as text), instr(t2.end_date, '/') + 1) - substr(cas... | Question: name all the trips where the bike was borrowed and returned on a different day. state the city where the bike was returned. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_stati... | name all the trips where the bike was borrowed and returned on a different day. state the city where the bike was returned. |
bike_share_1 | select t1.name, t1.long from station as t1 inner join status as t2 on t2.station_id = t1.id where t2.time = '2013/11/03 02:01:01' and t2.bikes_available = 0 | Question: which is the station where no bike could not be borrowed form on the 2013/11/03 02:01:01? state the location of the station. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_stat... | which is the station where no bike could not be borrowed form on the 2013/11/03 02:01:01? state the location of the station. |
bike_share_1 | select t2.start_station_name, t1.city from station as t1 inner join trip as t2 on t2.start_station_name = t1.name group by t2.start_station_name order by count(t2.start_station_name) desc limit 1 | Question: name the station and city with the most borrowed bike. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id... | name the station and city with the most borrowed bike. |
bike_share_1 | select max(t2.max_temperature_f) from trip as t1 inner join weather as t2 on t2.zip_code = t1.zip_code and t2.date = substr(cast(t1.start_date as text), 1, instr(t1.start_date, ' ') - 1) where t1.id = 4080 | Question: what was the hottest temperature on the day of trip id 4080? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_stat... | what was the hottest temperature on the day of trip id 4080? |
bike_share_1 | select t2.time from station as t1 inner join status as t2 on t2.station_id = t1.id where t1.name = 'san jose diridon caltrain station' and t2.bikes_available = ( select max(t2.bikes_available) from station as t1 inner join status as t2 on t2.station_id = t1.id where t1.name = 'san jose diridon caltrain station' ) | Question: at what date and time did san jose diridon caltrain station have most bikes available. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, ... | at what date and time did san jose diridon caltrain station have most bikes available. |
bike_share_1 | select t1.id, t1.duration from trip as t1 inner join weather as t2 on t2.zip_code = t1.zip_code and t2.date = substr(cast(t1.start_date as text), 1, instr(t1.start_date, ' ') - 1) where t2.events like '%rain%' or t2.events like '%rain%' | Question: name all the trip on the days when it rained. state the duration of the trip | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_statio... | name all the trip on the days when it rained. state the duration of the trip |
bike_share_1 | select t2.end_station_name, t2.start_date from station as t1 inner join trip as t2 on t2.end_station_name = t1.name where t1.lat = 37.331415 and t1.long = -121.8932 | Question: list all trips where bikes were returned at location 37.331415, -121.8932. state the date the bike was borrowed. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, st... | list all trips where bikes were returned at location 37.331415, -121.8932. state the date the bike was borrowed. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.