answer
stringlengths 18
557
| context
stringlengths 27
489
| question
stringlengths 12
244
| text
stringlengths 275
1.7k
|
---|---|---|---|
SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10
|
CREATE TABLE player (POSITION VARCHAR, Points INTEGER)
|
What are the positions with both players having more than 20 points and less than 10 points.
|
<s>[INST] Given the following SQL query and context: Query: SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 Context: CREATE TABLE player (POSITION VARCHAR, Points INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the positions with both players having more than 20 points and less than 10 points. The answer to your question is: SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10. [/s>
|
SELECT SUM(Points) FROM player
|
CREATE TABLE player (Points INTEGER)
|
Show total points of all players.
|
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(Points) FROM player Context: CREATE TABLE player (Points INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show total points of all players. The answer to your question is: SELECT SUM(Points) FROM player. [/s>
|
SELECT COUNT(DISTINCT POSITION) FROM player
|
CREATE TABLE player (POSITION VARCHAR)
|
how many different positions are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT POSITION) FROM player Context: CREATE TABLE player (POSITION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: how many different positions are there? The answer to your question is: SELECT COUNT(DISTINCT POSITION) FROM player. [/s>
|
SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player)
|
CREATE TABLE player (name VARCHAR, points INTEGER)
|
what are the name of players who get more than the average points.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player) Context: CREATE TABLE player (name VARCHAR, points INTEGER) [/INST] Based on the provided SQL query and context, your question is: what are the name of players who get more than the average points. The answer to your question is: SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player). [/s>
|
SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION
|
CREATE TABLE player (POSITION VARCHAR, points INTEGER)
|
find the number of players whose points are lower than 30 in each position.
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION Context: CREATE TABLE player (POSITION VARCHAR, points INTEGER) [/INST] Based on the provided SQL query and context, your question is: find the number of players whose points are lower than 30 in each position. The answer to your question is: SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION. [/s>
|
SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)
|
which country did participated in the most number of Tournament competitions?
|
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which country did participated in the most number of Tournament competitions? The answer to your question is: SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'
|
CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)
|
which countries did participated in both Friendly and Tournament type competitions.
|
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' Context: CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which countries did participated in both Friendly and Tournament type competitions. The answer to your question is: SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'. [/s>
|
SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'
|
CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)
|
Find the countries that have never participated in any competition with Friendly type.
|
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' Context: CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the countries that have never participated in any competition with Friendly type. The answer to your question is: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'. [/s>
|
SELECT SUM(num_of_component) FROM furniture
|
CREATE TABLE furniture (num_of_component INTEGER)
|
How many furniture components are there in total?
|
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(num_of_component) FROM furniture Context: CREATE TABLE furniture (num_of_component INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many furniture components are there in total? The answer to your question is: SELECT SUM(num_of_component) FROM furniture. [/s>
|
SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1
|
CREATE TABLE furniture (name VARCHAR, furniture_id VARCHAR, market_rate VARCHAR)
|
Return the name and id of the furniture with the highest market rate.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1 Context: CREATE TABLE furniture (name VARCHAR, furniture_id VARCHAR, market_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the name and id of the furniture with the highest market rate. The answer to your question is: SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1. [/s>
|
SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2
|
CREATE TABLE furniture (market_rate INTEGER)
|
find the total market rate of the furnitures that have the top 2 market shares.
|
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2 Context: CREATE TABLE furniture (market_rate INTEGER) [/INST] Based on the provided SQL query and context, your question is: find the total market rate of the furnitures that have the top 2 market shares. The answer to your question is: SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2. [/s>
|
SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10
|
CREATE TABLE furniture (Num_of_Component INTEGER, name VARCHAR)
|
Find the component amounts and names of all furnitures that have more than 10 components.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10 Context: CREATE TABLE furniture (Num_of_Component INTEGER, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the component amounts and names of all furnitures that have more than 10 components. The answer to your question is: SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10. [/s>
|
SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1
|
CREATE TABLE furniture (name VARCHAR, Num_of_Component VARCHAR, market_rate VARCHAR)
|
Find the name and component amount of the least popular furniture.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1 Context: CREATE TABLE furniture (name VARCHAR, Num_of_Component VARCHAR, market_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and component amount of the least popular furniture. The answer to your question is: SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1. [/s>
|
SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte)
|
CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, Price_in_Dollar INTEGER); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Price_in_Dollar INTEGER)
|
Find the names of furnitures whose prices are lower than the highest price.
|
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte) Context: CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, Price_in_Dollar INTEGER); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Price_in_Dollar INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the names of furnitures whose prices are lower than the highest price. The answer to your question is: SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte). [/s>
|
SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1
|
CREATE TABLE manufacturer (open_year VARCHAR, name VARCHAR, num_of_shops VARCHAR)
|
Which manufacturer has the most number of shops? List its name and year of opening.
|
<s>[INST] Given the following SQL query and context: Query: SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1 Context: CREATE TABLE manufacturer (open_year VARCHAR, name VARCHAR, num_of_shops VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which manufacturer has the most number of shops? List its name and year of opening. The answer to your question is: SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1. [/s>
|
SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20
|
CREATE TABLE manufacturer (Num_of_Factories INTEGER, num_of_shops INTEGER)
|
Find the average number of factories for the manufacturers that have more than 20 shops.
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20 Context: CREATE TABLE manufacturer (Num_of_Factories INTEGER, num_of_shops INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average number of factories for the manufacturers that have more than 20 shops. The answer to your question is: SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20. [/s>
|
SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year
|
CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR, open_year VARCHAR)
|
List all manufacturer names and ids ordered by their opening year.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year Context: CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR, open_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all manufacturer names and ids ordered by their opening year. The answer to your question is: SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year. [/s>
|
SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10
|
CREATE TABLE manufacturer (name VARCHAR, open_year VARCHAR, num_of_shops VARCHAR, Num_of_Factories VARCHAR)
|
Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10 Context: CREATE TABLE manufacturer (name VARCHAR, open_year VARCHAR, num_of_shops VARCHAR, Num_of_Factories VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. The answer to your question is: SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10. [/s>
|
SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990
|
CREATE TABLE manufacturer (num_of_shops INTEGER, Num_of_Factories INTEGER, open_year INTEGER)
|
what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.
|
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990 Context: CREATE TABLE manufacturer (num_of_shops INTEGER, Num_of_Factories INTEGER, open_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. The answer to your question is: SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990. [/s>
|
SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1
|
CREATE TABLE manufacturer (manufacturer_id VARCHAR, num_of_shops VARCHAR); CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR, Price_in_Dollar VARCHAR)
|
Find the id and number of shops for the company that produces the most expensive furniture.
|
<s>[INST] Given the following SQL query and context: Query: SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1 Context: CREATE TABLE manufacturer (manufacturer_id VARCHAR, num_of_shops VARCHAR); CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR, Price_in_Dollar VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id and number of shops for the company that produces the most expensive furniture. The answer to your question is: SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1. [/s>
|
SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id
|
CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR)
|
Find the number of funiture types produced by each manufacturer as well as the company names.
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id Context: CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of funiture types produced by each manufacturer as well as the company names. The answer to your question is: SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id. [/s>
|
SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
|
CREATE TABLE furniture_manufacte (price_in_dollar VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR)
|
Give me the names and prices of furnitures which some companies are manufacturing.
|
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID Context: CREATE TABLE furniture_manufacte (price_in_dollar VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Give me the names and prices of furnitures which some companies are manufacturing. The answer to your question is: SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID. [/s>
|
SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)
|
CREATE TABLE furniture (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR)
|
Find the market shares and names of furnitures which no any company is producing in our records.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) Context: CREATE TABLE furniture (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the market shares and names of furnitures which no any company is producing in our records. The answer to your question is: SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte). [/s>
|
SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10
|
CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR); CREATE TABLE furniture (Furniture_ID VARCHAR, num_of_component INTEGER)
|
Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.
|
<s>[INST] Given the following SQL query and context: Query: SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10 Context: CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR); CREATE TABLE furniture (Furniture_ID VARCHAR, num_of_component INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components. The answer to your question is: SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10. [/s>
|
SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id
|
CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR)
|
Display the first name and department name for each employee.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id Context: CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Display the first name and department name for each employee. The answer to your question is: SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id. [/s>
|
SELECT first_name, last_name, salary FROM employees WHERE salary < 6000
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER)
|
List the full name (first and last name), and salary for those employees who earn below 6000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, salary FROM employees WHERE salary < 6000 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the full name (first and last name), and salary for those employees who earn below 6000. The answer to your question is: SELECT first_name, last_name, salary FROM employees WHERE salary < 6000. [/s>
|
SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'
|
CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR, last_name VARCHAR)
|
Display the first name, and department number for all employees whose last name is "McEwen".
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen' Context: CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Display the first name, and department number for all employees whose last name is "McEwen". The answer to your question is: SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'. [/s>
|
SELECT * FROM employees WHERE department_id = "null"
|
CREATE TABLE employees (department_id VARCHAR)
|
Return all the information for all employees without any department number.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE department_id = "null" Context: CREATE TABLE employees (department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return all the information for all employees without any department number. The answer to your question is: SELECT * FROM employees WHERE department_id = "null". [/s>
|
SELECT * FROM departments WHERE department_name = 'Marketing'
|
CREATE TABLE departments (department_name VARCHAR)
|
Display all the information about the department Marketing.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM departments WHERE department_name = 'Marketing' Context: CREATE TABLE departments (department_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Display all the information about the department Marketing. The answer to your question is: SELECT * FROM departments WHERE department_name = 'Marketing'. [/s>
|
SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%'
|
CREATE TABLE employees (hire_date VARCHAR, first_name VARCHAR)
|
when is the hire date for those employees whose first name does not containing the letter M?
|
<s>[INST] Given the following SQL query and context: Query: SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%' Context: CREATE TABLE employees (hire_date VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: when is the hire date for those employees whose first name does not containing the letter M? The answer to your question is: SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%'. [/s>
|
SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR)
|
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M. The answer to your question is: SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'. [/s>
|
SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR)
|
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number. The answer to your question is: SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id. [/s>
|
SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000
|
CREATE TABLE employees (phone_number VARCHAR, salary INTEGER)
|
what is the phone number of employees whose salary is in the range of 8000 and 12000?
|
<s>[INST] Given the following SQL query and context: Query: SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 Context: CREATE TABLE employees (phone_number VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: what is the phone number of employees whose salary is in the range of 8000 and 12000? The answer to your question is: SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000. [/s>
|
SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> "null" OR department_id <> 40
|
CREATE TABLE employees (department_id VARCHAR, salary VARCHAR, commission_pct VARCHAR)
|
display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> "null" OR department_id <> 40 Context: CREATE TABLE employees (department_id VARCHAR, salary VARCHAR, commission_pct VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40. The answer to your question is: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> "null" OR department_id <> 40. [/s>
|
SELECT first_name, last_name, salary FROM employees WHERE commission_pct = "null"
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR, commission_pct VARCHAR)
|
What are the full name (first and last name) and salary for all employees who does not have any value for commission?
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, salary FROM employees WHERE commission_pct = "null" Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR, commission_pct VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the full name (first and last name) and salary for all employees who does not have any value for commission? The answer to your question is: SELECT first_name, last_name, salary FROM employees WHERE commission_pct = "null". [/s>
|
SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR)
|
Display the first and last name, and salary for those employees whose first name is ending with the letter m.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m' Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Display the first and last name, and salary for those employees whose first name is ending with the letter m. The answer to your question is: SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'. [/s>
|
SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'
|
CREATE TABLE employees (job_id VARCHAR, hire_date INTEGER)
|
Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05' Context: CREATE TABLE employees (job_id VARCHAR, hire_date INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009. The answer to your question is: SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'. [/s>
|
SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR)
|
What are the first and last name for those employees who works either in department 70 or 90?
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the first and last name for those employees who works either in department 70 or 90? The answer to your question is: SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90. [/s>
|
SELECT salary, manager_id FROM employees WHERE manager_id <> "null"
|
CREATE TABLE employees (salary VARCHAR, manager_id VARCHAR)
|
Find the salary and manager number for those employees who is working under a manager.
|
<s>[INST] Given the following SQL query and context: Query: SELECT salary, manager_id FROM employees WHERE manager_id <> "null" Context: CREATE TABLE employees (salary VARCHAR, manager_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the salary and manager number for those employees who is working under a manager. The answer to your question is: SELECT salary, manager_id FROM employees WHERE manager_id <> "null". [/s>
|
SELECT * FROM employees WHERE hire_date < '2002-06-21'
|
CREATE TABLE employees (hire_date INTEGER)
|
display all the details from Employees table for those employees who was hired before 2002-06-21.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE hire_date < '2002-06-21' Context: CREATE TABLE employees (hire_date INTEGER) [/INST] Based on the provided SQL query and context, your question is: display all the details from Employees table for those employees who was hired before 2002-06-21. The answer to your question is: SELECT * FROM employees WHERE hire_date < '2002-06-21'. [/s>
|
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
|
CREATE TABLE employees (salary VARCHAR, first_name VARCHAR)
|
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC Context: CREATE TABLE employees (salary VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary. The answer to your question is: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC. [/s>
|
SELECT * FROM employees WHERE hire_date > '1987-09-07'
|
CREATE TABLE employees (hire_date INTEGER)
|
display those employees who joined after 7th September, 1987.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE hire_date > '1987-09-07' Context: CREATE TABLE employees (hire_date INTEGER) [/INST] Based on the provided SQL query and context, your question is: display those employees who joined after 7th September, 1987. The answer to your question is: SELECT * FROM employees WHERE hire_date > '1987-09-07'. [/s>
|
SELECT job_title FROM jobs WHERE min_salary > 9000
|
CREATE TABLE jobs (job_title VARCHAR, min_salary INTEGER)
|
display the job title of jobs which minimum salary is greater than 9000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_title FROM jobs WHERE min_salary > 9000 Context: CREATE TABLE jobs (job_title VARCHAR, min_salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: display the job title of jobs which minimum salary is greater than 9000. The answer to your question is: SELECT job_title FROM jobs WHERE min_salary > 9000. [/s>
|
SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000
|
CREATE TABLE jobs (job_title VARCHAR, max_salary INTEGER, min_salary VARCHAR)
|
display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 Context: CREATE TABLE jobs (job_title VARCHAR, max_salary INTEGER, min_salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000. The answer to your question is: SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000. [/s>
|
SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50
|
CREATE TABLE employees (email VARCHAR, department_id VARCHAR, commission_pct VARCHAR, salary VARCHAR)
|
display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.
|
<s>[INST] Given the following SQL query and context: Query: SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50 Context: CREATE TABLE employees (email VARCHAR, department_id VARCHAR, commission_pct VARCHAR, salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50. The answer to your question is: SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50. [/s>
|
SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id
|
CREATE TABLE job_history (employee_id VARCHAR, end_date INTEGER)
|
display the employee ID for each employee and the date on which he ended his previous job.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id Context: CREATE TABLE job_history (employee_id VARCHAR, end_date INTEGER) [/INST] Based on the provided SQL query and context, your question is: display the employee ID for each employee and the date on which he ended his previous job. The answer to your question is: SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id. [/s>
|
SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10
|
CREATE TABLE employees (department_id VARCHAR, commission_pct VARCHAR)
|
display those departments where more than ten employees work who got a commission percentage.
|
<s>[INST] Given the following SQL query and context: Query: SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 Context: CREATE TABLE employees (department_id VARCHAR, commission_pct VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display those departments where more than ten employees work who got a commission percentage. The answer to your question is: SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10. [/s>
|
SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4
|
CREATE TABLE employees (department_id VARCHAR, manager_id VARCHAR, employee_id VARCHAR)
|
Find the ids of the departments where any manager is managing 4 or more employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4 Context: CREATE TABLE employees (department_id VARCHAR, manager_id VARCHAR, employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ids of the departments where any manager is managing 4 or more employees. The answer to your question is: SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4. [/s>
|
SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id
|
CREATE TABLE employees (department_id VARCHAR, salary INTEGER, commission_pct VARCHAR)
|
display the average salary of employees for each department who gets a commission percentage.
|
<s>[INST] Given the following SQL query and context: Query: SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id Context: CREATE TABLE employees (department_id VARCHAR, salary INTEGER, commission_pct VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the average salary of employees for each department who gets a commission percentage. The answer to your question is: SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id. [/s>
|
SELECT country_id, COUNT(*) FROM locations GROUP BY country_id
|
CREATE TABLE locations (country_id VARCHAR)
|
display the country ID and number of cities for each country.
|
<s>[INST] Given the following SQL query and context: Query: SELECT country_id, COUNT(*) FROM locations GROUP BY country_id Context: CREATE TABLE locations (country_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the country ID and number of cities for each country. The answer to your question is: SELECT country_id, COUNT(*) FROM locations GROUP BY country_id. [/s>
|
SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2
|
CREATE TABLE job_history (job_id VARCHAR, end_date VARCHAR, start_date VARCHAR)
|
display job ID for those jobs that were done by two or more for more than 300 days.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 Context: CREATE TABLE job_history (job_id VARCHAR, end_date VARCHAR, start_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display job ID for those jobs that were done by two or more for more than 300 days. The answer to your question is: SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2. [/s>
|
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2
|
CREATE TABLE job_history (employee_id VARCHAR)
|
display the ID for those employees who did two or more jobs in the past.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 Context: CREATE TABLE job_history (employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the ID for those employees who did two or more jobs in the past. The answer to your question is: SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2. [/s>
|
SELECT 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
|
CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, department_id VARCHAR)
|
Find employee with ID and name of the country presently where (s)he is working.
|
<s>[INST] Given the following SQL query and context: Query: SELECT 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 Context: CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find employee with ID and name of the country presently where (s)he is working. The answer to your question is: SELECT 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. [/s>
|
SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name
|
CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR)
|
display the department name and number of employees in each of the department.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name Context: CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the department name and number of employees in each of the department. The answer to your question is: SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name. [/s>
|
SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000
|
CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR)
|
Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 Context: CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000? The answer to your question is: SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000. [/s>
|
SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title
|
CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (job_id VARCHAR)
|
display job title and average salary of employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title Context: CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (job_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display job title and average salary of employees. The answer to your question is: SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title. [/s>
|
SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, employee_id VARCHAR)
|
What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163) Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163? The answer to your question is: SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163). [/s>
|
SELECT MIN(salary), department_id FROM employees GROUP BY department_id
|
CREATE TABLE employees (department_id VARCHAR, salary INTEGER)
|
return the smallest salary for every departments.
|
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(salary), department_id FROM employees GROUP BY department_id Context: CREATE TABLE employees (department_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: return the smallest salary for every departments. The answer to your question is: SELECT MIN(salary), department_id FROM employees GROUP BY department_id. [/s>
|
SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR, salary INTEGER)
|
Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id) Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments. The answer to your question is: SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id). [/s>
|
SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)
|
CREATE TABLE employees (employee_id VARCHAR, salary INTEGER)
|
Find the employee id for all employees who earn more than the average salary.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) Context: CREATE TABLE employees (employee_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the employee id for all employees who earn more than the average salary. The answer to your question is: SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees). [/s>
|
SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')
|
CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR, manager_id VARCHAR, first_name VARCHAR)
|
display the employee id and salary of all employees who report to Payam (first name).
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam') Context: CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR, manager_id VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee id and salary of all employees who report to Payam (first name). The answer to your question is: SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam'). [/s>
|
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id
|
CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR)
|
find the name of all departments that do actually have one or more employees assigned to them.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id Context: CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the name of all departments that do actually have one or more employees assigned to them. The answer to your question is: SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id. [/s>
|
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id
|
CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR)
|
get the details of employees who manage a department.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id Context: CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: get the details of employees who manage a department. The answer to your question is: SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id. [/s>
|
SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000
|
CREATE TABLE employees (job_id VARCHAR, salary INTEGER)
|
Find the job ID for those jobs which average salary is above 8000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000 Context: CREATE TABLE employees (job_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the job ID for those jobs which average salary is above 8000. The answer to your question is: SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000. [/s>
|
SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80
|
CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, department_id VARCHAR)
|
display the employee ID and job name for all those jobs in department 80.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80 Context: CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee ID and job name for all those jobs in department 80. The answer to your question is: SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80. [/s>
|
SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'
|
CREATE TABLE departments (department_id VARCHAR, department_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, job_id VARCHAR, department_id VARCHAR)
|
What is the first name and job id for all employees in the Finance department?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance' Context: CREATE TABLE departments (department_id VARCHAR, department_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, job_id VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name and job id for all employees in the Finance department? The answer to your question is: SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'. [/s>
|
SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500
|
CREATE TABLE employees (salary INTEGER)
|
display all the information of the employees whose salary if within the range of smallest salary and 2500.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 Context: CREATE TABLE employees (salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: display all the information of the employees whose salary if within the range of smallest salary and 2500. The answer to your question is: SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500. [/s>
|
SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)
|
CREATE TABLE departments (department_id VARCHAR, manager_id INTEGER); CREATE TABLE employees (department_id VARCHAR, manager_id INTEGER)
|
Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200) Context: CREATE TABLE departments (department_id VARCHAR, manager_id INTEGER); CREATE TABLE employees (department_id VARCHAR, manager_id INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200. The answer to your question is: SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200). [/s>
|
SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara")
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR)
|
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara. The answer to your question is: SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara"). [/s>
|
SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name <> "Clara"
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR)
|
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name <> "Clara" Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara. The answer to your question is: SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name <> "Clara". [/s>
|
SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')
|
CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, department_id VARCHAR)
|
display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%') Context: CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’. The answer to your question is: SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%'). [/s>
|
SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')
|
CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR)
|
display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%') Context: CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name. The answer to your question is: SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%'). [/s>
|
SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')
|
CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, salary INTEGER)
|
display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN') Context: CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN. The answer to your question is: SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN'). [/s>
|
SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN')
|
CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, job_id VARCHAR, salary INTEGER)
|
display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN') Context: CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, job_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN. The answer to your question is: SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN'). [/s>
|
SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2
|
CREATE TABLE employees (department_id VARCHAR, salary INTEGER)
|
display the department id and the total salary for those departments which contains at least two employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2 Context: CREATE TABLE employees (department_id VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: display the department id and the total salary for those departments which contains at least two employees. The answer to your question is: SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2. [/s>
|
SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history)
|
CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR)
|
display all the information of those employees who did not have any job in the past.
|
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history) Context: CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display all the information of those employees who did not have any job in the past. The answer to your question is: SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history). [/s>
|
SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id
|
CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR)
|
display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.
|
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the department ID, full name (first and last name), salary for those employees who is highest salary in every department. The answer to your question is: SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id. [/s>
|
SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province 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
|
CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR)
|
display the first and last name, department, city, and state province for each employee.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province 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 Context: CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the first and last name, department, city, and state province for each employee. The answer to your question is: SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province 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. [/s>
|
SELECT T1.first_name, T1.last_name, T3.city 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 T1.first_name LIKE '%z%'
|
CREATE TABLE locations (city VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR)
|
display those employees who contain a letter z to their first name and also display their last name, city.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, T3.city 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 T1.first_name LIKE '%z%' Context: CREATE TABLE locations (city VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display those employees who contain a letter z to their first name and also display their last name, city. The answer to your question is: SELECT T1.first_name, T1.last_name, T3.city 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 T1.first_name LIKE '%z%'. [/s>
|
SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id
|
CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, location_id VARCHAR)
|
display the department name, city, and state province for each department.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id Context: CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, location_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the department name, city, and state province for each department. The answer to your question is: SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id. [/s>
|
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
|
CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, employee_id VARCHAR, department_id VARCHAR)
|
display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, employee_id VARCHAR, department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working. The answer to your question is: 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. [/s>
|
SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name
|
CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR)
|
display the department name and number of employees in each of the department.
|
<s>[INST] Given the following SQL query and context: Query: SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name Context: CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the department name and number of employees in each of the department. The answer to your question is: SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name. [/s>
|
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'
|
CREATE TABLE locations (location_id VARCHAR, city VARCHAR); CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR)
|
display the full name (first and last name), and salary of those employees who working in any department located in London.
|
<s>[INST] Given the following SQL query and context: Query: 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' Context: CREATE TABLE locations (location_id VARCHAR, city VARCHAR); CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: display the full name (first and last name), and salary of those employees who working in any department located in London. The answer to your question is: 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'. [/s>
|
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1
|
CREATE TABLE song (song_name VARCHAR, releasedate VARCHAR)
|
What is the name of the song that was released in the most recent year?
|
<s>[INST] Given the following SQL query and context: Query: SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1 Context: CREATE TABLE song (song_name VARCHAR, releasedate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the song that was released in the most recent year? The answer to your question is: SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1. [/s>
|
SELECT f_id FROM files ORDER BY duration DESC LIMIT 1
|
CREATE TABLE files (f_id VARCHAR, duration VARCHAR)
|
What is the id of the longest song?
|
<s>[INST] Given the following SQL query and context: Query: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1 Context: CREATE TABLE files (f_id VARCHAR, duration VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the longest song? The answer to your question is: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1. [/s>
|
SELECT song_name FROM song WHERE languages = "english"
|
CREATE TABLE song (song_name VARCHAR, languages VARCHAR)
|
Find the names of all English songs.
|
<s>[INST] Given the following SQL query and context: Query: SELECT song_name FROM song WHERE languages = "english" Context: CREATE TABLE song (song_name VARCHAR, languages VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all English songs. The answer to your question is: SELECT song_name FROM song WHERE languages = "english". [/s>
|
SELECT f_id FROM files WHERE formats = "mp3"
|
CREATE TABLE files (f_id VARCHAR, formats VARCHAR)
|
What are the id of songs whose format is mp3.
|
<s>[INST] Given the following SQL query and context: Query: SELECT f_id FROM files WHERE formats = "mp3" Context: CREATE TABLE files (f_id VARCHAR, formats VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the id of songs whose format is mp3. The answer to your question is: SELECT f_id FROM files WHERE formats = "mp3". [/s>
|
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
|
CREATE TABLE song (artist_name VARCHAR, rating INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
|
List the name and country of origin for all singers who have produced songs with rating above 9.
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE song (artist_name VARCHAR, rating INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name and country of origin for all singers who have produced songs with rating above 9. The answer to your question is: 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. [/s>
|
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
|
CREATE TABLE song (f_id VARCHAR, resolution INTEGER); CREATE TABLE files (file_size VARCHAR, formats VARCHAR, f_id VARCHAR)
|
List the file size and format for all songs that have resolution lower than 800.
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE song (f_id VARCHAR, resolution INTEGER); CREATE TABLE files (file_size VARCHAR, formats VARCHAR, f_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the file size and format for all songs that have resolution lower than 800. The answer to your question is: 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. [/s>
|
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
|
CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (artist_name VARCHAR, f_id VARCHAR)
|
What is the name of the artist who produced the shortest song?
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (artist_name VARCHAR, f_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the artist who produced the shortest song? The answer to your question is: 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. [/s>
|
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
|
CREATE TABLE song (artist_name VARCHAR, rating VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
|
What are the names and countries of origin for the artists who produced the top three highly rated songs.
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE song (artist_name VARCHAR, rating VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and countries of origin for the artists who produced the top three highly rated songs. The answer to your question is: 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. [/s>
|
SELECT COUNT(*) FROM files WHERE duration LIKE "4:%"
|
CREATE TABLE files (duration VARCHAR)
|
How many songs have 4 minute duration?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM files WHERE duration LIKE "4:%" Context: CREATE TABLE files (duration VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many songs have 4 minute duration? The answer to your question is: SELECT COUNT(*) FROM files WHERE duration LIKE "4:%". [/s>
|
SELECT COUNT(*) FROM artist WHERE country = "Bangladesh"
|
CREATE TABLE artist (country VARCHAR)
|
How many artists are from Bangladesh?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM artist WHERE country = "Bangladesh" Context: CREATE TABLE artist (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many artists are from Bangladesh? The answer to your question is: SELECT COUNT(*) FROM artist WHERE country = "Bangladesh". [/s>
|
SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female"
|
CREATE TABLE song (rating INTEGER, artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR)
|
What is the average rating of songs produced by female artists?
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" Context: CREATE TABLE song (rating INTEGER, artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average rating of songs produced by female artists? The answer to your question is: SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female". [/s>
|
SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE files (formats VARCHAR)
|
What is the most popular file format?
|
<s>[INST] Given the following SQL query and context: Query: SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE files (formats VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most popular file format? The answer to your question is: SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"
|
CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, languages VARCHAR); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, languages VARCHAR)
|
Find the names of the artists who are from UK and have produced English songs.
|
<s>[INST] Given the following SQL query and context: Query: SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english" Context: CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, languages VARCHAR); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, languages VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of the artists who are from UK and have produced English songs. The answer to your question is: SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english". [/s>
|
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
|
CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER)
|
Find the id of songs that are available in mp4 format and have resolution lower than 1000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000 Context: CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the id of songs that are available in mp4 format and have resolution lower than 1000. The answer to your question is: SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000. [/s>
|
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"
|
CREATE TABLE artist (country VARCHAR, artist_name VARCHAR, gender VARCHAR); CREATE TABLE song (artist_name VARCHAR, languages VARCHAR)
|
What is the country of origin of the artist who is female and produced a song in Bangla?
|
<s>[INST] Given the following SQL query and context: Query: 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" Context: CREATE TABLE artist (country VARCHAR, artist_name VARCHAR, gender VARCHAR); CREATE TABLE song (artist_name VARCHAR, languages VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the country of origin of the artist who is female and produced a song in Bangla? The answer to your question is: 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". [/s>
|
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
|
CREATE TABLE files (duration INTEGER, f_id VARCHAR, formats VARCHAR); CREATE TABLE song (f_id VARCHAR, resolution VARCHAR)
|
What is the average duration of songs that have mp3 format and resolution below 800?
|
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE files (duration INTEGER, f_id VARCHAR, formats VARCHAR); CREATE TABLE song (f_id VARCHAR, resolution VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average duration of songs that have mp3 format and resolution below 800? The answer to your question is: 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. [/s>
|
SELECT COUNT(*), gender FROM artist GROUP BY gender
|
CREATE TABLE artist (gender VARCHAR)
|
What is the number of artists for each gender?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), gender FROM artist GROUP BY gender Context: CREATE TABLE artist (gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the number of artists for each gender? The answer to your question is: SELECT COUNT(*), gender FROM artist GROUP BY gender. [/s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.