prompt stringlengths 155 8.09k | answer stringlengths 18 577 |
|---|---|
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students does each advisor have?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID INT... | SELECT advisor , count(*) FROM Student GROUP BY advisor |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Which advisor has most number of students?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID IN... | SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Give the advisor with the most students., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID INTE... | SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students have cat allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID INTEGER... | SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students are affected by cat allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID... | SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Show all student IDs who have at least two allergies., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( ... | SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the students ids of students who have more than one allergy?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_... | SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the student ids of students who don't have any allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_All... | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Which students are unaffected by allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID I... | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many female students have milk or egg allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( S... | SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students who are female are allergic to milk or eggs?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy... | SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students have a food allergy?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID INTEGE... | SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students are affected by food related allergies?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( ... | SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Which allergy has most number of students affected?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( St... | SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Which allergy is the most common?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID INTEGER, ... | SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Show all allergies with number of students affected., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( S... | SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students have each different allergy?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( StuID ... | SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Show all allergy type with number of students affected., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( ... | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students are affected by each allergy type?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_Allergy ( S... | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the last name and age of the student who has allergy to both milk and cat., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create ... | SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the last names and ages of the students who are allergic to milk and cat?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); crea... | SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KE... | SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, A... | SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the first name and gender of the student who has allergy to milk but not cat., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); crea... | SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the first name and gender of the students who have allergy to milk but can put up with cats?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType ... | SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the average age of the students who have allergies with food and animal types., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); cre... | SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How old are the students with allergies to food and animal types on average?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create tab... | SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the first and last name of the students who do not have any food type allergy., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); cre... | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the full name of each student who is not allergic to any type of food., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create t... | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the number of male (sex is 'M') students who have some food type allery., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create ta... | SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many male students (sex is 'M') are allergic to any type of food?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table Has_... | SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the different first names and cities of the students who have allergy to milk or cat., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20... | SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the distinct first names and cities of the students who have allergy either to milk or to cat?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType ... | SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the number of students who are older than 18 and do not have allergy to either food or animal., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType V... | SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many students are over 18 and do not have allergy to food type or animal type?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); crea... | SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the first name and major of the students who are not allegry to soy., schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create table ... | SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the first name and major of the students who are able to consume soy?, schema:create table Allergy_Type ( Allergy VARCHAR(20) PRIMARY KEY, AllergyType VARCHAR(20)); create t... | SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:A list of the top 5 countries by number of invoices. List country name and number of invoices., schema:Create Tables********************************************************************************/CREA... | SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the top 5 countries by number of invoices and how many do they have?, schema:Create Tables********************************************************************************/CREATE TABLE artists(... | SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size., schema:Create Tables*******************************************************************************... | SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the names of the top 8 countries by total invoice size and what are those sizes?, schema:Create Tables********************************************************************************/CREATE TA... | SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:A list of the top 10 countries by average invoice size. List country name and average invoice size., schema:Create Tables********************************************************************************... | SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the names of the countries and average invoice size of the top countries by size?, schema:Create Tables********************************************************************************/CREATE T... | SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find out 5 customers who most recently purchased something. List customers' first and last name., schema:Create Tables********************************************************************************/CR... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the first and last names of the 5 customers who purchased something most recently?, schema:Create Tables********************************************************************************/CREATE ... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders., schema:Create Tables*******************************************************... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the top 10 customers' first and last names by total number of orders and how many orders did they make?, schema:Create Tables*******************************************************************... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the top 10 customers by total gross sales. List customers' first and last name and total gross sales., schema:Create Tables*************************************************************************... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales?, schema:Create Tables*********************************************************************... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the top 5 genres by number of tracks. List genres name and total tracks., schema:Create Tables********************************************************************************/CREATE TABLE artists(... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many tracks does each genre have and what are the names of the top 5?, schema:Create Tables********************************************************************************/CREATE TABLE artists( ... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List every album's title., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMENT, name VA... | SELECT title FROM albums; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the titles of all the albums?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMEN... | SELECT title FROM albums; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List every album ordered by album title in ascending order., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRI... | SELECT title FROM albums ORDER BY title; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the titles of all the albums alphabetically ascending?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER... | SELECT title FROM albums ORDER BY title; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List every album whose title starts with A in alphabetical order., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEG... | SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the titles of all albums that start with A in alphabetical order?, schema:Create Tables********************************************************************************/CREATE TABLE artists( ... | SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the customers first and last name of 10 least expensive invoices., schema:Create Tables********************************************************************************/CREATE TABLE artists( id ... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the first and last names of the customers with the 10 cheapest invoices?, schema:Create Tables********************************************************************************/CREATE TABLE arti... | 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; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List total amount of invoice from Chicago, IL., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUT... | SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the total amount of money in the invoices billed from Chicago, Illinois?, schema:Create Tables********************************************************************************/CREATE TABLE arti... | SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the number of invoices from Chicago, IL., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOI... | SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many invoices were billed from Chicago, IL?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUT... | SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the number of invoices from the US, grouped by state., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIM... | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many invoices were billed from each state?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the state in the US with the most invoices., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AU... | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the states with the most invoices?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINC... | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the number of invoices and the invoice total from California., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTE... | SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the number of invoices and total money billed in them from CA?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id ... | SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List Aerosmith's albums., schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMENT, name VAR... | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What are the titles of all the Aerosmith albums?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AU... | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many albums does Billy Cobham has?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMEN... | SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many albums has Billy Cobam released?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCRE... | SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Eduardo Martins is a customer at which company?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUT... | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the company where Eduardo Martins is a customer?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMAR... | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is Astrid Gruber's email and phone number?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUT... | SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the email and phone number of Astrid Gruber the customer?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEG... | SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many customers live in Prague city?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREME... | SELECT count(*) FROM customers WHERE city = "Prague"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many customers live in the city of Prague?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | SELECT count(*) FROM customers WHERE city = "Prague"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many customers in state of CA?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMENT, ... | SELECT count(*) FROM customers WHERE state = "CA"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many customers are from California?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREME... | SELECT count(*) FROM customers WHERE state = "CA"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What country does Roberto Almeida live?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREME... | SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:In which country does Roberto Almeida?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMEN... | SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:List the name of albums that are released by aritist whose name has 'Led', schema:Create Tables********************************************************************************/CREATE TABLE artists( ... | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the title of the album that was released by the artist whose name has the phrase 'Led'?, schema:Create Tables********************************************************************************/CRE... | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many customers does Steve Johnson support?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | 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"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the count of customers that Steve Johnson supports?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRI... | 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"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the title, phone and hire date of Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMAR... | SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the title, phone number and hire date for the employee named Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE ar... | SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:find the full name of employees who report to Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PR... | 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"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the first and last name of the employee who reports to Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE artists(... | 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"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the address of employee Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is Nancy Edwards's address?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMENT, ... | SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Find the full name of employee who supported the most number of customers., schema:Create Tables********************************************************************************/CREATE TABLE artists( ... | 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 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the full name of the employee who has the most customers?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEG... | 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 |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many employees are living in Canada?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREM... | SELECT count(*) FROM employees WHERE country = "Canada"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:How many employees live in Canada?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTOINCREMENT, ... | SELECT count(*) FROM employees WHERE country = "Canada"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is employee Nancy Edwards's phone number?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:What is the the phone number of Nancy Edwards?, schema:Create Tables********************************************************************************/CREATE TABLE artists( id INTEGER PRIMARY KEY AUTO... | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; |
You are an excellent developer. Please make an SQL query based on the instructions and the provided schema.Instruction:Who is the youngest employee in the company? List employee's first and last name., schema:Create Tables********************************************************************************/CREATE TABLE arti... | SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.