instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_11 ( feet INTEGER, latitude__n_ VARCHAR, metres VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average feet that has a Latitude (N) of 35 48 35 , and under 8,047m?
SELECT AVG(feet) FROM table_name_11 WHERE latitude__n_ = "35°48′35″" AND metres < 8 OFFSET 047
sql_create_context
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) 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 cine...
SELECT Name, COUNT(Name) 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 Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_name_82 ( label VARCHAR, format VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the label in the region of Argentina and had a format of CD?
SELECT label FROM table_name_82 WHERE format = "cd" AND region = "argentina"
sql_create_context
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, ap...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
nvbench
CREATE TABLE table_75637 ( "Country" text, "Political Rights 2010" real, "Civil Liberties 2010" real, "Status 2010" text, "Political Rights 2011" real, "Civil Liberties 2011" real, "Status 2011" text, "Political Rights 2012" real, "Civil Liberties 2012" real, "Status 2012" text, ...
SELECT COUNT("Civil Liberties 2013") FROM table_75637 WHERE "Political Rights 2010" = '6' AND "Civil Liberties 2012" > '5' AND "Political Rights 2011" < '6'
wikisql
CREATE TABLE table_27756014_1 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of game 4?
SELECT score FROM table_27756014_1 WHERE game = 4
sql_create_context
CREATE TABLE table_name_76 ( home VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the home with chicago visiting
SELECT home FROM table_name_76 WHERE visitor = "chicago"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Alveolar-arterial Gradient"
mimicsql_data
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'indomethacin') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_30831 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the race on June 26?
SELECT "Race Winner" FROM table_30831 WHERE "Date" = 'June 26'
wikisql
CREATE TABLE table_name_41 ( year INTEGER, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the competition vitry-sur-seine humarathon?
SELECT AVG(year) FROM table_name_41 WHERE competition = "vitry-sur-seine humarathon"
sql_create_context
CREATE TABLE table_35955 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the tournament on November 5, 2007 with a carpet surface?
SELECT "Score" FROM table_35955 WHERE "Surface" = 'carpet' AND "Date" = 'november 5, 2007'
wikisql
CREATE TABLE table_10773 ( "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. -- Where was the game played where North Melbourne ...
SELECT "Venue" FROM table_10773 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE'
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Renal Epithelial Cells"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos...
mimic_iii
CREATE TABLE table_name_5 ( name VARCHAR, pos VARCHAR, club VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What D Player with a Height of m (ft 4in) is in the Spandau 04 Club?
SELECT name FROM table_name_5 WHERE club = "spandau 04" AND height = "m (ft 4in)" AND pos = "d"
sql_create_context
CREATE TABLE table_name_34 ( area INTEGER, name VARCHAR, municipal_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the area of ask y, with a Municipal code less than 1247?
SELECT SUM(area) FROM table_name_34 WHERE name = "askøy" AND municipal_code < 1247
sql_create_context
CREATE TABLE table_22756549_1 ( winner VARCHAR, runner_up_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won when V. A. Muthiah was the runner-up?
SELECT winner FROM table_22756549_1 WHERE runner_up_a = "V. A. Muthiah"
sql_create_context
CREATE TABLE table_73580 ( "No. in Series" real, "No. in Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the episo...
SELECT "Original air date" FROM table_73580 WHERE "U.S. viewers (millions)" = '10.50'
wikisql
CREATE TABLE table_2818164_4 ( no_in_series INTEGER, directed_by VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series number for the episode directed by jay sandrich that aired October 23, 1986?
SELECT MIN(no_in_series) FROM table_2818164_4 WHERE directed_by = "Jay Sandrich" AND original_air_date = "October 23, 1986"
sql_create_context
CREATE TABLE table_71462 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label is the ALCA-9197 Catalog?
SELECT "Label" FROM table_71462 WHERE "Catalog" = 'alca-9197'
wikisql
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 person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_10106 ( "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 home team had a crowd size of 14,000 at Ju...
SELECT "Home team" FROM table_10106 WHERE "Crowd" > '14,000' AND "Venue" = 'junction oval'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'fiber-optic bronchoscopy') AND DATETIME(procedures_i...
mimic_iii
CREATE TABLE inst ( name VARCHAR, instid VARCHAR ) CREATE TABLE papers ( paperid VARCHAR ) CREATE TABLE authorship ( instid VARCHAR, paperid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the organization that has published the...
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_test_10 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "immunosuppressive_disease" bool, "systolic_arterial_pressure_sap" int, "lymphomas" bool, "left_ventricular_dysfunction" bool, "tissue_hypoperfusion" bool, "heart_...
SELECT * FROM table_test_10 WHERE heart_disease = 1 OR left_ventricular_dysfunction = 1 OR cardiomyopathy = 1
criteria2sql
CREATE TABLE table_72444 ( "County" text, "Population" real, "Per capita income" text, "Median household income" text, "Median family income" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the per capita income of shasta?
SELECT "Per capita income" FROM table_72444 WHERE "County" = 'Shasta'
wikisql
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_70 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Bobby Nichols play for?
SELECT country FROM table_name_70 WHERE player = "bobby nichols"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJL...
css
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "PNEUMONIA" AND procedures.short_title = "Circumcision"
mimicsql_data
CREATE TABLE table_name_81 ( years VARCHAR, jersey_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did jersey number 55 play?
SELECT years FROM table_name_81 WHERE jersey_number_s_ = "55"
sql_create_context
CREATE TABLE table_name_72 ( rookie_of_the_year VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Rookie of the Year for the Season in 2000?
SELECT rookie_of_the_year FROM table_name_72 WHERE season = 2000
sql_create_context
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE table_name_99 ( total VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the finish was t44?
SELECT total FROM table_name_99 WHERE finish = "t44"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_name_48 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date did Footscray play an away game?
SELECT date FROM table_name_48 WHERE away_team = "footscray"
sql_create_context
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '35446983768' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%多奈哌齐%'
css
CREATE TABLE table_name_21 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Hawthorn score as the home team?
SELECT home_team AS score FROM table_name_21 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_204_673 ( id number, "name" text, "egot completed" text, "emmy" number, "grammy" number, "oscar" number, "tony" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- of those actresses receiving a tony after 1960 , which took t...
SELECT "name" FROM table_204_673 WHERE "tony" > 1960 ORDER BY "egot completed" DESC LIMIT 1
squall
CREATE TABLE table_204_51 ( id number, "week #" text, "theme" text, "song choice" text, "original artist" text, "order #" number, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which came first , the judge 's choice or birth year so...
SELECT "theme" FROM table_204_51 WHERE "theme" IN ("judge's choice", 'birth year songs') ORDER BY "order #" LIMIT 1
squall
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '33693601206' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%神经科%'
css
CREATE TABLE table_29676 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the Top 12 Men theme?
SELECT "Result" FROM table_29676 WHERE "Theme" = 'Top 12 Men'
wikisql
CREATE TABLE table_16677887_2 ( opponent VARCHAR, bills_first_downs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team were the bills playing where their first down was 23?
SELECT opponent FROM table_16677887_2 WHERE bills_first_downs = 23
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_99 ( country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country with the T3 Place Player with a Score of 71-76-71=218?
SELECT country FROM table_name_99 WHERE place = "t3" AND score = 71 - 76 - 71 = 218
sql_create_context
CREATE TABLE table_66604 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format is Premi re Cha ne?
SELECT "Format" FROM table_66604 WHERE "Branding" = 'première chaîne'
wikisql
CREATE TABLE table_51902 ( "Draw" real, "Artist" text, "Song" text, "Rank" real, "Points" real, "A. Krajka" real, "Gj. Leka" real, "B. Haxhia" real, "D. Tukiqi" real, "R. Magjistari" real, "Gj. Xhuvani" real, "A. Sk\u00ebnderaj" real ) -- Using valid SQLite, answer the ...
SELECT MAX("Points") FROM table_51902 WHERE "R. Magjistari" > '12'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104...
eicu
CREATE TABLE table_name_41 ( drawn VARCHAR, lost VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games drawn when there are 78 losses and over 121 games played?
SELECT COUNT(drawn) FROM table_name_41 WHERE lost = 78 AND played > 121
sql_create_context
CREATE TABLE table_11622829_1 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the dates with a score of 203 (-13)?
SELECT date FROM table_11622829_1 WHERE score = "203 (-13)"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT Score AS "question_score", Id AS "post_link", ClosedDate FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND Id IN (SELECT ParentId FROM Posts WHERE NOT ParentId IS NULL AND OwnerUserId = '##MyID##')
sede
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57'
atis
CREATE TABLE table_50294 ( "Parameter" text, "1st stage" text, "2nd stage" text, "3rd stage" text, "4th stage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the third stage that has the first phase of 5,443kg?
SELECT "3rd stage" FROM table_50294 WHERE "1st stage" = '5,443kg'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "9744"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-14278')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE Products ( Product_Name VARCHAR, Product_Price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the name of products in ascending order of price.
SELECT Product_Name FROM Products ORDER BY Product_Price
sql_create_context
CREATE TABLE table_name_71 ( year INTEGER, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Runner(s)-up of tammie green?
SELECT MIN(year) FROM table_name_71 WHERE runner_s__up = "tammie green"
sql_create_context
CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction...
SELECT COUNT(*) FROM ref_document_types
spider
CREATE TABLE table_76884 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest game with a score of 99-89?
SELECT MIN("Game") FROM table_76884 WHERE "Score" = '99-89'
wikisql
CREATE TABLE table_name_17 ( score VARCHAR, game VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Game larger than 7, and Points smaller than 14?
SELECT score FROM table_name_17 WHERE game > 7 AND points < 14
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dod_year <= "2174.0"
mimicsql_data
CREATE TABLE table_31081 ( "Year" real, "Number of tropical storms" real, "Number of hurricanes" real, "Number of major hurricanes" real, "Deaths" text, "Strongest storm" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest overall...
SELECT MAX("Number of major hurricanes") FROM table_31081
wikisql
CREATE TABLE table_17883 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height for the player born in 1980 and center?
SELECT "Height" FROM table_17883 WHERE "Year born" = '1980' AND "Position" = 'Center'
wikisql
CREATE TABLE table_45300 ( "Type" text, "Construction period" text, "Cylinder" text, "Capacity" text, "Power" text, "Vmax" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the maximum speed for straight-4, 1.466 cc Type r 150?
SELECT "Vmax" FROM table_45300 WHERE "Cylinder" = 'straight-4' AND "Capacity" = '1.466 cc' AND "Type" = 'r 150'
wikisql
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Fo...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
nvbench
CREATE TABLE table_name_97 ( diameter__km_ INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest diameter for Eirene Tholus?
SELECT MIN(diameter__km_) FROM table_name_97 WHERE name = "eirene tholus"
sql_create_context
CREATE TABLE table_16311 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For ga...
SELECT "High points" FROM table_16311 WHERE "Date" = 'December 20'
wikisql
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 d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13838) AND STRFTIME('%y-%m', labevents.charttime) = '2102-08' ORDER BY labevents.charttime LIMIT 1)
mimic_iii
CREATE TABLE table_18254 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum first elected with incumbent being gus yatron
SELECT MAX("First elected") FROM table_18254 WHERE "Incumbent" = 'Gus Yatron'
wikisql
CREATE TABLE table_56381 ( "Bowling figures Wickets-Runs (Overs)" text, "Bowler" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent during the competition in which the bowling figures were 5...
SELECT "Versus" FROM table_56381 WHERE "Bowling figures Wickets-Runs (Overs)" = '5-33 (10)'
wikisql
CREATE TABLE Rating ( stars VARCHAR, mID VARCHAR, rID VARCHAR ) CREATE TABLE Reviewer ( name VARCHAR, rID VARCHAR ) CREATE TABLE Movie ( title VARCHAR, mID VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For any rat...
SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name
sql_create_context
CREATE TABLE table_name_71 ( grid VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids for peter collins?
SELECT COUNT(grid) FROM table_name_71 WHERE driver = "peter collins"
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3692210' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-10-25' AND '2020-02-24' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE table_3756 ( "Institution" text, "City" text, "Nickname" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Tenure" text, "Current womens lacrosse conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name th...
SELECT "Current womens lacrosse conference" FROM table_3756 WHERE "Enrollment" = '6000'
wikisql
CREATE TABLE table_18062 ( "Country" text, "Population" real, "Native American" text, "Whites" text, "s Mestizo" text, "es Mulatto" text, "Blacks" text, "s Zambo" text, "Asians" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's t...
SELECT "s Mestizo" FROM table_18062 WHERE "Population" = '29461933'
wikisql
CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE view_unit_status ( apt_id number,...
SELECT building_address, building_phone FROM apartment_buildings WHERE building_manager = "Brenden"
spider
CREATE TABLE table_name_10 ( driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver when there were 35 laps?
SELECT driver FROM table_name_10 WHERE laps = "35"
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_name_92 ( attendance VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of week 1
SELECT attendance FROM table_name_92 WHERE week = 1
sql_create_context
CREATE TABLE table_name_86 ( college_junior_club_team__league_ VARCHAR, position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Mike Crowley plays defense for league?
SELECT college_junior_club_team__league_ FROM table_name_86 WHERE position = "defense" AND player = "mike crowley"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hig...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_62079 ( "Companion (in order from star)" text, "Mass" text, "Semimajor axis ( AU )" text, "Orbital period ( s day )" text, "Eccentricity" text, "Inclination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Inclination has ...
SELECT "Inclination" FROM table_62079 WHERE "Eccentricity" = '0.06 +0.06 −0.11'
wikisql
CREATE TABLE table_name_71 ( nationality VARCHAR, rank VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a Rank larger than 3, and a Name of tom hilde?
SELECT nationality FROM table_name_71 WHERE rank > 3 AND name = "tom hilde"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '45531183' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-02-04') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE diagnoses ( 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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "24"
mimicsql_data
CREATE TABLE table_19905183_1 ( team VARCHAR, head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many teams is Waqar Younis the head coach?
SELECT COUNT(team) FROM table_19905183_1 WHERE head_coach = "Waqar Younis"
sql_create_context
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 = "PNEUMONIA" AND demographic.days_stay > "0"
mimicsql_data
CREATE TABLE table_49051 ( "Source Version" text, "Target Version" text, "Last Release" text, "License" text, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Website, when Last Release is 2009-08-09, 1.2.9?
SELECT "Website" FROM table_49051 WHERE "Last Release" = '2009-08-09, 1.2.9'
wikisql
CREATE TABLE table_204_880 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which competition did this runner participate in after the xiamen ...
SELECT "competition" FROM table_204_880 WHERE id = (SELECT id FROM table_204_880 WHERE "competition" = 'xiamen international marathon') + 1
squall
CREATE TABLE table_63567 ( "Song" text, "Performer" text, "Original artist" text, "Length" text, "Recorded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the original artist of the 3:00 song?
SELECT "Original artist" FROM table_63567 WHERE "Length" = '3:00'
wikisql
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Urea Nitrogen"
mimicsql_data
CREATE TABLE table_name_48 ( character VARCHAR, italian_voice_actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character does Italian voice actor Emanuela Damasio play?
SELECT character FROM table_name_48 WHERE italian_voice_actor = "emanuela damasio"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '钱天逸' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO...
css
CREATE TABLE table_8311 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player when the Score was 72-73-67-72=284?
SELECT "Player" FROM table_8311 WHERE "Score" = '72-73-67-72=284'
wikisql
CREATE TABLE table_name_29 ( result VARCHAR, h___a VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for an H/A of H and a round value of R6 replay?
SELECT result FROM table_name_29 WHERE h___a = "h" AND round = "r6 replay"
sql_create_context
CREATE TABLE table_name_49 ( crude_birth_rate__per_1000_ INTEGER, natural_change VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Natural change of 42 689 has which lowest Crude birth rate (per 1000)?
SELECT MIN(crude_birth_rate__per_1000_) FROM table_name_49 WHERE natural_change = "42 689"
sql_create_context
CREATE TABLE table_name_74 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jerry Barber's To par?
SELECT to_par FROM table_name_74 WHERE player = "jerry barber"
sql_create_context