answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM Financial_transactions
CREATE TABLE Financial_transactions (transaction_amount INTEGER)
What is the average, minimum, maximum, and total transaction amount?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM Financial_transactions Context: CREATE TABLE Financial_transactions (transaction_amount INTEGER) [/INST] Based on the provided SQL query and context,...
SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM Financial_transactions)
CREATE TABLE Financial_transactions (transaction_id VARCHAR, transaction_amount INTEGER)
Show ids for all transactions whose amounts are greater than the average.
<s>[INST] Given the following SQL query and context: Query: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM Financial_transactions) Context: CREATE TABLE Financial_transactions (transaction_id VARCHAR, transaction_amount INTEGER) [/INST] Based on the pro...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
CREATE TABLE Financial_transactions (transaction_type VARCHAR, transaction_amount INTEGER)
Show the transaction types and the total amount of transactions.
<s>[INST] Given the following SQL query and context: Query: SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type Context: CREATE TABLE Financial_transactions (transaction_type VARCHAR, transaction_amount INTEGER) [/INST] Based on the provided SQL query and context, your...
SELECT T2.account_name, T1.account_id, COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id
CREATE TABLE Financial_transactions (account_id VARCHAR); CREATE TABLE Accounts (account_name VARCHAR, account_id VARCHAR)
Show the account name, id and the number of transactions for each account.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.account_name, T1.account_id, COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id Context: CREATE TABLE Financial_transactions (account_id VARCHAR); CREATE TABLE Accounts (account_name...
SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Financial_transactions (account_id VARCHAR)
Show the account id with most number of transactions.
<s>[INST] Given the following SQL query and context: Query: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Financial_transactions (account_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the account id with m...
SELECT T1.account_id, T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING COUNT(*) >= 4
CREATE TABLE Financial_transactions (account_id VARCHAR); CREATE TABLE Accounts (account_name VARCHAR, account_id VARCHAR)
Show the account id and name with at least 4 transactions.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.account_id, T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING COUNT(*) >= 4 Context: CREATE TABLE Financial_transactions (account_id VARCHAR); CREATE TABLE Accounts (a...
SELECT DISTINCT product_size FROM Products
CREATE TABLE Products (product_size VARCHAR)
Show all product sizes.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT product_size FROM Products Context: CREATE TABLE Products (product_size VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all product sizes. The answer to your question is: SELECT DISTINCT product_size FROM Pr...
SELECT DISTINCT product_color FROM Products
CREATE TABLE Products (product_color VARCHAR)
Show all product colors.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT product_color FROM Products Context: CREATE TABLE Products (product_color VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all product colors. The answer to your question is: SELECT DISTINCT product_color FRO...
SELECT invoice_number, COUNT(*) FROM Financial_transactions GROUP BY invoice_number
CREATE TABLE Financial_transactions (invoice_number VARCHAR)
Show the invoice number and the number of transactions for each invoice.
<s>[INST] Given the following SQL query and context: Query: SELECT invoice_number, COUNT(*) FROM Financial_transactions GROUP BY invoice_number Context: CREATE TABLE Financial_transactions (invoice_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the invoice number and the num...
SELECT T2.invoice_number, T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Invoices (invoice_number VARCHAR, invoice_date VARCHAR); CREATE TABLE Financial_transactions (invoice_number VARCHAR)
What is the invoice number and invoice date for the invoice with most number of transactions?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.invoice_number, T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Invoices (invoice_number VARCHAR, invoice_d...
SELECT COUNT(*) FROM Invoices
CREATE TABLE Invoices (Id VARCHAR)
How many invoices do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Invoices Context: CREATE TABLE Invoices (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many invoices do we have? The answer to your question is: SELECT COUNT(*) FROM Invoices. [/s>
SELECT T1.invoice_date, T1.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id
CREATE TABLE Invoices (invoice_date VARCHAR, order_id VARCHAR); CREATE TABLE Orders (order_details VARCHAR, order_id VARCHAR)
Show invoice dates and order id and details for all invoices.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.invoice_date, T1.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id Context: CREATE TABLE Invoices (invoice_date VARCHAR, order_id VARCHAR); CREATE TABLE Orders (order_details VARCHAR, order_id VARCHAR) [/IN...
SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id
CREATE TABLE Invoices (order_id VARCHAR)
Show the order ids and the number of invoices for each order.
<s>[INST] Given the following SQL query and context: Query: SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id Context: CREATE TABLE Invoices (order_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the order ids and the number of invoices for each order. The answer to your ...
SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2
CREATE TABLE Orders (order_id VARCHAR, order_details VARCHAR); CREATE TABLE Invoices (order_id VARCHAR)
What is the order id and order details for the order more than two invoices.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2 Context: CREATE TABLE Orders (order_id VARCHAR, order_details VARCHAR); CREATE TABLE Invoices (order_id VARCHAR) [/...
SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Orders (customer_id VARCHAR); CREATE TABLE Customers (customer_last_name VARCHAR, phone_number VARCHAR, customer_id VARCHAR)
What is the customer last name, id and phone number with most number of orders?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Orders (customer_id VARCHAR); CREATE TABLE Cust...
SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id
CREATE TABLE Products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE Order_items (product_id VARCHAR); CREATE TABLE Products (product_name VARCHAR)
Show all product names without an order.
<s>[INST] Given the following SQL query and context: Query: SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id Context: CREATE TABLE Products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE Order_items (product_id VARCHAR)...
SELECT T2.product_name, SUM(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name
CREATE TABLE Products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE Order_items (product_quantity INTEGER, product_id VARCHAR)
Show all product names and the total quantity ordered for each product name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_name, SUM(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name Context: CREATE TABLE Products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE Order_items (product_q...
SELECT order_id, COUNT(*) FROM Order_items GROUP BY order_id
CREATE TABLE Order_items (order_id VARCHAR)
Show the order ids and the number of items in each order.
<s>[INST] Given the following SQL query and context: Query: SELECT order_id, COUNT(*) FROM Order_items GROUP BY order_id Context: CREATE TABLE Order_items (order_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the order ids and the number of items in each order. The answer to you...
SELECT product_id, COUNT(DISTINCT order_id) FROM Order_items GROUP BY product_id
CREATE TABLE Order_items (product_id VARCHAR, order_id VARCHAR)
Show the product ids and the number of unique orders containing each product.
<s>[INST] Given the following SQL query and context: Query: SELECT product_id, COUNT(DISTINCT order_id) FROM Order_items GROUP BY product_id Context: CREATE TABLE Order_items (product_id VARCHAR, order_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the product ids and the number...
SELECT T2.product_name, COUNT(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name
CREATE TABLE Order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE Orders (order_id VARCHAR); CREATE TABLE Products (product_name VARCHAR, product_id VARCHAR)
Show all product names and the number of customers having an order on each product.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_name, COUNT(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name Context: CREATE TABLE Order_items (product_id VARCHAR, order_id VARCHAR); CREAT...
SELECT order_id, COUNT(DISTINCT product_id) FROM Order_items GROUP BY order_id
CREATE TABLE Order_items (order_id VARCHAR, product_id VARCHAR)
Show order ids and the number of products in each order.
<s>[INST] Given the following SQL query and context: Query: SELECT order_id, COUNT(DISTINCT product_id) FROM Order_items GROUP BY order_id Context: CREATE TABLE Order_items (order_id VARCHAR, product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show order ids and the number of prod...
SELECT order_id, SUM(product_quantity) FROM Order_items GROUP BY order_id
CREATE TABLE Order_items (order_id VARCHAR, product_quantity INTEGER)
Show order ids and the total quantity in each order.
<s>[INST] Given the following SQL query and context: Query: SELECT order_id, SUM(product_quantity) FROM Order_items GROUP BY order_id Context: CREATE TABLE Order_items (order_id VARCHAR, product_quantity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show order ids and the total quantit...
SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items)
CREATE TABLE products (product_id VARCHAR); CREATE TABLE Order_items (product_id VARCHAR)
How many products were not included in any order?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items) Context: CREATE TABLE products (product_id VARCHAR); CREATE TABLE Order_items (product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is:...
SELECT COUNT(*) FROM Church WHERE Open_Date < 1850
CREATE TABLE Church (Open_Date INTEGER)
How many churches opened before 1850 are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Church WHERE Open_Date < 1850 Context: CREATE TABLE Church (Open_Date INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many churches opened before 1850 are there? The answer to your question is: SELECT CO...
SELECT name, open_date, organized_by FROM Church
CREATE TABLE Church (name VARCHAR, open_date VARCHAR, organized_by VARCHAR)
Show the name, open date, and organizer for all churches.
<s>[INST] Given the following SQL query and context: Query: SELECT name, open_date, organized_by FROM Church Context: CREATE TABLE Church (name VARCHAR, open_date VARCHAR, organized_by VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name, open date, and organizer for all churche...
SELECT name FROM church ORDER BY open_date DESC
CREATE TABLE church (name VARCHAR, open_date VARCHAR)
List all church names in descending order of opening date.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM church ORDER BY open_date DESC Context: CREATE TABLE church (name VARCHAR, open_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all church names in descending order of opening date. The answer to your ...
SELECT open_date FROM church GROUP BY open_date HAVING COUNT(*) >= 2
CREATE TABLE church (open_date VARCHAR)
Show the opening year in whcih at least two churches opened.
<s>[INST] Given the following SQL query and context: Query: SELECT open_date FROM church GROUP BY open_date HAVING COUNT(*) >= 2 Context: CREATE TABLE church (open_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the opening year in whcih at least two churches opened. The answer...
SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840
CREATE TABLE church (organized_by VARCHAR, name VARCHAR, open_date INTEGER)
Show the organizer and name for churches that opened between 1830 and 1840.
<s>[INST] Given the following SQL query and context: Query: SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840 Context: CREATE TABLE church (organized_by VARCHAR, name VARCHAR, open_date INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the organizer and name ...
SELECT open_date, COUNT(*) FROM church GROUP BY open_date
CREATE TABLE church (open_date VARCHAR)
Show all opening years and the number of churches that opened in that year.
<s>[INST] Given the following SQL query and context: Query: SELECT open_date, COUNT(*) FROM church GROUP BY open_date Context: CREATE TABLE church (open_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all opening years and the number of churches that opened in that year. The an...
SELECT name, open_date FROM church ORDER BY open_date DESC LIMIT 3
CREATE TABLE church (name VARCHAR, open_date VARCHAR)
Show the name and opening year for three churches that opened most recently.
<s>[INST] Given the following SQL query and context: Query: SELECT name, open_date FROM church ORDER BY open_date DESC LIMIT 3 Context: CREATE TABLE church (name VARCHAR, open_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name and opening year for three churches that open...
SELECT COUNT(*) FROM people WHERE is_male = 'F' AND age > 30
CREATE TABLE people (is_male VARCHAR, age VARCHAR)
How many female people are older than 30 in our record?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM people WHERE is_male = 'F' AND age > 30 Context: CREATE TABLE people (is_male VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many female people are older than 30 in our record? The answer t...
SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30
CREATE TABLE people (country VARCHAR, age INTEGER)
Show the country where people older than 30 and younger than 25 are from.
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30 Context: CREATE TABLE people (country VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the country where people older...
SELECT MIN(age), MAX(age), AVG(age) FROM people
CREATE TABLE people (age INTEGER)
Show the minimum, maximum, and average age for all people.
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(age), MAX(age), AVG(age) FROM people Context: CREATE TABLE people (age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the minimum, maximum, and average age for all people. The answer to your question is: SELECT ...
SELECT name, country FROM people WHERE age < (SELECT AVG(age) FROM people)
CREATE TABLE people (name VARCHAR, country VARCHAR, age INTEGER)
Show the name and country for all people whose age is smaller than the average.
<s>[INST] Given the following SQL query and context: Query: SELECT name, country FROM people WHERE age < (SELECT AVG(age) FROM people) Context: CREATE TABLE people (name VARCHAR, country VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the name and country for all people...
SELECT T2.name, T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014
CREATE TABLE wedding (male_id VARCHAR, female_id VARCHAR, year INTEGER); CREATE TABLE people (name VARCHAR, people_id VARCHAR)
Show the pair of male and female names in all weddings after year 2014
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014 Context: CREATE TABLE wedding (male_id VARCHAR, female_id VARCHAR, year INTEGER); CREATE TABLE peopl...
SELECT name, age FROM people WHERE is_male = 'T' AND NOT people_id IN (SELECT male_id FROM wedding)
CREATE TABLE wedding (name VARCHAR, age VARCHAR, is_male VARCHAR, people_id VARCHAR, male_id VARCHAR); CREATE TABLE people (name VARCHAR, age VARCHAR, is_male VARCHAR, people_id VARCHAR, male_id VARCHAR)
Show the name and age for all male people who don't have a wedding.
<s>[INST] Given the following SQL query and context: Query: SELECT name, age FROM people WHERE is_male = 'T' AND NOT people_id IN (SELECT male_id FROM wedding) Context: CREATE TABLE wedding (name VARCHAR, age VARCHAR, is_male VARCHAR, people_id VARCHAR, male_id VARCHAR); CREATE TABLE people (name VARCHAR, age VARCHAR, ...
SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015
CREATE TABLE church (name VARCHAR); CREATE TABLE wedding (church_id VARCHAR, year VARCHAR); CREATE TABLE church (name VARCHAR, church_id VARCHAR)
Show all church names except for those that had a wedding in year 2015.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015 Context: CREATE TABLE church (name VARCHAR); CREATE TABLE wedding (church_id VARCHAR, year VARCHAR); CREATE TABLE church (nam...
SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING COUNT(*) >= 2
CREATE TABLE wedding (church_id VARCHAR); CREATE TABLE church (name VARCHAR, church_id VARCHAR)
Show all church names that have hosted least two weddings.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING COUNT(*) >= 2 Context: CREATE TABLE wedding (church_id VARCHAR); CREATE TABLE church (name VARCHAR, church_id VARCHAR) [/INST] Based on the provided...
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'
CREATE TABLE people (name VARCHAR, people_id VARCHAR, country VARCHAR, is_male VARCHAR); CREATE TABLE wedding (female_id VARCHAR, year VARCHAR)
Show the names for all females from Canada having a wedding in year 2016.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada' Context: CREATE TABLE people (name VARCHAR, people_id VARCHAR, country VARCHAR, is_male VARCHAR); CREATE TABL...
SELECT COUNT(*) FROM wedding WHERE YEAR = 2016
CREATE TABLE wedding (YEAR VARCHAR)
How many weddings are there in year 2016?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM wedding WHERE YEAR = 2016 Context: CREATE TABLE wedding (YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many weddings are there in year 2016? The answer to your question is: SELECT COUNT(*) FROM we...
SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30
CREATE TABLE church (name VARCHAR, church_id VARCHAR); CREATE TABLE people (people_id VARCHAR, age VARCHAR); CREATE TABLE wedding (male_id VARCHAR, female_id VARCHAR, church_id VARCHAR)
Show the church names for the weddings of all people older than 30.
<s>[INST] Given the following SQL query and context: Query: SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30 Context: CREATE TABLE church (name VARCHAR, chur...
SELECT country, COUNT(*) FROM people GROUP BY country
CREATE TABLE people (country VARCHAR)
Show all countries and the number of people from each country.
<s>[INST] Given the following SQL query and context: Query: SELECT country, COUNT(*) FROM people GROUP BY country Context: CREATE TABLE people (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all countries and the number of people from each country. The answer to your questi...
SELECT COUNT(DISTINCT church_id) FROM wedding WHERE YEAR = 2016
CREATE TABLE wedding (church_id VARCHAR, YEAR VARCHAR)
How many churches have a wedding in year 2016?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT church_id) FROM wedding WHERE YEAR = 2016 Context: CREATE TABLE wedding (church_id VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many churches have a wedding in year 2016? The answer to ...
SELECT COUNT(*) FROM artist
CREATE TABLE artist (Id VARCHAR)
How many artists do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM artist Context: CREATE TABLE artist (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many artists do we have? The answer to your question is: SELECT COUNT(*) FROM artist. [/s>
SELECT name, age, country FROM artist ORDER BY Year_Join
CREATE TABLE artist (name VARCHAR, age VARCHAR, country VARCHAR, Year_Join VARCHAR)
Show all artist name, age, and country ordered by the yeared they joined.
<s>[INST] Given the following SQL query and context: Query: SELECT name, age, country FROM artist ORDER BY Year_Join Context: CREATE TABLE artist (name VARCHAR, age VARCHAR, country VARCHAR, Year_Join VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all artist name, age, and country ...
SELECT DISTINCT country FROM artist
CREATE TABLE artist (country VARCHAR)
What are all distinct country for artists?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT country FROM artist Context: CREATE TABLE artist (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all distinct country for artists? The answer to your question is: SELECT DISTINCT country FROM ar...
SELECT name, year_join FROM artist WHERE country <> 'United States'
CREATE TABLE artist (name VARCHAR, year_join VARCHAR, country VARCHAR)
Show all artist names and the year joined who are not from United States.
<s>[INST] Given the following SQL query and context: Query: SELECT name, year_join FROM artist WHERE country <> 'United States' Context: CREATE TABLE artist (name VARCHAR, year_join VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all artist names and the year joined...
SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990
CREATE TABLE artist (age VARCHAR, year_join VARCHAR)
How many artists are above age 46 and joined after 1990?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990 Context: CREATE TABLE artist (age VARCHAR, year_join VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many artists are above age 46 and joined after 1990? The an...
SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States'
CREATE TABLE artist (age INTEGER, country VARCHAR)
What is the average and minimum age of all artists from United States.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States' Context: CREATE TABLE artist (age INTEGER, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average and minimum age of all artists from Uni...
SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
CREATE TABLE artist (name VARCHAR, year_join VARCHAR)
What is the name of the artist who joined latest?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1 Context: CREATE TABLE artist (name VARCHAR, year_join VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the artist who joined latest? The answer to your q...
SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005
CREATE TABLE exhibition (YEAR VARCHAR)
How many exhibition are there in year 2005 or after?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005 Context: CREATE TABLE exhibition (YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many exhibition are there in year 2005 or after? The answer to your question is: SELEC...
SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15
CREATE TABLE exhibition (theme VARCHAR, YEAR VARCHAR, ticket_price INTEGER)
Show theme and year for all exhibitions with ticket prices lower than 15.
<s>[INST] Given the following SQL query and context: Query: SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15 Context: CREATE TABLE exhibition (theme VARCHAR, YEAR VARCHAR, ticket_price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show theme and year for all exhibitions with ...
SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id
CREATE TABLE artist (name VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition (artist_id VARCHAR)
Show all artist names and the number of exhibitions for each artist.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id Context: CREATE TABLE artist (name VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition (artist_id VARCHAR) [/INST] Based on the provided SQL ...
SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE exhibition (artist_id VARCHAR); CREATE TABLE artist (name VARCHAR, country VARCHAR, artist_id VARCHAR)
What is the name and country for the artist with most number of exhibitions?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE exhibition (artist_id VARCHAR); CREATE TABLE artist (name VARCHAR, country VARCHAR, art...
SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition)
CREATE TABLE artist (name VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition (name VARCHAR, artist_id VARCHAR)
Show names for artists without any exhibition.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition) Context: CREATE TABLE artist (name VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition (name VARCHAR, artist_id VARCHAR) [/INST] Based on the provided SQL query and context, you...
SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition)
CREATE TABLE exhibition (ticket_price INTEGER); CREATE TABLE exhibition (theme VARCHAR, artist_id VARCHAR, ticket_price INTEGER); CREATE TABLE artist (name VARCHAR, artist_id VARCHAR)
What is the theme and artist name for the exhibition with a ticket price higher than the average?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition) Context: CREATE TABLE exhibition (ticket_price INTEGER); CREATE TABLE exhibition (theme VARCHAR, ...
SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009
CREATE TABLE exhibition (ticket_price INTEGER, YEAR INTEGER)
Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009 Context: CREATE TABLE exhibition (ticket_price INTEGER, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the average, mini...
SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC
CREATE TABLE exhibition (theme VARCHAR, YEAR VARCHAR, ticket_price VARCHAR)
Show theme and year for all exhibitions in an descending order of ticket price.
<s>[INST] Given the following SQL query and context: Query: SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC Context: CREATE TABLE exhibition (theme VARCHAR, YEAR VARCHAR, ticket_price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show theme and year for all exhibitions in...
SELECT T2.theme, T1.date, T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004
CREATE TABLE exhibition_record (date VARCHAR, attendance VARCHAR, exhibition_id VARCHAR); CREATE TABLE exhibition (theme VARCHAR, exhibition_id VARCHAR, year VARCHAR)
What is the theme, date, and attendance for the exhibition in year 2004?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.theme, T1.date, T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004 Context: CREATE TABLE exhibition_record (date VARCHAR, attendance VARCHAR, exhibition_id VARCHAR); CREATE TAB...
SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004
CREATE TABLE exhibition (artist_id VARCHAR, year VARCHAR); CREATE TABLE artist (name VARCHAR); CREATE TABLE artist (name VARCHAR, artist_id VARCHAR)
Show all artist names who didn't have an exhibition in 2004.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004 Context: CREATE TABLE exhibition (artist_id VARCHAR, year VARCHAR); CREATE TABLE artist (name VARCHAR); CREATE TABLE artis...
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500
CREATE TABLE exhibition (theme VARCHAR, exhibition_id VARCHAR); CREATE TABLE exhibition_record (exhibition_id VARCHAR, attendance INTEGER)
Show the theme for exhibitions with both records of an attendance below 100 and above 500.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.att...
SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10
CREATE TABLE exhibition_record (exhibition_id VARCHAR, attendance VARCHAR); CREATE TABLE exhibition (exhibition_id VARCHAR, ticket_price VARCHAR)
How many exhibitions have a attendance more than 100 or have a ticket price below 10?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10 Context: CREATE TABLE exhibition_record (exhibition_id VARCHAR, attendance VARCHAR); CREATE TABLE exhibi...
SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200
CREATE TABLE artist (name VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition (exhibition_id VARCHAR, artist_id VARCHAR); CREATE TABLE exhibition_record (exhibition_id VARCHAR, attendance INTEGER)
Show all artist names with an average exhibition attendance over 200.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200 Context: CREATE TABLE artist (name VARCHAR, artist_i...
SELECT i_id FROM item WHERE title = "orange"
CREATE TABLE item (i_id VARCHAR, title VARCHAR)
Find the id of the item whose title is "orange".
<s>[INST] Given the following SQL query and context: Query: SELECT i_id FROM item WHERE title = "orange" Context: CREATE TABLE item (i_id VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id of the item whose title is "orange". The answer to your question is: SELECT...
SELECT * FROM item
CREATE TABLE item (Id VARCHAR)
List all information in the item table.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM item Context: CREATE TABLE item (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all information in the item table. The answer to your question is: SELECT * FROM item. [/s>
SELECT COUNT(*) FROM review
CREATE TABLE review (Id VARCHAR)
Find the number of reviews.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM review Context: CREATE TABLE review (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of reviews. The answer to your question is: SELECT COUNT(*) FROM review. [/s>
SELECT COUNT(*) FROM useracct
CREATE TABLE useracct (Id VARCHAR)
How many users are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM useracct Context: CREATE TABLE useracct (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many users are there? The answer to your question is: SELECT COUNT(*) FROM useracct. [/s>
SELECT AVG(rating), MAX(rating) FROM review
CREATE TABLE review (rating INTEGER)
Find the average and maximum rating of all reviews.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(rating), MAX(rating) FROM review Context: CREATE TABLE review (rating INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average and maximum rating of all reviews. The answer to your question is: SELECT AVG(rati...
SELECT MIN(rank) FROM review
CREATE TABLE review (rank INTEGER)
Find the highest rank of all reviews.
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(rank) FROM review Context: CREATE TABLE review (rank INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the highest rank of all reviews. The answer to your question is: SELECT MIN(rank) FROM review. [/s>
SELECT COUNT(DISTINCT u_id) FROM review
CREATE TABLE review (u_id VARCHAR)
How many different users wrote some reviews?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT u_id) FROM review Context: CREATE TABLE review (u_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different users wrote some reviews? The answer to your question is: SELECT COUNT(DISTINCT u_id) ...
SELECT COUNT(DISTINCT i_id) FROM review
CREATE TABLE review (i_id VARCHAR)
How many different items were reviewed by some users?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT i_id) FROM review Context: CREATE TABLE review (i_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different items were reviewed by some users? The answer to your question is: SELECT COUNT(DISTIN...
SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)
CREATE TABLE review (i_id VARCHAR); CREATE TABLE item (i_id VARCHAR)
Find the number of items that did not receive any review.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review) Context: CREATE TABLE review (i_id VARCHAR); CREATE TABLE item (i_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of items that did not rec...
SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)
CREATE TABLE review (name VARCHAR, u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR)
Find the names of users who did not leave any review.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review) Context: CREATE TABLE review (name VARCHAR, u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating VARCHAR)
Find the names of goods that receive a rating of 10.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10 Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating VARCHAR) [/INST] Based on the provided SQL query and context, your q...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)
CREATE TABLE review (rating INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER)
Find the titles of items whose rating is higher than the average review rating of all items.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review) Context: CREATE TABLE review (rating INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating ...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER)
Find the titles of items that received any rating below 5.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER) [/INST] Based on the provided SQL query and context, your qu...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER)
Find the titles of items that received both a rating higher than 8 and a rating below 5.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TAB...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING AVG(T2.rating) > 5
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rank INTEGER, rating INTEGER)
Find the names of items whose rank is higher than 3 and whose average rating is above 5.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING AVG(T2.rating) > 5 Context: CREATE TABLE item (title VARCHAR, i_id...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) LIMIT 1
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER)
Find the name of the item with the lowest average rating.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) LIMIT 1 Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER) [/INST] Based on the provided S...
SELECT title FROM item ORDER BY title
CREATE TABLE item (title VARCHAR)
List the titles of all items in alphabetic order .
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM item ORDER BY title Context: CREATE TABLE item (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the titles of all items in alphabetic order . The answer to your question is: SELECT title FROM item OR...
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE review (u_id VARCHAR)
Find the name of the user who gives the most reviews.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE review (u_id VARCHAR) [/INST] Based on the provided SQL query an...
SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) DESC LIMIT 1
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER)
Find the name and id of the item with the highest average rating.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) DESC LIMIT 1 Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (i_id VARCHAR, rating INTEGER) [/INST] Based on ...
SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC LIMIT 1
CREATE TABLE review (i_id VARCHAR, rank INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR)
Find the name and id of the good with the highest average rank.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC LIMIT 1 Context: CREATE TABLE review (i_id VARCHAR, rank INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR) [/INST] Based on the ...
SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
CREATE TABLE review (rating INTEGER, u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR)
For each user, return the name and the average rating of reviews given by them.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id Context: CREATE TABLE review (rating INTEGER, u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR) [/INST] Based on the provided SQL query a...
SELECT T1.name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE review (u_id VARCHAR)
For each user, find their name and the number of reviews written by them.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id Context: CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE review (u_id VARCHAR) [/INST] Based on the provided SQL query and context, your quest...
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1
CREATE TABLE review (u_id VARCHAR, rating VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR)
Find the name of the user who gave the highest rating.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1 Context: CREATE TABLE review (u_id VARCHAR, rating VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR) [/INST] Based on the provided SQL query an...
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY AVG(trust) DESC LIMIT 1
CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE trust (source_u_id VARCHAR)
Find the name of the source user with the highest average trust score.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY AVG(trust) DESC LIMIT 1 Context: CREATE TABLE useracct (name VARCHAR, u_id VARCHAR); CREATE TABLE trust (source_u_id VARCHAR) [/INST] Based on the ...
SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id
CREATE TABLE trust (target_u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR)
Find each target user's name and average trust score.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id Context: CREATE TABLE trust (target_u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR) [/INST] Based on the provided SQL query an...
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust LIMIT 1
CREATE TABLE trust (target_u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR)
Find the name of the target user with the lowest trust score.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust LIMIT 1 Context: CREATE TABLE trust (target_u_id VARCHAR); CREATE TABLE useracct (name VARCHAR, u_id VARCHAR) [/INST] Based on the provided SQL query and context, yo...
SELECT title FROM item WHERE NOT i_id IN (SELECT i_id FROM review)
CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (title VARCHAR, i_id VARCHAR)
Find the names of the items that did not receive any review.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM item WHERE NOT i_id IN (SELECT i_id FROM review) Context: CREATE TABLE item (title VARCHAR, i_id VARCHAR); CREATE TABLE review (title VARCHAR, i_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names...
SELECT COUNT(*) FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)
CREATE TABLE review (u_id VARCHAR); CREATE TABLE useracct (u_id VARCHAR)
Find the number of users who did not write any review.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review) Context: CREATE TABLE review (u_id VARCHAR); CREATE TABLE useracct (u_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of users who did ...
SELECT COUNT(*) FROM player
CREATE TABLE player (Id VARCHAR)
How many players are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM player Context: CREATE TABLE player (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many players are there? The answer to your question is: SELECT COUNT(*) FROM player. [/s>
SELECT Player_name FROM player ORDER BY Votes
CREATE TABLE player (Player_name VARCHAR, Votes VARCHAR)
List the names of players in ascending order of votes.
<s>[INST] Given the following SQL query and context: Query: SELECT Player_name FROM player ORDER BY Votes Context: CREATE TABLE player (Player_name VARCHAR, Votes VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of players in ascending order of votes. The answer to your que...
SELECT Gender, Occupation FROM player
CREATE TABLE player (Gender VARCHAR, Occupation VARCHAR)
What are the gender and occupation of players?
<s>[INST] Given the following SQL query and context: Query: SELECT Gender, Occupation FROM player Context: CREATE TABLE player (Gender VARCHAR, Occupation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the gender and occupation of players? The answer to your question is: SELECT...
SELECT Player_name, residence FROM player WHERE Occupation <> "Researcher"
CREATE TABLE player (Player_name VARCHAR, residence VARCHAR, Occupation VARCHAR)
List the name and residence for players whose occupation is not "Researcher".
<s>[INST] Given the following SQL query and context: Query: SELECT Player_name, residence FROM player WHERE Occupation <> "Researcher" Context: CREATE TABLE player (Player_name VARCHAR, residence VARCHAR, Occupation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name and reside...
SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Residence = "Birtle"
CREATE TABLE player (Sponsor_name VARCHAR, Residence VARCHAR)
Show the names of sponsors of players whose residence is either "Brandon" or "Birtle".
<s>[INST] Given the following SQL query and context: Query: SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Residence = "Birtle" Context: CREATE TABLE player (Sponsor_name VARCHAR, Residence VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of sponsors of play...
SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1
CREATE TABLE player (Player_name VARCHAR, Votes VARCHAR)
What is the name of the player with the largest number of votes?
<s>[INST] Given the following SQL query and context: Query: SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1 Context: CREATE TABLE player (Player_name VARCHAR, Votes VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the player with the largest number of votes?...
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation
CREATE TABLE player (Occupation VARCHAR)
Show different occupations along with the number of players in each occupation.
<s>[INST] Given the following SQL query and context: Query: SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation Context: CREATE TABLE player (Occupation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different occupations along with the number of players in each occupation....
SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE player (Occupation VARCHAR)
Please show the most common occupation of players.
<s>[INST] Given the following SQL query and context: Query: SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE player (Occupation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the most common occupation of players. The ans...
SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2
CREATE TABLE player (Residence VARCHAR)
Show the residences that have at least two players.
<s>[INST] Given the following SQL query and context: Query: SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2 Context: CREATE TABLE player (Residence VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the residences that have at least two players. The answer to your ...