Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working. [/INST]

Output: SELECT T1.first_name ,  T1.last_name , T1.employee_id ,  T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN locations AS T3 ON T2.location_id  =  T3.location_id JOIN countries AS T4 ON T3.country_id  =  T4.country_id;


Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: What the full names, ids of each employee and the name of the country they are in? [/INST]

Output: SELECT T1.first_name ,  T1.last_name , T1.employee_id ,  T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN locations AS T3 ON T2.location_id  =  T3.location_id JOIN countries AS T4 ON T3.country_id  =  T4.country_id;


Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: display the department name and number of employees in each of the department. [/INST]

Output: SELECT department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY department_name;


Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: What are the department names and how many employees work in each of them? [/INST]

Output: SELECT department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY department_name;


Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: display the full name (first and last name), and salary of those employees who working in any department located in London. [/INST]

Output: SELECT first_name ,  last_name ,  salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN  locations AS T3 ON T2.location_id  =  T3.location_id WHERE  T3.city  =  'London';


Input:
[INST] Here is a database schema:
regions :
REGION_ID [ INT ] primary_key
REGION_NAME [ TEXT ]

countries :
COUNTRY_ID [ TEXT ] primary_key
COUNTRY_NAME [ TEXT ]
REGION_ID [ INT ] countries.REGION_ID = regions.REGION_ID

departments :
DEPARTMENT_ID [ INT ] primary_key
DEPARTMENT_NAME [ TEXT ]
MANAGER_ID [ INT ]
LOCATION_ID [ INT ]

jobs :
JOB_ID [ TEXT ] primary_key
JOB_TITLE [ TEXT ]
MIN_SALARY [ INT ]
MAX_SALARY [ INT ]

employees :
EMPLOYEE_ID [ INT ] primary_key
FIRST_NAME [ TEXT ]
LAST_NAME [ TEXT ]
EMAIL [ TEXT ]
PHONE_NUMBER [ TEXT ]
HIRE_DATE [ TEXT ]
JOB_ID [ TEXT ] employees.JOB_ID = jobs.JOB_ID
SALARY [ INT ]
COMMISSION_PCT [ INT ]
MANAGER_ID [ INT ]
DEPARTMENT_ID [ INT ] employees.DEPARTMENT_ID = departments.DEPARTMENT_ID

job_history :
EMPLOYEE_ID [ INT ] primary_key job_history.EMPLOYEE_ID = employees.EMPLOYEE_ID
START_DATE [ TEXT ]
END_DATE [ TEXT ]
JOB_ID [ TEXT ] job_history.JOB_ID = jobs.JOB_ID
DEPARTMENT_ID [ INT ] job_history.DEPARTMENT_ID = departments.DEPARTMENT_ID

locations :
LOCATION_ID [ INT ] primary_key
STREET_ADDRESS [ TEXT ]
POSTAL_CODE [ TEXT ]
CITY [ TEXT ]
STATE_PROVINCE [ TEXT ]
COUNTRY_ID [ TEXT ] locations.COUNTRY_ID = countries.COUNTRY_ID

Please write me a SQL statement that answers the following question: What are full names and salaries of employees working in the city of London? [/INST]

Output: SELECT first_name ,  last_name ,  salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN  locations AS T3 ON T2.location_id  =  T3.location_id WHERE  T3.city  =  'London';


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the song that was released in the most recent year? [/INST]

Output: SELECT song_name ,  releasedate FROM song ORDER BY releasedate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the song that was released most recently? [/INST]

Output: SELECT song_name ,  releasedate FROM song ORDER BY releasedate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the id of the longest song? [/INST]

Output: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the id of the song that lasts the longest. [/INST]

Output: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names of all English songs. [/INST]

Output: SELECT song_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all songs in English? [/INST]

Output: SELECT song_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the id of songs whose format is mp3. [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp3";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the id of all the files in mp3 format? [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp3";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the name and country of origin for all singers who have produced songs with rating above 9. [/INST]

Output: SELECT DISTINCT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.rating  >  9;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the different names and countries of origins for all artists whose song ratings are above 9? [/INST]

Output: SELECT DISTINCT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.rating  >  9;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the file size and format for all songs that have resolution lower than 800. [/INST]

Output: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the file sizes and formats for all songs with a resolution lower than 800? [/INST]

Output: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the artist who produced the shortest song? [/INST]

Output: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the artists who sang the shortest song? [/INST]

Output: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names and countries of origin for the artists who produced the top three highly rated songs. [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.rating DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from? [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.rating DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: How many songs have 4 minute duration? [/INST]

Output: SELECT count(*) FROM files WHERE duration LIKE "4:%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the count of the songs that last approximately 4 minutes? [/INST]

Output: SELECT count(*) FROM files WHERE duration LIKE "4:%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

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

Output: SELECT count(*) FROM artist WHERE country  =  "Bangladesh";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: How many Bangladeshi artists are listed? [/INST]

Output: SELECT count(*) FROM artist WHERE country  =  "Bangladesh";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average rating of songs produced by female artists? [/INST]

Output: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: How many songs, on average, are sung by a female artist? [/INST]

Output: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the most popular file format? [/INST]

Output: SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the file format that is used by the most files. [/INST]

Output: SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names of the artists who are from UK and have produced English songs. [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the artists that are from the UK and sang songs in English? [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the id of songs that are available in mp4 format and have resolution lower than 1000. [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id FROM song WHERE resolution  <  1000;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000? [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id FROM song WHERE resolution  <  1000;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the country of origin of the artist who is female and produced a song in Bangla? [/INST]

Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.languages  =  "bangla";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What countries are the female artists who sung in the language Bangla from? [/INST]

Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.languages  =  "bangla";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average duration of songs that have mp3 format and resolution below 800? [/INST]

Output: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average song duration for the songs that are in mp3 format and whose resolution below 800? [/INST]

Output: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the number of artists for each gender? [/INST]

Output: SELECT count(*) ,  gender FROM artist GROUP BY gender;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: How many artists are male and how many are female? [/INST]

Output: SELECT count(*) ,  gender FROM artist GROUP BY gender;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average rating of songs for each language? [/INST]

Output: SELECT avg(rating) ,  languages FROM song GROUP BY languages;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average song rating for each language? [/INST]

Output: SELECT avg(rating) ,  languages FROM song GROUP BY languages;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Return the gender and name of artist who produced the song with the lowest resolution. [/INST]

Output: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the gender and name of the artist who sang the song with the smallest resolution? [/INST]

Output: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: For each file format, return the number of artists who released songs in that format. [/INST]

Output: SELECT count(*) ,  formats FROM files GROUP BY formats;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: How many songs were released for each format? [/INST]

Output: SELECT count(*) ,  formats FROM files GROUP BY formats;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the distinct names of all songs that have a higher resolution than some songs in English. [/INST]

Output: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) FROM song WHERE languages  =  "english");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the different names for all songs that have a higher resolution than English songs? [/INST]

Output: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) FROM song WHERE languages  =  "english");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all songs that have a lower rating than some song of blues genre? [/INST]

Output: SELECT song_name FROM song WHERE rating  <  (SELECT max(rating) FROM song WHERE genre_is  =  "blues");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the songs that have a lower rating than at least one blues song? [/INST]

Output: SELECT song_name FROM song WHERE rating  <  (SELECT max(rating) FROM song WHERE genre_is  =  "blues");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name and country of origin of the artist who released a song that has "love" in its title? [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.song_name LIKE "%love%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the artists who released a song that has the word love in its title, and where are the artists from? [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.song_name LIKE "%love%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the name and gender for all artists who released songs in March. [/INST]

Output: SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names and genders of all artists who released songs in the month of March? [/INST]

Output: SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the names of all genres in alphabetical oder, together with its ratings. [/INST]

Output: SELECT g_name ,  rating FROM genre ORDER BY g_name;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all genres in alphabetical order, combined with its ratings? [/INST]

Output: SELECT g_name ,  rating FROM genre ORDER BY g_name;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Give me a list of the names of all songs ordered by their resolution. [/INST]

Output: SELECT song_name FROM song ORDER BY resolution;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all songs that are ordered by their resolution numbers? [/INST]

Output: SELECT song_name FROM song ORDER BY resolution;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the ids of songs that are available in either mp4 format or have resolution above 720? [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the ids of all songs that are available on mp4 or have a higher resolution than 720? [/INST]

Output: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the names of all songs that have 4 minute duration or are in English. [/INST]

Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all songs that are approximately 4 minutes long or are in English? [/INST]

Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the language used most often in the songs? [/INST]

Output: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the languages that are used most often in songs? [/INST]

Output: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the language that was used most often in songs with resolution above 500? [/INST]

Output: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the artist, for each language, that has the most songs with a higher resolution than 500? [/INST]

Output: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of artists who are Male and are from UK? [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all male British artists? [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names of songs whose genre is modern or language is English. [/INST]

Output: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the songs that are modern or sung in English? [/INST]

Output: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Return the names of songs for which format is mp3 and resolution is below 1000. [/INST]

Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all songs that are in mp3 format and have a resolution lower than 1000? [/INST]

Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Return the names of singers who are from UK and released an English song. [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of all singers that are from the UK and released a song in English? [/INST]

Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the average rating and resolution of songs that are in Bangla? [/INST]

Output: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the average rating and resolution of all bangla songs? [/INST]

Output: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the maximum and minimum resolution of songs whose duration is 3 minutes? [/INST]

Output: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the maximum and minimum resolution of all songs that are approximately 3 minutes long? [/INST]

Output: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%";


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the maximum duration and resolution of songs grouped and ordered by languages? [/INST]

Output: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the maximum duration and resolution of all songs, for each language, ordered alphabetically by language? [/INST]

Output: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre? [/INST]

Output: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the shortest and most poorly rated song for each genre, ordered alphabetically by genre? [/INST]

Output: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names and number of works of all artists who have at least one English songs. [/INST]

Output: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names and number of works for all artists who have sung at least one song in English? [/INST]

Output: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the name and country of origin for all artists who have release at least one song of resolution above 900. [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the name and country of origin for each artist who has released a song with a resolution higher than 900? [/INST]

Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names and number of works of the three artists who have produced the most songs. [/INST]

Output: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the three artists who have produced the most songs, and how many works did they produce? [/INST]

Output: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the country of origin for the artist who made the least number of songs? [/INST]

Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What country is the artist who made the fewest songs from? [/INST]

Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the songs whose rating is below the rating of all songs in English? [/INST]

Output: SELECT song_name FROM song WHERE rating  <   (SELECT min(rating) FROM song WHERE languages  =  'english');


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the song names for every song whose rating is less than the minimum rating for English songs? [/INST]

Output: SELECT song_name FROM song WHERE rating  <   (SELECT min(rating) FROM song WHERE languages  =  'english');


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8? [/INST]

Output: SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8);


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the id of every song that has a resolution higher than that of a song with a rating below 8? [/INST]

Output: SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8);


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre? [/INST]

Output: SELECT f_id FROM song WHERE resolution  >  (SELECT avg(resolution) FROM song WHERE genre_is  =  "modern");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the ids of all songs that have higher resolution of the average resolution in the modern genre? [/INST]

Output: SELECT f_id FROM song WHERE resolution  >  (SELECT avg(resolution) FROM song WHERE genre_is  =  "modern");


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the top 3 artists who have the largest number of songs works whose language is Bangla. [/INST]

Output: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "bangla" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the top 3 artists with the largest number of songs in the language Bangla? [/INST]

Output: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "bangla" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the id, genre and artist name of English songs ordered by rating. [/INST]

Output: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the id, genre, and name of the artist for every English song ordered by ascending rating? [/INST]

Output: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating;