training_input
stringlengths
118
1.06k
###context:CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) ###human: List each donator name and the amount of endowment in descending order of the amount of endowment. ###assistant: SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC
###context:CREATE TABLE endowment (school_name VARCHAR, school_id VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ###human: List the names of the schools without any endowment. ###assistant: SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment)
###context:CREATE TABLE school (school_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ###human: List all the names of schools with an endowment amount smaller than or equal to 10. ###assistant: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.schoo...
###context:CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR) ###human: Show the names of donors who donated to both school "Glenn" and "Triton." ###assistant: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_i...
###context:CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) ###human: Show the names of all the donors except those whose donation amount less than 9. ###assistant: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9
###context:CREATE TABLE endowment (amount VARCHAR, donator_name VARCHAR) ###human: List the amount and donor name for the largest amount of donation. ###assistant: SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1
###context:CREATE TABLE budget (budgeted VARCHAR, YEAR VARCHAR) ###human: How many budgets are above 3000 in year 2001 or before? ###assistant: SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001
###context:CREATE TABLE budget (budgeted VARCHAR, invested VARCHAR, school_id VARCHAR, year VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ###human: Show each school name, its budgeted amount, and invested amount in year 2002 or after. ###assistant: SELECT T2.school_name, T1.budgeted, T1...
###context:CREATE TABLE endowment (donator_name VARCHAR) ###human: Show all donor names. ###assistant: SELECT DISTINCT donator_name FROM endowment
###context:CREATE TABLE budget (budgeted INTEGER, invested VARCHAR) ###human: How many budget record has a budget amount smaller than the invested amount? ###assistant: SELECT COUNT(*) FROM budget WHERE budgeted < invested
###context:CREATE TABLE budget (budgeted INTEGER, school_id VARCHAR); CREATE TABLE school (school_id VARCHAR, school_name VARCHAR) ###human: What is the total budget amount for school "Glenn" in all years? ###assistant: SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id W...
###context:CREATE TABLE endowment (school_id VARCHAR, amount INTEGER); CREATE TABLE budget (school_id VARCHAR, budgeted INTEGER); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ###human: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. ###...
###context:CREATE TABLE school (School_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ###human: Find the names of schools that have more than one donator with donation amount above 8.5. ###assistant: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1...
###context:CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ###human: Find the number of schools that have more than one donator whose donation amount is less than 8.5. ###assistant: SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1)
###context:CREATE TABLE school (School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR); CREATE TABLE budget (school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR) ###human: List the name, IHSAA Football Class, and Mascot of the schools that h...
###context:CREATE TABLE building (Id VARCHAR) ###human: How many buildings are there? ###assistant: SELECT COUNT(*) FROM building
###context:CREATE TABLE building (name VARCHAR, street_address VARCHAR, floors VARCHAR) ###human: Show the name, street address, and number of floors for all buildings ordered by the number of floors. ###assistant: SELECT name, street_address, floors FROM building ORDER BY floors
###context:CREATE TABLE building (name VARCHAR, height_feet VARCHAR) ###human: What is the name of the tallest building? ###assistant: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1
###context:CREATE TABLE building (floors INTEGER) ###human: What are the average, maximum, and minimum number of floors for all buildings? ###assistant: SELECT AVG(floors), MAX(floors), MIN(floors) FROM building
###context:CREATE TABLE building (height_feet INTEGER, floors INTEGER) ###human: Show the number of buildings with a height above the average or a number of floors above the average. ###assistant: SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(f...
###context:CREATE TABLE building (name VARCHAR, height_feet VARCHAR, floors VARCHAR) ###human: List the names of buildings with at least 200 feet of height and with at least 20 floors. ###assistant: SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20
###context:CREATE TABLE institution (institution VARCHAR, LOCATION VARCHAR, founded VARCHAR, TYPE VARCHAR) ###human: Show the names and locations of institutions that are founded after 1990 and have the type "Private". ###assistant: SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = '...
###context:CREATE TABLE institution (TYPE VARCHAR, enrollment INTEGER) ###human: Show institution types, along with the number of institutions and total enrollment for each type. ###assistant: SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE
###context:CREATE TABLE institution (TYPE VARCHAR) ###human: Show the institution type with the largest number of institutions. ###assistant: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
###context:CREATE TABLE institution (TYPE VARCHAR, founded VARCHAR, enrollment VARCHAR) ###human: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. ###assistant: SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000
###context:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (name VARCHAR, building_id VARCHAR) ###human: Show the name of buildings that do not have any institution. ###assistant: SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)
###context:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE building (name VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded VARCHAR) ###human: Show the names of buildings except for those having an institution founded in 2003. ###assistant: SELECT name FROM building EXCEPT...
###context:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR) ###human: For each building, show the name of the building and the number of institutions in it. ###assistant: SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_i...
###context:CREATE TABLE building (name VARCHAR, height_feet VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded INTEGER) ###human: Show the names and heights of buildings with at least two institutions founded after 1880. ###assistant: SELECT T1.name, T1.height_feet FROM buildi...
###context:CREATE TABLE institution (TYPE VARCHAR) ###human: Show all the distinct institution types. ###assistant: SELECT DISTINCT TYPE FROM institution
###context:CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ###human: Show institution names along with the number of proteins for each institution. ###assistant: SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1....
###context:CREATE TABLE institution (institution_id VARCHAR, founded VARCHAR, type VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ###human: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? ###assistant: SELECT COUNT(*) FROM institution AS T1...
###context:CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (protein_name VARCHAR, institution_id VARCHAR) ###human: Show the protein name and the institution name. ###assistant: SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.in...
###context:CREATE TABLE institution (institution_id VARCHAR, building_id VARCHAR); CREATE TABLE building (building_id VARCHAR, floors VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ###human: How many proteins are associated with an institution in a building with at least 20 floors? ###assistant: SELECT...
###context:CREATE TABLE protein (institution_id VARCHAR); CREATE TABLE institution (institution_id VARCHAR) ###human: How many institutions do not have an associated protein in our record? ###assistant: SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein)
###context:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ###human: Show all the locations where no cinema has capacity over 800. ###assistant: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800
###context:CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) ###human: Show all the locations where some cinemas were opened in both year 2010 and year 2011. ###assistant: SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011
###context:CREATE TABLE cinema (Id VARCHAR) ###human: How many cinema do we have? ###assistant: SELECT COUNT(*) FROM cinema
###context:CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR, capacity VARCHAR) ###human: Show name, opening year, and capacity for each cinema. ###assistant: SELECT name, openning_year, capacity FROM cinema
###context:CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity INTEGER) ###human: Show the cinema name and location for cinemas with capacity above average. ###assistant: SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)
###context:CREATE TABLE cinema (LOCATION VARCHAR) ###human: What are all the locations with a cinema? ###assistant: SELECT DISTINCT LOCATION FROM cinema
###context:CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR) ###human: Show all the cinema names and opening years in descending order of opening year. ###assistant: SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
###context:CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity VARCHAR) ###human: What are the name and location of the cinema with the largest capacity? ###assistant: SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
###context:CREATE TABLE cinema (capacity INTEGER, openning_year VARCHAR) ###human: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later. ###assistant: SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011
###context:CREATE TABLE cinema (LOCATION VARCHAR) ###human: Show each location and the number of cinemas there. ###assistant: SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION
###context:CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) ###human: What is the location with the most cinemas opened in year 2010 or later? ###assistant: SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
###context:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ###human: Show all the locations with at least two cinemas with capacity above 300. ###assistant: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2
###context:CREATE TABLE film (title VARCHAR, directed_by VARCHAR) ###human: Show the title and director for all films. ###assistant: SELECT title, directed_by FROM film
###context:CREATE TABLE film (directed_by VARCHAR) ###human: Show all directors. ###assistant: SELECT DISTINCT directed_by FROM film
###context:CREATE TABLE film (directed_by VARCHAR) ###human: List all directors along with the number of films directed by each director. ###assistant: SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by
###context:CREATE TABLE schedule (show_times_per_day INTEGER, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR) ###human: What is total number of show times per dat for each cinema? ###assistant: SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinem...
###context:CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE schedule (price INTEGER, film_id VARCHAR) ###human: What are the title and maximum price of each film? ###assistant: SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id
###context:CREATE TABLE schedule (date VARCHAR, price VARCHAR, film_id VARCHAR, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR) ###human: Show cinema name, film title, date, and price for each record in schedule. ###assistant: SELECT ...
###context:CREATE TABLE schedule (title VARCHAR, directed_by VARCHAR, film_id VARCHAR); CREATE TABLE film (title VARCHAR, directed_by VARCHAR, film_id VARCHAR) ###human: What are the title and director of the films without any schedule? ###assistant: SELECT title, directed_by FROM film WHERE NOT film_id IN (SEL...
###context:CREATE TABLE schedule (film_id VARCHAR, show_times_per_day INTEGER); CREATE TABLE film (directed_by VARCHAR, film_id VARCHAR) ###human: Show director with the largest number of show times in total. ###assistant: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROU...
###context:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ###human: Find the locations that have more than one movie theater with capacity above 300. ###assistant: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1
###context:CREATE TABLE film (title VARCHAR) ###human: How many films have the word 'Dummy' in their titles? ###assistant: SELECT COUNT(*) FROM film WHERE title LIKE "%Dummy%"
###context:CREATE TABLE discount_coupons (coupon_id VARCHAR, coupon_amount VARCHAR); CREATE TABLE customers (good_or_bad_customer VARCHAR, coupon_id VARCHAR) ###human: Are the customers holding coupons with amount 500 bad or good? ###assistant: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_c...
###context:CREATE TABLE bookings (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR) ###human: How many bookings did each customer make? List the customer id, first name, and the count. ###assistant: SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN boo...
###context:CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER) ###human: What is the maximum total amount paid by a customer? List the customer id and amount. ###assistant: SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1
###context:CREATE TABLE Payments (booking_id VARCHAR); CREATE TABLE Bookings (booking_id VARCHAR, amount_of_refund VARCHAR) ###human: What are the id and the amount of refund of the booking that incurred the most times of payments? ###assistant: SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN...
###context:CREATE TABLE products_booked (product_id VARCHAR) ###human: What is the id of the product that is booked for 3 times? ###assistant: SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3
###context:CREATE TABLE products_for_hire (product_description VARCHAR, product_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booked_amount VARCHAR) ###human: What is the product description of the product booked with an amount of 102.76? ###assistant: SELECT T2.product_description FROM product...
###context:CREATE TABLE bookings (booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booking_id VARCHAR); CREATE TABLE Products_for_hire (product_id VARCHAR, product_name VARCHAR) ###human: What are the start date and end date of the booking ...
###context:CREATE TABLE view_product_availability (product_id VARCHAR, available_yn VARCHAR); CREATE TABLE products_for_hire (product_name VARCHAR, product_id VARCHAR) ###human: What are the names of products whose availability equals to 1? ###assistant: SELECT T2.product_name FROM view_product_availability AS ...
###context:CREATE TABLE products_for_hire (product_type_code VARCHAR) ###human: How many different product types are there? ###assistant: SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire
###context:CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, good_or_bad_customer VARCHAR) ###human: What are the first name, last name, and gender of all the good customers? Order by their last name. ###assistant: SELECT first_name, last_name, gender_mf FROM customers WHERE good...
###context:CREATE TABLE payments (amount_due INTEGER) ###human: What is the average amount due for all the payments? ###assistant: SELECT AVG(amount_due) FROM payments
###context:CREATE TABLE products_booked (booked_count INTEGER) ###human: What are the maximum, minimum, and average booked count for the products booked? ###assistant: SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked
###context:CREATE TABLE payments (payment_type_code VARCHAR) ###human: What are all the distinct payment types? ###assistant: SELECT DISTINCT payment_type_code FROM payments
###context:CREATE TABLE Products_for_hire (daily_hire_cost VARCHAR, product_name VARCHAR) ###human: What are the daily hire costs for the products with substring 'Book' in its name? ###assistant: SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'
###context:CREATE TABLE products_booked (product_id VARCHAR, booked_amount INTEGER); CREATE TABLE Products_for_hire (product_id VARCHAR, booked_amount INTEGER) ###human: How many products are never booked with amount higher than 200? ###assistant: SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (...
###context:CREATE TABLE Discount_Coupons (coupon_amount VARCHAR, coupon_id VARCHAR); CREATE TABLE customers (coupon_id VARCHAR, good_or_bad_customer VARCHAR) ###human: What are the coupon amount of the coupons owned by both good and bad customers? ###assistant: SELECT T1.coupon_amount FROM Discount_Coupons AS T...
###context:CREATE TABLE payments (payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR) ###human: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' ###assistant: SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code...
###context:CREATE TABLE products_for_hire (product_name VARCHAR, product_description VARCHAR, product_type_code VARCHAR, daily_hire_cost VARCHAR) ###human: What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? ###assistant: SELECT product_name, pr...
###context:CREATE TABLE phone (Id VARCHAR) ###human: How many phones are there? ###assistant: SELECT COUNT(*) FROM phone
###context:CREATE TABLE phone (Name VARCHAR, Price VARCHAR) ###human: List the names of phones in ascending order of price. ###assistant: SELECT Name FROM phone ORDER BY Price
###context:CREATE TABLE phone (Memory_in_G VARCHAR, Carrier VARCHAR) ###human: What are the memories and carriers of phones? ###assistant: SELECT Memory_in_G, Carrier FROM phone
###context:CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) ###human: List the distinct carriers of phones with memories bigger than 32. ###assistant: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
###context:CREATE TABLE phone (Name VARCHAR, Carrier VARCHAR) ###human: Show the names of phones with carrier either "Sprint" or "TMobile". ###assistant: SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile"
###context:CREATE TABLE phone (Carrier VARCHAR, Price VARCHAR) ###human: What is the carrier of the most expensive phone? ###assistant: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
###context:CREATE TABLE phone (Carrier VARCHAR) ###human: Show different carriers of phones together with the number of phones with each carrier. ###assistant: SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier
###context:CREATE TABLE phone (Carrier VARCHAR) ###human: Show the most frequently used carrier of the phones. ###assistant: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
###context:CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) ###human: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. ###assistant: SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64
###context:CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE market (District VARCHAR, Market_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ###human: Show the names of phones and the districts of markets they are on. ###assistant: SELECT T3.Name, T2.District FROM p...
###context:CREATE TABLE market (District VARCHAR, Market_ID VARCHAR, Ranking VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ###human: Show the names of phones and the districts of markets they are on, in ascending order of the ranking o...
###context:CREATE TABLE market (Market_ID VARCHAR, Num_of_shops INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ###human: Show the names of phones that are on market with number of shops greater than 50. ###assistant: SELECT T3.Name ...
###context:CREATE TABLE phone_market (Num_of_stock INTEGER, Phone_ID VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) ###human: For each phone, show its names and total number of stocks. ###assistant: SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2....
###context:CREATE TABLE phone_market (Phone_ID VARCHAR, Num_of_stock INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) ###human: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. ###assistant: SELECT T2.Name FROM phone_mark...
###context:CREATE TABLE phone (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR) ###human: List the names of phones that are not on any market. ###assistant: SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_mar...
###context:CREATE TABLE company (Id VARCHAR) ###human: How many gas companies are there? ###assistant: SELECT COUNT(*) FROM company
###context:CREATE TABLE company (company VARCHAR, rank VARCHAR, Sales_billion VARCHAR) ###human: List the company name and rank for all companies in the decreasing order of their sales. ###assistant: SELECT company, rank FROM company ORDER BY Sales_billion DESC
###context:CREATE TABLE company (company VARCHAR, main_industry VARCHAR, headquarters VARCHAR) ###human: Show the company name and the main industry for all companies whose headquarters are not from USA. ###assistant: SELECT company, main_industry FROM company WHERE headquarters <> 'USA'
###context:CREATE TABLE company (company VARCHAR, headquarters VARCHAR, market_value VARCHAR) ###human: Show all company names and headquarters in the descending order of market value. ###assistant: SELECT company, headquarters FROM company ORDER BY market_value DESC
###context:CREATE TABLE company (market_value INTEGER) ###human: Show minimum, maximum, and average market value for all companies. ###assistant: SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company
###context:CREATE TABLE company (main_industry VARCHAR) ###human: Show all main industry for all companies. ###assistant: SELECT DISTINCT main_industry FROM company
###context:CREATE TABLE company (headquarters VARCHAR) ###human: List all headquarters and the number of companies in each headquarter. ###assistant: SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
###context:CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) ###human: Show all main industry and total market value in each industry. ###assistant: SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry
###context:CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) ###human: List the main industry with highest total market value and its number of companies. ###assistant: SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1
###context:CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) ###human: Show headquarters with at least two companies in the banking industry. ###assistant: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2