Unnamed: 0
int64
0
60k
text
stringlengths
109
1.06k
2,600
<question>: Find all the name of documents without any sections. <context>: CREATE TABLE document_sections (document_name VARCHAR, document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) <answer>: SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections)
2,601
<question>: List all the username and passwords of users with the most popular role. <context>: CREATE TABLE users (user_name VARCHAR, password VARCHAR, role_code VARCHAR) <answer>: SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
2,602
<question>: Find the average access counts of documents with functional area "Acknowledgement". <context>: 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) <answer>: 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"
2,603
<question>: Find names of the document without any images. <context>: 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) <answer>: 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
2,604
<question>: What is the name of the document with the most number of sections? <context>: CREATE TABLE document_sections (document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) <answer>: 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
2,605
<question>: List all the document names which contains "CV". <context>: CREATE TABLE documents (document_name VARCHAR) <answer>: SELECT document_name FROM documents WHERE document_name LIKE "%CV%"
2,606
<question>: How many users are logged in? <context>: CREATE TABLE users (user_login VARCHAR) <answer>: SELECT COUNT(*) FROM users WHERE user_login = 1
2,607
<question>: Find the description of the most popular role among the users that have logged in. <context>: CREATE TABLE users (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR); CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR) <answer>: 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)
2,608
<question>: Find the average access count of documents with the least popular structure. <context>: CREATE TABLE documents (access_count INTEGER, document_structure_code VARCHAR) <answer>: SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1
2,609
<question>: List all the image name and URLs in the order of their names. <context>: CREATE TABLE images (image_name VARCHAR, image_url VARCHAR) <answer>: SELECT image_name, image_url FROM images ORDER BY image_name
2,610
<question>: Find the number of users in each role. <context>: CREATE TABLE users (role_code VARCHAR) <answer>: SELECT COUNT(*), role_code FROM users GROUP BY role_code
2,611
<question>: What document types have more than 2 corresponding documents? <context>: CREATE TABLE documents (document_type_code VARCHAR) <answer>: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2
2,612
<question>: How many companies are there? <context>: CREATE TABLE Companies (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Companies
2,613
<question>: List the names of companies in descending order of market value. <context>: CREATE TABLE Companies (name VARCHAR, Market_Value_billion VARCHAR) <answer>: SELECT name FROM Companies ORDER BY Market_Value_billion DESC
2,614
<question>: What are the names of companies whose headquarters are not "USA"? <context>: CREATE TABLE Companies (name VARCHAR, Headquarters VARCHAR) <answer>: SELECT name FROM Companies WHERE Headquarters <> 'USA'
2,615
<question>: What are the name and assets of each company, sorted in ascending order of company name? <context>: CREATE TABLE Companies (name VARCHAR, Assets_billion VARCHAR) <answer>: SELECT name, Assets_billion FROM Companies ORDER BY name
2,616
<question>: What are the average profits of companies? <context>: CREATE TABLE Companies (Profits_billion INTEGER) <answer>: SELECT AVG(Profits_billion) FROM Companies
2,617
<question>: What are the maximum and minimum sales of the companies whose industries are not "Banking". <context>: CREATE TABLE Companies (Sales_billion INTEGER, Industry VARCHAR) <answer>: SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> "Banking"
2,618
<question>: How many different industries are the companies in? <context>: CREATE TABLE Companies (Industry VARCHAR) <answer>: SELECT COUNT(DISTINCT Industry) FROM Companies
2,619
<question>: List the names of buildings in descending order of building height. <context>: CREATE TABLE buildings (name VARCHAR, Height VARCHAR) <answer>: SELECT name FROM buildings ORDER BY Height DESC
2,620
<question>: Find the stories of the building with the largest height. <context>: CREATE TABLE buildings (Stories VARCHAR, Height VARCHAR) <answer>: SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1
2,621
<question>: List the name of a building along with the name of a company whose office is in the building. <context>: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR); CREATE TABLE Companies (name VARCHAR, id VARCHAR) <answer>: 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
2,622
<question>: Show the names of the buildings that have more than one company offices. <context>: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) <answer>: 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
2,623
<question>: Show the name of the building that has the most company offices. <context>: CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) <answer>: 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
2,624
<question>: Please show the names of the buildings whose status is "on-hold", in ascending order of stories. <context>: CREATE TABLE buildings (name VARCHAR, Status VARCHAR, Stories VARCHAR) <answer>: SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories
2,625
<question>: Please show each industry and the corresponding number of companies in that industry. <context>: CREATE TABLE Companies (Industry VARCHAR) <answer>: SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry
2,626
<question>: Please show the industries of companies in descending order of the number of companies. <context>: CREATE TABLE Companies (Industry VARCHAR) <answer>: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
2,627
<question>: List the industry shared by the most companies. <context>: CREATE TABLE Companies (Industry VARCHAR) <answer>: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1
2,628
<question>: List the names of buildings that have no company office. <context>: CREATE TABLE buildings (name VARCHAR, id VARCHAR, building_id VARCHAR); CREATE TABLE Office_locations (name VARCHAR, id VARCHAR, building_id VARCHAR) <answer>: SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations)
2,629
<question>: Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China". <context>: CREATE TABLE Companies (Industry VARCHAR, Headquarters VARCHAR) <answer>: SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China"
2,630
<question>: Find the number of companies whose industry is "Banking" or "Conglomerate", <context>: CREATE TABLE Companies (Industry VARCHAR) <answer>: SELECT COUNT(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate"
2,631
<question>: Show the headquarters shared by more than two companies. <context>: CREATE TABLE Companies (Headquarters VARCHAR) <answer>: SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2
2,632
<question>: How many products are there? <context>: CREATE TABLE Products (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Products
2,633
<question>: List the name of products in ascending order of price. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) <answer>: SELECT Product_Name FROM Products ORDER BY Product_Price
2,634
<question>: What are the names and type codes of products? <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_Type_Code VARCHAR) <answer>: SELECT Product_Name, Product_Type_Code FROM Products
2,635
<question>: Show the prices of the products named "Dining" or "Trading Policy". <context>: CREATE TABLE Products (Product_Price VARCHAR, Product_Name VARCHAR) <answer>: SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy"
2,636
<question>: What is the average price for products? <context>: CREATE TABLE Products (Product_Price INTEGER) <answer>: SELECT AVG(Product_Price) FROM Products
2,637
<question>: What is the name of the product with the highest price? <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) <answer>: SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1
2,638
<question>: Show different type codes of products and the number of products with each type code. <context>: CREATE TABLE Products (Product_Type_Code VARCHAR) <answer>: SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code
2,639
<question>: Show the most common type code across products. <context>: CREATE TABLE Products (Product_Type_Code VARCHAR) <answer>: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
2,640
<question>: Show the product type codes that have at least two products. <context>: CREATE TABLE Products (Product_Type_Code VARCHAR) <answer>: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2
2,641
<question>: Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000. <context>: CREATE TABLE Products (Product_Type_Code VARCHAR, Product_Price INTEGER) <answer>: SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000
2,642
<question>: Show the names of products and the number of events they are in. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) <answer>: 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
2,643
<question>: Show the names of products and the number of events they are in, sorted by the number of events in descending order. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) <answer>: 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
2,644
<question>: Show the names of products that are in at least two events. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) <answer>: 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
2,645
<question>: Show the names of products that are in at least two events in ascending alphabetical order of product name. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) <answer>: 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
2,646
<question>: List the names of products that are not in any event. <context>: CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_Name VARCHAR, Product_ID VARCHAR) <answer>: SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events)
2,647
<question>: How many artworks are there? <context>: CREATE TABLE artwork (Id VARCHAR) <answer>: SELECT COUNT(*) FROM artwork
2,648
<question>: List the name of artworks in ascending alphabetical order. <context>: CREATE TABLE artwork (Name VARCHAR) <answer>: SELECT Name FROM artwork ORDER BY Name
2,649
<question>: List the name of artworks whose type is not "Program Talent Show". <context>: CREATE TABLE artwork (Name VARCHAR, TYPE VARCHAR) <answer>: SELECT Name FROM artwork WHERE TYPE <> "Program Talent Show"
2,650
<question>: What are the names and locations of festivals? <context>: CREATE TABLE festival_detail (Festival_Name VARCHAR, LOCATION VARCHAR) <answer>: SELECT Festival_Name, LOCATION FROM festival_detail
2,651
<question>: What are the names of the chairs of festivals, sorted in ascending order of the year held? <context>: CREATE TABLE festival_detail (Chair_Name VARCHAR, YEAR VARCHAR) <answer>: SELECT Chair_Name FROM festival_detail ORDER BY YEAR
2,652
<question>: What is the location of the festival with the largest number of audience? <context>: CREATE TABLE festival_detail (LOCATION VARCHAR, Num_of_Audience VARCHAR) <answer>: SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1
2,653
<question>: What are the names of festivals held in year 2007? <context>: CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) <answer>: SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007
2,654
<question>: What is the average number of audience for festivals? <context>: CREATE TABLE festival_detail (Num_of_Audience INTEGER) <answer>: SELECT AVG(Num_of_Audience) FROM festival_detail
2,655
<question>: Show the names of the three most recent festivals. <context>: CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) <answer>: SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3
2,656
<question>: For each nomination, show the name of the artwork and name of the festival where it is nominated. <context>: 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) <answer>: 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
2,657
<question>: Show distinct types of artworks that are nominated in festivals in 2007. <context>: 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) <answer>: 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
2,658
<question>: Show the names of artworks in ascending order of the year they are nominated in. <context>: 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) <answer>: 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
2,659
<question>: Show the names of festivals that have nominated artworks of type "Program Talent Show". <context>: 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) <answer>: 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"
2,660
<question>: Show the ids and names of festivals that have at least two nominations for artworks. <context>: 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) <answer>: 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
2,661
<question>: Show the id, name of each festival and the number of artworks it has nominated. <context>: 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) <answer>: 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
2,662
<question>: Please show different types of artworks with the corresponding number of artworks of each type. <context>: CREATE TABLE artwork (TYPE VARCHAR) <answer>: SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE
2,663
<question>: List the most common type of artworks. <context>: CREATE TABLE artwork (TYPE VARCHAR) <answer>: SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
2,664
<question>: List the year in which there are more than one festivals. <context>: CREATE TABLE festival_detail (YEAR VARCHAR) <answer>: SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1
2,665
<question>: List the name of artworks that are not nominated. <context>: CREATE TABLE nomination (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE Artwork (Name VARCHAR, Artwork_ID VARCHAR) <answer>: SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination)
2,666
<question>: Show the number of audience in year 2008 or 2010. <context>: CREATE TABLE festival_detail (Num_of_Audience VARCHAR, YEAR VARCHAR) <answer>: SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010
2,667
<question>: What are the total number of the audiences who visited any of the festivals? <context>: CREATE TABLE festival_detail (Num_of_Audience INTEGER) <answer>: SELECT SUM(Num_of_Audience) FROM festival_detail
2,668
<question>: In which year are there festivals both inside the 'United States' and outside the 'United States'? <context>: CREATE TABLE festival_detail (YEAR VARCHAR, LOCATION VARCHAR) <answer>: SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States'
2,669
<question>: How many premises are there? <context>: CREATE TABLE premises (Id VARCHAR) <answer>: SELECT COUNT(*) FROM premises
2,670
<question>: What are all the distinct premise types? <context>: CREATE TABLE premises (premises_type VARCHAR) <answer>: SELECT DISTINCT premises_type FROM premises
2,671
<question>: Find the types and details for all premises and order by the premise type. <context>: CREATE TABLE premises (premises_type VARCHAR, premise_details VARCHAR) <answer>: SELECT premises_type, premise_details FROM premises ORDER BY premises_type
2,672
<question>: Show each premise type and the number of premises in that type. <context>: CREATE TABLE premises (premises_type VARCHAR) <answer>: SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type
2,673
<question>: Show all distinct product categories along with the number of mailshots in each category. <context>: CREATE TABLE mailshot_campaigns (product_category VARCHAR) <answer>: SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category
2,674
<question>: Show the name and phone of the customer without any mailshot. <context>: 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) <answer>: SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers)
2,675
<question>: Show the name and phone for customers with a mailshot with outcome code 'No Response'. <context>: CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) <answer>: 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'
2,676
<question>: Show the outcome code of mailshots along with the number of mailshots in each outcome code. <context>: CREATE TABLE mailshot_customers (outcome_code VARCHAR) <answer>: SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code
2,677
<question>: Show the names of customers who have at least 2 mailshots with outcome code 'Order'. <context>: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) <answer>: 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
2,678
<question>: Show the names of customers who have the most mailshots. <context>: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) <answer>: 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
2,679
<question>: What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome. <context>: CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) <answer>: 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_code = 'No Response'
2,680
<question>: Show the premise type and address type code for all customer addresses. <context>: CREATE TABLE premises (premises_type VARCHAR, premise_id VARCHAR); CREATE TABLE customer_addresses (address_type_code VARCHAR, premise_id VARCHAR) <answer>: SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id
2,681
<question>: What are the distinct address type codes for all customer addresses? <context>: CREATE TABLE customer_addresses (address_type_code VARCHAR) <answer>: SELECT DISTINCT address_type_code FROM customer_addresses
2,682
<question>: Show the shipping charge and customer id for customer orders with order status Cancelled or Paid. <context>: CREATE TABLE customer_orders (order_shipping_charges VARCHAR, customer_id VARCHAR, order_status_code VARCHAR) <answer>: SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'
2,683
<question>: Show the names of customers having an order with shipping method FedEx and order status Paid. <context>: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) <answer>: 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'
2,684
<question>: How many courses are there in total? <context>: CREATE TABLE COURSE (Id VARCHAR) <answer>: SELECT COUNT(*) FROM COURSE
2,685
<question>: How many courses have more than 2 credits? <context>: CREATE TABLE COURSE (Credits INTEGER) <answer>: SELECT COUNT(*) FROM COURSE WHERE Credits > 2
2,686
<question>: List all names of courses with 1 credit? <context>: CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) <answer>: SELECT CName FROM COURSE WHERE Credits = 1
2,687
<question>: Which courses are taught on days MTW? <context>: CREATE TABLE COURSE (CName VARCHAR, Days VARCHAR) <answer>: SELECT CName FROM COURSE WHERE Days = "MTW"
2,688
<question>: What is the number of departments in Division "AS"? <context>: CREATE TABLE DEPARTMENT (Division VARCHAR) <answer>: SELECT COUNT(*) FROM DEPARTMENT WHERE Division = "AS"
2,689
<question>: What are the phones of departments in Room 268? <context>: CREATE TABLE DEPARTMENT (DPhone VARCHAR, Room VARCHAR) <answer>: SELECT DPhone FROM DEPARTMENT WHERE Room = 268
2,690
<question>: Find the number of students that have at least one grade "B". <context>: CREATE TABLE ENROLLED_IN (StuID VARCHAR, Grade VARCHAR) <answer>: SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B"
2,691
<question>: Find the max and min grade point for all letter grade. <context>: CREATE TABLE GRADECONVERSION (gradepoint INTEGER) <answer>: SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION
2,692
<question>: Find the first names of students whose first names contain letter "a". <context>: CREATE TABLE STUDENT (Fname VARCHAR) <answer>: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'
2,693
<question>: Find the first names and last names of male (sex is M) faculties who live in building NEB. <context>: CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, sex VARCHAR, Building VARCHAR) <answer>: SELECT Fname, Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB"
2,694
<question>: Find the rooms of faculties with rank professor who live in building NEB. <context>: CREATE TABLE FACULTY (Room VARCHAR, Rank VARCHAR, Building VARCHAR) <answer>: SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB"
2,695
<question>: Find the department name that is in Building "Mergenthaler". <context>: CREATE TABLE DEPARTMENT (DName VARCHAR, Building VARCHAR) <answer>: SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler"
2,696
<question>: List all information about courses sorted by credits in the ascending order. <context>: CREATE TABLE COURSE (Credits VARCHAR) <answer>: SELECT * FROM COURSE ORDER BY Credits
2,697
<question>: List the course name of courses sorted by credits. <context>: CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) <answer>: SELECT CName FROM COURSE ORDER BY Credits
2,698
<question>: Find the first name of students in the descending order of age. <context>: CREATE TABLE STUDENT (Fname VARCHAR, Age VARCHAR) <answer>: SELECT Fname FROM STUDENT ORDER BY Age DESC
2,699
<question>: Find the last name of female (sex is F) students in the descending order of age. <context>: CREATE TABLE STUDENT (LName VARCHAR, Sex VARCHAR, Age VARCHAR) <answer>: SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC