db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
store_1 | select first_name , last_name from employees order by birth_date desc limit 1; | Question: what si the youngest employee's first and last name? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, fi... | what si the youngest employee's first and last name? |
store_1 | select first_name , last_name from employees order by hire_date asc limit 10; | Question: list top 10 employee work longest in the company. list employee's first and last name. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phon... | list top 10 employee work longest in the company. list employee's first and last name. |
store_1 | select first_name , last_name from employees order by hire_date asc limit 10; | Question: what are the first and last names of the top 10 longest-serving employees? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, emai... | what are the first and last names of the top 10 longest-serving employees? |
store_1 | select count(*) , city from employees where title = 'it staff' group by city | Question: find the number of employees whose title is it staff from each city? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. cus... | find the number of employees whose title is it staff from each city? |
store_1 | select count(*) , city from employees where title = 'it staff' group by city | Question: how many employees who are it staff are from each city? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id,... | how many employees who are it staff are from each city? |
store_1 | select t2.first_name , t2.last_name , count(t1.reports_to) from employees as t1 join employees as t2 on t1.reports_to = t2.id group by t1.reports_to order by count(t1.reports_to) desc limit 1; | Question: which employee manage most number of peoples? list employee's first and last name, and number of people report to that employee. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, addres... | which employee manage most number of peoples? list employee's first and last name, and number of people report to that employee. |
store_1 | select t2.first_name , t2.last_name , count(t1.reports_to) from employees as t1 join employees as t2 on t1.reports_to = t2.id group by t1.reports_to order by count(t1.reports_to) desc limit 1; | Question: what are the first and last names of all the employees and how many people report to them? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, ... | what are the first and last names of all the employees and how many people report to them? |
store_1 | select count(*) from customers as t1 join invoices as t2 on t1.id = t2.customer_id where t1.first_name = 'lucas' and t1.last_name = 'mancini'; | Question: how many orders does lucas mancini has? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, las... | how many orders does lucas mancini has? |
store_1 | select count(*) from customers as t1 join invoices as t2 on t1.id = t2.customer_id where t1.first_name = 'lucas' and t1.last_name = 'mancini'; | Question: how many orders does luca mancini have in his invoices? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id,... | how many orders does luca mancini have in his invoices? |
store_1 | select sum(t2.total) from customers as t1 join invoices as t2 on t1.id = t2.customer_id where t1.first_name = 'lucas' and t1.last_name = 'mancini'; | Question: what is the total amount of money spent by lucas mancini? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> i... | what is the total amount of money spent by lucas mancini? |
store_1 | select sum(t2.total) from customers as t1 join invoices as t2 on t1.id = t2.customer_id where t1.first_name = 'lucas' and t1.last_name = 'mancini'; | Question: how much money did lucas mancini spend? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, las... | how much money did lucas mancini spend? |
store_1 | select name from media_types; | Question: list all media types. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last_name, company, a... | list all media types. |
store_1 | select name from media_types; | Question: what are the names of all the media types? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, ... | what are the names of all the media types? |
store_1 | select distinct name from genres; | Question: list all different genre types. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last_name, ... | list all different genre types. |
store_1 | select distinct name from genres; | Question: what are the different names of the genres? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name,... | what are the different names of the genres? |
store_1 | select name from playlists; | Question: list the name of all playlist. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last_name, c... | list the name of all playlist. |
store_1 | select name from playlists; | Question: what are the names of all the playlists? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, la... | what are the names of all the playlists? |
store_1 | select composer from tracks where name = 'fast as a shark'; | Question: who is the composer of track fast as a shark? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_nam... | who is the composer of track fast as a shark? |
store_1 | select composer from tracks where name = 'fast as a shark'; | Question: what is the composer who created the track 'fast as a shark'? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers ... | what is the composer who created the track 'fast as a shark'? |
store_1 | select milliseconds from tracks where name = 'fast as a shark'; | Question: how long does track fast as a shark has? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, la... | how long does track fast as a shark has? |
store_1 | select milliseconds from tracks where name = 'fast as a shark'; | Question: how many milliseconds long is fast as a shark? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_na... | how many milliseconds long is fast as a shark? |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id where t1.name = 'rock'; | Question: what is the name of tracks whose genre is rock? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_n... | what is the name of tracks whose genre is rock? |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id where t1.name = 'rock'; | Question: what is the name of all tracks in the rock genre? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first... | what is the name of all tracks in the rock genre? |
store_1 | select t1.title from albums as t1 join tracks as t2 on t1.id = t2.genre_id where t2.name = 'balls to the wall'; | Question: what is title of album which track balls to the wall belongs to? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. custome... | what is title of album which track balls to the wall belongs to? |
store_1 | select t1.title from albums as t1 join tracks as t2 on t1.id = t2.genre_id where t2.name = 'balls to the wall'; | Question: what is the name of the album that has the track ball to the wall? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. custo... | what is the name of the album that has the track ball to the wall? |
store_1 | select t2.name from albums as t1 join tracks as t2 on t1.id = t2.genre_id where t1.title = 'balls to the wall'; | Question: list name of all tracks in balls to the wall. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_nam... | list name of all tracks in balls to the wall. |
store_1 | select t2.name from albums as t1 join tracks as t2 on t1.id = t2.genre_id where t1.title = 'balls to the wall'; | Question: what is the name of all tracks in the album named balls to the wall? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. cus... | what is the name of all tracks in the album named balls to the wall? |
store_1 | select t1.title from albums as t1 join tracks as t2 on t1.id = t2.album_id group by t1.id having count(t1.id) > 10; | Question: list title of albums have the number of tracks greater than 10. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customer... | list title of albums have the number of tracks greater than 10. |
store_1 | select t1.title from albums as t1 join tracks as t2 on t1.id = t2.album_id group by t1.id having count(t1.id) > 10; | Question: what are the names of the albums that have more than 10 tracks? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customer... | what are the names of the albums that have more than 10 tracks? |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id join media_types as t3 on t3.id = t2.media_type_id where t1.name = 'rock' and t3.name = 'mpeg audio file'; | Question: list the name of tracks belongs to genre rock and whose media type is mpeg audio file. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phon... | list the name of tracks belongs to genre rock and whose media type is mpeg audio file. |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id join media_types as t3 on t3.id = t2.media_type_id where t1.name = 'rock' and t3.name = 'mpeg audio file'; | Question: what are the names of all rock tracks that are stored on mpeg audio files? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, emai... | what are the names of all rock tracks that are stored on mpeg audio files? |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id join media_types as t3 on t3.id = t2.media_type_id where t1.name = 'rock' or t3.name = 'mpeg audio file'; | Question: list the name of tracks belongs to genre rock or media type is mpeg audio file. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax,... | list the name of tracks belongs to genre rock or media type is mpeg audio file. |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id join media_types as t3 on t3.id = t2.media_type_id where t1.name = 'rock' or t3.name = 'mpeg audio file'; | Question: what are the names of all tracks that belong to the rock genre and whose media type is mpeg? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code... | what are the names of all tracks that belong to the rock genre and whose media type is mpeg? |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id where t1.name = 'rock' or t1.name = 'jazz' | Question: list the name of tracks belongs to genre rock or genre jazz. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -... | list the name of tracks belongs to genre rock or genre jazz. |
store_1 | select t2.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id where t1.name = 'rock' or t1.name = 'jazz' | Question: what are the names of the tracks that are rock or jazz songs? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers ... | what are the names of the tracks that are rock or jazz songs? |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t3.id = t2.playlist_id where t3.name = 'movies'; | Question: list the name of all tracks in the playlists of movies. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id,... | list the name of all tracks in the playlists of movies. |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t3.id = t2.playlist_id where t3.name = 'movies'; | Question: what are the names of all tracks that are on playlists titled movies? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. cu... | what are the names of all tracks that are on playlists titled movies? |
store_1 | select t2.name from playlist_tracks as t1 join playlists as t2 on t2.id = t1.playlist_id group by t1.playlist_id having count(t1.track_id) > 100; | Question: list the name of playlist which has number of tracks greater than 100. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. c... | list the name of playlist which has number of tracks greater than 100. |
store_1 | select t2.name from playlist_tracks as t1 join playlists as t2 on t2.id = t1.playlist_id group by t1.playlist_id having count(t1.track_id) > 100; | Question: what are the names of all playlists that have more than 100 tracks? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. cust... | what are the names of all playlists that have more than 100 tracks? |
store_1 | select t1.name from tracks as t1 join invoice_lines as t2 on t1.id = t2.track_id join invoices as t3 on t3.id = t2.invoice_id join customers as t4 on t4.id = t3.customer_id where t4.first_name = 'daan' and t4.last_name = 'peeters'; | Question: list all tracks bought by customer daan peeters. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_... | list all tracks bought by customer daan peeters. |
store_1 | select t1.name from tracks as t1 join invoice_lines as t2 on t1.id = t2.track_id join invoices as t3 on t3.id = t2.invoice_id join customers as t4 on t4.id = t3.customer_id where t4.first_name = 'daan' and t4.last_name = 'peeters'; | Question: what are the tracks that dean peeters bought? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_nam... | what are the tracks that dean peeters bought? |
store_1 | select unit_price from tracks where name = 'fast as a shark'; | Question: how much is the track fast as a shark? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last... | how much is the track fast as a shark? |
store_1 | select unit_price from tracks where name = 'fast as a shark'; | Question: what is the unit price of the tune 'fast as a shark'? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, f... | what is the unit price of the tune 'fast as a shark'? |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = 'movies' except select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = ... | Question: find the name of tracks which are in movies playlist but not in music playlist. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax,... | find the name of tracks which are in movies playlist but not in music playlist. |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = 'movies' except select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = ... | Question: what are the names of all tracks that are on the movies playlist but not in the music playlist? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_c... | what are the names of all tracks that are on the movies playlist but not in the music playlist? |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = 'movies' intersect select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name ... | Question: find the name of tracks which are in both movies and music playlists. | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. cu... | find the name of tracks which are in both movies and music playlists. |
store_1 | select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name = 'movies' intersect select t1.name from tracks as t1 join playlist_tracks as t2 on t1.id = t2.track_id join playlists as t3 on t2.playlist_id = t3.id where t3.name ... | Question: what are the names of all the tracks that are in both the movies and music playlists? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone... | what are the names of all the tracks that are in both the movies and music playlists? |
store_1 | select count(*) , t1.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id group by t1.name; | Question: find number of tracks in each genre? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last_n... | find number of tracks in each genre? |
store_1 | select count(*) , t1.name from genres as t1 join tracks as t2 on t1.id = t2.genre_id group by t1.name; | Question: how many tracks are in each genre? | Tables: artists -> id, name. sqlite_sequence -> name, seq. albums -> id, title, artist_id. employees -> id, last_name, first_name, title, reports_to, birth_date, hire_date, address, city, state, country, postal_code, phone, fax, email. customers -> id, first_name, last_nam... | how many tracks are in each genre? |
journal_committee | select count(*) from editor | Question: how many editors are there? | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | how many editors are there? |
journal_committee | select name from editor order by age asc | Question: list the names of editors in ascending order of age. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | list the names of editors in ascending order of age. |
journal_committee | select name , age from editor | Question: what are the names and ages of editors? | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | what are the names and ages of editors? |
journal_committee | select name from editor where age > 25 | Question: list the names of editors who are older than 25. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | list the names of editors who are older than 25. |
journal_committee | select name from editor where age = 24 or age = 25 | Question: show the names of editors of age either 24 or 25. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | show the names of editors of age either 24 or 25. |
journal_committee | select name from editor order by age asc limit 1 | Question: what is the name of the youngest editor? | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | what is the name of the youngest editor? |
journal_committee | select age , count(*) from editor group by age | Question: what are the different ages of editors? show each age along with the number of editors of that age. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_co... | what are the different ages of editors? show each age along with the number of editors of that age. |
journal_committee | select age from editor group by age order by count(*) desc limit 1 | Question: please show the most common age of editors. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | please show the most common age of editors. |
journal_committee | select distinct theme from journal | Question: show the distinct themes of journals. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_ID, | show the distinct themes of journals. |
journal_committee | select t2.name , t3.theme from journal_committee as t1 join editor as t2 on t1.editor_id = t2.editor_id join journal as t3 on t1.journal_id = t3.journal_id | Question: show the names of editors and the theme of journals for which they serve on committees. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Edit... | show the names of editors and the theme of journals for which they serve on committees. |
journal_committee | select t2.name , t3.theme from journal_committee as t1 join editor as t2 on t1.editor_id = t2.editor_id join journal as t3 on t1.journal_id = t3.journal_id | Question: for each journal_committee, find the editor name and the journal theme. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.E... | for each journal_committee, find the editor name and the journal theme. |
journal_committee | select t2.name , t2.age , t3.theme from journal_committee as t1 join editor as t2 on t1.editor_id = t2.editor_id join journal as t3 on t1.journal_id = t3.journal_id order by t3.theme asc | Question: show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Jour... | show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme. |
journal_committee | select t2.name from journal_committee as t1 join editor as t2 on t1.editor_id = t2.editor_id join journal as t3 on t1.journal_id = t3.journal_id where t3.sales > 3000 | Question: show the names of editors that are on the committee of journals with sales bigger than 3000. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee... | show the names of editors that are on the committee of journals with sales bigger than 3000. |
journal_committee | select t1.editor_id , t1.name , count(*) from editor as t1 join journal_committee as t2 on t1.editor_id = t2.editor_id group by t1.editor_id | Question: show the id, name of each editor and the number of journal committees they are on. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID... | show the id, name of each editor and the number of journal committees they are on. |
journal_committee | select t1.name from editor as t1 join journal_committee as t2 on t1.editor_id = t2.editor_id group by t1.name having count(*) >= 2 | Question: show the names of editors that are on at least two journal committees. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Ed... | show the names of editors that are on at least two journal committees. |
journal_committee | select name from editor where editor_id not in (select editor_id from journal_committee) | Question: list the names of editors that are not on any journal committee. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Editor_ID = editor.Editor_I... | list the names of editors that are not on any journal committee. |
journal_committee | select date , theme , sales from journal except select t1.date , t1.theme , t1.sales from journal as t1 join journal_committee as t2 on t1.journal_id = t2.journal_id | Question: list the date, theme and sales of the journal which did not have any of the listed editors serving on committee. | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_I... | list the date, theme and sales of the journal which did not have any of the listed editors serving on committee. |
journal_committee | select avg(t1.sales) from journal as t1 join journal_committee as t2 on t1.journal_id = t2.journal_id where t2.work_type = 'photo' | Question: what is the average sales of the journals that have an editor whose work type is 'photo'? | Tables: journal -> Journal_ID, Date, Theme, Sales. editor -> Editor_ID, Name, Age. journal_committee -> Editor_ID, Journal_ID, Work_Type. | Joins: journal_committee.Journal_ID = journal.Journal_ID, journal_committee.Ed... | what is the average sales of the journals that have an editor whose work type is 'photo'? |
customers_card_transactions | select count(*) from accounts | Question: how many accounts do we have? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type_code... | how many accounts do we have? |
customers_card_transactions | select count(*) from accounts | Question: count the number of accounts. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type_code... | count the number of accounts. |
customers_card_transactions | select account_id , customer_id , account_name from accounts | Question: show ids, customer ids, names for all accounts. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_... | show ids, customer ids, names for all accounts. |
customers_card_transactions | select account_id , customer_id , account_name from accounts | Question: what are the account ids, customer ids, and account names for all the accounts? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Custo... | what are the account ids, customer ids, and account names for all the accounts? |
customers_card_transactions | select other_account_details from accounts where account_name = '338' | Question: show other account details for account with name 338. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, cus... | show other account details for account with name 338. |
customers_card_transactions | select other_account_details from accounts where account_name = '338' | Question: what are the other account details for the account with the name 338? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards... | what are the other account details for the account with the name 338? |
customers_card_transactions | select t2.customer_first_name , t2.customer_last_name , t2.customer_phone from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id where t1.account_name = '162' | Question: what is the first name, last name, and phone of the customer with account name 162? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. C... | what is the first name, last name, and phone of the customer with account name 162? |
customers_card_transactions | select t2.customer_first_name , t2.customer_last_name , t2.customer_phone from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id where t1.account_name = '162' | Question: give the full name and phone of the customer who has the account name 162. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_... | give the full name and phone of the customer who has the account name 162. |
customers_card_transactions | select count(*) from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id where t2.customer_first_name = 'art' and t2.customer_last_name = 'turcotte' | Question: how many accounts does the customer with first name art and last name turcotte have? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. ... | how many accounts does the customer with first name art and last name turcotte have? |
customers_card_transactions | select count(*) from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id where t2.customer_first_name = 'art' and t2.customer_last_name = 'turcotte' | Question: return the number of accounts that the customer with the first name art and last name turcotte has. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_cus... | return the number of accounts that the customer with the first name art and last name turcotte has. |
customers_card_transactions | select customer_id , count(*) from accounts group by customer_id | Question: show all customer ids and the number of accounts for each customer. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -... | show all customer ids and the number of accounts for each customer. |
customers_card_transactions | select customer_id , count(*) from accounts group by customer_id | Question: how many accounts are there for each customer id? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, custome... | how many accounts are there for each customer id? |
customers_card_transactions | select customer_id , count(*) from accounts group by customer_id order by count(*) desc limit 1 | Question: show the customer id and number of accounts with most accounts. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> ca... | show the customer id and number of accounts with most accounts. |
customers_card_transactions | select customer_id , count(*) from accounts group by customer_id order by count(*) desc limit 1 | Question: what is the customer id of the customer with the most accounts, and how many accounts does this person have? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, ... | what is the customer id of the customer with the most accounts, and how many accounts does this person have? |
customers_card_transactions | select t2.customer_first_name , t2.customer_last_name , t1.customer_id from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) asc limit 1 | Question: what is the customer first, last name and id with least number of accounts. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers... | what is the customer first, last name and id with least number of accounts. |
customers_card_transactions | select t2.customer_first_name , t2.customer_last_name , t1.customer_id from accounts as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) asc limit 1 | Question: give the full name and customer id of the customer with the fewest accounts. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customer... | give the full name and customer id of the customer with the fewest accounts. |
customers_card_transactions | select count(*) from customers where customer_id not in (select customer_id from accounts) | Question: show the number of all customers without an account. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, cust... | show the number of all customers without an account. |
customers_card_transactions | select count(*) from customers where customer_id not in (select customer_id from accounts) | Question: how many customers do not have an account? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, c... | how many customers do not have an account? |
customers_card_transactions | select customer_first_name , customer_last_name from customers except select t1.customer_first_name , t1.customer_last_name from customers as t1 join accounts as t2 on t1.customer_id = t2.customer_id | Question: show the first names and last names of customers without any account. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards... | show the first names and last names of customers without any account. |
customers_card_transactions | select customer_first_name , customer_last_name from customers except select t1.customer_first_name , t1.customer_last_name from customers as t1 join accounts as t2 on t1.customer_id = t2.customer_id | Question: what are the full names of customers who do not have any accounts? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards ->... | what are the full names of customers who do not have any accounts? |
customers_card_transactions | select distinct t1.customer_first_name , t1.customer_last_name from customers as t1 join accounts as t2 on t1.customer_id = t2.customer_id | Question: show distinct first and last names for all customers with an account. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards... | show distinct first and last names for all customers with an account. |
customers_card_transactions | select distinct t1.customer_first_name , t1.customer_last_name from customers as t1 join accounts as t2 on t1.customer_id = t2.customer_id | Question: what are the full names of customers who have accounts? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, c... | what are the full names of customers who have accounts? |
customers_card_transactions | select count(distinct customer_id) from accounts | Question: how many customers have an account? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_typ... | how many customers have an account? |
customers_card_transactions | select count(distinct customer_id) from accounts | Question: count the number of customers who hold an account. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, custom... | count the number of customers who hold an account. |
customers_card_transactions | select count(*) from customers | Question: how many customers do we have? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type_cod... | how many customers do we have? |
customers_card_transactions | select count(*) from customers | Question: count the number of customers. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type_cod... | count the number of customers. |
customers_card_transactions | select customer_id , customer_first_name , customer_last_name , customer_phone from customers | Question: show ids, first names, last names, and phones for all customers. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> c... | show ids, first names, last names, and phones for all customers. |
customers_card_transactions | select customer_id , customer_first_name , customer_last_name , customer_phone from customers | Question: what are the ids, full names, and phones of each customer? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id... | what are the ids, full names, and phones of each customer? |
customers_card_transactions | select customer_phone , customer_email from customers where customer_first_name = 'aniyah' and customer_last_name = 'feest' | Question: what is the phone and email for customer with first name aniyah and last name feest? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. ... | what is the phone and email for customer with first name aniyah and last name feest? |
customers_card_transactions | select customer_phone , customer_email from customers where customer_first_name = 'aniyah' and customer_last_name = 'feest' | Question: return the phone and email of the customer with the first name aniyah and last name feest. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_det... | return the phone and email of the customer with the first name aniyah and last name feest. |
customers_card_transactions | select count(*) from customers_cards | Question: show the number of customer cards. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type... | show the number of customer cards. |
customers_card_transactions | select count(*) from customers_cards | Question: how many customer cards are there? | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards -> card_id, customer_id, card_type... | how many customer cards are there? |
customers_card_transactions | select card_id , customer_id , card_type_code , card_number from customers_cards | Question: show ids, customer ids, card type codes, card numbers for all cards. | Tables: Accounts -> account_id, customer_id, account_name, other_account_details. Customers -> customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details. Customers_Cards ... | show ids, customer ids, card type codes, card numbers for all cards. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.