Dataset Viewer
Auto-converted to Parquet Duplicate
context
stringlengths
199
773
question
stringlengths
72
293
answer
stringlengths
32
611
original_question
stringlengths
4
225
query
stringlengths
19
598
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Instruments ( Instrument );
Write a SQL query to answer the following question: What is the most used instrument? <|sql answer|>
SELECT Instrument FROM Instruments WHERE Instrument IS NOT NULL GROUP BY Instrument ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
What is the most used instrument?
SELECT Instrument FROM Instruments WHERE Instrument IS NOT NULL GROUP BY Instrument ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Campuses ( Campus, County, Franc, Location );
Write a SQL query to answer the following question: What is the total number of campuses? <|sql answer|>
SELECT COUNT(*) AS num_campuses FROM Campuses;<|endoftext|>
What is the total number of campuses?
SELECT COUNT(*) AS num_campuses FROM Campuses;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE highlow ( highest_elevation, highest_point, lowest_elevation, lowest_point, state_name ); CREATE TABLE river ( LENGTH, country_name, illino, river_name, traverse );
Write a SQL query to answer the following question: what is the longest river in the state with the highest point? <|sql answer|>
SELECT T1.river_name FROM highlow AS T2 JOIN river AS T1 ON T1.traverse = T2.state_name WHERE T2.highest_elevation = (SELECT MAX(highest_elevation) FROM highlow) ORDER BY T1.LENGTH DESC NULLS LAST LIMIT 1;<|endoftext|>
what is the longest river in the state with the highest point?
SELECT T1.river_name FROM highlow AS T2 JOIN river AS T1 ON T1.traverse = T2.state_name WHERE T2.highest_elevation = (SELECT MAX(highest_elevation) FROM highlow) ORDER BY T1.LENGTH DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE entrepreneur ( Company, Investor, Money_Requested ); CREATE TABLE people ( Age, Birth_Date, Birth_Place, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more );
Write a SQL query to answer the following question: What is the name of the entrepreneur with the greatest weight? <|sql answer|>
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC NULLS LAST LIMIT 1;<|endoftext|>
What is the name of the entrepreneur with the greatest weight?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Club ( ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn );
Write a SQL query to answer the following question: What is the description of the club "Pen and Paper Gaming"? <|sql answer|>
SELECT ClubDesc FROM Club WHERE ClubName = 'Pen and Paper Gaming';<|endoftext|>
What is the description of the club "Pen and Paper Gaming"?
SELECT ClubDesc FROM Club WHERE ClubName = 'Pen and Paper Gaming';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Products ( Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more ); CREATE TABLE Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure ); CREATE TABLE Ref_Colors ( color_description );
Write a SQL query to answer the following question: What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'? <|sql answer|>
SELECT T1.product_name FROM Products AS T1 JOIN Ref_Product_Categories AS T2 ON T1.product_category_code = T2.product_category_code JOIN Ref_Colors AS T3 ON T1.color_code = T3.color_code WHERE T3.color_description = 'white' AND T2.unit_of_measure != 'Handful';<|endoftext|>
What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?
SELECT T1.product_name FROM Products AS T1 JOIN Ref_Product_Categories AS T2 ON T1.product_category_code = T2.product_category_code JOIN Ref_Colors AS T3 ON T1.color_code = T3.color_code WHERE T3.color_description = 'white' AND T2.unit_of_measure != 'Handful';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE venue ( venueId, venueName ); CREATE TABLE paper ( For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year );
Write a SQL query to answer the following question: how many papers appeared at nature communications last year? <|sql answer|>
SELECT DISTINCT COUNT(T1.paperId) AS num_papers FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'nature communications';<|endoftext|>
how many papers appeared at nature communications last year?
SELECT DISTINCT COUNT(T1.paperId) AS num_papers FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'nature communications';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE PersonFriend ( friend, name );
Write a SQL query to answer the following question: What are the names of everybody who has exactly one friend? <|sql answer|>
SELECT name FROM PersonFriend WHERE name IS NOT NULL GROUP BY name HAVING COUNT(*) = 1;<|endoftext|>
What are the names of everybody who has exactly one friend?
SELECT name FROM PersonFriend WHERE name IS NOT NULL GROUP BY name HAVING COUNT(*) = 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE airports ( AirportCode, AirportName, Argent, City, Country, city, country, elevation, name ); CREATE TABLE routes ( ... );
Write a SQL query to answer the following question: What is the number of routes that end at John F Kennedy International Airport? <|sql answer|>
SELECT COUNT(*) AS num_routes FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport';<|endoftext|>
What is the number of routes that end at John F Kennedy International Airport?
SELECT COUNT(*) AS num_routes FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE company ( Bank, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more );
Write a SQL query to answer the following question: List all headquarters and the number of companies in each headquarter.? <|sql answer|>
SELECT Headquarters, COUNT(*) AS num_companies FROM company GROUP BY Headquarters;<|endoftext|>
List all headquarters and the number of companies in each headquarter.?
SELECT Headquarters, COUNT(*) AS num_companies FROM company GROUP BY Headquarters;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE director ( Afghan, name, nationality ); CREATE TABLE directed_by ( ... ); CREATE TABLE movie ( Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title ); CREATE TABLE made_by ( ... ); CREATE TABLE producer ( ... );
Write a SQL query to answer the following question: Which producer has worked with the most number of directors ? <|sql answer|>
SELECT T1.name FROM director AS T3 JOIN directed_by AS T2 ON T3.did = T2.did JOIN movie AS T4 ON T4.mid = T2.msid JOIN made_by AS T5 ON T4.mid = T5.msid JOIN producer AS T1 ON T1.pid = T5.pid GROUP BY T1.name ORDER BY COUNT(DISTINCT T3.name) DESC NULLS LAST LIMIT 1;<|endoftext|>
Which producer has worked with the most number of directors ?
SELECT T1.name FROM director AS T3 JOIN directed_by AS T2 ON T3.did = T2.did JOIN movie AS T4 ON T4.mid = T2.msid JOIN made_by AS T5 ON T4.mid = T5.msid JOIN producer AS T1 ON T1.pid = T5.pid GROUP BY T1.name ORDER BY COUNT(DISTINCT T3.name) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE paperDataset ( ... ); CREATE TABLE dataset ( ... ); CREATE TABLE paper ( For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year );
Write a SQL query to answer the following question: How many papers written on ImageNet ? <|sql answer|>
SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers FROM paperDataset AS T2 JOIN dataset AS T1 ON T2.datasetId = T1.datasetId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.datasetName LIKE 'ImageNet';<|endoftext|>
How many papers written on ImageNet ?
SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers FROM paperDataset AS T2 JOIN dataset AS T1 ON T2.datasetId = T1.datasetId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.datasetName LIKE 'ImageNet';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Students ( cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more );
Write a SQL query to answer the following question: What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"? <|sql answer|>
SELECT date_of_latest_logon FROM Students WHERE family_name = 'Jaskolski' OR family_name = 'Langosh';<|endoftext|>
What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?
SELECT date_of_latest_logon FROM Students WHERE family_name = 'Jaskolski' OR family_name = 'Langosh';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Part_Faults ( ... ); CREATE TABLE Skills_Required_To_Fix ( ... ); CREATE TABLE Skills ( ... );
Write a SQL query to answer the following question: For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.? <|sql answer|>
SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id;<|endoftext|>
For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.?
SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE highlow ( highest_elevation, highest_point, lowest_elevation, lowest_point, state_name ); CREATE TABLE border_info ( T1, border, state_name );
Write a SQL query to answer the following question: which state has the lowest point that borders idaho? <|sql answer|>
SELECT state_name FROM highlow WHERE lowest_elevation = (SELECT MIN(lowest_elevation) FROM highlow WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'idaho')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'idaho');<|endoftext|>
which state has the lowest point that borders idaho?
SELECT state_name FROM highlow WHERE lowest_elevation = (SELECT MIN(lowest_elevation) FROM highlow WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'idaho')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'idaho');
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE country ( Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, Name, Official_native_language, ... (4 more );
Write a SQL query to answer the following question: How many different forms of governments are there in Africa? <|sql answer|>
SELECT COUNT(DISTINCT GovernmentForm) AS num_governments FROM country WHERE Continent = 'Africa';<|endoftext|>
How many different forms of governments are there in Africa?
SELECT COUNT(DISTINCT GovernmentForm) AS num_governments FROM country WHERE Continent = 'Africa';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE match_ ( Competition, Date, Match_ID, Venue );
Write a SQL query to answer the following question: Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"? <|sql answer|>
SELECT Match_ID FROM match_ WHERE Competition = '1994 FIFA World Cup qualification';<|endoftext|>
Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
SELECT Match_ID FROM match_ WHERE Competition = '1994 FIFA World Cup qualification';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE genre ( g_name, rating ); CREATE TABLE classification ( ... ); CREATE TABLE movie ( Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title );
Write a SQL query to answer the following question: What is the genre of the movie " Jurassic Park " ? <|sql answer|>
SELECT T2.genre FROM genre AS T2 JOIN classification AS T1 ON T2.gid = T1.gid JOIN movie AS T3 ON T3.mid = T1.msid WHERE T3.title = 'Jurassic Park';<|endoftext|>
What is the genre of the movie " Jurassic Park " ?
SELECT T2.genre FROM genre AS T2 JOIN classification AS T1 ON T2.gid = T1.gid JOIN movie AS T3 ON T3.mid = T1.msid WHERE T3.title = 'Jurassic Park';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Professionals ( Wiscons, cell_number, city, email_address, home_phone, role_code, state, street );
Write a SQL query to answer the following question: Find the role, street, city and state of the professionals living in a city that contains the substring 'West'.? <|sql answer|>
SELECT role_code, street, city, state FROM Professionals WHERE city LIKE '%West%';<|endoftext|>
Find the role, street, city and state of the professionals living in a city that contains the substring 'West'.?
SELECT role_code, street, city, state FROM Professionals WHERE city LIKE '%West%';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Department ( Building, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2 );
Write a SQL query to answer the following question: Find the names of departments that are either in division AS or in division EN and in Building NEB.? <|sql answer|>
SELECT DISTINCT DName FROM (SELECT DName FROM Department WHERE Division = 'AS' UNION ALL SELECT DName FROM Department WHERE Division = 'EN' AND Building = 'NEB');<|endoftext|>
Find the names of departments that are either in division AS or in division EN and in Building NEB.?
SELECT DISTINCT DName FROM (SELECT DName FROM Department WHERE Division = 'AS' UNION ALL SELECT DName FROM Department WHERE Division = 'EN' AND Building = 'NEB');
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Student ( Advisor, Age, Fname, L, LName, Major, Sex, StuID, city_code, oldest_age );
Write a SQL query to answer the following question: What is the first and last name of all students who are younger than average? <|sql answer|>
SELECT Fname, LName FROM Student WHERE Age < (SELECT AVG(Age) FROM Student);<|endoftext|>
What is the first and last name of all students who are younger than average?
SELECT Fname, LName FROM Student WHERE Age < (SELECT AVG(Age) FROM Student);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE device ( Carrier, Software_Platform );
Write a SQL query to answer the following question: What are the different software platforms for devices, and how many devices have each? <|sql answer|>
SELECT Software_Platform, COUNT(*) AS num_devices FROM device GROUP BY Software_Platform;<|endoftext|>
What are the different software platforms for devices, and how many devices have each?
SELECT Software_Platform, COUNT(*) AS num_devices FROM device GROUP BY Software_Platform;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE phone ( Accreditation_level, Accreditation_type, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode );
Write a SQL query to answer the following question: List the name of the company that produced more than one phone model.? <|sql answer|>
SELECT Company_name FROM phone WHERE Company_name IS NOT NULL GROUP BY Company_name HAVING COUNT(*) > 1;<|endoftext|>
List the name of the company that produced more than one phone model.?
SELECT Company_name FROM phone WHERE Company_name IS NOT NULL GROUP BY Company_name HAVING COUNT(*) > 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Projects ( Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details ); CREATE TABLE AssignedTo ( Scientist );
Write a SQL query to answer the following question: What are the names of projects that have not been assigned? <|sql answer|>
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo);<|endoftext|>
What are the names of projects that have not been assigned?
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE race ( Class, Date, Name );
Write a SQL query to answer the following question: How many races are there? <|sql answer|>
SELECT COUNT(*) AS num_races FROM race;<|endoftext|>
How many races are there?
SELECT COUNT(*) AS num_races FROM race;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE writes ( ... ); CREATE TABLE author ( ... );
Write a SQL query to answer the following question: How many papers does Christopher D. Manning have ? <|sql answer|>
SELECT DISTINCT COUNT(DISTINCT T2.paperId) AS num_papers FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Christopher D. Manning';<|endoftext|>
How many papers does Christopher D. Manning have ?
SELECT DISTINCT COUNT(DISTINCT T2.paperId) AS num_papers FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Christopher D. Manning';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE city ( City, District, GDP, Name, Official_Name, Population, Regional_Population, Status, T1, ... (10 more ); CREATE TABLE farm_competition ( Hosts, Theme, Year );
Write a SQL query to answer the following question: What is the status of the city that has hosted the most competitions? <|sql answer|>
SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID, T1.Status ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
What is the status of the city that has hosted the most competitions?
SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID, T1.Status ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE degrees ( Campus, Degrees, Year );
Write a SQL query to answer the following question: What campus has the most degrees conferrred over its entire existence? <|sql answer|>
SELECT Campus FROM degrees WHERE Campus IS NOT NULL GROUP BY Campus ORDER BY SUM(Degrees) DESC NULLS LAST LIMIT 1;<|endoftext|>
What campus has the most degrees conferrred over its entire existence?
SELECT Campus FROM degrees WHERE Campus IS NOT NULL GROUP BY Campus ORDER BY SUM(Degrees) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE city ( City, District, GDP, Name, Official_Name, Population, Regional_Population, Status, T1, ... (10 more ); CREATE TABLE hosting_city ( Host_City, Year );
Write a SQL query to answer the following question: Which city has hosted the most events? <|sql answer|>
SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City GROUP BY T2.Host_City, T1.City ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
Which city has hosted the most events?
SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City GROUP BY T2.Host_City, T1.City ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE member_ ( Address, Age, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more );
Write a SQL query to answer the following question: What are the card numbers, names, and hometowns of every member ordered by descending level? <|sql answer|>
SELECT Card_Number, Name, Hometown FROM member_ ORDER BY Level DESC NULLS LAST;<|endoftext|>
What are the card numbers, names, and hometowns of every member ordered by descending level?
SELECT Card_Number, Name, Hometown FROM member_ ORDER BY Level DESC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Faculty ( Building, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex );
Write a SQL query to answer the following question: How many faculty do we have? <|sql answer|>
SELECT COUNT(*) AS num_faculty FROM Faculty;<|endoftext|>
How many faculty do we have?
SELECT COUNT(*) AS num_faculty FROM Faculty;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Dorm ( dorm_name, gender, student_capacity ); CREATE TABLE Has_amenity ( dormid );
Write a SQL query to answer the following question: For each dorm, how many amenities does it have? <|sql answer|>
SELECT COUNT(*) AS num_amenities, T1.dormid FROM Dorm AS T1 JOIN Has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid;<|endoftext|>
For each dorm, how many amenities does it have?
SELECT COUNT(*) AS num_amenities, T1.dormid FROM Dorm AS T1 JOIN Has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE TV_Channel ( Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name ); CREATE TABLE Cartoon ( Channel, Directed_by, Original_air_date, Production_code, Title, Written_by );
Write a SQL query to answer the following question: List the title of all Cartoons showed on TV Channel with series name "Sky Radio".? <|sql answer|>
SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = 'Sky Radio';<|endoftext|>
List the title of all Cartoons showed on TV Channel with series name "Sky Radio".?
SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = 'Sky Radio';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE car_makers ( ... ); CREATE TABLE model_list ( Maker, Model ); CREATE TABLE car_names ( Model ); CREATE TABLE cars_data ( Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year );
Write a SQL query to answer the following question: What is the name of the different car makers who produced a car in 1970? <|sql answer|>
SELECT DISTINCT T1.Maker FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker JOIN car_names AS T3 ON T2.Model = T3.Model JOIN cars_data AS T4 ON T3.MakeId = T4.Id WHERE T4."Year" = '1970';<|endoftext|>
What is the name of the different car makers who produced a car in 1970?
SELECT DISTINCT T1.Maker FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker JOIN car_names AS T3 ON T2.Model = T3.Model JOIN cars_data AS T4 ON T3.MakeId = T4.Id WHERE T4."Year" = '1970';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE player ( Age, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more );
Write a SQL query to answer the following question: What are the teams that have the 5 oldest players? <|sql answer|>
SELECT Team FROM player ORDER BY Age DESC NULLS LAST LIMIT 5;<|endoftext|>
What are the teams that have the 5 oldest players?
SELECT Team FROM player ORDER BY Age DESC NULLS LAST LIMIT 5;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE people ( Age, Birth_Date, Birth_Place, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more ); CREATE TABLE employment ( ... );
Write a SQL query to answer the following question: List the names of people that are not employed by any company? <|sql answer|>
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment);<|endoftext|>
List the names of people that are not employed by any company?
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE paperKeyphrase ( ... ); CREATE TABLE keyphrase ( ... ); CREATE TABLE paper ( For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year ); CREATE TABLE writes ( ... ); CREATE TABLE author ( ... );
Write a SQL query to answer the following question: keyphrases used by Luke Zettlemoyer? <|sql answer|>
SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer';<|endoftext|>
keyphrases used by Luke Zettlemoyer?
SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE city ( City, District, GDP, Name, Official_Name, Population, Regional_Population, Status, T1, ... (10 more ); CREATE TABLE state ( area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom );
Write a SQL query to answer the following question: what is the biggest city in the smallest state? <|sql answer|>
SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state))) AND state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state));<|endoftext|>
what is the biggest city in the smallest state?
SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state))) AND state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state));
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE bank ( bname, city, morn, no_of_customers, state );
Write a SQL query to answer the following question: What is the average number of bank customers? <|sql answer|>
SELECT AVG(no_of_customers) AS avg_no_of_customers FROM bank;<|endoftext|>
What is the average number of bank customers?
SELECT AVG(no_of_customers) AS avg_no_of_customers FROM bank;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE team ( Name );
Write a SQL query to answer the following question: What are the names of all teams? <|sql answer|>
SELECT Name FROM team;<|endoftext|>
What are the names of all teams?
SELECT Name FROM team;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE College ( cName, enr, state ); CREATE TABLE Tryout ( EX, T1, cName, decision, pPos );
Write a SQL query to answer the following question: Find the names of states that have some college students playing in the mid position but not in the goalie position.? <|sql answer|>
SELECT DISTINCT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' AND T1.state NOT IN (SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie');<|endoftext|>
Find the names of states that have some college students playing in the mid position but not in the goalie position.?
SELECT DISTINCT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' AND T1.state NOT IN (SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie');
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Has_Allergy ( Allergy, StuID ); CREATE TABLE Allergy_Type ( Allergy, AllergyType );
Write a SQL query to answer the following question: How many students are affected by each allergy type? <|sql answer|>
SELECT T2.AllergyType, COUNT(*) AS num_students FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType;<|endoftext|>
How many students are affected by each allergy type?
SELECT T2.AllergyType, COUNT(*) AS num_students FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Project_Staff ( date_from, date_to, role_code );
Write a SQL query to answer the following question: How many different roles are there on the project staff? <|sql answer|>
SELECT COUNT(DISTINCT role_code) AS num_roles FROM Project_Staff;<|endoftext|>
How many different roles are there on the project staff?
SELECT COUNT(DISTINCT role_code) AS num_roles FROM Project_Staff;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE submission ( Author, College, Scores ); CREATE TABLE Acceptance ( ... );
Write a SQL query to answer the following question: List the authors who do not have submission to any workshop.? <|sql answer|>
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM Acceptance);<|endoftext|>
List the authors who do not have submission to any workshop.?
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM Acceptance);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Products ( Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more );
Write a SQL query to answer the following question: Show the minimum, maximum, average price for all products.? <|sql answer|>
SELECT MIN(product_price) AS min_price, MAX(product_price) AS max_price, AVG(product_price) AS avg_price FROM Products;<|endoftext|>
Show the minimum, maximum, average price for all products.?
SELECT MIN(product_price) AS min_price, MAX(product_price) AS max_price, AVG(product_price) AS avg_price FROM Products;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE category ( ... ); CREATE TABLE business ( business_id, city, full_address, name, rating, review_count, state ); CREATE TABLE review ( i_id, rank, rating, text ); CREATE TABLE user_ ( name );
Write a SQL query to answer the following question: How many people reviewed restaurant " Vintner Grill " in 2010 ? <|sql answer|>
SELECT COUNT(DISTINCT T4.name) AS num_reviewers FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN review AS T3 ON T3.business_id = T1.business_id JOIN user_ AS T4 ON T4.user_id = T3.user_id WHERE T1.name = 'Vintner Grill' AND T3."year" = 2010;<|endoftext|>
How many people reviewed restaurant " Vintner Grill " in 2010 ?
SELECT COUNT(DISTINCT T4.name) AS num_reviewers FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN review AS T3 ON T3.business_id = T1.business_id JOIN user_ AS T4 ON T4.user_id = T3.user_id WHERE T1.name = 'Vintner Grill' AND T3."year" = 2010;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Club ( ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn ); CREATE TABLE Member_of_club ( ... ); CREATE TABLE Student ( Advisor, Age, Fname, L, LName, Major, Sex, StuID, city_code, oldest_age );
Write a SQL query to answer the following question: Find the average age of members of the club "Hopkins Student Enterprises".? <|sql answer|>
SELECT AVG(T3.Age) AS avg_age FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Hopkins Student Enterprises';<|endoftext|>
Find the average age of members of the club "Hopkins Student Enterprises".?
SELECT AVG(T3.Age) AS avg_age FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Hopkins Student Enterprises';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE market ( Country, Number_cities );
Write a SQL query to answer the following question: Return the maximum and minimum number of cities across all markets.? <|sql answer|>
SELECT MAX(Number_cities) AS max_number_cities, MIN(Number_cities) AS min_number_cities FROM market;<|endoftext|>
Return the maximum and minimum number of cities across all markets.?
SELECT MAX(Number_cities) AS max_number_cities, MIN(Number_cities) AS min_number_cities FROM market;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE song ( art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more );
Write a SQL query to answer the following question: What is the name of the song that was released in the most recent year? <|sql answer|>
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC NULLS LAST LIMIT 1;<|endoftext|>
What is the name of the song that was released in the most recent year?
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE paperKeyphrase ( ... ); CREATE TABLE keyphrase ( ... ); CREATE TABLE paper ( For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year );
Write a SQL query to answer the following question: first deep learning paper? <|sql answer|>
SELECT DISTINCT T3."year" FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.keyphraseName = 'deep learning' GROUP BY T3."year" ORDER BY T3."year" ASC NULLS LAST;<|endoftext|>
first deep learning paper?
SELECT DISTINCT T3."year" FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.keyphraseName = 'deep learning' GROUP BY T3."year" ORDER BY T3."year" ASC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE airlines ( Abbreviation, Airline, Country, active, country, name );
Write a SQL query to answer the following question: List all countries and their number of airlines in the descending order of number of airlines.? <|sql answer|>
SELECT country, COUNT(*) AS num_airlines FROM airlines WHERE country IS NOT NULL GROUP BY country ORDER BY num_airlines DESC NULLS LAST;<|endoftext|>
List all countries and their number of airlines in the descending order of number of airlines.?
SELECT country, COUNT(*) AS num_airlines FROM airlines WHERE country IS NOT NULL GROUP BY country ORDER BY num_airlines DESC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Invoices ( DOUBLE, Order_Quantity, Product_ID, TRY_CAST, invoice_date, invoice_details, invoice_number, order_id, payment_method_code );
Write a SQL query to answer the following question: What is the average quantities ordered with payment method code "MasterCard" on invoices? <|sql answer|>
SELECT AVG(TRY_CAST(Order_Quantity AS DOUBLE)) AS avg_quantity FROM Invoices WHERE payment_method_code = 'MasterCard';<|endoftext|>
What is the average quantities ordered with payment method code "MasterCard" on invoices?
SELECT AVG(TRY_CAST(Order_Quantity AS DOUBLE)) AS avg_quantity FROM Invoices WHERE payment_method_code = 'MasterCard';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE mountain ( Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more );
Write a SQL query to answer the following question: Return the countries of the mountains that have a height larger than 5000.? <|sql answer|>
SELECT Country FROM mountain WHERE Height > 5000;<|endoftext|>
Return the countries of the mountains that have a height larger than 5000.?
SELECT Country FROM mountain WHERE Height > 5000;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE csu_fees ( CampusFee );
Write a SQL query to answer the following question: What is the average fee for a CSU campus in the year of 1996? <|sql answer|>
SELECT AVG(CampusFee) AS avg_fee FROM csu_fees WHERE "Year" = 1996;<|endoftext|>
What is the average fee for a CSU campus in the year of 1996?
SELECT AVG(CampusFee) AS avg_fee FROM csu_fees WHERE "Year" = 1996;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE city ( City, District, GDP, Name, Official_Name, Population, Regional_Population, Status, T1, ... (10 more ); CREATE TABLE state ( area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom );
Write a SQL query to answer the following question: what are the major cities in the largest state? <|sql answer|>
SELECT city_name FROM city WHERE population > 150000 AND state_name = (SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state));<|endoftext|>
what are the major cities in the largest state?
SELECT city_name FROM city WHERE population > 150000 AND state_name = (SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state));
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Student ( Advisor, Age, Fname, L, LName, Major, Sex, StuID, city_code, oldest_age );
Write a SQL query to answer the following question: Find the last names of students with major 50.? <|sql answer|>
SELECT LName FROM Student WHERE Major = 50;<|endoftext|>
Find the last names of students with major 50.?
SELECT LName FROM Student WHERE Major = 50;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE city ( City, District, GDP, Name, Official_Name, Population, Regional_Population, Status, T1, ... (10 more ); CREATE TABLE country ( Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, Name, Official_native_language, ... (4 more );
Write a SQL query to answer the following question: What are the countries that contain 3 or more cities? <|sql answer|>
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id, T2.country HAVING COUNT(*) >= 3;<|endoftext|>
What are the countries that contain 3 or more cities?
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id, T2.country HAVING COUNT(*) >= 3;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Product_Suppliers ( DOUBLE, TRY_CAST, product_id, supplier_id );
Write a SQL query to answer the following question: What are the ids of the top three products that were purchased in the largest amount? <|sql answer|>
SELECT product_id FROM Product_Suppliers ORDER BY total_amount_purchased DESC NULLS LAST LIMIT 3;<|endoftext|>
What are the ids of the top three products that were purchased in the largest amount?
SELECT product_id FROM Product_Suppliers ORDER BY total_amount_purchased DESC NULLS LAST LIMIT 3;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Rooms ( K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName );
Write a SQL query to answer the following question: Find the average and minimum price of the rooms in different decor.? <|sql answer|>
SELECT decor, AVG(basePrice) AS avg_price, MIN(basePrice) AS min_price FROM Rooms GROUP BY decor;<|endoftext|>
Find the average and minimum price of the rooms in different decor.?
SELECT decor, AVG(basePrice) AS avg_price, MIN(basePrice) AS min_price FROM Rooms GROUP BY decor;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE employee ( Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary );
Write a SQL query to answer the following question: Count the number of employees for each city.? <|sql answer|>
SELECT COUNT(*) AS num_employees, City FROM employee GROUP BY City;<|endoftext|>
Count the number of employees for each city.?
SELECT COUNT(*) AS num_employees, City FROM employee GROUP BY City;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE border_info ( T1, border, state_name ); CREATE TABLE state ( area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom );
Write a SQL query to answer the following question: how many states border on the state whose capital is boston? <|sql answer|>
SELECT COUNT(border) AS num_states FROM border_info WHERE state_name = (SELECT state_name FROM state WHERE capital = 'boston');<|endoftext|>
how many states border on the state whose capital is boston?
SELECT COUNT(border) AS num_states FROM border_info WHERE state_name = (SELECT state_name FROM state WHERE capital = 'boston');
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE category ( ... ); CREATE TABLE film_category ( ... ); CREATE TABLE film ( Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more );
Write a SQL query to answer the following question: What is the genre name of the film HUNGER ROOF? <|sql answer|>
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF';<|endoftext|>
What is the genre name of the film HUNGER ROOF?
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE invoices ( billing_city, billing_country, billing_state, total );
Write a SQL query to answer the following question: List the number of invoices and the invoice total from California.? <|sql answer|>
SELECT billing_state, COUNT(*) AS num_invoices, SUM(total) AS total_invoices FROM invoices WHERE billing_state = 'CA' GROUP BY billing_state;<|endoftext|>
List the number of invoices and the invoice total from California.?
SELECT billing_state, COUNT(*) AS num_invoices, SUM(total) AS total_invoices FROM invoices WHERE billing_state = 'CA' GROUP BY billing_state;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE book_club ( Author_or_Editor, Book_Title, Category, Publ, Publisher, T1 );
Write a SQL query to answer the following question: How many books fall into each category? <|sql answer|>
SELECT Category, COUNT(*) AS num_books FROM book_club GROUP BY Category;<|endoftext|>
How many books fall into each category?
SELECT Category, COUNT(*) AS num_books FROM book_club GROUP BY Category;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE country ( Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, Name, Official_native_language, ... (4 more ); CREATE TABLE countrylanguage ( CountryCode, Engl, Language );
Write a SQL query to answer the following question: Which continent has the most diverse languages? <|sql answer|>
SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
Which continent has the most diverse languages?
SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE poker_player ( Best_Finish, Earnings, Final_Table_Made, Money_Rank );
Write a SQL query to answer the following question: What is the maximum number of final tables made among poker players with earnings less than 200000? <|sql answer|>
SELECT MAX(Final_Table_Made) AS max_final_table_made FROM poker_player WHERE Earnings < 200000;<|endoftext|>
What is the maximum number of final tables made among poker players with earnings less than 200000?
SELECT MAX(Final_Table_Made) AS max_final_table_made FROM poker_player WHERE Earnings < 200000;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE people ( Age, Birth_Date, Birth_Place, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more );
Write a SQL query to answer the following question: What is the party of the youngest people? <|sql answer|>
SELECT Party FROM people ORDER BY Age ASC NULLS LAST LIMIT 1;<|endoftext|>
What is the party of the youngest people?
SELECT Party FROM people ORDER BY Age ASC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE car_makers ( ... ); CREATE TABLE model_list ( Maker, Model );
Write a SQL query to answer the following question: What are the names and ids of all makers with more than 3 models? <|sql answer|>
SELECT T1.FullName, T1.Id FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id, T1.FullName HAVING COUNT(*) > 3;<|endoftext|>
What are the names and ids of all makers with more than 3 models?
SELECT T1.FullName, T1.Id FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id, T1.FullName HAVING COUNT(*) > 3;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE SportsInfo ( GamesPlayed, OnScholarship, SportName, StuID );
Write a SQL query to answer the following question: Show all sport name and the number of students.? <|sql answer|>
SELECT SportName, COUNT(*) AS num_students FROM SportsInfo GROUP BY SportName;<|endoftext|>
Show all sport name and the number of students.?
SELECT SportName, COUNT(*) AS num_students FROM SportsInfo GROUP BY SportName;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Customers ( BIGINT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more ); CREATE TABLE Customer_Contact_Channels ( DATEDIFF, DAY, active_from_date, active_to_date, channel_code, contact_number, diff );
Write a SQL query to answer the following question: Which contact channel has been used by the customer with name "Tillman Ernser"? <|sql answer|>
SELECT DISTINCT channel_code FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Tillman Ernser';<|endoftext|>
Which contact channel has been used by the customer with name "Tillman Ernser"?
SELECT DISTINCT channel_code FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Tillman Ernser';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE state ( area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom );
Write a SQL query to answer the following question: what is the capital of the texas state? <|sql answer|>
SELECT capital FROM state WHERE state_name = 'texas';<|endoftext|>
what is the capital of the texas state?
SELECT capital FROM state WHERE state_name = 'texas';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE car_makers ( ... ); CREATE TABLE countries ( ... );
Write a SQL query to answer the following question: What is the name of the country with the most car makers? <|sql answer|>
SELECT T2.CountryName FROM car_makers AS T1 JOIN countries AS T2 ON T1.CountryId = T2.CountryId GROUP BY T2.CountryId, T2.CountryName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
What is the name of the country with the most car makers?
SELECT T2.CountryName FROM car_makers AS T1 JOIN countries AS T2 ON T1.CountryId = T2.CountryId GROUP BY T2.CountryId, T2.CountryName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Products ( Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more );
Write a SQL query to answer the following question: Select the name of the products with a price less than or equal to $200.? <|sql answer|>
SELECT Name FROM Products WHERE Price <= 200;<|endoftext|>
Select the name of the products with a price less than or equal to $200.?
SELECT Name FROM Products WHERE Price <= 200;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Songs ( Title );
Write a SQL query to answer the following question: Count the number of songs.? <|sql answer|>
SELECT COUNT(*) AS num_songs FROM Songs;<|endoftext|>
Count the number of songs.?
SELECT COUNT(*) AS num_songs FROM Songs;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE College ( cName, enr, state );
Write a SQL query to answer the following question: How many states have a college with more students than average? <|sql answer|>
SELECT COUNT(DISTINCT state) AS num_states FROM College WHERE enr > (SELECT AVG(enr) FROM College);<|endoftext|>
How many states have a college with more students than average?
SELECT COUNT(DISTINCT state) AS num_states FROM College WHERE enr > (SELECT AVG(enr) FROM College);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE party_events ( Event_Name );
Write a SQL query to answer the following question: Count the number of party events.? <|sql answer|>
SELECT COUNT(*) AS num_party_events FROM party_events;<|endoftext|>
Count the number of party events.?
SELECT COUNT(*) AS num_party_events FROM party_events;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Hotels ( hotel_id, other_hotel_details, pets_allowed_yn, price_range, star_rating_code );
Write a SQL query to answer the following question: What is the average price range of hotels for each each star rating code? <|sql answer|>
SELECT star_rating_code, AVG(price_range) AS avg_price_range FROM Hotels GROUP BY star_rating_code;<|endoftext|>
What is the average price range of hotels for each each star rating code?
SELECT star_rating_code, AVG(price_range) AS avg_price_range FROM Hotels GROUP BY star_rating_code;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE aircraft ( Description, aid, d, distance, name ); CREATE TABLE airport_aircraft ( ... ); CREATE TABLE airport ( Airport_Name, City, Country, Domestic_Passengers, International_Passengers, Transit_Passengers, id, name );
Write a SQL query to answer the following question: Please show the names of aircrafts associated with airport with name "London Gatwick".? <|sql answer|>
SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick';<|endoftext|>
Please show the names of aircrafts associated with airport with name "London Gatwick".?
SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Customers ( BIGINT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more ); CREATE TABLE Customer_Orders ( customer_id, order_date, order_id, order_shipping_charges );
Write a SQL query to answer the following question: What are the distinct names of customers with an order status of Pending, sorted by customer id? <|sql answer|>
SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' GROUP BY T1.customer_name, T2.customer_id ORDER BY T2.customer_id ASC NULLS LAST;<|endoftext|>
What are the distinct names of customers with an order status of Pending, sorted by customer id?
SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' GROUP BY T1.customer_name, T2.customer_id ORDER BY T2.customer_id ASC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE publication_keyword ( ... ); CREATE TABLE keyword ( keyword ); CREATE TABLE publication ( Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year ); CREATE TABLE conference ( homepage, name );
Write a SQL query to answer the following question: return me the keyword, which have been contained by the most number of papers in VLDB conference .? <|sql answer|>
SELECT T1.keyword FROM publication_keyword AS T4 JOIN keyword AS T1 ON T4.kid = T1.kid JOIN publication AS T3 ON T3.pid = T4.pid JOIN conference AS T2 ON T3.cid = CAST(T2.cid AS TEXT) WHERE T2.name = 'VLDB' GROUP BY T1.keyword ORDER BY COUNT(DISTINCT T3.title) DESC NULLS LAST LIMIT 1;<|endoftext|>
return me the keyword, which have been contained by the most number of papers in VLDB conference .?
SELECT T1.keyword FROM publication_keyword AS T4 JOIN keyword AS T1 ON T4.kid = T1.kid JOIN publication AS T3 ON T3.pid = T4.pid JOIN conference AS T2 ON T3.cid = CAST(T2.cid AS TEXT) WHERE T2.name = 'VLDB' GROUP BY T1.keyword ORDER BY COUNT(DISTINCT T3.title) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE paperKeyphrase ( ... ); CREATE TABLE keyphrase ( ... ); CREATE TABLE paper ( For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year ); CREATE TABLE writes ( ... ); CREATE TABLE author ( ... );
Write a SQL query to answer the following question: recent research interests of sanjeev arora? <|sql answer|>
SELECT DISTINCT T1.keyphraseName, T3."year" FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'sanjeev arora' ORDER BY T3."year" DESC NULLS LAST;<|endoftext|>
recent research interests of sanjeev arora?
SELECT DISTINCT T1.keyphraseName, T3."year" FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'sanjeev arora' ORDER BY T3."year" DESC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Course ( CName, Credits, Days ); CREATE TABLE Enrolled_in ( Fname, Grade, LName, StuID, T2, T3, gradepoint );
Write a SQL query to answer the following question: Give the names of the courses with at least five enrollments.? <|sql answer|>
SELECT T1.CName FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T2.CID, T1.CName HAVING COUNT(*) >= 5;<|endoftext|>
Give the names of the courses with at least five enrollments.?
SELECT T1.CName FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T2.CID, T1.CName HAVING COUNT(*) >= 5;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE body_builder ( Clean_Jerk, Snatch, Total ); CREATE TABLE people ( Age, Birth_Date, Birth_Place, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more );
Write a SQL query to answer the following question: What are the names of body builders? <|sql answer|>
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID;<|endoftext|>
What are the names of body builders?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE paperDataset ( ... ); CREATE TABLE dataset ( ... ); CREATE TABLE paperKeyphrase ( ... ); CREATE TABLE keyphrase ( ... );
Write a SQL query to answer the following question: list datasets for semantic parsing? <|sql answer|>
SELECT DISTINCT T2.datasetId FROM paperDataset AS T3 JOIN dataset AS T2 ON T3.datasetId = T2.datasetId JOIN paperKeyphrase AS T1 ON T1.paperId = T3.paperId JOIN keyphrase AS T4 ON T1.keyphraseId = T4.keyphraseId WHERE T4.keyphraseName = 'semantic parsing';<|endoftext|>
list datasets for semantic parsing?
SELECT DISTINCT T2.datasetId FROM paperDataset AS T3 JOIN dataset AS T2 ON T3.datasetId = T2.datasetId JOIN paperKeyphrase AS T1 ON T1.paperId = T3.paperId JOIN keyphrase AS T4 ON T1.keyphraseId = T4.keyphraseId WHERE T4.keyphraseName = 'semantic parsing';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Policies ( Policy_Type_Code ); CREATE TABLE Customers ( BIGINT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more );
Write a SQL query to answer the following question: Find the names of the customers who have an deputy policy.? <|sql answer|>
SELECT DISTINCT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Policy_Type_Code = 'Deputy';<|endoftext|>
Find the names of the customers who have an deputy policy.?
SELECT DISTINCT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Policy_Type_Code = 'Deputy';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE technician ( Age, JO, Start, Starting_Year, T1, Team, name );
Write a SQL query to answer the following question: List the names of technicians in ascending order of age.? <|sql answer|>
SELECT name FROM technician ORDER BY Age ASC NULLS LAST;<|endoftext|>
List the names of technicians in ascending order of age.?
SELECT name FROM technician ORDER BY Age ASC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE All_Documents ( Date_Stored, Document_Name, Document_Type_Code ); CREATE TABLE Document_Locations ( Date_in_Location_From, Date_in_Locaton_To, Location_Code ); CREATE TABLE Ref_Locations ( Location_Code, Location_Description, Location_Name );
Write a SQL query to answer the following question: What is the location name of the document "Robin CV"? <|sql answer|>
SELECT T3.Location_Name FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T1.Document_ID = T2.Document_ID JOIN Ref_Locations AS T3 ON T2.Location_Code = T3.Location_Code WHERE T1.Document_Name = 'Robin CV';<|endoftext|>
What is the location name of the document "Robin CV"?
SELECT T3.Location_Name FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T1.Document_ID = T2.Document_ID JOIN Ref_Locations AS T3 ON T2.Location_Code = T3.Location_Code WHERE T1.Document_Name = 'Robin CV';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Accounts ( Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details ); CREATE TABLE Customers ( BIGINT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more );
Write a SQL query to answer the following question: Show id, first name and last name for all customers and the number of accounts.? <|sql answer|>
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name, COUNT(*) AS num_accounts FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id, T2.customer_first_name, T2.customer_last_name;<|endoftext|>
Show id, first name and last name for all customers and the number of accounts.?
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name, COUNT(*) AS num_accounts FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id, T2.customer_first_name, T2.customer_last_name;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE customer ( T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id );
Write a SQL query to answer the following question: What are the names and account balances of customers with the letter a in their names? <|sql answer|>
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%';<|endoftext|>
What are the names and account balances of customers with the letter a in their names?
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE College ( cName, enr, state );
Write a SQL query to answer the following question: Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.? <|sql answer|>
SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA';<|endoftext|>
Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.?
SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE district ( City_Area, City_Population, District_name, d );
Write a SQL query to answer the following question: What are the names of all districts with a city area greater than 10 or have more than 100000 people living there? <|sql answer|>
SELECT District_name FROM district WHERE City_Area > 10 OR City_Population > 100000;<|endoftext|>
What are the names of all districts with a city area greater than 10 or have more than 100000 people living there?
SELECT District_name FROM district WHERE City_Area > 10 OR City_Population > 100000;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Authors ( fname, lname ); CREATE TABLE Authorship ( ... ); CREATE TABLE Papers ( title );
Write a SQL query to answer the following question: Find the titles of all the papers written by "Aaron Turon".? <|sql answer|>
SELECT T3.title FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Papers AS T3 ON T2.paperID = T3.paperID WHERE T1.fname = 'Aaron' AND T1.lname = 'Turon';<|endoftext|>
Find the titles of all the papers written by "Aaron Turon".?
SELECT T3.title FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Papers AS T3 ON T2.paperID = T3.paperID WHERE T1.fname = 'Aaron' AND T1.lname = 'Turon';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Customers ( BIGINT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more );
Write a SQL query to answer the following question: Return the names and ids of customers who have TN in their address.? <|sql answer|>
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE '%TN%';<|endoftext|>
Return the names and ids of customers who have TN in their address.?
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE '%TN%';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE list ( Classroom, FirstName, Grade, LastName ); CREATE TABLE teachers ( Classroom, FirstName, LastName );
Write a SQL query to answer the following question: How many students does KAWA GORDON teaches? <|sql answer|>
SELECT COUNT(*) AS num_students FROM list AS T1 JOIN teachers AS T2 ON T1.Classroom = T2.Classroom WHERE T2.FirstName = 'KAWA' AND T2.LastName = 'GORDON';<|endoftext|>
How many students does KAWA GORDON teaches?
SELECT COUNT(*) AS num_students FROM list AS T1 JOIN teachers AS T2 ON T1.Classroom = T2.Classroom WHERE T2.FirstName = 'KAWA' AND T2.LastName = 'GORDON';
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE state ( area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom );
Write a SQL query to answer the following question: what is the smallest state by area? <|sql answer|>
SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state);<|endoftext|>
what is the smallest state by area?
SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state);
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Customer_Master_Index ( cmi_details );
Write a SQL query to answer the following question: List all information about customer master index, and sort them by details in descending order.? <|sql answer|>
SELECT * FROM Customer_Master_Index ORDER BY cmi_details DESC NULLS LAST;<|endoftext|>
List all information about customer master index, and sort them by details in descending order.?
SELECT * FROM Customer_Master_Index ORDER BY cmi_details DESC NULLS LAST;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE customer ( T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id );
Write a SQL query to answer the following question: What are the names of customers who do not have saving accounts? <|sql answer|>
SELECT DISTINCT cust_name FROM customer WHERE cust_name NOT IN (SELECT cust_name FROM customer WHERE acc_type = 'saving');<|endoftext|>
What are the names of customers who do not have saving accounts?
SELECT DISTINCT cust_name FROM customer WHERE cust_name NOT IN (SELECT cust_name FROM customer WHERE acc_type = 'saving');
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE Catalog_Contents ( capacity, catalog_entry_name, height, next_entry_id, price_in_dollars, price_in_euros, product_stock_number );
Write a SQL query to answer the following question: What are the average and minimum price (in Euro) of all products? <|sql answer|>
SELECT AVG(price_in_euros) AS avg_price_in_euros, MIN(price_in_euros) AS min_price_in_euros FROM Catalog_Contents;<|endoftext|>
What are the average and minimum price (in Euro) of all products?
SELECT AVG(price_in_euros) AS avg_price_in_euros, MIN(price_in_euros) AS min_price_in_euros FROM Catalog_Contents;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE SportsInfo ( GamesPlayed, OnScholarship, SportName, StuID );
Write a SQL query to answer the following question: Which sport has most number of students on scholarship? <|sql answer|>
SELECT SportName FROM SportsInfo WHERE OnScholarship = 'Y' AND SportName IS NOT NULL GROUP BY SportName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;<|endoftext|>
Which sport has most number of students on scholarship?
SELECT SportName FROM SportsInfo WHERE OnScholarship = 'Y' AND SportName IS NOT NULL GROUP BY SportName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
<|sql prompt|> You are an expert data analyst adept at writing SQL queries to answer user questions. You have access to the following relational tables, with schemas below. CREATE TABLE invoices ( billing_city, billing_country, billing_state, total );
Write a SQL query to answer the following question: What is the number of invoices and total money billed in them from CA? <|sql answer|>
SELECT billing_state, COUNT(*) AS num_invoices, SUM(total) AS total_money_billed FROM invoices WHERE billing_state = 'CA' GROUP BY billing_state;<|endoftext|>
What is the number of invoices and total money billed in them from CA?
SELECT billing_state, COUNT(*) AS num_invoices, SUM(total) AS total_money_billed FROM invoices WHERE billing_state = 'CA' GROUP BY billing_state;
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
22