db_id
stringlengths
4
31
text
stringlengths
370
4.84k
products_gen_characteristics
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 colors are never used by any product? | ref_characteristic_types : characteristic_type_code , characteristic_type_description | ref_colors : color_code , color_description | ref_product_categories : product_category_code , product_category_description , unit_of_measure | characteristics : characteristic_id , characteristic_type_code , characteristic_data_type , characteristic_name , other_characteristic_details | products : product_id , color_code , product_category_code , product_name , typical_buying_price , typical_selling_price , product_description , other_product_details | product_characteristics : product_id , characteristic_id , product_characteristic_value | characteristics.characteristic_type_code = ref_characteristic_types.characteristic_type_code | products.color_code = ref_colors.color_code | products.product_category_code = ref_product_categories.product_category_code | product_characteristics.product_id = products.product_id | product_characteristics.characteristic_id = characteristics.characteristic_id | ### Response: select count ( * ) from ref_colors where color_code not in ( select color_code from products )
products_gen_characteristics
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 colors that are not used in any products. | ref_characteristic_types : characteristic_type_code , characteristic_type_description | ref_colors : color_code , color_description | ref_product_categories : product_category_code , product_category_description , unit_of_measure | characteristics : characteristic_id , characteristic_type_code , characteristic_data_type , characteristic_name , other_characteristic_details | products : product_id , color_code , product_category_code , product_name , typical_buying_price , typical_selling_price , product_description , other_product_details | product_characteristics : product_id , characteristic_id , product_characteristic_value | characteristics.characteristic_type_code = ref_characteristic_types.characteristic_type_code | products.color_code = ref_colors.color_code | products.product_category_code = ref_product_categories.product_category_code | product_characteristics.product_id = products.product_id | product_characteristics.characteristic_id = characteristics.characteristic_id | ### Response: select count ( * ) from ref_colors where color_code not in ( select color_code from products )
swimming
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 events are there? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select count ( * ) from event
swimming
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 the event names by year from the most recent to the oldest. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from event order by year desc
swimming
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 event that happened in the most recent year? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from event order by year desc limit 1
swimming
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 stadiums are there? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select count ( * ) from stadium
swimming
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 name of the stadium that has the maximum capacity. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from stadium order by capacity desc limit 1
swimming
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 stadiums whose capacity is smaller than the average capacity. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from stadium where capacity < ( select avg ( capacity ) from stadium )
swimming
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 country that has the most stadiums. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select country from stadium group by country order by count ( * ) desc limit 1
swimming
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 country has at most 3 stadiums listed? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select country from stadium group by country having count ( * ) <= 3
swimming
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 country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select country from stadium where capacity > 60000 intersect select country from stadium where capacity < 50000
swimming
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 cities have a stadium that was opened before the year of 2006? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select count ( distinct city ) from stadium where opening_year < 2006
swimming
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 stadiums does each country have? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select country , count ( * ) from stadium group by country
swimming
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 countries do not have a stadium that was opened after 2006? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select country from stadium except select country from stadium where opening_year > 2006
swimming
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 stadiums are not in country "Russia"? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select count ( * ) from stadium where country != 'Russia'
swimming
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 all swimmers, sorted by their 100 meter scores in ascending order. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from swimmer order by meter_100 asc
swimming
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 countries are all the swimmers from? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select count ( distinct nationality ) from swimmer
swimming
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 countries that have more than one swimmer. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select nationality , count ( * ) from swimmer group by nationality having count ( * ) > 1
swimming
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 all 200 meter and 300 meter results of swimmers with nationality "Australia". | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select meter_200 , meter_300 from swimmer where nationality = 'Australia'
swimming
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 swimmers who has a result of "win". | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select swimmer.name from swimmer join record on swimmer.id = record.swimmer_id where result = 'Win'
swimming
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 stadium which held the most events? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select stadium.name from stadium join event on stadium.id = event.stadium_id group by event.stadium_id order by count ( * ) desc limit 1
swimming
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 name and capacity of the stadium where the event named "World Junior" happened. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select stadium.name , stadium.capacity from stadium join event on stadium.id = event.stadium_id where event.name = 'World Junior'
swimming
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 stadiums which have never had any event. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from stadium where id not in ( select stadium_id from event )
swimming
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 name of the swimmer who has the most records. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select swimmer.name from swimmer join record on swimmer.id = record.swimmer_id group by record.swimmer_id order by count ( * ) desc limit 1
swimming
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 name of the swimmer who has at least 2 records. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select swimmer.name from swimmer join record on swimmer.id = record.swimmer_id group by record.swimmer_id having count ( * ) >= 2
swimming
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 name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select swimmer.name , swimmer.nationality from swimmer join record on swimmer.id = record.swimmer_id where result = 'Win' group by record.swimmer_id having count ( * ) > 1
swimming
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 the swimmers who have no record. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select name from swimmer where id not in ( select swimmer_id from record )
swimming
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 the swimmers who have both "win" and "loss" results in the record. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select swimmer.name from swimmer join record on swimmer.id = record.swimmer_id where result = 'Win' intersect select swimmer.name from swimmer join record on swimmer.id = record.swimmer_id where result = 'Loss'
swimming
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 stadiums that some Australian swimmers have been to. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select stadium.name from swimmer join record on swimmer.id = record.swimmer_id join event on record.event_id = event.id join stadium on stadium.id = event.stadium_id where swimmer.nationality = 'Australia'
swimming
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 stadiums that the most swimmers have been to. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select stadium.name from record join event on record.event_id = event.id join stadium on stadium.id = event.stadium_id group by event.stadium_id order by count ( * ) desc limit 1
swimming
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 all details for each swimmer. | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select * from swimmer
swimming
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 capacity of the stadiums that were opened in year 2005? | swimmer : id , name , nationality , meter_100 , meter_200 , meter_300 , meter_400 , meter_500 , meter_600 , meter_700 , time | stadium : id , name , capacity , city , country , opening_year | event : id , name , stadium_id , year | record : id , result , swimmer_id , event_id | event.stadium_id = stadium.id | record.swimmer_id = swimmer.id | record.event_id = event.id | ### Response: select avg ( capacity ) from stadium where opening_year = 2005
railway
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 railways are there? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select count ( * ) from railway
railway
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 builders of railways in ascending alphabetical order. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select builder from railway order by builder asc
railway
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 wheels and locations of the railways. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select wheels , location from railway
railway
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 level of managers in countries that are not "Australia"? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select max ( level ) from manager where country != 'Australia '
railway
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 age for all managers? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select avg ( age ) from manager
railway
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 managers in ascending order of level? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select name from manager order by level asc
railway
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 arrival times of trains? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select name , arrival from train
railway
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 oldest manager? | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select name from manager order by age desc limit 1
railway
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 trains and locations of railways they are in. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select train.name , railway.location from railway join train on railway.railway_id = train.railway_id
railway
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 builder of railways associated with the trains named "Andaman Exp". | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select railway.builder from railway join train on railway.railway_id = train.railway_id where train.name = 'Andaman Exp'
railway
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 id and location of railways that are associated with more than one train. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select train.railway_id , railway.location from railway join train on railway.railway_id = train.railway_id group by train.railway_id having count ( * ) > 1
railway
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 id and builder of the railway that are associated with the most trains. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select train.railway_id , railway.builder from railway join train on railway.railway_id = train.railway_id group by train.railway_id order by count ( * ) desc limit 1
railway
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 builders of railways, along with the corresponding number of railways using each builder. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select builder , count ( * ) from railway group by builder
railway
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 common builder of railways. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select builder from railway group by builder order by count ( * ) desc limit 1
railway
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 locations of railways along with the corresponding number of railways at each location. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select location , count ( * ) from railway group by location
railway
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 locations that have more than one railways. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select location from railway group by location having count ( * ) > 1
railway
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 object number of railways that do not have any trains. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select objectnumber from railway where railway_id not in ( select railway_id from train )
railway
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 countries that have both managers of age above 50 and managers of age below 46. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select country from manager where age > 50 intersect select country from manager where age < 46
railway
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 distinct countries of managers. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select distinct country from manager
railway
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 working years of managers in descending order of their level. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select working_year_starts from manager order by level desc
railway
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 countries that have managers of age above 50 or below 46. | railway : railway_id , railway , builder , built , wheels , location , objectnumber | train : train_id , train_num , name , from , arrival , railway_id | manager : manager_id , name , country , working_year_starts , age , level | railway_manage : railway_id , manager_id , from_year | train.railway_id = railway.railway_id | railway_manage.railway_id = railway.railway_id | railway_manage.manager_id = manager.manager_id | ### Response: select country from manager where age > 50 or age < 46
customers_and_products_contacts
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 addresses are there in country USA? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select count ( * ) from addresses where country = 'USA'
customers_and_products_contacts
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 distinct cities in the address record. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select distinct city from addresses
customers_and_products_contacts
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 state and the number of addresses in each state. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select state_province_county , count ( * ) from addresses group by state_province_county
customers_and_products_contacts
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 names and phones of customers who do not have address information. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customer_name , customer_phone from customers where customer_id not in ( select customer_id from customer_address_history )
customers_and_products_contacts
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 the customer who has the most orders. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id group by customers.customer_id order by count ( * ) desc limit 1
customers_and_products_contacts
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 product type codes which have at least two products. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select product_type_code from products group by product_type_code having count ( * ) >= 2
customers_and_products_contacts
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 customers who have both an order in completed status and an order in part status. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id where customer_orders.order_status_code = 'Completed' intersect select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id where customer_orders.order_status_code = 'Part'
customers_and_products_contacts
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, phone, and payment method code for all customers in descending order of customer number. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customer_name , customer_phone , payment_method_code from customers order by customer_number desc
customers_and_products_contacts
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 product name and total order quantity for each product. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select products.product_name , sum ( order_items.order_quantity ) from products join order_items on products.product_id = order_items.product_id group by products.product_id
customers_and_products_contacts
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 minimum, maximum, average price for all products. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select min ( product_price ) , max ( product_price ) , avg ( product_price ) from products
customers_and_products_contacts
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 have a price higher than the average? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select count ( * ) from products where product_price > ( select avg ( product_price ) from products )
customers_and_products_contacts
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 customer name, customer address city, date from, and date to for each customer address history. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customers.customer_name , addresses.city , customer_address_history.date_from , customer_address_history.date_to from customer_address_history join customers on customer_address_history.customer_id = customers.customer_id join addresses on customer_address_history.address_id = addresses.address_id
customers_and_products_contacts
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 customers who use Credit Card payment method and have more than 2 orders. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id where customers.payment_method_code = 'Credit Card' group by customers.customer_id having count ( * ) > 2
customers_and_products_contacts
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 phone of the customer with the most ordered product quantity? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select customers.customer_name , customers.customer_phone from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on order_items.order_id = customer_orders.order_id group by customers.customer_id order by sum ( order_items.order_quantity ) desc limit 1
customers_and_products_contacts
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 product type and name for the products with price higher than 1000 or lower than 500. | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | products : product_id , product_type_code , product_name , product_price | customers : customer_id , payment_method_code , customer_number , customer_name , customer_address , customer_phone , customer_email | contacts : contact_id , customer_id , gender , first_name , last_name , contact_phone | customer_address_history : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_date , order_status_code | order_items : order_item_id , order_id , product_id , order_quantity | customer_address_history.address_id = addresses.address_id | customer_address_history.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | ### Response: select product_type_code , product_name from products where product_price > 1000 or product_price < 500
dorm_1
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 name of dorms only for female (F gender). | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where gender = 'F'
dorm_1
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 the all-female dorms? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where gender = 'F'
dorm_1
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 name of dorms that can accommodate more than 300 students. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where student_capacity > 300
dorm_1
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 all the dorms that can accomdate more than 300 students? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where student_capacity > 300
dorm_1
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 female students (sex is F) whose age is below 25? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from student where sex = 'F' and age < 25
dorm_1
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 girl students who are younger than 25? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from student where sex = 'F' and age < 25
dorm_1
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 first name of students who is older than 20. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select fname from student where age > 20
dorm_1
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 names of all students who are older than 20? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select fname from student where age > 20
dorm_1
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 first name of students living in city PHL whose age is between 20 and 25. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select fname from student where city_code = 'PHL' and age between 20 and 25
dorm_1
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 first name of the students who are in age 20 to 25 and living in PHL city? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select fname from student where city_code = 'PHL' and age between 20 and 25
dorm_1
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 dorms are there? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from dorm
dorm_1
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 dorms are in the database? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from dorm
dorm_1
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 distinct amenities. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from dorm_amenity
dorm_1
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 diffrent dorm amenities are there? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from dorm_amenity
dorm_1
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 total capacity of all dorms. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select sum ( student_capacity ) from dorm
dorm_1
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 student capacity of all dorms? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select sum ( student_capacity ) from dorm
dorm_1
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 students are there? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from student
dorm_1
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 students exist? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( * ) from student
dorm_1
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 average age of all students living in the each city. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select avg ( age ) , city_code from student group by city_code
dorm_1
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 age for each city and what are those cities? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select avg ( age ) , city_code from student group by city_code
dorm_1
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 average and total capacity of dorms for the students with gender X. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select avg ( student_capacity ) , sum ( student_capacity ) from dorm where gender = 'X'
dorm_1
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 and total capacity for all dorms who are of gender X? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select avg ( student_capacity ) , sum ( student_capacity ) from dorm where gender = 'X'
dorm_1
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 dorms that have some amenity. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( distinct dormid ) from has_amenity
dorm_1
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 dorms have amenities? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( distinct dormid ) from has_amenity
dorm_1
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 name of dorms that do not have any amenity | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where dormid not in ( select dormid from has_amenity )
dorm_1
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 all the dorms that don't have any amenities? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name from dorm where dormid not in ( select dormid from has_amenity )
dorm_1
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 distinct gender for dorms. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( distinct gender ) from dorm
dorm_1
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 genders are there in the dorms? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select count ( distinct gender ) from dorm
dorm_1
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 capacity and gender type of the dorm whose name has substring 'Donor'. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select student_capacity , gender from dorm where dorm_name like '%Donor%'
dorm_1
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 student capacity and type of gender for the dorm whose name as the phrase Donor in it? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select student_capacity , gender from dorm where dorm_name like '%Donor%'
dorm_1
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 name and gender type of the dorms whose capacity is greater than 300 or less than 100. | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name , gender from dorm where student_capacity > 300 or student_capacity < 100
dorm_1
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 types of the dorms that have a capacity greater than 300 or less than 100? | student : stuid , lname , fname , age , sex , major , advisor , city_code | dorm : dormid , dorm_name , student_capacity , gender | dorm_amenity : amenid , amenity_name | has_amenity : dormid , amenid | lives_in : stuid , dormid , room_number | has_amenity.amenid = dorm_amenity.amenid | has_amenity.dormid = dorm.dormid | lives_in.dormid = dorm.dormid | lives_in.stuid = student.stuid | ### Response: select dorm_name , gender from dorm where student_capacity > 300 or student_capacity < 100