answer stringlengths 18 557 | context stringlengths 27 489 | question stringlengths 12 244 | text stringlengths 275 1.7k |
|---|---|---|---|
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5 | CREATE TABLE invoices (billing_country VARCHAR) | A list of the top 5 countries by number of invoices. List country name and number of invoices. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5 Context: CREATE TABLE invoices (billing_country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: A list of the top 5 countries by number of invoices. List country name and number of invoices. The answer to your question is: SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5. [/s> |
SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8 | CREATE TABLE invoices (billing_country VARCHAR, total INTEGER) | A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8 Context: CREATE TABLE invoices (billing_country VARCHAR, total INTEGER) [/INST] Based on the provided SQL query and context, your question is: A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. The answer to your question is: SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8. [/s> |
SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10 | CREATE TABLE invoices (billing_country VARCHAR, total INTEGER) | A list of the top 10 countries by average invoice size. List country name and average invoice size. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10 Context: CREATE TABLE invoices (billing_country VARCHAR, total INTEGER) [/INST] Based on the provided SQL query and context, your question is: A list of the top 10 countries by average invoice size. List country name and average invoice size. The answer to your question is: SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10. [/s> |
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5 | CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR, invoice_date VARCHAR) | Find out 5 customers who most recently purchased something. List customers' first and last name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5 Context: CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR, invoice_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find out 5 customers who most recently purchased something. List customers' first and last name. The answer to your question is: SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5. [/s> |
SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10 | CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR) | Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10 Context: CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. The answer to your question is: SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10. [/s> |
SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10 | CREATE TABLE invoices (total INTEGER, customer_id VARCHAR); CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR) | List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10 Context: CREATE TABLE invoices (total INTEGER, customer_id VARCHAR); CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. The answer to your question is: SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10. [/s> |
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5 | CREATE TABLE tracks (genre_id VARCHAR); CREATE TABLE genres (name VARCHAR, id VARCHAR) | List the top 5 genres by number of tracks. List genres name and total tracks. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5 Context: CREATE TABLE tracks (genre_id VARCHAR); CREATE TABLE genres (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the top 5 genres by number of tracks. List genres name and total tracks. The answer to your question is: SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5. [/s> |
SELECT title FROM albums | CREATE TABLE albums (title VARCHAR) | List every album's title. | <s>[INST] Given the following SQL query and context: Query: SELECT title FROM albums Context: CREATE TABLE albums (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List every album's title. The answer to your question is: SELECT title FROM albums. [/s> |
SELECT title FROM albums ORDER BY title | CREATE TABLE albums (title VARCHAR) | List every album ordered by album title in ascending order. | <s>[INST] Given the following SQL query and context: Query: SELECT title FROM albums ORDER BY title Context: CREATE TABLE albums (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List every album ordered by album title in ascending order. The answer to your question is: SELECT title FROM albums ORDER BY title. [/s> |
SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title | CREATE TABLE albums (title VARCHAR) | List every album whose title starts with A in alphabetical order. | <s>[INST] Given the following SQL query and context: Query: SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title Context: CREATE TABLE albums (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List every album whose title starts with A in alphabetical order. The answer to your question is: SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title. [/s> |
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10 | CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR) | List the customers first and last name of 10 least expensive invoices. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10 Context: CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE invoices (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the customers first and last name of 10 least expensive invoices. The answer to your question is: SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10. [/s> |
SELECT SUM(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL" | CREATE TABLE invoices (total INTEGER, billing_city VARCHAR, billing_state VARCHAR) | List total amount of invoice from Chicago, IL. | <s>[INST] Given the following SQL query and context: Query: SELECT SUM(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL" Context: CREATE TABLE invoices (total INTEGER, billing_city VARCHAR, billing_state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List total amount of invoice from Chicago, IL. The answer to your question is: SELECT SUM(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL". [/s> |
SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL" | CREATE TABLE invoices (billing_city VARCHAR, billing_state VARCHAR) | List the number of invoices from Chicago, IL. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL" Context: CREATE TABLE invoices (billing_city VARCHAR, billing_state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the number of invoices from Chicago, IL. The answer to your question is: SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL". [/s> |
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state | CREATE TABLE invoices (billing_state VARCHAR, billing_country VARCHAR) | List the number of invoices from the US, grouped by state. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state Context: CREATE TABLE invoices (billing_state VARCHAR, billing_country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the number of invoices from the US, grouped by state. The answer to your question is: SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state. [/s> |
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE invoices (billing_state VARCHAR, billing_country VARCHAR) | List the state in the US with the most invoices. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE invoices (billing_state VARCHAR, billing_country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the state in the US with the most invoices. The answer to your question is: SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1. [/s> |
SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = "CA" | CREATE TABLE invoices (billing_state VARCHAR, total INTEGER) | List the number of invoices and the invoice total from California. | <s>[INST] Given the following SQL query and context: Query: SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = "CA" Context: CREATE TABLE invoices (billing_state VARCHAR, total INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the number of invoices and the invoice total from California. The answer to your question is: SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = "CA". [/s> |
SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith" | CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, artist_id VARCHAR) | List Aerosmith's albums. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith" Context: CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, artist_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List Aerosmith's albums. The answer to your question is: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith". [/s> |
SELECT COUNT(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham" | CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (artist_id VARCHAR) | How many albums does Billy Cobham has? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham" Context: CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (artist_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many albums does Billy Cobham has? The answer to your question is: SELECT COUNT(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham". [/s> |
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins" | CREATE TABLE customers (company VARCHAR, first_name VARCHAR, last_name VARCHAR) | Eduardo Martins is a customer at which company? | <s>[INST] Given the following SQL query and context: Query: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins" Context: CREATE TABLE customers (company VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Eduardo Martins is a customer at which company? The answer to your question is: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins". [/s> |
SELECT email, phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber" | CREATE TABLE customers (email VARCHAR, phone VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is Astrid Gruber's email and phone number? | <s>[INST] Given the following SQL query and context: Query: SELECT email, phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber" Context: CREATE TABLE customers (email VARCHAR, phone VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is Astrid Gruber's email and phone number? The answer to your question is: SELECT email, phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber". [/s> |
SELECT COUNT(*) FROM customers WHERE city = "Prague" | CREATE TABLE customers (city VARCHAR) | How many customers live in Prague city? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customers WHERE city = "Prague" Context: CREATE TABLE customers (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers live in Prague city? The answer to your question is: SELECT COUNT(*) FROM customers WHERE city = "Prague". [/s> |
SELECT COUNT(*) FROM customers WHERE state = "CA" | CREATE TABLE customers (state VARCHAR) | How many customers in state of CA? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customers WHERE state = "CA" Context: CREATE TABLE customers (state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers in state of CA? The answer to your question is: SELECT COUNT(*) FROM customers WHERE state = "CA". [/s> |
SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida" | CREATE TABLE customers (country VARCHAR, first_name VARCHAR, last_name VARCHAR) | What country does Roberto Almeida live? | <s>[INST] Given the following SQL query and context: Query: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida" Context: CREATE TABLE customers (country VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What country does Roberto Almeida live? The answer to your question is: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida". [/s> |
SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' | CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, artist_id VARCHAR) | List the name of albums that are released by aritist whose name has 'Led' | <s>[INST] Given the following SQL query and context: Query: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' Context: CREATE TABLE artists (id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, artist_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of albums that are released by aritist whose name has 'Led' The answer to your question is: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'. [/s> |
SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson" | CREATE TABLE employees (id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE customers (support_rep_id VARCHAR) | How many customers does Steve Johnson support? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson" Context: CREATE TABLE employees (id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE customers (support_rep_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers does Steve Johnson support? The answer to your question is: SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson". [/s> |
SELECT title, phone, hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | CREATE TABLE employees (title VARCHAR, phone VARCHAR, hire_date VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is the title, phone and hire date of Nancy Edwards? | <s>[INST] Given the following SQL query and context: Query: SELECT title, phone, hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" Context: CREATE TABLE employees (title VARCHAR, phone VARCHAR, hire_date VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the title, phone and hire date of Nancy Edwards? The answer to your question is: SELECT title, phone, hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards". [/s> |
SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards" | CREATE TABLE employees (id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, reports_to VARCHAR) | find the full name of employees who report to Nancy Edwards? | <s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards" Context: CREATE TABLE employees (id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, reports_to VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the full name of employees who report to Nancy Edwards? The answer to your question is: SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards". [/s> |
SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | CREATE TABLE employees (address VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is the address of employee Nancy Edwards? | <s>[INST] Given the following SQL query and context: Query: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" Context: CREATE TABLE employees (address VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the address of employee Nancy Edwards? The answer to your question is: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards". [/s> |
SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE customers (support_rep_id VARCHAR) | Find the full name of employee who supported the most number of customers. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE customers (support_rep_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the full name of employee who supported the most number of customers. The answer to your question is: SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1. [/s> |
SELECT COUNT(*) FROM employees WHERE country = "Canada" | CREATE TABLE employees (country VARCHAR) | How many employees are living in Canada? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM employees WHERE country = "Canada" Context: CREATE TABLE employees (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many employees are living in Canada? The answer to your question is: SELECT COUNT(*) FROM employees WHERE country = "Canada". [/s> |
SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | CREATE TABLE employees (phone VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is employee Nancy Edwards's phone number? | <s>[INST] Given the following SQL query and context: Query: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" Context: CREATE TABLE employees (phone VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is employee Nancy Edwards's phone number? The answer to your question is: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards". [/s> |
SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1 | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR) | Who is the youngest employee in the company? List employee's first and last name. | <s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the youngest employee in the company? List employee's first and last name. The answer to your question is: SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1. [/s> |
SELECT first_name, last_name FROM employees ORDER BY hire_date LIMIT 10 | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR) | List top 10 employee work longest in the company. List employee's first and last name. | <s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM employees ORDER BY hire_date LIMIT 10 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List top 10 employee work longest in the company. List employee's first and last name. The answer to your question is: SELECT first_name, last_name FROM employees ORDER BY hire_date LIMIT 10. [/s> |
SELECT COUNT(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city | CREATE TABLE employees (city VARCHAR, title VARCHAR) | Find the number of employees whose title is IT Staff from each city? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city Context: CREATE TABLE employees (city VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of employees whose title is IT Staff from each city? The answer to your question is: SELECT COUNT(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city. [/s> |
SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1 | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE employees (reports_to VARCHAR) | Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1 Context: CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, id VARCHAR); CREATE TABLE employees (reports_to VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee. The answer to your question is: SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1. [/s> |
SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" | CREATE TABLE invoices (customer_id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) | How many orders does Lucas Mancini has? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" Context: CREATE TABLE invoices (customer_id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many orders does Lucas Mancini has? The answer to your question is: SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini". [/s> |
SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" | CREATE TABLE invoices (total INTEGER, customer_id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is the total amount of money spent by Lucas Mancini? | <s>[INST] Given the following SQL query and context: Query: SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" Context: CREATE TABLE invoices (total INTEGER, customer_id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total amount of money spent by Lucas Mancini? The answer to your question is: SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini". [/s> |
SELECT name FROM media_types | CREATE TABLE media_types (name VARCHAR) | List all media types. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM media_types Context: CREATE TABLE media_types (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all media types. The answer to your question is: SELECT name FROM media_types. [/s> |
SELECT DISTINCT name FROM genres | CREATE TABLE genres (name VARCHAR) | List all different genre types. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT name FROM genres Context: CREATE TABLE genres (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all different genre types. The answer to your question is: SELECT DISTINCT name FROM genres. [/s> |
SELECT name FROM playlists | CREATE TABLE playlists (name VARCHAR) | List the name of all playlist. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM playlists Context: CREATE TABLE playlists (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of all playlist. The answer to your question is: SELECT name FROM playlists. [/s> |
SELECT composer FROM tracks WHERE name = "Fast As a Shark" | CREATE TABLE tracks (composer VARCHAR, name VARCHAR) | Who is the composer of track Fast As a Shark? | <s>[INST] Given the following SQL query and context: Query: SELECT composer FROM tracks WHERE name = "Fast As a Shark" Context: CREATE TABLE tracks (composer VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the composer of track Fast As a Shark? The answer to your question is: SELECT composer FROM tracks WHERE name = "Fast As a Shark". [/s> |
SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark" | CREATE TABLE tracks (milliseconds VARCHAR, name VARCHAR) | How long does track Fast As a Shark has? | <s>[INST] Given the following SQL query and context: Query: SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark" Context: CREATE TABLE tracks (milliseconds VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How long does track Fast As a Shark has? The answer to your question is: SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark". [/s> |
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" | CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR) | What is the name of tracks whose genre is Rock? | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" Context: CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of tracks whose genre is Rock? The answer to your question is: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock". [/s> |
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall" | CREATE TABLE tracks (genre_id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, id VARCHAR) | What is title of album which track Balls to the Wall belongs to? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall" Context: CREATE TABLE tracks (genre_id VARCHAR, name VARCHAR); CREATE TABLE albums (title VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is title of album which track Balls to the Wall belongs to? The answer to your question is: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall". [/s> |
SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall" | CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR); CREATE TABLE albums (id VARCHAR, title VARCHAR) | List name of all tracks in Balls to the Wall. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall" Context: CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR); CREATE TABLE albums (id VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List name of all tracks in Balls to the Wall. The answer to your question is: SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall". [/s> |
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10 | CREATE TABLE tracks (album_id VARCHAR); CREATE TABLE albums (title VARCHAR, id VARCHAR) | List title of albums have the number of tracks greater than 10. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10 Context: CREATE TABLE tracks (album_id VARCHAR); CREATE TABLE albums (title VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List title of albums have the number of tracks greater than 10. The answer to your question is: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10. [/s> |
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file" | CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR, media_type_id VARCHAR); CREATE TABLE media_types (id VARCHAR, name VARCHAR) | List the name of tracks belongs to genre Rock and whose media type is MPEG audio file. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file" Context: CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR, media_type_id VARCHAR); CREATE TABLE media_types (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of tracks belongs to genre Rock and whose media type is MPEG audio file. The answer to your question is: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file". [/s> |
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file" | CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR, media_type_id VARCHAR); CREATE TABLE media_types (id VARCHAR, name VARCHAR) | List the name of tracks belongs to genre Rock or media type is MPEG audio file. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file" Context: CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR, media_type_id VARCHAR); CREATE TABLE media_types (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of tracks belongs to genre Rock or media type is MPEG audio file. The answer to your question is: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file". [/s> |
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz" | CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR) | List the name of tracks belongs to genre Rock or genre Jazz. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz" Context: CREATE TABLE genres (id VARCHAR, name VARCHAR); CREATE TABLE tracks (name VARCHAR, genre_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of tracks belongs to genre Rock or genre Jazz. The answer to your question is: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz". [/s> |
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies" | CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) | List the name of all tracks in the playlists of Movies. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies" Context: CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of all tracks in the playlists of Movies. The answer to your question is: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies". [/s> |
SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100 | CREATE TABLE playlist_tracks (playlist_id VARCHAR, track_id VARCHAR); CREATE TABLE playlists (name VARCHAR, id VARCHAR) | List the name of playlist which has number of tracks greater than 100. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100 Context: CREATE TABLE playlist_tracks (playlist_id VARCHAR, track_id VARCHAR); CREATE TABLE playlists (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of playlist which has number of tracks greater than 100. The answer to your question is: SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100. [/s> |
SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters" | CREATE TABLE invoices (id VARCHAR, customer_id VARCHAR); CREATE TABLE invoice_lines (track_id VARCHAR, invoice_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) | List all tracks bought by customer Daan Peeters. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters" Context: CREATE TABLE invoices (id VARCHAR, customer_id VARCHAR); CREATE TABLE invoice_lines (track_id VARCHAR, invoice_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR); CREATE TABLE customers (id VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all tracks bought by customer Daan Peeters. The answer to your question is: SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters". [/s> |
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark" | CREATE TABLE tracks (unit_price VARCHAR, name VARCHAR) | How much is the track Fast As a Shark? | <s>[INST] Given the following SQL query and context: Query: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark" Context: CREATE TABLE tracks (unit_price VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How much is the track Fast As a Shark? The answer to your question is: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark". [/s> |
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' | CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) | Find the name of tracks which are in Movies playlist but not in music playlist. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' Context: CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of tracks which are in Movies playlist but not in music playlist. The answer to your question is: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'. [/s> |
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' | CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) | Find the name of tracks which are in both Movies and music playlists. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' Context: CREATE TABLE playlists (id VARCHAR, name VARCHAR); CREATE TABLE playlist_tracks (track_id VARCHAR, playlist_id VARCHAR); CREATE TABLE tracks (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of tracks which are in both Movies and music playlists. The answer to your question is: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'. [/s> |
SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name | CREATE TABLE tracks (genre_id VARCHAR); CREATE TABLE genres (name VARCHAR, id VARCHAR) | Find number of tracks in each genre? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name Context: CREATE TABLE tracks (genre_id VARCHAR); CREATE TABLE genres (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find number of tracks in each genre? The answer to your question is: SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name. [/s> |
SELECT COUNT(*) FROM editor | CREATE TABLE editor (Id VARCHAR) | How many editors are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM editor Context: CREATE TABLE editor (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many editors are there? The answer to your question is: SELECT COUNT(*) FROM editor. [/s> |
SELECT Name FROM editor ORDER BY Age | CREATE TABLE editor (Name VARCHAR, Age VARCHAR) | List the names of editors in ascending order of age. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM editor ORDER BY Age Context: CREATE TABLE editor (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of editors in ascending order of age. The answer to your question is: SELECT Name FROM editor ORDER BY Age. [/s> |
SELECT Name, Age FROM editor | CREATE TABLE editor (Name VARCHAR, Age VARCHAR) | What are the names and ages of editors? | <s>[INST] Given the following SQL query and context: Query: SELECT Name, Age FROM editor Context: CREATE TABLE editor (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and ages of editors? The answer to your question is: SELECT Name, Age FROM editor. [/s> |
SELECT Name FROM editor WHERE Age > 25 | CREATE TABLE editor (Name VARCHAR, Age INTEGER) | List the names of editors who are older than 25. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM editor WHERE Age > 25 Context: CREATE TABLE editor (Name VARCHAR, Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the names of editors who are older than 25. The answer to your question is: SELECT Name FROM editor WHERE Age > 25. [/s> |
SELECT Name FROM editor WHERE Age = 24 OR Age = 25 | CREATE TABLE editor (Name VARCHAR, Age VARCHAR) | Show the names of editors of age either 24 or 25. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM editor WHERE Age = 24 OR Age = 25 Context: CREATE TABLE editor (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of editors of age either 24 or 25. The answer to your question is: SELECT Name FROM editor WHERE Age = 24 OR Age = 25. [/s> |
SELECT Name FROM editor ORDER BY Age LIMIT 1 | CREATE TABLE editor (Name VARCHAR, Age VARCHAR) | What is the name of the youngest editor? | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM editor ORDER BY Age LIMIT 1 Context: CREATE TABLE editor (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the youngest editor? The answer to your question is: SELECT Name FROM editor ORDER BY Age LIMIT 1. [/s> |
SELECT Age, COUNT(*) FROM editor GROUP BY Age | CREATE TABLE editor (Age VARCHAR) | What are the different ages of editors? Show each age along with the number of editors of that age. | <s>[INST] Given the following SQL query and context: Query: SELECT Age, COUNT(*) FROM editor GROUP BY Age Context: CREATE TABLE editor (Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the different ages of editors? Show each age along with the number of editors of that age. The answer to your question is: SELECT Age, COUNT(*) FROM editor GROUP BY Age. [/s> |
SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE editor (Age VARCHAR) | Please show the most common age of editors. | <s>[INST] Given the following SQL query and context: Query: SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE editor (Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the most common age of editors. The answer to your question is: SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1. [/s> |
SELECT DISTINCT Theme FROM journal | CREATE TABLE journal (Theme VARCHAR) | Show the distinct themes of journals. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Theme FROM journal Context: CREATE TABLE journal (Theme VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the distinct themes of journals. The answer to your question is: SELECT DISTINCT Theme FROM journal. [/s> |
SELECT T2.Name, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID | CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Theme VARCHAR, Journal_ID VARCHAR) | Show the names of editors and the theme of journals for which they serve on committees. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID Context: CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Theme VARCHAR, Journal_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of editors and the theme of journals for which they serve on committees. The answer to your question is: SELECT T2.Name, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID. [/s> |
SELECT T2.Name, T2.age, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme | CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, age VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Theme VARCHAR, Journal_ID VARCHAR) | Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T2.age, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme Context: CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, age VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Theme VARCHAR, Journal_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme. The answer to your question is: SELECT T2.Name, T2.age, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme. [/s> |
SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 | CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Journal_ID VARCHAR, Sales INTEGER) | Show the names of editors that are on the committee of journals with sales bigger than 3000. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 Context: CREATE TABLE journal_committee (Editor_ID VARCHAR, Journal_ID VARCHAR); CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal (Journal_ID VARCHAR, Sales INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the names of editors that are on the committee of journals with sales bigger than 3000. The answer to your question is: SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000. [/s> |
SELECT T1.editor_id, T1.Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id | CREATE TABLE editor (editor_id VARCHAR, Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal_committee (Editor_ID VARCHAR) | Show the id, name of each editor and the number of journal committees they are on. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.editor_id, T1.Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id Context: CREATE TABLE editor (editor_id VARCHAR, Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal_committee (Editor_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the id, name of each editor and the number of journal committees they are on. The answer to your question is: SELECT T1.editor_id, T1.Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id. [/s> |
SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2 | CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal_committee (Editor_ID VARCHAR) | Show the names of editors that are on at least two journal committees. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2 Context: CREATE TABLE editor (Name VARCHAR, Editor_ID VARCHAR); CREATE TABLE journal_committee (Editor_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of editors that are on at least two journal committees. The answer to your question is: SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2. [/s> |
SELECT Name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee) | CREATE TABLE editor (Name VARCHAR, editor_id VARCHAR); CREATE TABLE journal_committee (Name VARCHAR, editor_id VARCHAR) | List the names of editors that are not on any journal committee. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee) Context: CREATE TABLE editor (Name VARCHAR, editor_id VARCHAR); CREATE TABLE journal_committee (Name VARCHAR, editor_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of editors that are not on any journal committee. The answer to your question is: SELECT Name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee). [/s> |
SELECT date, theme, sales FROM journal EXCEPT SELECT T1.date, T1.theme, T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID | CREATE TABLE journal_committee (journal_ID VARCHAR); CREATE TABLE journal (date VARCHAR, theme VARCHAR, sales VARCHAR); CREATE TABLE journal (date VARCHAR, theme VARCHAR, sales VARCHAR, journal_ID VARCHAR) | List the date, theme and sales of the journal which did not have any of the listed editors serving on committee. | <s>[INST] Given the following SQL query and context: Query: SELECT date, theme, sales FROM journal EXCEPT SELECT T1.date, T1.theme, T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID Context: CREATE TABLE journal_committee (journal_ID VARCHAR); CREATE TABLE journal (date VARCHAR, theme VARCHAR, sales VARCHAR); CREATE TABLE journal (date VARCHAR, theme VARCHAR, sales VARCHAR, journal_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the date, theme and sales of the journal which did not have any of the listed editors serving on committee. The answer to your question is: SELECT date, theme, sales FROM journal EXCEPT SELECT T1.date, T1.theme, T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID. [/s> |
SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo' | CREATE TABLE journal_committee (journal_ID VARCHAR, work_type VARCHAR); CREATE TABLE journal (sales INTEGER, journal_ID VARCHAR) | What is the average sales of the journals that have an editor whose work type is 'Photo'? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo' Context: CREATE TABLE journal_committee (journal_ID VARCHAR, work_type VARCHAR); CREATE TABLE journal (sales INTEGER, journal_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average sales of the journals that have an editor whose work type is 'Photo'? The answer to your question is: SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'. [/s> |
SELECT COUNT(*) FROM Accounts | CREATE TABLE Accounts (Id VARCHAR) | How many accounts do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Accounts Context: CREATE TABLE Accounts (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many accounts do we have? The answer to your question is: SELECT COUNT(*) FROM Accounts. [/s> |
SELECT account_id, customer_id, account_name FROM Accounts | CREATE TABLE Accounts (account_id VARCHAR, customer_id VARCHAR, account_name VARCHAR) | Show ids, customer ids, names for all accounts. | <s>[INST] Given the following SQL query and context: Query: SELECT account_id, customer_id, account_name FROM Accounts Context: CREATE TABLE Accounts (account_id VARCHAR, customer_id VARCHAR, account_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids, customer ids, names for all accounts. The answer to your question is: SELECT account_id, customer_id, account_name FROM Accounts. [/s> |
SELECT other_account_details FROM Accounts WHERE account_name = "338" | CREATE TABLE Accounts (other_account_details VARCHAR, account_name VARCHAR) | Show other account details for account with name 338. | <s>[INST] Given the following SQL query and context: Query: SELECT other_account_details FROM Accounts WHERE account_name = "338" Context: CREATE TABLE Accounts (other_account_details VARCHAR, account_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show other account details for account with name 338. The answer to your question is: SELECT other_account_details FROM Accounts WHERE account_name = "338". [/s> |
SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162" | CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE Accounts (customer_id VARCHAR, account_name VARCHAR) | What is the first name, last name, and phone of the customer with account name 162? | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162" Context: CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE Accounts (customer_id VARCHAR, account_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name, last name, and phone of the customer with account name 162? The answer to your question is: SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162". [/s> |
SELECT COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte" | CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) | How many accounts does the customer with first name Art and last name Turcotte have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte" Context: CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many accounts does the customer with first name Art and last name Turcotte have? The answer to your question is: SELECT COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte". [/s> |
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id | CREATE TABLE Accounts (customer_id VARCHAR) | Show all customer ids and the number of accounts for each customer. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id Context: CREATE TABLE Accounts (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all customer ids and the number of accounts for each customer. The answer to your question is: SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id. [/s> |
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Accounts (customer_id VARCHAR) | Show the customer id and number of accounts with most accounts. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Accounts (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the customer id and number of accounts with most accounts. The answer to your question is: SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1. [/s> |
SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) | What is the customer first, last name and id with least number of accounts. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the customer first, last name and id with least number of accounts. The answer to your question is: SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1. [/s> |
SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts) | CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Accounts (customer_id VARCHAR) | Show the number of all customers without an account. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts) Context: CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Accounts (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of all customers without an account. The answer to your question is: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts). [/s> |
SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id | CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR) | Show the first names and last names of customers without any account. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id Context: CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the first names and last names of customers without any account. The answer to your question is: SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id. [/s> |
SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id | CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) | Show distinct first and last names for all customers with an account. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id Context: CREATE TABLE Accounts (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show distinct first and last names for all customers with an account. The answer to your question is: SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id. [/s> |
SELECT COUNT(DISTINCT customer_id) FROM Accounts | CREATE TABLE Accounts (customer_id VARCHAR) | How many customers have an account? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT customer_id) FROM Accounts Context: CREATE TABLE Accounts (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers have an account? The answer to your question is: SELECT COUNT(DISTINCT customer_id) FROM Accounts. [/s> |
SELECT COUNT(*) FROM Customers | CREATE TABLE Customers (Id VARCHAR) | How many customers do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers Context: CREATE TABLE Customers (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers do we have? The answer to your question is: SELECT COUNT(*) FROM Customers. [/s> |
SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers | CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR) | Show ids, first names, last names, and phones for all customers. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers Context: CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids, first names, last names, and phones for all customers. The answer to your question is: SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers. [/s> |
SELECT customer_phone, customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest" | CREATE TABLE Customers (customer_phone VARCHAR, customer_email VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) | What is the phone and email for customer with first name Aniyah and last name Feest? | <s>[INST] Given the following SQL query and context: Query: SELECT customer_phone, customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest" Context: CREATE TABLE Customers (customer_phone VARCHAR, customer_email VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the phone and email for customer with first name Aniyah and last name Feest? The answer to your question is: SELECT customer_phone, customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest". [/s> |
SELECT COUNT(*) FROM Customers_cards | CREATE TABLE Customers_cards (Id VARCHAR) | Show the number of customer cards. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers_cards Context: CREATE TABLE Customers_cards (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of customer cards. The answer to your question is: SELECT COUNT(*) FROM Customers_cards. [/s> |
SELECT card_id, customer_id, card_type_code, card_number FROM Customers_cards | CREATE TABLE Customers_cards (card_id VARCHAR, customer_id VARCHAR, card_type_code VARCHAR, card_number VARCHAR) | Show ids, customer ids, card type codes, card numbers for all cards. | <s>[INST] Given the following SQL query and context: Query: SELECT card_id, customer_id, card_type_code, card_number FROM Customers_cards Context: CREATE TABLE Customers_cards (card_id VARCHAR, customer_id VARCHAR, card_type_code VARCHAR, card_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids, customer ids, card type codes, card numbers for all cards. The answer to your question is: SELECT card_id, customer_id, card_type_code, card_number FROM Customers_cards. [/s> |
SELECT date_valid_from, date_valid_to FROM Customers_cards WHERE card_number = "4560596484842" | CREATE TABLE Customers_cards (date_valid_from VARCHAR, date_valid_to VARCHAR, card_number VARCHAR) | Show the date valid from and the date valid to for the card with card number '4560596484842'. | <s>[INST] Given the following SQL query and context: Query: SELECT date_valid_from, date_valid_to FROM Customers_cards WHERE card_number = "4560596484842" Context: CREATE TABLE Customers_cards (date_valid_from VARCHAR, date_valid_to VARCHAR, card_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the date valid from and the date valid to for the card with card number '4560596484842'. The answer to your question is: SELECT date_valid_from, date_valid_to FROM Customers_cards WHERE card_number = "4560596484842". [/s> |
SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = "4560596484842" | CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE Customers_cards (customer_id VARCHAR, card_number VARCHAR) | What is the first name, last name, and phone of the customer with card 4560596484842. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = "4560596484842" Context: CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE Customers_cards (customer_id VARCHAR, card_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name, last name, and phone of the customer with card 4560596484842. The answer to your question is: SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = "4560596484842". [/s> |
SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte" | CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) | How many cards does customer Art Turcotte have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte" Context: CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many cards does customer Art Turcotte have? The answer to your question is: SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte". [/s> |
SELECT COUNT(*) FROM Customers_cards WHERE card_type_code = "Debit" | CREATE TABLE Customers_cards (card_type_code VARCHAR) | How many debit cards do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers_cards WHERE card_type_code = "Debit" Context: CREATE TABLE Customers_cards (card_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many debit cards do we have? The answer to your question is: SELECT COUNT(*) FROM Customers_cards WHERE card_type_code = "Debit". [/s> |
SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit" | CREATE TABLE Customers_cards (customer_id VARCHAR, card_type_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) | How many credit cards does customer Blanche Huels have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit" Context: CREATE TABLE Customers_cards (customer_id VARCHAR, card_type_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many credit cards does customer Blanche Huels have? The answer to your question is: SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit". [/s> |
SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id | CREATE TABLE Customers_cards (customer_id VARCHAR) | Show all customer ids and the number of cards owned by each customer. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id Context: CREATE TABLE Customers_cards (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all customer ids and the number of cards owned by each customer. The answer to your question is: SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id. [/s> |
SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Customers_cards (customer_id VARCHAR) | What is the customer id with most number of cards, and how many does he have? | <s>[INST] Given the following SQL query and context: Query: SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Customers_cards (customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the customer id with most number of cards, and how many does he have? The answer to your question is: SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1. [/s> |
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 | CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) | Show id, first and last names for all customers with at least two cards. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show id, first and last names for all customers with at least two cards. The answer to your question is: SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2. [/s> |
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) | What is the customer id, first and last name with least number of accounts. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Customers_cards (customer_id VARCHAR); CREATE TABLE Customers (customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the customer id, first and last name with least number of accounts. The answer to your question is: SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1. [/s> |
SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code | CREATE TABLE Customers_cards (card_type_code VARCHAR) | Show all card type codes and the number of cards in each type. | <s>[INST] Given the following SQL query and context: Query: SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code Context: CREATE TABLE Customers_cards (card_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all card type codes and the number of cards in each type. The answer to your question is: SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code. [/s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.