instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in 2008 in track and field events who broke more world records , usa...
SELECT "athlete" FROM table_203_102 WHERE "athlete" IN ('usain bolt', 'haile gebrselassie') GROUP BY "athlete" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT T1.SALARY, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA"
mimicsql_data
CREATE TABLE table_53509 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game with t...
SELECT "Result" FROM table_53509 WHERE "Attendance" = '45,320'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwner...
SELECT Id AS "post_link", Score, ViewCount, Body, Title, Tags FROM Posts AS c WHERE ViewCount != 0 AND ParentId IS NULL AND Tags LIKE '%<windows-phone%' AND CreationDate >= '01/01/2018' ORDER BY ViewCount DESC
sede
CREATE TABLE Allergy_Type ( Allergy VARCHAR, allergytype VARCHAR ) CREATE TABLE Has_allergy ( Allergy VARCHAR ) CREATE TABLE Student ( age VARCHAR, StuID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of students who are older t...
SELECT COUNT(*) FROM Student WHERE age > 18 AND NOT StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css
CREATE TABLE table_43954 ( "Constellation" text, "Largest component, fractional share" real, "Other components, fractional shares" text, "N, Laakso-Taagepera" real, "N, Golosov" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the v...
SELECT SUM("Largest component, fractional share") FROM table_43954 WHERE "Constellation" = 'e' AND "N, Golosov" > '2.9'
wikisql
CREATE TABLE table_name_63 ( result VARCHAR, week VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when the record was 1-0 and it was earlier than week 4?
SELECT result FROM table_name_63 WHERE week < 4 AND record = "1-0"
sql_create_context
CREATE TABLE table_name_72 ( pick INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of picks for mckinney high school?
SELECT SUM(pick) FROM table_name_72 WHERE school = "mckinney high school"
sql_create_context
CREATE TABLE table_19519 ( "Station Name" text, "2002\u201303" real, "2004\u201305" real, "2005\u201306" real, "2006\u201307" real, "2007\u201308" real, "2008\u201309" real, "2009\u201310" real, "2010\u201311" real, "2011\u201312" real ) -- Using valid SQLite, answer the follow...
SELECT "Station Name" FROM table_19519 WHERE "2004\u201305" = '5088'
wikisql
CREATE TABLE table_name_50 ( population__2010_11_01_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population as of 11-01-2010 for Bayan County?
SELECT population__2010_11_01_ FROM table_name_50 WHERE name = "bayan county"
sql_create_context
CREATE TABLE table_52318 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for don january with over 2 wins and over 17 events?
SELECT MIN("Rank") FROM table_52318 WHERE "Wins" > '2' AND "Player" = 'don january' AND "Events" > '17'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "93"
mimicsql_data
CREATE TABLE table_41032 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "2010" FROM table_41032 WHERE "2002" = '2r'
wikisql
CREATE TABLE table_202_279 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which movie did matthew j. morrison play a policeman and what year was it released ?
SELECT "title", "year" FROM table_202_279 WHERE "role" = 'policeman'
squall
CREATE TABLE table_69135 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "April" FROM table_69135 WHERE "June" = 'candice cassidy'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) = '2105' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "NEOLEVO5"
mimicsql_data
CREATE TABLE table_23231 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location for 1829
SELECT "Location" FROM table_23231 WHERE "Founded" = '1829'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '朱安翔' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 6593.0)
css
CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real, Total_Points real ) CREATE TABLE people ( People_ID int, Name text, Age real, Height ...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown DESC
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '潘红雪' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 2937.59)
css
CREATE TABLE table_79182 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the golfer that golfs for Northern Ireland?
SELECT "Player" FROM table_79182 WHERE "Country" = 'northern ireland'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
SELECT Title, COUNT(Title) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title ORDER BY Title
nvbench
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
nvbench
CREATE TABLE table_name_68 ( masculine_u_stems VARCHAR, neuter_a_stems VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the masculine u form for the old Swedish word with a neuter a form of skipum?
SELECT masculine_u_stems FROM table_name_68 WHERE neuter_a_stems = "skipum"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name DESC
nvbench
CREATE TABLE table_22404 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the original airdate for shell shocked sheldon?
SELECT "Original Airdate" FROM table_22404 WHERE "U.S. Acres Episode" = 'Shell Shocked Sheldon'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "CHLO180S"
mimicsql_data
CREATE TABLE table_36032 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Outcome has a Score of 4 6 3 6?
SELECT "Outcome" FROM table_36032 WHERE "Score" = '4–6 3–6'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_19 ( year VARCHAR, nominated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Teen Angels 2 nominated?
SELECT year FROM table_name_19 WHERE nominated = "teen angels 2"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT * FROM VoteTypes
sede
CREATE TABLE country ( id number, name text ) CREATE TABLE league ( id number, country_id number, name text ) CREATE TABLE team_attributes ( id number, team_fifa_api_id number, team_api_id number, date text, buildupplayspeed number, buildupplayspeedclass text, builduppl...
SELECT COUNT(*) FROM country AS T1 JOIN league AS T2 ON T1.id = T2.country_id WHERE T1.name = "England"
spider
CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id DESC
nvbench
CREATE TABLE table_16727 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the p...
SELECT "Pole Position" FROM table_16727 WHERE "Fastest Lap" = 'Nelson Piquet' AND "Constructor" = 'Ferrari'
wikisql
CREATE TABLE table_2588674_1 ( population__2000_census__ INTEGER, area_km² VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population for the place with an area of 2.33 km2?
SELECT MAX(population__2000_census__) FROM table_2588674_1 WHERE area_km² = "2.33"
sql_create_context
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
SELECT f_id, genre_is, artist_name FROM song WHERE languages = "english" ORDER BY rating
spider
CREATE TABLE table_54329 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does Graeme Souness manage?
SELECT "Team" FROM table_54329 WHERE "Manager" = 'graeme souness'
wikisql
CREATE TABLE table_19769 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most attendance for game site for los angeles memorial...
SELECT MAX("Attendance") FROM table_19769 WHERE "Game Site" = 'Los Angeles Memorial Coliseum'
wikisql
CREATE TABLE table_203_529 ( id number, "fin" number, "st" number, "driver" text, "car #" number, "make" text, "points" number, "bonus" number, "laps" number, "winnings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many dri...
SELECT COUNT("driver") FROM table_203_529 WHERE "fin" > (SELECT "fin" FROM table_203_529 WHERE "driver" = 'tony stewart')
squall
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '姜慧美' AND t_kc21.MED_SER_ORG_NO = '6311609' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%所致%'
css
CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name t...
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_43 ( player VARCHAR, to_par VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the player for England when the to par is 7?
SELECT player FROM table_name_43 WHERE to_par = 7 AND country = "england"
sql_create_context
CREATE TABLE table_name_50 ( winning_score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score of the Greater Vancouver Open tournament?
SELECT winning_score FROM table_name_50 WHERE tournament = "greater vancouver open"
sql_create_context
CREATE TABLE table_name_64 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Score on September 29, 2003?
SELECT score FROM table_name_64 WHERE date = "september 29, 2003"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.age < "71"
mimicsql_data
CREATE TABLE table_name_80 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the home team is Essendon?
SELECT home_team AS score FROM table_name_80 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 23 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_name_49 ( power VARCHAR, acceleration_0_100km_h__0_62mph_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Power when the acceleration 0 100km/h (0 62mph) is 9.1 s?
SELECT power FROM table_name_49 WHERE acceleration_0_100km_h__0_62mph_ = "9.1 s"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Price)
nvbench
CREATE TABLE table_68563 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- College of san diego state, and a Pick # smaller than 30 is what lowest overall?
SELECT MIN("Overall") FROM table_68563 WHERE "College" = 'san diego state' AND "Pick #" < '30'
wikisql
CREATE TABLE table_28526 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text, "Left" text, "Nickname" text, "Primary Conference when joining the MSFA" text, "Current Primary Conference" text ) -- Using valid SQLite, answer the fo...
SELECT "Type" FROM table_28526 WHERE "Nickname" = 'Oilers'
wikisql
CREATE TABLE table_37830 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Original title has a Year of 1983, and a Country of italy?
SELECT "Original title" FROM table_37830 WHERE "Year" = '1983' AND "Country" = 'italy'
wikisql
CREATE TABLE table_name_81 ( losses VARCHAR, ties VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Losses, when Ties is 2, and when Wins is greater than 8?
SELECT COUNT(losses) FROM table_name_81 WHERE ties = 2 AND wins > 8
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.insurance = "Government"
mimicsql_data
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
SELECT COUNT(*) FROM fires WHERE fire_year = 2010 AND stat_cause_descr LIKE "%Arson%"
uswildfires
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE table_204_246 ( id number, "department" text, "total deputies" number, "uninominal deputies" number, "plurinominal deputies" number, "special indigenous\nor campesino deputies" number, "senators" number ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "department" FROM table_204_246 ORDER BY "total deputies" DESC LIMIT 1
squall
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏蕴美' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-12-02' AND '2015-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_name_87 ( nations VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nations participated in 2007?
SELECT nations FROM table_name_87 WHERE year = "2007"
sql_create_context
CREATE TABLE table_name_68 ( haydon VARCHAR, ben_tahir VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Haydon had a 33 Ben-Tahir?
SELECT haydon FROM table_name_68 WHERE ben_tahir = "33"
sql_create_context
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Fo...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_20531 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the university located ...
SELECT "Location" FROM table_20531 WHERE "Team Nickname" = 'Wolves'
wikisql
CREATE TABLE table_22806 ( "Episode title" text, "Subject" text, "Music by" text, "Performed by" text, "First aired" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When interplanet janet is the episode title who is the music by?
SELECT "Music by" FROM table_22806 WHERE "Episode title" = 'Interplanet Janet'
wikisql
CREATE TABLE table_name_53 ( record VARCHAR, result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Result of loss, and an Opponent of @ la clippers?
SELECT record FROM table_name_53 WHERE result = "loss" AND opponent = "@ la clippers"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id num...
SELECT * FROM ReviewTaskTypes
sede
CREATE TABLE table_55681 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has an away score of 7.9 (51)?
SELECT "Away team score" FROM table_55681 WHERE "Home team score" = '7.9 (51)'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT JYJSGH, JYJSQM FROM jybgb WHERE BGDH = '53568131993'
css
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name tex...
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister
nvbench
CREATE TABLE table_name_2 ( points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of points for chassis of bmw t269 (f2)
SELECT COUNT(points) FROM table_name_2 WHERE chassis = "bmw t269 (f2)"
sql_create_context
CREATE TABLE table_9967 ( "Type" text, "Year" real, "Block" text, "Displacement" text, "Mainly For" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Mainly For with a displacement of 997 cc in a year before 1962?
SELECT "Mainly For" FROM table_9967 WHERE "Year" < '1962' AND "Displacement" = '997 cc'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT demographic.admission_location, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT Fname, COUNT(Fname) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY Fname ORDER BY COUNT(Fname)
nvbench
CREATE TABLE table_11622924_1 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the tournament that was won with a score of 204 (-6) played?
SELECT date FROM table_11622924_1 WHERE score = "204 (-6)"
sql_create_context
CREATE TABLE table_19722664_5 ( rebounds INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rebounds did Rhonda Mapp make?
SELECT MAX(rebounds) FROM table_19722664_5 WHERE player = "Rhonda Mapp"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_33899 ( "Position" real, "Name" text, "Country" text, "Win-Loss" text, "Spread" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What name has a spread of 69?
SELECT "Name" FROM table_33899 WHERE "Spread" = '69'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT total_gpa FROM student WHERE student_id = 1
advising
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) -- Using valid SQLite, answer...
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location) DESC
nvbench
CREATE TABLE table_name_52 ( attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the attendance of the game with a score of 5-4?
SELECT attendance FROM table_name_52 WHERE score = "5-4"
sql_create_context
CREATE TABLE Apartments ( apt_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*)
sql_create_context
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE writes ( paperid int, aut...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016
scholar
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course...
advising
CREATE TABLE table_41830 ( "Year" text, "Team" text, "Comp" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the comp for the year 1989?
SELECT "Comp" FROM table_41830 WHERE "Year" = '1989'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0012194' AND t_kc21.OUT_DIAG_DIS_CD = 'I51.076')
css
CREATE TABLE table_51977 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer window with n/a as the Transfer fee, free agent for th...
SELECT "Transfer window" FROM table_51977 WHERE "Transfer fee" = 'n/a' AND "Moving to" = 'free agent' AND "Name" = 'joe sagar'
wikisql
CREATE TABLE table_41173 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average match has a lost greater than 0, points greater than 6, legia warszawa as the team, and a draw less...
SELECT AVG("Match") FROM table_41173 WHERE "Lost" > '0' AND "Points" > '6' AND "Team" = 'legia warszawa' AND "Draw" < '0'
wikisql
CREATE TABLE table_73305 ( "Region" text, "Population" text, "Country" text, "Language" text, "N" real, "Total%" text, "R1b1c (R-V88)" text, "R1b1a2 (R-M269)" text, "R1b1c* (R-V88*)" text, "R1b1c4 (R-V69)" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT COUNT("N") FROM table_73305 WHERE "R1b1a2 (R-M269)" = '0.6%'
wikisql
CREATE TABLE table_10021 ( "Rank" text, "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Run 1, when Athletes is 'Theo Kitt & Friedrich K...
SELECT "Run 1" FROM table_10021 WHERE "Athletes" = 'theo kitt & friedrich kuhn'
wikisql
CREATE TABLE table_14003108_1 ( lowest INTEGER, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum lowest with average being 734
SELECT MAX(lowest) FROM table_14003108_1 WHERE average = 734
sql_create_context
CREATE TABLE table_1977630_2 ( él___ella___usted VARCHAR, vos__ VARCHAR, _ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What us the conjucated form(s) of el/ella/ usted when the Vos (*) is muelas / mol s?
SELECT él___ella___usted FROM table_1977630_2 WHERE vos__ * _ = "muelas / molás"
sql_create_context
CREATE TABLE table_79734 ( "Race" text, "Position" text, "Time" text, "Speed" text, "Replica" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race has a position of 3rd and a speed of 126.452?
SELECT "Race" FROM table_79734 WHERE "Position" = '3rd' AND "Speed" = '126.452'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID
nvbench
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BUDDHST' AND course.number = 351 AND semester.semester <> 'Fall'
advising
CREATE TABLE table_30102 ( "Branding" text, "Callsign" text, "Frequency" text, "Power kW" text, "Coverage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of coverage for 106.7 energy fm
SELECT COUNT("Coverage") FROM table_30102 WHERE "Branding" = '106.7 Energy FM'
wikisql
CREATE TABLE table_15187735_16 ( segment_b VARCHAR, segment_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many segment b's when segment a is filigree glass
SELECT COUNT(segment_b) FROM table_15187735_16 WHERE segment_a = "Filigree Glass"
sql_create_context