answer stringlengths 18 557 | context stringlengths 27 489 | question stringlengths 12 244 | text stringlengths 275 1.7k |
|---|---|---|---|
SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections) | CREATE TABLE document_sections (document_name VARCHAR, document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) | Find all the name of documents without any sections. | <s>[INST] Given the following SQL query and context: Query: SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections) Context: CREATE TABLE document_sections (document_name VARCHAR, document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VA... |
SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE users (user_name VARCHAR, password VARCHAR, role_code VARCHAR) | List all the username and passwords of users with the most popular role. | <s>[INST] Given the following SQL query and context: Query: SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE users (user_name VARCHAR, password VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the use... |
SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement" | CREATE TABLE document_functional_areas (document_code VARCHAR, functional_area_code VARCHAR); CREATE TABLE documents (access_count INTEGER, document_code VARCHAR); CREATE TABLE functional_areas (functional_area_code VARCHAR, functional_area_description VARCHAR) | Find the average access counts of documents with functional area "Acknowledgement". | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgemen... |
SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id | CREATE TABLE document_sections_images (section_id VARCHAR); CREATE TABLE documents (document_name VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR); CREATE TABLE document_sections (document_code VARCHAR, section_id VARCHAR) | Find names of the document without any images. | <s>[INST] Given the following SQL query and context: Query: SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id Context: CREATE TABLE document_sect... |
SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE document_sections (document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) | What is the name of the document with the most number of sections? | <s>[INST] Given the following SQL query and context: Query: SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE document_sections (document_code VARCHAR); CREATE TABLE documents (d... |
SELECT document_name FROM documents WHERE document_name LIKE "%CV%" | CREATE TABLE documents (document_name VARCHAR) | List all the document names which contains "CV". | <s>[INST] Given the following SQL query and context: Query: SELECT document_name FROM documents WHERE document_name LIKE "%CV%" Context: CREATE TABLE documents (document_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the document names which contains "CV". The answer to yo... |
SELECT COUNT(*) FROM users WHERE user_login = 1 | CREATE TABLE users (user_login VARCHAR) | How many users are logged in? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM users WHERE user_login = 1 Context: CREATE TABLE users (user_login VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many users are logged in? The answer to your question is: SELECT COUNT(*) FROM users WHE... |
SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1) | CREATE TABLE users (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR); CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR) | Find the description of the most popular role among the users that have logged in. | <s>[INST] Given the following SQL query and context: Query: SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1) Context: CREATE TABLE users (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR); CREATE TABL... |
SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE documents (access_count INTEGER, document_structure_code VARCHAR) | Find the average access count of documents with the least popular structure. | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE documents (access_count INTEGER, document_structure_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Fi... |
SELECT image_name, image_url FROM images ORDER BY image_name | CREATE TABLE images (image_name VARCHAR, image_url VARCHAR) | List all the image name and URLs in the order of their names. | <s>[INST] Given the following SQL query and context: Query: SELECT image_name, image_url FROM images ORDER BY image_name Context: CREATE TABLE images (image_name VARCHAR, image_url VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the image name and URLs in the order of their name... |
SELECT COUNT(*), role_code FROM users GROUP BY role_code | CREATE TABLE users (role_code VARCHAR) | Find the number of users in each role. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), role_code FROM users GROUP BY role_code Context: CREATE TABLE users (role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of users in each role. The answer to your question is: SELECT COUNT(... |
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2 | CREATE TABLE documents (document_type_code VARCHAR) | What document types have more than 2 corresponding documents? | <s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2 Context: CREATE TABLE documents (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What document types have more than 2 co... |
SELECT COUNT(*) FROM Companies | CREATE TABLE Companies (Id VARCHAR) | How many companies are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Companies Context: CREATE TABLE Companies (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many companies are there? The answer to your question is: SELECT COUNT(*) FROM Companies. [/s> |
SELECT name FROM Companies ORDER BY Market_Value_billion DESC | CREATE TABLE Companies (name VARCHAR, Market_Value_billion VARCHAR) | List the names of companies in descending order of market value. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM Companies ORDER BY Market_Value_billion DESC Context: CREATE TABLE Companies (name VARCHAR, Market_Value_billion VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of companies in descending order of... |
SELECT name FROM Companies WHERE Headquarters <> 'USA' | CREATE TABLE Companies (name VARCHAR, Headquarters VARCHAR) | What are the names of companies whose headquarters are not "USA"? | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM Companies WHERE Headquarters <> 'USA' Context: CREATE TABLE Companies (name VARCHAR, Headquarters VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of companies whose headquarters are not "USA"?... |
SELECT name, Assets_billion FROM Companies ORDER BY name | CREATE TABLE Companies (name VARCHAR, Assets_billion VARCHAR) | What are the name and assets of each company, sorted in ascending order of company name? | <s>[INST] Given the following SQL query and context: Query: SELECT name, Assets_billion FROM Companies ORDER BY name Context: CREATE TABLE Companies (name VARCHAR, Assets_billion VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the name and assets of each company, sorted in ascen... |
SELECT AVG(Profits_billion) FROM Companies | CREATE TABLE Companies (Profits_billion INTEGER) | What are the average profits of companies? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(Profits_billion) FROM Companies Context: CREATE TABLE Companies (Profits_billion INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average profits of companies? The answer to your question is: SELECT AVG(Pr... |
SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> "Banking" | CREATE TABLE Companies (Sales_billion INTEGER, Industry VARCHAR) | What are the maximum and minimum sales of the companies whose industries are not "Banking". | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> "Banking" Context: CREATE TABLE Companies (Sales_billion INTEGER, Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the maximum and m... |
SELECT COUNT(DISTINCT Industry) FROM Companies | CREATE TABLE Companies (Industry VARCHAR) | How many different industries are the companies in? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT Industry) FROM Companies Context: CREATE TABLE Companies (Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different industries are the companies in? The answer to your question is: SELECT ... |
SELECT name FROM buildings ORDER BY Height DESC | CREATE TABLE buildings (name VARCHAR, Height VARCHAR) | List the names of buildings in descending order of building height. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM buildings ORDER BY Height DESC Context: CREATE TABLE buildings (name VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of buildings in descending order of building height. The answer... |
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1 | CREATE TABLE buildings (Stories VARCHAR, Height VARCHAR) | Find the stories of the building with the largest height. | <s>[INST] Given the following SQL query and context: Query: SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1 Context: CREATE TABLE buildings (Stories VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the stories of the building with the largest height. The an... |
SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id | CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR); CREATE TABLE Companies (name VARCHAR, id VARCHAR) | List the name of a building along with the name of a company whose office is in the building. | <s>[INST] Given the following SQL query and context: Query: SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id Context: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, com... |
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1 | CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) | Show the names of the buildings that have more than one company offices. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1 Context: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Compani... |
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) | Show the name of the building that has the most company offices. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TA... |
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories | CREATE TABLE buildings (name VARCHAR, Status VARCHAR, Stories VARCHAR) | Please show the names of the buildings whose status is "on-hold", in ascending order of stories. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories Context: CREATE TABLE buildings (name VARCHAR, Status VARCHAR, Stories VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the names of the buildings w... |
SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry | CREATE TABLE Companies (Industry VARCHAR) | Please show each industry and the corresponding number of companies in that industry. | <s>[INST] Given the following SQL query and context: Query: SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry Context: CREATE TABLE Companies (Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show each industry and the corresponding number of companies in that ind... |
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC | CREATE TABLE Companies (Industry VARCHAR) | Please show the industries of companies in descending order of the number of companies. | <s>[INST] Given the following SQL query and context: Query: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC Context: CREATE TABLE Companies (Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the industries of companies in descending order of the... |
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Companies (Industry VARCHAR) | List the industry shared by the most companies. | <s>[INST] Given the following SQL query and context: Query: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Companies (Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the industry shared by the most companies. The answer... |
SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations) | CREATE TABLE buildings (name VARCHAR, id VARCHAR, building_id VARCHAR); CREATE TABLE Office_locations (name VARCHAR, id VARCHAR, building_id VARCHAR) | List the names of buildings that have no company office. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations) Context: CREATE TABLE buildings (name VARCHAR, id VARCHAR, building_id VARCHAR); CREATE TABLE Office_locations (name VARCHAR, id VARCHAR, building_id VARCHAR) [/INST] Based o... |
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China" | CREATE TABLE Companies (Industry VARCHAR, Headquarters VARCHAR) | Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China". | <s>[INST] Given the following SQL query and context: Query: SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China" Context: CREATE TABLE Companies (Industry VARCHAR, Headquarters VARCHAR) [/INST] Based on the provided SQL query and context, your q... |
SELECT COUNT(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate" | CREATE TABLE Companies (Industry VARCHAR) | Find the number of companies whose industry is "Banking" or "Conglomerate", | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate" Context: CREATE TABLE Companies (Industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of companies whose industry is "Ban... |
SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2 | CREATE TABLE Companies (Headquarters VARCHAR) | Show the headquarters shared by more than two companies. | <s>[INST] Given the following SQL query and context: Query: SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2 Context: CREATE TABLE Companies (Headquarters VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the headquarters shared by more than two companies. ... |
SELECT COUNT(*) FROM Products | CREATE TABLE Products (Id VARCHAR) | How many products are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Products Context: CREATE TABLE Products (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many products are there? The answer to your question is: SELECT COUNT(*) FROM Products. [/s> |
SELECT Product_Name FROM Products ORDER BY Product_Price | CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) | List the name of products in ascending order of price. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Name FROM Products ORDER BY Product_Price Context: CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of products in ascending order of price. ... |
SELECT Product_Name, Product_Type_Code FROM Products | CREATE TABLE Products (Product_Name VARCHAR, Product_Type_Code VARCHAR) | What are the names and type codes of products? | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Name, Product_Type_Code FROM Products Context: CREATE TABLE Products (Product_Name VARCHAR, Product_Type_Code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and type codes of products? The answ... |
SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy" | CREATE TABLE Products (Product_Price VARCHAR, Product_Name VARCHAR) | Show the prices of the products named "Dining" or "Trading Policy". | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy" Context: CREATE TABLE Products (Product_Price VARCHAR, Product_Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the pri... |
SELECT AVG(Product_Price) FROM Products | CREATE TABLE Products (Product_Price INTEGER) | What is the average price for products? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(Product_Price) FROM Products Context: CREATE TABLE Products (Product_Price INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average price for products? The answer to your question is: SELECT AVG(Product_Pri... |
SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1 | CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) | What is the name of the product with the highest price? | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1 Context: CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the product with the h... |
SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code | CREATE TABLE Products (Product_Type_Code VARCHAR) | Show different type codes of products and the number of products with each type code. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code Context: CREATE TABLE Products (Product_Type_Code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different type codes of products and the number o... |
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Products (Product_Type_Code VARCHAR) | Show the most common type code across products. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Products (Product_Type_Code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common type code ac... |
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2 | CREATE TABLE Products (Product_Type_Code VARCHAR) | Show the product type codes that have at least two products. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2 Context: CREATE TABLE Products (Product_Type_Code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the product type codes that have at le... |
SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000 | CREATE TABLE Products (Product_Type_Code VARCHAR, Product_Price INTEGER) | Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000 Context: CREATE TABLE Products (Product_Type_Code VARCHAR, Product_Price INTEGER) [/INST] Based on the provided SQL qu... |
SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name | CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) | Show the names of products and the number of events they are in. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name Context: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID ... |
SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC | CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) | Show the names of products and the number of events they are in, sorted by the number of events in descending order. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC Context: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products... |
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 | CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) | Show the names of products that are in at least two events. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 Context: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (... |
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name | CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) | Show the names of products that are in at least two events in ascending alphabetical order of product name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name Context: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE T... |
SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) | CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_Name VARCHAR, Product_ID VARCHAR) | List the names of products that are not in any event. | <s>[INST] Given the following SQL query and context: Query: SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) Context: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_Name VARCHAR, Product_ID VARCHAR) [/INST] ... |
SELECT COUNT(*) FROM artwork | CREATE TABLE artwork (Id VARCHAR) | How many artworks are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM artwork Context: CREATE TABLE artwork (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many artworks are there? The answer to your question is: SELECT COUNT(*) FROM artwork. [/s> |
SELECT Name FROM artwork ORDER BY Name | CREATE TABLE artwork (Name VARCHAR) | List the name of artworks in ascending alphabetical order. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM artwork ORDER BY Name Context: CREATE TABLE artwork (Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of artworks in ascending alphabetical order. The answer to your question is: SELECT Name FR... |
SELECT Name FROM artwork WHERE TYPE <> "Program Talent Show" | CREATE TABLE artwork (Name VARCHAR, TYPE VARCHAR) | List the name of artworks whose type is not "Program Talent Show". | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM artwork WHERE TYPE <> "Program Talent Show" Context: CREATE TABLE artwork (Name VARCHAR, TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of artworks whose type is not "Program Talent Show". Th... |
SELECT Festival_Name, LOCATION FROM festival_detail | CREATE TABLE festival_detail (Festival_Name VARCHAR, LOCATION VARCHAR) | What are the names and locations of festivals? | <s>[INST] Given the following SQL query and context: Query: SELECT Festival_Name, LOCATION FROM festival_detail Context: CREATE TABLE festival_detail (Festival_Name VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and locations of festivals? The answer... |
SELECT Chair_Name FROM festival_detail ORDER BY YEAR | CREATE TABLE festival_detail (Chair_Name VARCHAR, YEAR VARCHAR) | What are the names of the chairs of festivals, sorted in ascending order of the year held? | <s>[INST] Given the following SQL query and context: Query: SELECT Chair_Name FROM festival_detail ORDER BY YEAR Context: CREATE TABLE festival_detail (Chair_Name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the chairs of festivals, sorted in ascend... |
SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1 | CREATE TABLE festival_detail (LOCATION VARCHAR, Num_of_Audience VARCHAR) | What is the location of the festival with the largest number of audience? | <s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1 Context: CREATE TABLE festival_detail (LOCATION VARCHAR, Num_of_Audience VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the location of the fest... |
SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007 | CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) | What are the names of festivals held in year 2007? | <s>[INST] Given the following SQL query and context: Query: SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007 Context: CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of festivals held in year 2007? Th... |
SELECT AVG(Num_of_Audience) FROM festival_detail | CREATE TABLE festival_detail (Num_of_Audience INTEGER) | What is the average number of audience for festivals? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(Num_of_Audience) FROM festival_detail Context: CREATE TABLE festival_detail (Num_of_Audience INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of audience for festivals? The answer to your que... |
SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3 | CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) | Show the names of the three most recent festivals. | <s>[INST] Given the following SQL query and context: Query: SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3 Context: CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of the three most recent fest... |
SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID | CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR) | For each nomination, show the name of the artwork and name of the festival where it is nominated. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID Context: CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (... |
SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 | CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR); CREATE TABLE artwork (Type VARCHAR, Artwork_ID VARCHAR) | Show distinct types of artworks that are nominated in festivals in 2007. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 Context: CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CRE... |
SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year | CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR) | Show the names of artworks in ascending order of the year they are nominated in. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year Context: CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (A... |
SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = "Program Talent Show" | CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR, Type VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR) | Show the names of festivals that have nominated artworks of type "Program Talent Show". | <s>[INST] Given the following SQL query and context: Query: SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = "Program Talent Show" Context: CREATE TABLE nomination (Artwork_ID VARCHAR, Festival... |
SELECT T1.Festival_ID, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2 | CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR) | Show the ids and names of festivals that have at least two nominations for artworks. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Festival_ID, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2 Context: CREATE TABLE nomination (Festi... |
SELECT T1.Festival_ID, T3.Festival_Name, COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID | CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR) | Show the id, name of each festival and the number of artworks it has nominated. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Festival_ID, T3.Festival_Name, COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID Context: CREATE TABLE nomination (Festival_ID VARC... |
SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE | CREATE TABLE artwork (TYPE VARCHAR) | Please show different types of artworks with the corresponding number of artworks of each type. | <s>[INST] Given the following SQL query and context: Query: SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE Context: CREATE TABLE artwork (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show different types of artworks with the corresponding number of artworks of each type.... |
SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE artwork (TYPE VARCHAR) | List the most common type of artworks. | <s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE artwork (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the most common type of artworks. The answer to your question is: SEL... |
SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1 | CREATE TABLE festival_detail (YEAR VARCHAR) | List the year in which there are more than one festivals. | <s>[INST] Given the following SQL query and context: Query: SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1 Context: CREATE TABLE festival_detail (YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the year in which there are more than one festivals. The answer ... |
SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination) | CREATE TABLE nomination (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE Artwork (Name VARCHAR, Artwork_ID VARCHAR) | List the name of artworks that are not nominated. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination) Context: CREATE TABLE nomination (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE Artwork (Name VARCHAR, Artwork_ID VARCHAR) [/INST] Based on the provided SQL query and contex... |
SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010 | CREATE TABLE festival_detail (Num_of_Audience VARCHAR, YEAR VARCHAR) | Show the number of audience in year 2008 or 2010. | <s>[INST] Given the following SQL query and context: Query: SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010 Context: CREATE TABLE festival_detail (Num_of_Audience VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of audience in yea... |
SELECT SUM(Num_of_Audience) FROM festival_detail | CREATE TABLE festival_detail (Num_of_Audience INTEGER) | What are the total number of the audiences who visited any of the festivals? | <s>[INST] Given the following SQL query and context: Query: SELECT SUM(Num_of_Audience) FROM festival_detail Context: CREATE TABLE festival_detail (Num_of_Audience INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the total number of the audiences who visited any of the festivals?... |
SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States' | CREATE TABLE festival_detail (YEAR VARCHAR, LOCATION VARCHAR) | In which year are there festivals both inside the 'United States' and outside the 'United States'? | <s>[INST] Given the following SQL query and context: Query: SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States' Context: CREATE TABLE festival_detail (YEAR VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and co... |
SELECT COUNT(*) FROM premises | CREATE TABLE premises (Id VARCHAR) | How many premises are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM premises Context: CREATE TABLE premises (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many premises are there? The answer to your question is: SELECT COUNT(*) FROM premises. [/s> |
SELECT DISTINCT premises_type FROM premises | CREATE TABLE premises (premises_type VARCHAR) | What are all the distinct premise types? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT premises_type FROM premises Context: CREATE TABLE premises (premises_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the distinct premise types? The answer to your question is: SELECT DISTINCT p... |
SELECT premises_type, premise_details FROM premises ORDER BY premises_type | CREATE TABLE premises (premises_type VARCHAR, premise_details VARCHAR) | Find the types and details for all premises and order by the premise type. | <s>[INST] Given the following SQL query and context: Query: SELECT premises_type, premise_details FROM premises ORDER BY premises_type Context: CREATE TABLE premises (premises_type VARCHAR, premise_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the types and details for all... |
SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type | CREATE TABLE premises (premises_type VARCHAR) | Show each premise type and the number of premises in that type. | <s>[INST] Given the following SQL query and context: Query: SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type Context: CREATE TABLE premises (premises_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show each premise type and the number of premises in that type. Th... |
SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category | CREATE TABLE mailshot_campaigns (product_category VARCHAR) | Show all distinct product categories along with the number of mailshots in each category. | <s>[INST] Given the following SQL query and context: Query: SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category Context: CREATE TABLE mailshot_campaigns (product_category VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all distinct product categories ... |
SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers) | CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR) | Show the name and phone of the customer without any mailshot. | <s>[INST] Given the following SQL query and context: Query: SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers) Context: CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (cus... |
SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response' | CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) | Show the name and phone for customers with a mailshot with outcome code 'No Response'. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response' Context: CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id V... |
SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code | CREATE TABLE mailshot_customers (outcome_code VARCHAR) | Show the outcome code of mailshots along with the number of mailshots in each outcome code. | <s>[INST] Given the following SQL query and context: Query: SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code Context: CREATE TABLE mailshot_customers (outcome_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the outcome code of mailshots along with the... |
SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING COUNT(*) >= 2 | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) | Show the names of customers who have at least 2 mailshots with outcome code 'Order'. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING COUNT(*) >= 2 Context: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)... |
SELECT T2.customer_name FROM mailshot_customers 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 customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) | Show the names of customers who have the most mailshots. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_name FROM mailshot_customers 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 customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mail... |
SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_cod... | CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) | What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers A... |
SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id | CREATE TABLE premises (premises_type VARCHAR, premise_id VARCHAR); CREATE TABLE customer_addresses (address_type_code VARCHAR, premise_id VARCHAR) | Show the premise type and address type code for all customer addresses. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id Context: CREATE TABLE premises (premises_type VARCHAR, premise_id VARCHAR); CREATE TABLE customer_addresses (address_type_code VARC... |
SELECT DISTINCT address_type_code FROM customer_addresses | CREATE TABLE customer_addresses (address_type_code VARCHAR) | What are the distinct address type codes for all customer addresses? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT address_type_code FROM customer_addresses Context: CREATE TABLE customer_addresses (address_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the distinct address type codes for all customer addr... |
SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid' | CREATE TABLE customer_orders (order_shipping_charges VARCHAR, customer_id VARCHAR, order_status_code VARCHAR) | Show the shipping charge and customer id for customer orders with order status Cancelled or Paid. | <s>[INST] Given the following SQL query and context: Query: SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid' Context: CREATE TABLE customer_orders (order_shipping_charges VARCHAR, customer_id VARCHAR, order_status_code VARCHAR) [/INST] B... |
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid' | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) | Show the names of customers having an order with shipping method FedEx and order status Paid. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid' Context: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE ... |
SELECT COUNT(*) FROM COURSE | CREATE TABLE COURSE (Id VARCHAR) | How many courses are there in total? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM COURSE Context: CREATE TABLE COURSE (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many courses are there in total? The answer to your question is: SELECT COUNT(*) FROM COURSE. [/s> |
SELECT COUNT(*) FROM COURSE WHERE Credits > 2 | CREATE TABLE COURSE (Credits INTEGER) | How many courses have more than 2 credits? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM COURSE WHERE Credits > 2 Context: CREATE TABLE COURSE (Credits INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many courses have more than 2 credits? The answer to your question is: SELECT COUNT(*) FROM ... |
SELECT CName FROM COURSE WHERE Credits = 1 | CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) | List all names of courses with 1 credit? | <s>[INST] Given the following SQL query and context: Query: SELECT CName FROM COURSE WHERE Credits = 1 Context: CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all names of courses with 1 credit? The answer to your question is: SELECT CNam... |
SELECT CName FROM COURSE WHERE Days = "MTW" | CREATE TABLE COURSE (CName VARCHAR, Days VARCHAR) | Which courses are taught on days MTW? | <s>[INST] Given the following SQL query and context: Query: SELECT CName FROM COURSE WHERE Days = "MTW" Context: CREATE TABLE COURSE (CName VARCHAR, Days VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which courses are taught on days MTW? The answer to your question is: SELECT CName FRO... |
SELECT COUNT(*) FROM DEPARTMENT WHERE Division = "AS" | CREATE TABLE DEPARTMENT (Division VARCHAR) | What is the number of departments in Division "AS"? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM DEPARTMENT WHERE Division = "AS" Context: CREATE TABLE DEPARTMENT (Division VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the number of departments in Division "AS"? The answer to your question is:... |
SELECT DPhone FROM DEPARTMENT WHERE Room = 268 | CREATE TABLE DEPARTMENT (DPhone VARCHAR, Room VARCHAR) | What are the phones of departments in Room 268? | <s>[INST] Given the following SQL query and context: Query: SELECT DPhone FROM DEPARTMENT WHERE Room = 268 Context: CREATE TABLE DEPARTMENT (DPhone VARCHAR, Room VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the phones of departments in Room 268? The answer to your question is... |
SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B" | CREATE TABLE ENROLLED_IN (StuID VARCHAR, Grade VARCHAR) | Find the number of students that have at least one grade "B". | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B" Context: CREATE TABLE ENROLLED_IN (StuID VARCHAR, Grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of students that have at least one grade "B"... |
SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION | CREATE TABLE GRADECONVERSION (gradepoint INTEGER) | Find the max and min grade point for all letter grade. | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION Context: CREATE TABLE GRADECONVERSION (gradepoint INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the max and min grade point for all letter grade. The answer to ... |
SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%' | CREATE TABLE STUDENT (Fname VARCHAR) | Find the first names of students whose first names contain letter "a". | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%' Context: CREATE TABLE STUDENT (Fname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of students whose first names contain letter "a". The answer to ... |
SELECT Fname, Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB" | CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, sex VARCHAR, Building VARCHAR) | Find the first names and last names of male (sex is M) faculties who live in building NEB. | <s>[INST] Given the following SQL query and context: Query: SELECT Fname, Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB" Context: CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, sex VARCHAR, Building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names and la... |
SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB" | CREATE TABLE FACULTY (Room VARCHAR, Rank VARCHAR, Building VARCHAR) | Find the rooms of faculties with rank professor who live in building NEB. | <s>[INST] Given the following SQL query and context: Query: SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB" Context: CREATE TABLE FACULTY (Room VARCHAR, Rank VARCHAR, Building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the rooms of faculties with rank pro... |
SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler" | CREATE TABLE DEPARTMENT (DName VARCHAR, Building VARCHAR) | Find the department name that is in Building "Mergenthaler". | <s>[INST] Given the following SQL query and context: Query: SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler" Context: CREATE TABLE DEPARTMENT (DName VARCHAR, Building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the department name that is in Building "Mergenthaler". ... |
SELECT * FROM COURSE ORDER BY Credits | CREATE TABLE COURSE (Credits VARCHAR) | List all information about courses sorted by credits in the ascending order. | <s>[INST] Given the following SQL query and context: Query: SELECT * FROM COURSE ORDER BY Credits Context: CREATE TABLE COURSE (Credits VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all information about courses sorted by credits in the ascending order. The answer to your question... |
SELECT CName FROM COURSE ORDER BY Credits | CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) | List the course name of courses sorted by credits. | <s>[INST] Given the following SQL query and context: Query: SELECT CName FROM COURSE ORDER BY Credits Context: CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the course name of courses sorted by credits. The answer to your question is: SE... |
SELECT Fname FROM STUDENT ORDER BY Age DESC | CREATE TABLE STUDENT (Fname VARCHAR, Age VARCHAR) | Find the first name of students in the descending order of age. | <s>[INST] Given the following SQL query and context: Query: SELECT Fname FROM STUDENT ORDER BY Age DESC Context: CREATE TABLE STUDENT (Fname VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first name of students in the descending order of age. The answer to your que... |
SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC | CREATE TABLE STUDENT (LName VARCHAR, Sex VARCHAR, Age VARCHAR) | Find the last name of female (sex is F) students in the descending order of age. | <s>[INST] Given the following SQL query and context: Query: SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC Context: CREATE TABLE STUDENT (LName VARCHAR, Sex VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the last name of female (sex is F) students in the d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.