messages
listlengths 3
3
|
|---|
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the dates that have an average sea level pressure between 30.3 and 31?\nSELECT \n"
},
{
"role": "assistant",
"content": "date from weather where mean_sea_level_pressure_inches between 30.3 and 31"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### Find the day in which the difference between the max temperature and min temperature was the smallest. Also report the difference.\nSELECT \n"
},
{
"role": "assistant",
"content": "date , max_temperature_f - min_temperature_f from weather order by max_temperature_f - min_temperature_f asc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the days that had the smallest temperature range, and what was that range?\nSELECT \n"
},
{
"role": "assistant",
"content": "date , max_temperature_f - min_temperature_f from weather order by max_temperature_f - min_temperature_f asc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the id and name of the stations that have ever had more than 12 bikes available?\nSELECT \n"
},
{
"role": "assistant",
"content": "distinct station.id , station.name from station join status on station.id = status.station_id where status.bikes_available > 12"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the different ids and names of the stations that have had more than 12 bikes available?\nSELECT \n"
},
{
"role": "assistant",
"content": "distinct station.id , station.name from station join status on station.id = status.station_id where status.bikes_available > 12"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.\nSELECT \n"
},
{
"role": "assistant",
"content": "zip_code from weather group by zip_code having avg ( mean_humidity ) < 70 intersect select zip_code from trip group by zip_code having count ( * ) >= 100"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there?\nSELECT \n"
},
{
"role": "assistant",
"content": "zip_code from weather group by zip_code having avg ( mean_humidity ) < 70 intersect select zip_code from trip group by zip_code having count ( * ) >= 100"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?\nSELECT \n"
},
{
"role": "assistant",
"content": "name from station where city = 'Palo Alto' except select end_station_name from trip group by end_station_name having count ( * ) > 100"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What are the names of the stations that are located in Palo Alto but have never been the ending point of the trips\nSELECT \n"
},
{
"role": "assistant",
"content": "name from station where city = 'Palo Alto' except select end_station_name from trip group by end_station_name having count ( * ) > 100"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### How many trips started from Mountain View city and ended at Palo Alto city?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from station join trip join station join trip on station.id = trip.start_station_id and trip.id = trip.id and station.id = trip.end_station_id where station.city = 'Mountain View' and station.city = 'Palo Alto'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### How many trips stated from a station in Mountain View and ended at one in Palo Alto?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from station join trip join station join trip on station.id = trip.start_station_id and trip.id = trip.id and station.id = trip.end_station_id where station.city = 'Mountain View' and station.city = 'Palo Alto'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What is the average latitude and longitude of the starting points of all trips?\nSELECT \n"
},
{
"role": "assistant",
"content": "avg ( station.lat ) , avg ( station.long ) from station join trip on station.id = trip.start_station_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# trip ( id , duration , start_date , start_station_name , start_station_id , end_date , end_station_name , end_station_id , bike_id , subscription_type , zip_code )\n# weather ( date , max_temperature_f , mean_temperature_f , min_temperature_f , max_dew_point_f , mean_dew_point_f , min_dew_point_f , max_humidity , mean_humidity , min_humidity , max_sea_level_pressure_inches , mean_sea_level_pressure_inches , min_sea_level_pressure_inches , max_visibility_miles , mean_visibility_miles , min_visibility_miles , max_wind_speed_mph , mean_wind_speed_mph , max_gust_speed_mph , precipitation_inches , cloud_cover , events , wind_dir_degrees , zip_code )\n# status.station_id = station.id\n\n#\n### What is the average latitude and longitude of all starting stations for the trips?\nSELECT \n"
},
{
"role": "assistant",
"content": "avg ( station.lat ) , avg ( station.long ) from station join trip on station.id = trip.start_station_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### How many books are there?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from book"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the writers of the books in ascending alphabetical order.\nSELECT \n"
},
{
"role": "assistant",
"content": "writer from book order by writer asc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the titles of the books in ascending order of issues.\nSELECT \n"
},
{
"role": "assistant",
"content": "title from book order by issues asc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### What are the titles of the books whose writer is not \"Elaine Lee\"?\nSELECT \n"
},
{
"role": "assistant",
"content": "title from book where writer != 'Elaine Lee'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### What are the title and issues of the books?\nSELECT \n"
},
{
"role": "assistant",
"content": "title , issues from book"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### What are the dates of publications in descending order of price?\nSELECT \n"
},
{
"role": "assistant",
"content": "publication_date from publication order by price desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### What are the distinct publishers of publications with price higher than 5000000?\nSELECT \n"
},
{
"role": "assistant",
"content": "distinct publisher from publication where price > 5000000"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the publisher of the publication with the highest price.\nSELECT \n"
},
{
"role": "assistant",
"content": "publisher from publication order by price desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the publication dates of publications with 3 lowest prices.\nSELECT \n"
},
{
"role": "assistant",
"content": "publication_date from publication order by price asc limit 3"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show the title and publication dates of books.\nSELECT \n"
},
{
"role": "assistant",
"content": "book.title , publication.publication_date from book join publication on book.book_id = publication.book_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show writers who have published a book with price more than 4000000.\nSELECT \n"
},
{
"role": "assistant",
"content": "book.writer from book join publication on book.book_id = publication.book_id where publication.price > 4000000"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show the titles of books in descending order of publication price.\nSELECT \n"
},
{
"role": "assistant",
"content": "book.title from book join publication on book.book_id = publication.book_id order by publication.price desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show publishers that have more than one publication.\nSELECT \n"
},
{
"role": "assistant",
"content": "publisher from publication group by publisher having count ( * ) > 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show different publishers together with the number of publications they have.\nSELECT \n"
},
{
"role": "assistant",
"content": "publisher , count ( * ) from publication group by publisher"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Please show the most common publication date.\nSELECT \n"
},
{
"role": "assistant",
"content": "publication_date from publication group by publication_date order by count ( * ) desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the writers who have written more than one book.\nSELECT \n"
},
{
"role": "assistant",
"content": "writer from book group by writer having count ( * ) > 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### List the titles of books that are not published.\nSELECT \n"
},
{
"role": "assistant",
"content": "title from book where book_id not in ( select book_id from publication )"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.\nSELECT \n"
},
{
"role": "assistant",
"content": "publisher from publication where price > 10000000 intersect select publisher from publication where price < 5000000"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### What is the number of distinct publication dates?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( distinct publication_date ) from publication"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### How many distinct publication dates are there in our record?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( distinct publication_date ) from publication"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# publication ( publication_id , book_id , publisher , publication_date , price )\n# book ( book_id , title , issues , writer )\n# publication.book_id = book.book_id\n\n#\n### Show the prices of publications whose publisher is either \"Person\" or \"Wiley\"\nSELECT \n"
},
{
"role": "assistant",
"content": "price from publication where publisher = 'Person' or publisher = 'Wiley'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### How many actors are there?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from actor"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Count the number of actors.\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from actor"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### List the name of actors in ascending alphabetical order.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from actor order by name asc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of actors, ordered alphabetically?\nSELECT \n"
},
{
"role": "assistant",
"content": "name from actor order by name asc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the characters and duration of actors?\nSELECT \n"
},
{
"role": "assistant",
"content": "character , duration from actor"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the characters and durations for each actor.\nSELECT \n"
},
{
"role": "assistant",
"content": "character , duration from actor"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### List the name of actors whose age is not 20.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from actor where age != 20"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of actors who are not 20 years old?\nSELECT \n"
},
{
"role": "assistant",
"content": "name from actor where age != 20"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the characters of actors in descending order of age?\nSELECT \n"
},
{
"role": "assistant",
"content": "character from actor order by age desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the characters for actors, ordered by age descending.\nSELECT \n"
},
{
"role": "assistant",
"content": "character from actor order by age desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What is the duration of the oldest actor?\nSELECT \n"
},
{
"role": "assistant",
"content": "duration from actor order by age desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the duration of the actor with the greatest age.\nSELECT \n"
},
{
"role": "assistant",
"content": "duration from actor order by age desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of musicals with nominee \"Bob Fosse\"?\nSELECT \n"
},
{
"role": "assistant",
"content": "name from musical where nominee = 'Bob Fosse'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the names of musicals who have the nominee Bob Fosse.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from musical where nominee = 'Bob Fosse'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the distinct nominees of the musicals with the award that is not \"Tony Award\"?\nSELECT \n"
},
{
"role": "assistant",
"content": "distinct nominee from musical where award != 'Tony Award'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the different nominees of musicals that have an award that is not the Tony Award.\nSELECT \n"
},
{
"role": "assistant",
"content": "distinct nominee from musical where award != 'Tony Award'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show names of actors and names of musicals they are in.\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name , musical.name from actor join musical on actor.musical_id = musical.musical_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of actors and the musicals that they are in?\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name , musical.name from actor join musical on actor.musical_id = musical.musical_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show names of actors that have appeared in musical with name \"The Phantom of the Opera\".\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name from actor join musical on actor.musical_id = musical.musical_id where musical.name = 'The Phantom of the Opera'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of actors who have been in the musical titled The Phantom of the Opera?\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name from actor join musical on actor.musical_id = musical.musical_id where musical.name = 'The Phantom of the Opera'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show names of actors in descending order of the year their musical is awarded.\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name from actor join musical on actor.musical_id = musical.musical_id order by musical.year desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of actors ordered descending by the year in which their musical was awarded?\nSELECT \n"
},
{
"role": "assistant",
"content": "actor.name from actor join musical on actor.musical_id = musical.musical_id order by musical.year desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show names of musicals and the number of actors who have appeared in the musicals.\nSELECT \n"
},
{
"role": "assistant",
"content": "musical.name , count ( * ) from actor join musical on actor.musical_id = musical.musical_id group by actor.musical_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### How many actors have appeared in each musical?\nSELECT \n"
},
{
"role": "assistant",
"content": "musical.name , count ( * ) from actor join musical on actor.musical_id = musical.musical_id group by actor.musical_id"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show names of musicals which have at least three actors.\nSELECT \n"
},
{
"role": "assistant",
"content": "musical.name from actor join musical on actor.musical_id = musical.musical_id group by actor.musical_id having count ( * ) >= 3"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of musicals who have at 3 or more actors?\nSELECT \n"
},
{
"role": "assistant",
"content": "musical.name from actor join musical on actor.musical_id = musical.musical_id group by actor.musical_id having count ( * ) >= 3"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show different nominees and the number of musicals they have been nominated.\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee , count ( * ) from musical group by nominee"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### How many musicals has each nominee been nominated for?\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee , count ( * ) from musical group by nominee"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Please show the nominee who has been nominated the greatest number of times.\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical group by nominee order by count ( * ) desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Who is the nominee who has been nominated for the most musicals?\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical group by nominee order by count ( * ) desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### List the most common result of the musicals.\nSELECT \n"
},
{
"role": "assistant",
"content": "result from musical group by result order by count ( * ) desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Return the most frequent result across all musicals.\nSELECT \n"
},
{
"role": "assistant",
"content": "result from musical group by result order by count ( * ) desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### List the nominees that have been nominated more than two musicals.\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical group by nominee having count ( * ) > 2"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Who are the nominees who have been nominated more than two times?\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical group by nominee having count ( * ) > 2"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### List the name of musicals that do not have actors.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from musical where musical_id not in ( select musical_id from actor )"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### What are the names of musicals who have no actors?\nSELECT \n"
},
{
"role": "assistant",
"content": "name from musical where musical_id not in ( select musical_id from actor )"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show the nominees that have nominated musicals for both \"Tony Award\" and \"Drama Desk Award\".\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical where award = 'Tony Award' intersect select nominee from musical where award = 'Drama Desk Award'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Who are the nominees who have been nominated for both a Tony Award and a Drama Desk Award?\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical where award = 'Tony Award' intersect select nominee from musical where award = 'Drama Desk Award'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Show the musical nominee with award \"Bob Fosse\" or \"Cleavant Derricks\".\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical where award = 'Tony Award' or award = 'Cleavant Derricks'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# musical ( musical_id , name , year , award , category , nominee , result )\n# actor ( actor_id , name , musical_id , character , duration , age )\n# actor.musical_id = actor.actor_id\n\n#\n### Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards?\nSELECT \n"
},
{
"role": "assistant",
"content": "nominee from musical where award = 'Tony Award' or award = 'Cleavant Derricks'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the emails of the user named \"Mary\".\nSELECT \n"
},
{
"role": "assistant",
"content": "email from user_profiles where name = 'Mary'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### What is the partition id of the user named \"Iron Man\".\nSELECT \n"
},
{
"role": "assistant",
"content": "partitionid from user_profiles where name = 'Iron Man'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### How many users are there?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from user_profiles"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### How many followers does each user have?\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from follows"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the number of followers for each user.\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from follows group by f1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the number of tweets in record.\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( * ) from tweets"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the number of users who posted some tweets.\nSELECT \n"
},
{
"role": "assistant",
"content": "count ( distinct uid ) from tweets"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name and email of the user whose name contains the word 'Swift'.\nSELECT \n"
},
{
"role": "assistant",
"content": "name , email from user_profiles where name like '%Swift%'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the names of users whose emails contain 'superstar' or 'edu'.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from user_profiles where email like '%superstar%' or email like '%edu%'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Return the text of tweets about the topic 'intern'.\nSELECT \n"
},
{
"role": "assistant",
"content": "text from tweets where text like '%intern%'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name and email of the users who have more than 1000 followers.\nSELECT \n"
},
{
"role": "assistant",
"content": "name , email from user_profiles where followers > 1000"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the names of the users whose number of followers is greater than that of the user named \"Tyler Swift\".\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name from user_profiles join follows on user_profiles.uid = follows.f1 group by follows.f1 having count ( * ) > ( select count ( * ) from user_profiles join follows on user_profiles.uid = follows.f1 where user_profiles.name = 'Tyler Swift' )"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name and email for the users who have more than one follower.\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name , user_profiles.email from user_profiles join follows on user_profiles.uid = follows.f1 group by follows.f1 having count ( * ) > 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the names of users who have more than one tweet.\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name from user_profiles join tweets on user_profiles.uid = tweets.uid group by tweets.uid having count ( * ) > 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the id of users who are followed by Mary and Susan.\nSELECT \n"
},
{
"role": "assistant",
"content": "follows.f1 from user_profiles join follows on user_profiles.uid = follows.f2 where user_profiles.name = 'Mary' intersect select follows.f1 from user_profiles join follows on user_profiles.uid = follows.f2 where user_profiles.name = 'Susan'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the id of users who are followed by Mary or Susan.\nSELECT \n"
},
{
"role": "assistant",
"content": "follows.f1 from user_profiles join follows on user_profiles.uid = follows.f2 where user_profiles.name = 'Mary' or user_profiles.name = 'Susan'"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name of the user who has the largest number of followers.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from user_profiles order by followers desc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name and email of the user followed by the least number of people.\nSELECT \n"
},
{
"role": "assistant",
"content": "name , email from user_profiles order by followers asc limit 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### List the name and number of followers for each user, and sort the results by the number of followers in descending order.\nSELECT \n"
},
{
"role": "assistant",
"content": "name , followers from user_profiles order by followers desc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### List the names of 5 users followed by the largest number of other users.\nSELECT \n"
},
{
"role": "assistant",
"content": "name from user_profiles order by followers desc limit 5"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### List the text of all tweets in the order of date.\nSELECT \n"
},
{
"role": "assistant",
"content": "text from tweets order by createdate asc"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name of each user and number of tweets tweeted by each of them.\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name , count ( * ) from user_profiles join tweets on user_profiles.uid = tweets.uid group by tweets.uid"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name and partition id for users who tweeted less than twice.\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name , user_profiles.partitionid from user_profiles join tweets on user_profiles.uid = tweets.uid group by tweets.uid having count ( * ) < 2"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the name of the user who tweeted more than once, and number of tweets tweeted by them.\nSELECT \n"
},
{
"role": "assistant",
"content": "user_profiles.name , count ( * ) from user_profiles join tweets on user_profiles.uid = tweets.uid group by tweets.uid having count ( * ) > 1"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the average number of followers for the users who do not have any tweet.\nSELECT \n"
},
{
"role": "assistant",
"content": "avg ( followers ) from user_profiles where uid not in ( select uid from tweets )"
}
] |
[
{
"role": "system",
"content": "You are an excellent SQL writer."
},
{
"role": "user",
"content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# follows ( f1 , f2 )\n# tweets ( id , uid , text , createdate )\n# user_profiles ( uid , name , email , partitionid , followers )\n# follows.f2 = user_profiles.uid\n# follows.f1 = user_profiles.uid\n# tweets.uid = user_profiles.uid\n\n#\n### Find the average number of followers for the users who had some tweets.\nSELECT \n"
},
{
"role": "assistant",
"content": "avg ( followers ) from user_profiles where uid in ( select uid from tweets )"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.