Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many invoices were billed from Chicago, IL? [/INST]

Output: SELECT COUNT(*) FROM invoices WHERE billing_city  =  "Chicago" AND billing_state  =  "IL";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List the number of invoices from the US, grouped by state. [/INST]

Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many invoices were billed from each state? [/INST]

Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List the state in the US with the most invoices. [/INST]

Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What are the states with the most invoices? [/INST]

Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List the number of invoices and the invoice total from California. [/INST]

Output: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the number of invoices and total money billed in them from CA? [/INST]

Output: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List Aerosmith's albums. [/INST]

Output: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What are the titles of all the Aerosmith albums? [/INST]

Output: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many albums does Billy Cobham has? [/INST]

Output: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many albums has Billy Cobam released? [/INST]

Output: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: Eduardo Martins is a customer at which company? [/INST]

Output: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the company where Eduardo Martins is a customer? [/INST]

Output: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is Astrid Gruber's email and phone number? [/INST]

Output: SELECT email ,  phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the email and phone number of Astrid Gruber the customer? [/INST]

Output: SELECT email ,  phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many customers live in Prague city? [/INST]

Output: SELECT count(*) FROM customers WHERE city = "Prague";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many customers live in the city of Prague? [/INST]

Output: SELECT count(*) FROM customers WHERE city = "Prague";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many customers in state of CA? [/INST]

Output: SELECT count(*) FROM customers WHERE state = "CA";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many customers are from California? [/INST]

Output: SELECT count(*) FROM customers WHERE state = "CA";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What country does Roberto Almeida live? [/INST]

Output: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: In which country does Roberto Almeida? [/INST]

Output: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List the name of albums that are released by aritist whose name has 'Led' [/INST]

Output: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%';


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the title of the album that was released by the artist whose name has the phrase 'Led'? [/INST]

Output: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%';


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many customers does Steve Johnson support? [/INST]

Output: SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the count of customers that Steve Johnson supports? [/INST]

Output: SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the title, phone and hire date of Nancy Edwards? [/INST]

Output: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the title, phone number and hire date for the employee named Nancy Edwards? [/INST]

Output: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: find the full name of employees who report to Nancy Edwards? [/INST]

Output: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the first and last name of the employee who reports to Nancy Edwards? [/INST]

Output: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the address of employee Nancy Edwards? [/INST]

Output: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is Nancy Edwards's address? [/INST]

Output: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: Find the full name of employee who supported the most number of customers. [/INST]

Output: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the full name of the employee who has the most customers? [/INST]

Output: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many employees are living in Canada? [/INST]

Output: SELECT count(*) FROM employees WHERE country = "Canada";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many employees live in Canada? [/INST]

Output: SELECT count(*) FROM employees WHERE country = "Canada";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is employee Nancy Edwards's phone number? [/INST]

Output: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the the phone number of Nancy Edwards? [/INST]

Output: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: Who is the youngest employee in the company? List employee's first and last name. [/INST]

Output: SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What si the youngest employee's first and last name? [/INST]

Output: SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: List top 10 employee work longest in the company. List employee's first and last name. [/INST]

Output: SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What are the first and last names of the top 10 longest-serving employees? [/INST]

Output: SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: Find the number of employees whose title is IT Staff from each city? [/INST]

Output: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many employees who are IT staff are from each city? [/INST]

Output: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee. [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What are the first and last names of all the employees and how many people report to them? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many orders does Lucas Mancini has? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: How many orders does Luca Mancini have in his invoices? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
artists :
id [ INT ] primary_key
name [ TEXT ]

sqlite_sequence :
name [ TEXT ]
seq [ TEXT ]

albums :
id [ INT ] primary_key
title [ TEXT ]
artist_id [ INT ] albums.artist_id = artists.id

employees :
id [ INT ] primary_key
last_name [ TEXT ]
first_name [ TEXT ]
title [ TEXT ]
reports_to [ INT ] employees.reports_to = employees.id
birth_date [ TEXT ]
hire_date [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]

customers :
id [ INT ] primary_key
first_name [ TEXT ]
last_name [ TEXT ]
company [ TEXT ]
address [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postal_code [ TEXT ]
phone [ TEXT ]
fax [ TEXT ]
email [ TEXT ]
support_rep_id [ INT ] customers.support_rep_id = employees.id

genres :
id [ INT ] primary_key
name [ TEXT ]

invoices :
id [ INT ] primary_key
customer_id [ INT ] invoices.customer_id = customers.id
invoice_date [ TEXT ]
billing_address [ TEXT ]
billing_city [ TEXT ]
billing_state [ TEXT ]
billing_country [ TEXT ]
billing_postal_code [ TEXT ]
total [ INT ]

media_types :
id [ INT ] primary_key
name [ TEXT ]

tracks :
id [ INT ] primary_key
name [ TEXT ]
album_id [ INT ] tracks.album_id = albums.id
media_type_id [ INT ] tracks.media_type_id = media_types.id
genre_id [ INT ] tracks.genre_id = genres.id
composer [ TEXT ]
milliseconds [ INT ]
bytes [ INT ]
unit_price [ INT ]

invoice_lines :
id [ INT ] primary_key
invoice_id [ INT ] invoice_lines.invoice_id = invoices.id
track_id [ INT ] invoice_lines.track_id = tracks.id
unit_price [ INT ]
quantity [ INT ]

playlists :
id [ INT ] primary_key
name [ TEXT ]

playlist_tracks :
playlist_id [ INT ] primary_key playlist_tracks.playlist_id = playlists.id
track_id [ INT ] playlist_tracks.track_id = tracks.id

Please write me a SQL statement that answers the following question: What is the total amount of money spent by Lucas Mancini? [/INST]

Output: 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";