db_id
stringlengths 4
31
| text
stringlengths 398
4.9k
|
---|---|
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many budgets are above 3000 in year 2001 or before? | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from budget where budgeted > 3000 and year <= 2001 |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000 | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from budget where budgeted > 3000 and year <= 2001 |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show each school name, its budgeted amount, and invested amount in year 2002 or after. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select _ from _ where _ | select school.school_name , budget.budgeted , budget.invested from budget join school on budget.school_id = school.school_id where budget.year >= 2002 |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all donor names. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select distinct _ from _ | select distinct donator_name from endowment |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many budget record has a budget amount smaller than the invested amount? | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from budget where budgeted < invested |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the total budget amount for school "Glenn" in all years? | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select sum ( _ ) from _ where _ | select sum ( budget.budgeted ) from budget join school on budget.school_id = school.school_id where school.school_name = 'Glenn' |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select _ from _ group by _ having sum ( _ ) > _ or sum ( _ ) > _ | select school.school_name from budget join school on budget.school_id = school.school_id join endowment on school.school_id = endowment.school_id group by school.school_name having sum ( budget.budgeted ) > 100 or sum ( endowment.amount ) > 10 |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the names of schools that have more than one donator with donation amount above 8.5. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) > _ | select school.school_name from endowment join school on endowment.school_id = school.school_id where endowment.amount > 8.5 group by endowment.school_id having count ( * ) > 1 |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of schools that have more than one donator whose donation amount is less than 8.5. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select count ( _ ) from ( select _ from _ where _ group by _ having count ( _ ) > _ ) | select count ( * ) from ( select * from endowment where amount > 8.5 group by school_id having count ( * ) > 1 ) |
school_finance | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget. | school : school_id , school_name , location , mascot , enrollment , ihsaa_class , ihsaa_football_class , county | budget : school_id , year , budgeted , total_budget_percent_budgeted , invested , total_budget_percent_invested , budget_invested_percent | endowment : endowment_id , school_id , donator_name , amount | budget.school_id = school.school_id | endowment.school_id = school.school_id |
### Response:
select _ from _ where _ order by _ | select school.school_name , school.mascot , school.ihsaa_football_class from school join budget on school.school_id = budget.school_id where budgeted > 6000 or year < 2003 order by budget.total_budget_percent_invested , budget.total_budget_percent_budgeted |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many buildings are there? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select count ( _ ) from _ | select count ( * ) from building |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name, street address, and number of floors for all buildings ordered by the number of floors. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ order by _ asc | select name , street_address , floors from building order by floors asc |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the tallest building? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ order by _ desc limit _ | select name from building order by height_feet desc limit 1 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the average, maximum, and minimum number of floors for all buildings? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select avg ( _ ) , max ( _ ) , min ( _ ) from _ | select avg ( floors ) , max ( floors ) , min ( floors ) from building |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the number of buildings with a height above the average or a number of floors above the average. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select count ( _ ) from _ where _ > ( select avg ( _ ) from _ ) or _ > ( select avg ( _ ) from _ ) | select count ( * ) from building where height_feet > ( select avg ( height_feet ) from building ) or floors > ( select avg ( floors ) from building ) |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the names of buildings with at least 200 feet of height and with at least 20 floors. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ where _ | select name from building where height_feet >= 200 and floors >= 20 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names and locations of institutions that are founded after 1990 and have the type "Private". | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ where _ | select institution , location from institution where founded > 1990 and type = 'Private' |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show institution types, along with the number of institutions and total enrollment for each type. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ , count ( _ ) , sum ( _ ) from _ group by _ | select type , count ( * ) , sum ( enrollment ) from institution group by type |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the institution type with the largest number of institutions. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select type from institution group by type order by count ( * ) desc limit 1 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ where _ | select type from institution where founded > 1990 and enrollment >= 1000 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name of buildings that do not have any institution. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name from building where building_id not in ( select building_id from institution ) |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of buildings except for those having an institution founded in 2003. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ except select _ from _ where _ | select name from building except select building.name from building join institution on building.building_id = institution.building_id where institution.founded = 2003 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: For each building, show the name of the building and the number of institutions in it. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ , count ( _ ) from _ group by _ | select building.name , count ( * ) from building join institution on building.building_id = institution.building_id group by building.building_id |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names and heights of buildings with at least two institutions founded after 1880. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) >= _ | select building.name , building.height_feet from building join institution on building.building_id = institution.building_id where institution.founded > 1880 group by building.building_id having count ( * ) >= 2 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the distinct institution types. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select distinct _ from _ | select distinct type from institution |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show institution names along with the number of proteins for each institution. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ , count ( _ ) from _ group by _ | select institution.institution , count ( * ) from institution join protein on institution.institution_id = protein.institution_id group by institution.institution_id |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from institution join protein on institution.institution_id = protein.institution_id where institution.founded > 1880 or institution.type = 'Private' |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the protein name and the institution name. | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select _ from _ | select protein.protein_name , institution.institution from institution join protein on institution.institution_id = protein.institution_id |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many proteins are associated with an institution in a building with at least 20 floors? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from institution join protein on institution.institution_id = protein.institution_id join building on building.building_id = institution.building_id where building.floors >= 20 |
protein_institute | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many institutions do not have an associated protein in our record? | building : building_id , name , street_address , years_as_tallest , height_feet , floors | institution : institution_id , institution , location , founded , type , enrollment , team , primary_conference , building_id | protein : common_name , protein_name , divergence_from_human_lineage , accession_number , sequence_length , sequence_identity_to_human_protein , institution_id | institution.building_id = building.building_id | protein.institution_id = institution.institution_id |
### Response:
select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from institution where institution_id not in ( select institution_id from protein ) |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the locations where no cinema has capacity over 800. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ except select _ from _ where _ | select location from cinema except select location from cinema where capacity > 800 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the locations where some cinemas were opened in both year 2010 and year 2011. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select location from cinema where openning_year = 2010 intersect select location from cinema where openning_year = 2011 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many cinema do we have? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select count ( _ ) from _ | select count ( * ) from cinema |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of cinemas. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select count ( _ ) from _ | select count ( * ) from cinema |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show name, opening year, and capacity for each cinema. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ | select name , openning_year , capacity from cinema |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the cinema name and location for cinemas with capacity above average. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ > ( select avg ( _ ) from _ ) | select name , location from cinema where capacity > ( select avg ( capacity ) from cinema ) |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all the locations with a cinema? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select distinct _ from _ | select distinct location from cinema |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct locations that has a cinema. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select distinct _ from _ | select distinct location from cinema |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the cinema names and opening years in descending order of opening year. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ order by _ desc | select name , openning_year from cinema order by openning_year desc |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the name and location of the cinema with the largest capacity? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ order by _ desc limit _ | select name , location from cinema order by capacity desc limit 1 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select avg ( _ ) , min ( _ ) , max ( _ ) from _ where _ | select avg ( capacity ) , min ( capacity ) , max ( capacity ) from cinema where openning_year >= 2011 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show each location and the number of cinemas there. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ , count ( _ ) from _ group by _ | select location , count ( * ) from cinema group by location |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the location with the most cinemas opened in year 2010 or later? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ group by _ order by count ( _ ) desc limit _ | select location from cinema where openning_year >= 2010 group by location order by count ( * ) desc limit 1 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the locations with at least two cinemas with capacity above 300. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) >= _ | select location from cinema where capacity > 300 group by location having count ( * ) >= 2 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which locations have 2 or more cinemas with capacity over 300? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) >= _ | select location from cinema where capacity > 300 group by location having count ( * ) >= 2 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the title and director for all films. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ | select title , directed_by from film |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the title and director of each film? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ | select title , directed_by from film |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all directors. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select distinct _ from _ | select distinct directed_by from film |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Who are all the directors? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select distinct _ from _ | select distinct directed_by from film |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List all directors along with the number of films directed by each director. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ , count ( _ ) from _ group by _ | select directed_by , count ( * ) from film group by directed_by |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is total number of show times per dat for each cinema? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select cinema.name , sum ( schedule.show_times_per_day ) from schedule join cinema on schedule.cinema_id = cinema.cinema_id group by schedule.cinema_id |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the title and maximum price of each film? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ , max ( _ ) from _ group by _ | select film.title , max ( schedule.price ) from schedule join film on schedule.film_id = film.film_id group by schedule.film_id |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give me the title and highest price for each film. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ , max ( _ ) from _ group by _ | select film.title , max ( schedule.price ) from schedule join film on schedule.film_id = film.film_id group by schedule.film_id |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show cinema name, film title, date, and price for each record in schedule. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ | select cinema.name , film.title , schedule.date , schedule.price from schedule join film on schedule.film_id = film.film_id join cinema on schedule.cinema_id = cinema.cinema_id |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the title and director of the films without any schedule? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select title , directed_by from film where film_id not in ( select film_id from schedule ) |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show director with the largest number of show times in total. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ group by _ order by sum ( _ ) desc limit _ | select film.directed_by from schedule join film on schedule.film_id = film.film_id group by film.directed_by order by sum ( schedule.show_times_per_day ) desc limit 1 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the locations that have more than one movie theater with capacity above 300. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) > _ | select location from cinema where capacity > 300 group by location having count ( * ) > 1 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: In which locations are there more than one movie theater with capacity above 300? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select _ from _ where _ group by _ having count ( _ ) > _ | select location from cinema where capacity > 300 group by location having count ( * ) > 1 |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many films have the word 'Dummy' in their titles? | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select count ( _ ) from _ where _ like _ | select count ( * ) from film where title like '%Dummy%' |
cinema | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of films whose title contains the word 'Dummy'. | film : film_id , rank_in_series , number_in_season , title , directed_by , original_air_date , production_code | cinema : cinema_id , name , openning_year , capacity , location | schedule : cinema_id , film_id , date , show_times_per_day , price | schedule.cinema_id = cinema.cinema_id | schedule.film_id = film.film_id |
### Response:
select count ( _ ) from _ where _ like _ | select count ( * ) from film where title like '%Dummy%' |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Are the customers holding coupons with amount 500 bad or good? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select customers.good_or_bad_customer from customers join discount_coupons on customers.coupon_id = discount_coupons.coupon_id where discount_coupons.coupon_amount = 500 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many bookings did each customer make? List the customer id, first name, and the count. | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ , count ( _ ) from _ group by _ | select customers.customer_id , customers.first_name , count ( * ) from customers join bookings on customers.customer_id = bookings.customer_id group by customers.customer_id |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the maximum total amount paid by a customer? List the customer id and amount. | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ , sum ( _ ) from _ group by _ order by sum ( _ ) desc limit _ | select customer_id , sum ( amount_paid ) from payments group by customer_id order by sum ( amount_paid ) desc limit 1 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the id and the amount of refund of the booking that incurred the most times of payments? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select bookings.booking_id , bookings.amount_of_refund from bookings join payments on bookings.booking_id = payments.booking_id group by bookings.booking_id order by count ( * ) desc limit 1 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the id of the product that is booked for 3 times? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ group by _ having count ( _ ) = _ | select product_id from products_booked group by product_id having count ( * ) = 3 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the product description of the product booked with an amount of 102.76? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select products_for_hire.product_description from products_booked join products_for_hire on products_booked.product_id = products_for_hire.product_id where products_booked.booked_amount = 102.76 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the start date and end date of the booking that has booked the product named 'Book collection A'? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select bookings.booking_start_date , bookings.booking_end_date from products_for_hire join products_booked on products_for_hire.product_id = products_booked.product_id join bookings on products_booked.booking_id = bookings.booking_id where products_for_hire.product_name = 'Book collection A' |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of products whose availability equals to 1? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select products_for_hire.product_name from view_product_availability join products_for_hire on view_product_availability.product_id = products_for_hire.product_id where view_product_availability.available_yn = 1 |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different product types are there? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select count ( distinct _ ) from _ | select count ( distinct product_type_code ) from products_for_hire |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first name, last name, and gender of all the good customers? Order by their last name. | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ order by _ asc | select first_name , last_name , gender_mf from customers where good_or_bad_customer = 'good' order by last_name asc |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average amount due for all the payments? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select avg ( _ ) from _ | select avg ( amount_due ) from payments |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the maximum, minimum, and average booked count for the products booked? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select max ( _ ) , min ( _ ) , avg ( _ ) from _ | select max ( booked_count ) , min ( booked_count ) , avg ( booked_count ) from products_booked |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all the distinct payment types? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select distinct _ from _ | select distinct payment_type_code from payments |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the daily hire costs for the products with substring 'Book' in its name? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ like _ | select daily_hire_cost from products_for_hire where product_name like '%Book%' |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many products are never booked with amount higher than 200? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select count ( _ ) from _ where _ not in ( select _ from _ where _ ) | select count ( * ) from products_for_hire where product_id not in ( select product_id from products_booked where booked_amount > 200 ) |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the coupon amount of the coupons owned by both good and bad customers? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select discount_coupons.coupon_amount from discount_coupons join customers on discount_coupons.coupon_id = customers.coupon_id where customers.good_or_bad_customer = 'good' intersect select discount_coupons.coupon_amount from discount_coupons join customers on discount_coupons.coupon_id = customers.coupon_id where customers.good_or_bad_customer = 'bad' |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select payment_date from payments where amount_paid > 300 or payment_type_code = 'Check' |
products_for_hire | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id |
### Response:
select _ from _ where _ | select product_name , product_description from products_for_hire where product_type_code = 'Cutlery' and daily_hire_cost < 20 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many phones are there? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select count ( _ ) from _ | select count ( * ) from phone |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the names of phones in ascending order of price. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ order by _ asc | select name from phone order by price asc |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the memories and carriers of phones? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ | select memory_in_g , carrier from phone |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the distinct carriers of phones with memories bigger than 32. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select distinct _ from _ where _ | select distinct carrier from phone where memory_in_g > 32 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of phones with carrier either "Sprint" or "TMobile". | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ where _ | select name from phone where carrier = 'Sprint' or carrier = 'TMobile' |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the carrier of the most expensive phone? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ order by _ desc limit _ | select carrier from phone order by price desc limit 1 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show different carriers of phones together with the number of phones with each carrier. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ , count ( _ ) from _ group by _ | select carrier , count ( * ) from phone group by carrier |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the most frequently used carrier of the phones. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select carrier from phone group by carrier order by count ( * ) desc limit 1 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select carrier from phone where memory_in_g < 32 intersect select carrier from phone where memory_in_g > 64 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of phones and the districts of markets they are on. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ | select phone.name , market.district from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ order by _ asc | select phone.name , market.district from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id order by market.ranking asc |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of phones that are on market with number of shops greater than 50. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ where _ | select phone.name from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id where market.num_of_shops > 50 |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: For each phone, show its names and total number of stocks. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select phone.name , sum ( phone_market.num_of_stock ) from phone_market join phone on phone_market.phone_id = phone.phone_id group by phone.name |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ group by _ having sum ( _ ) >= _ order by sum ( _ ) desc | select phone.name from phone_market join phone on phone_market.phone_id = phone.phone_id group by phone.name having sum ( phone_market.num_of_stock ) >= 2000 order by sum ( phone_market.num_of_stock ) desc |
phone_market | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the names of phones that are not on any market. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name from phone where phone_id not in ( select phone_id from phone_market ) |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many gas companies are there? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select count ( _ ) from _ | select count ( * ) from company |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the total number of companies? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select count ( _ ) from _ | select count ( * ) from company |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the company name and rank for all companies in the decreasing order of their sales. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select _ from _ order by _ desc | select company , rank from company order by sales_billion desc |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name and rank of every company ordered by descending number of sales? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select _ from _ order by _ desc | select company , rank from company order by sales_billion desc |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the company name and the main industry for all companies whose headquarters are not from USA. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select _ from _ where _ | select company , main_industry from company where headquarters != 'USA' |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the companies and main industries of all companies that are not headquartered in the United States? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select _ from _ where _ | select company , main_industry from company where headquarters != 'USA' |
gas_company | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all company names and headquarters in the descending order of market value. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id |
### Response:
select _ from _ order by _ desc | select company , headquarters from company order by market_value desc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.