db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
game_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 types of sports do we offer? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select count ( distinct sportname ) from sportsinfo |
game_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 play sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select count ( distinct stuid ) from sportsinfo |
game_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 students are involved in sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select count ( distinct stuid ) from sportsinfo |
game_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: List ids for all student who are on scholarship. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo where onscholarship = 'Y' |
game_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 ids for all sporty students who are on scholarship? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo where onscholarship = 'Y' |
game_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: Show last names for all student who are on scholarship. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.lname from sportsinfo join student on sportsinfo.stuid = student.stuid where sportsinfo.onscholarship = 'Y' |
game_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 last names for all scholarship students? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.lname from sportsinfo join student on sportsinfo.stuid = student.stuid where sportsinfo.onscholarship = 'Y' |
game_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 games are played for all students? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( gamesplayed ) from sportsinfo |
game_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 number of games played? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( gamesplayed ) from sportsinfo |
game_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 games are played for all football games by students on scholarship? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( gamesplayed ) from sportsinfo where sportname = 'Football' and onscholarship = 'Y' |
game_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 number of all football games played by scholarship students? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( gamesplayed ) from sportsinfo where sportname = 'Football' and onscholarship = 'Y' |
game_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: Show all sport name and the number of students. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sportname , count ( * ) from sportsinfo group by sportname |
game_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 play each sport? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sportname , count ( * ) from sportsinfo group by sportname |
game_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: Show all student IDs with the number of sports and total number of games played | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid , count ( * ) , sum ( gamesplayed ) from sportsinfo group by stuid |
game_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 ids of all students along with how many sports and games did they play? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid , count ( * ) , sum ( gamesplayed ) from sportsinfo group by stuid |
game_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: Show all student IDs with more than total 10 hours per week on all sports played. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo group by stuid having sum ( hoursperweek ) > 10 |
game_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 student IDs for everybody who worked for more than 10 hours per week on all sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo group by stuid having sum ( hoursperweek ) > 10 |
game_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 and last name of the student who have most number of sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.fname , student.lname from sportsinfo join student on sportsinfo.stuid = student.stuid group by sportsinfo.stuid order by count ( * ) desc limit 1 |
game_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 and last name of the student who played the most sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.fname , student.lname from sportsinfo join student on sportsinfo.stuid = student.stuid group by sportsinfo.stuid order by count ( * ) desc limit 1 |
game_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: Which sport has most number of students on scholarship? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sportname from sportsinfo where onscholarship = 'Y' group by sportname order by count ( * ) desc limit 1 |
game_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 sport with the most scholarship students? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sportname from sportsinfo where onscholarship = 'Y' group by sportname order by count ( * ) desc limit 1 |
game_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: Show student ids who don't have any sports. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student except select stuid from sportsinfo |
game_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 ids of all students who don't play sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student except select stuid from sportsinfo |
game_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: Show student ids who are on scholarship and have major 600. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where major = 600 intersect select stuid from sportsinfo where onscholarship = 'Y' |
game_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 student ids for those on scholarship in major number 600? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where major = 600 intersect select stuid from sportsinfo where onscholarship = 'Y' |
game_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: Show student ids who are female and play football. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where sex = 'F' intersect select stuid from sportsinfo where sportname = 'Football' |
game_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 ids of all female students who play football? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where sex = 'F' intersect select stuid from sportsinfo where sportname = 'Football' |
game_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: Show all male student ids who don't play football. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where sex = 'M' except select stuid from sportsinfo where sportname = 'Football' |
game_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 ids of all male students who do not play football? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student where sex = 'M' except select stuid from sportsinfo where sportname = 'Football' |
game_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: Show total hours per week and number of games played for student David Shieber. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( hoursperweek ) , sum ( gamesplayed ) from sportsinfo join student on sportsinfo.stuid = student.stuid where student.fname = 'David' and student.lname = 'Shieber' |
game_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 number of hours per work and number of games played by David Shieber? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( hoursperweek ) , sum ( gamesplayed ) from sportsinfo join student on sportsinfo.stuid = student.stuid where student.fname = 'David' and student.lname = 'Shieber' |
game_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: Show total hours per week and number of games played for students under 20. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( hoursperweek ) , sum ( gamesplayed ) from sportsinfo join student on sportsinfo.stuid = student.stuid where student.age < 20 |
game_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 number of hours per week and number of games played by students under 20? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select sum ( hoursperweek ) , sum ( gamesplayed ) from sportsinfo join student on sportsinfo.stuid = student.stuid where student.age < 20 |
game_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 play video games? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select count ( distinct stuid ) from plays_games |
game_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 students play games? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select count ( distinct stuid ) from plays_games |
game_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: Show ids of students who don't play video game. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student except select stuid from plays_games |
game_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 ids of all students who are not video game players? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from student except select stuid from plays_games |
game_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: Show ids of students who play video game and play sports. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo intersect select stuid from plays_games |
game_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 ids of all students who played video games and sports? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid from sportsinfo intersect select stuid from plays_games |
game_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: Show all game ids and the number of hours played. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gameid , sum ( hours_played ) from plays_games group by gameid |
game_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 ids and total number of hours played for each game? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gameid , sum ( hours_played ) from plays_games group by gameid |
game_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: Show all student ids and the number of hours played. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid , sum ( hours_played ) from plays_games group by stuid |
game_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 ids of all students and number of hours played? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select stuid , sum ( hours_played ) from plays_games group by stuid |
game_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: Show the game name that has most number of hours played. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid group by plays_games.gameid order by sum ( hours_played ) desc limit 1 |
game_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 name of the game that has been played the most? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid group by plays_games.gameid order by sum ( hours_played ) desc limit 1 |
game_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: Show all game names played by at least 1000 hours. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid group by plays_games.gameid having sum ( hours_played ) >= 1000 |
game_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 games that have been played for at least 1000 hours? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid group by plays_games.gameid having sum ( hours_played ) >= 1000 |
game_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: Show all game names played by Linda Smith | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid join student on student.stuid = plays_games.stuid where student.lname = 'Smith' and student.fname = 'Linda' |
game_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 games played by Linda Smith? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select gname from plays_games join video_games on plays_games.gameid = video_games.gameid join student on student.stuid = plays_games.stuid where student.lname = 'Smith' and student.fname = 'Linda' |
game_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 last and first name of students who are playing Football or Lacrosse. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.lname , student.fname from sportsinfo join student on sportsinfo.stuid = student.stuid where sportsinfo.sportname = 'Football' or sportsinfo.sportname = 'Lacrosse' |
game_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 and last name of all students who play Football or Lacrosse? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select student.lname , student.fname from sportsinfo join student on sportsinfo.stuid = student.stuid where sportsinfo.sportname = 'Football' or sportsinfo.sportname = 'Lacrosse' |
game_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 and age of the students who are playing both Football and Lacrosse. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select fname , age from student where stuid in ( select stuid from sportsinfo where sportname = 'Football' intersect select stuid from sportsinfo where sportname = 'Lacrosse' ) |
game_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 and ages of all students who are playing both Football and Lacrosse? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select fname , age from student where stuid in ( select stuid from sportsinfo where sportname = 'Football' intersect select stuid from sportsinfo where sportname = 'Lacrosse' ) |
game_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 last name and gender of the students who are playing both Call of Destiny and Works of Widenius games. | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select lname , sex from student where stuid in ( select plays_games.stuid from plays_games join video_games on plays_games.gameid = video_games.gameid where video_games.gname = 'Call of Destiny' intersect select plays_games.stuid from plays_games join video_games on plays_games.gameid = video_games.gameid where video_games.gname = 'Works of Widenius' ) |
game_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 last name and gender of all students who played both Call of Destiny and Works of Widenius? | student : stuid , lname , fname , age , sex , major , advisor , city_code | video_games : gameid , gname , gtype | plays_games : stuid , gameid , hours_played | sportsinfo : stuid , sportname , hoursperweek , gamesplayed , onscholarship | plays_games.stuid = student.stuid | plays_games.gameid = video_games.gameid | sportsinfo.stuid = student.stuid |
### Response:
select lname , sex from student where stuid in ( select plays_games.stuid from plays_games join video_games on plays_games.gameid = video_games.gameid where video_games.gname = 'Call of Destiny' intersect select plays_games.stuid from plays_games join video_games on plays_games.gameid = video_games.gameid where video_games.gname = 'Works of Widenius' ) |
customers_and_addresses | 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 all customers. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers |
customers_and_addresses | 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 customers? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers |
customers_and_addresses | 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 customers are there? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 customers |
customers_and_addresses | 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: Return the total number of distinct customers. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 customers |
customers_and_addresses | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average amount of items ordered in each order? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 avg ( order_quantity ) from order_items |
customers_and_addresses | 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 order quantity per order. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 avg ( order_quantity ) from order_items |
customers_and_addresses | 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 customers who use payment method "Cash"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where payment_method = 'Cash' |
customers_and_addresses | 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 customers use "Cash" for payment method? Return the customer names. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where payment_method = 'Cash' |
customers_and_addresses | 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 "date became customers" of the customers whose ID is between 10 and 20. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 date_became_customer from customers where customer_id between 10 and 20 |
customers_and_addresses | 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 dates when customers with ids between 10 and 20 became customers? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 date_became_customer from customers where customer_id between 10 and 20 |
customers_and_addresses | 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 payment method is used by most customers? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 payment_method from customers group by payment_method order by count ( * ) desc limit 1 |
customers_and_addresses | 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 payment method that is used most frequently. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 payment_method from customers group by payment_method order by count ( * ) desc limit 1 |
customers_and_addresses | 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 customers using the most popular payment method? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where payment_method = ( select payment_method from customers group by payment_method order by count ( * ) desc limit 1 ) |
customers_and_addresses | 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 customers who use the most frequently used payment method. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where payment_method = ( select payment_method from customers group by payment_method order by count ( * ) desc limit 1 ) |
customers_and_addresses | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all the payment methods? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 payment_method from customers |
customers_and_addresses | 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: Return all the distinct payment methods used by customers. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 payment_method from customers |
customers_and_addresses | 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 details of all products? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 product_details from products |
customers_and_addresses | 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: Return the the details of all products. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 product_details from products |
customers_and_addresses | 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 all customers whose name contains "Alex". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where customer_name like '%Alex%' |
customers_and_addresses | 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 customer's name contains "Alex"? Find the full name. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 from customers where customer_name like '%Alex%' |
customers_and_addresses | 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 detail of products whose detail contains the word "Latte" or the word "Americano" | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_details from products where product_details like '%Latte%' or product_details like '%Americano%' |
customers_and_addresses | 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 product's detail contains the word "Latte" or "Americano"? Return the full detail. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_details from products where product_details like '%Latte%' or product_details like '%Americano%' |
customers_and_addresses | 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 address content of the customer named "Maudie Kertzmann"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 addresses.address_content from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where customers.customer_name = 'Maudie Kertzmann' |
customers_and_addresses | 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: Return the address content for the customer whose name is "Maudie Kertzmann". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 addresses.address_content from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where customers.customer_name = 'Maudie Kertzmann' |
customers_and_addresses | 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 customers are living in city "Lake Geovannyton"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where addresses.city = 'Lake Geovannyton' |
customers_and_addresses | 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 customers who live in the city called Lake Geovannyton. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where addresses.city = 'Lake Geovannyton' |
customers_and_addresses | 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 customers who are living in Colorado? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where addresses.state_province_county = 'Colorado' |
customers_and_addresses | 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 customers who live in Colorado state? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where addresses.state_province_county = 'Colorado' |
customers_and_addresses | 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 list of cities that no customer is living in. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 city from addresses where city not in ( select distinct addresses.city from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id ) |
customers_and_addresses | 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 cities no customers live in? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 city from addresses where city not in ( select distinct addresses.city from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id ) |
customers_and_addresses | 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 city has the most customers living in? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 addresses.city from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id group by addresses.city order by count ( * ) desc limit 1 |
customers_and_addresses | 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 city where the most customers live. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 addresses.city from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id group by addresses.city order by count ( * ) desc limit 1 |
customers_and_addresses | 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: Retrieve the list of all cities. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_addresses | 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 distinct cities | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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_addresses | 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 city with post code 255. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 city from addresses where zip_postcode = 255 |
customers_and_addresses | 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 city is post code 255 located in? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 city from addresses where zip_postcode = 255 |
customers_and_addresses | 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 state and country of all cities with post code starting with 4. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 , country from addresses where zip_postcode like '4%' |
customers_and_addresses | 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 state and country of all the cities that have post codes starting with 4.\ | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 , country from addresses where zip_postcode like '4%' |
customers_and_addresses | 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 countries having more than 4 addresses listed. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 country from addresses group by country having count ( address_id ) > 4 |
customers_and_addresses | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: For which countries are there more than four distinct addresses listed? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 country from addresses group by country having count ( address_id ) > 4 |
customers_and_addresses | 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 contact channel codes that were used less than 5 times. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 channel_code from customer_contact_channels group by channel_code having count ( customer_id ) < 5 |
customers_and_addresses | 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 contact channel codes were used less than 5 times? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 channel_code from customer_contact_channels group by channel_code having count ( customer_id ) < 5 |
customers_and_addresses | 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 contact channel has been used by the customer with name "Tillman Ernser"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 channel_code from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser' |
customers_and_addresses | 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 contact channel code that was used by the customer named "Tillman Ernser". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 channel_code from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser' |
customers_and_addresses | 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 "active to date" of the latest contact channel used by "Tillman Ernser"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.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 max ( customer_contact_channels.active_to_date ) from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.