instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_70848 ( "Rider" text, "Matches" real, "Rides" real, "Bonus Pts" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for 34 matches with 111 rides, but no more than 15 bonus points?
SELECT AVG("Total Points") FROM table_70848 WHERE "Matches" = '34' AND "Rides" = '111' AND "Bonus Pts" > '15'
wikisql
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team was the last team that this team faced in the regular season ?
SELECT "opponent" FROM table_204_755 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_9596 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT MIN("Top 5") FROM table_9596 WHERE "Year" > '1995' AND "Team(s)" = '#15 billy ballew motorsports' AND "Starts" > '4'
wikisql
CREATE TABLE table_name_31 ( bleeding_time VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bleeding time has a Condition of factor x deficiency as seen in amyloid purpura?
SELECT bleeding_time FROM table_name_31 WHERE condition = "factor x deficiency as seen in amyloid purpura"
sql_create_context
CREATE TABLE table_name_59 ( company VARCHAR, built VARCHAR, ship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company built the ship named excellent in 1998?
SELECT company FROM table_name_59 WHERE built = 1998 AND ship = "excellent"
sql_create_context
CREATE TABLE table_name_20 ( birthdate VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Birthdate of raymond bonney?
SELECT birthdate FROM table_name_20 WHERE name = "raymond bonney"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_30547 ( "#" text, "Player" text, "Country" text, "Score" text, "To par" text, "Winnings ($)" real, "After" real, "Before" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for the winnings of 232500?
SELECT "To par" FROM table_30547 WHERE "Winnings ($)" = '232500'
wikisql
CREATE TABLE table_name_23 ( draw VARCHAR, lost VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What draw has a lost less than 6 with 28 as the points?
SELECT draw FROM table_name_23 WHERE lost < 6 AND points = 28
sql_create_context
CREATE TABLE table_19980 ( "No." real, "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text ) -- Using valid SQLite, answer the following questions...
SELECT "Old Bulgarian name - Meaning" FROM table_19980 WHERE "No." = '4'
wikisql
CREATE TABLE table_27565 ( "Facility" text, "Location" text, "Year Opened" text, "Major Facility" text, "Population Gender" text, "Capacity" real, "Custody Level(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the custody level of...
SELECT "Custody Level(s)" FROM table_27565 WHERE "Location" = 'Shelton'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2089" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_name_60 ( yards INTEGER, sack VARCHAR, asst VARCHAR, totaltk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of yards when asst. is 19, totaltk is 60 and sack is more than 0?
SELECT SUM(yards) FROM table_name_60 WHERE asst = 19 AND totaltk = 60 AND sack > 0
sql_create_context
CREATE TABLE table_test_30 ( "id" int, "ejection_fraction_ef" int, "multiple_long_bone_fractures" bool, "extracellular_volume_expansion" bool, "pregnancy_or_lactation" bool, "bleeding" int, "serum_potassium" float, "prosthetic_heart_valve" bool, "hbg" int, "anticoagulation" bool,...
SELECT * FROM table_test_30 WHERE trauma = 1 OR orthopedic = 1 AND (anticoagulation = 0 OR bleeding = 0) AND (injury_patterns = 1 OR head_injury = 1 OR gcs < 8 OR (incomplete_spinal_cord_injury = 1 AND para = 1 OR quadriplegia = 1) OR (complex_pelvic_fractures = 1 AND associated_long_bone_fractures = 1) OR multiple_lon...
criteria2sql
CREATE TABLE table_30334 ( "No. in series" real, "Title" text, "Directed by" text, "Story & Storyboards by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different people direct...
SELECT COUNT("Directed by") FROM table_30334 WHERE "Title" = 'Fail Fish'
wikisql
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '3472324' AND IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3472324' AND IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
CREATE TABLE table_71879 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the presentation of credentials date of ra l h. ...
SELECT "Presentation of Credentials" FROM table_71879 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Representative" = 'raúl h. castro'
wikisql
CREATE TABLE table_78150 ( "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. -- What is the Home team score for the Away team of...
SELECT "Home team score" FROM table_78150 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tri...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_73 ( attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in game that had a score of 7-6 what was the attendance?
SELECT attendance FROM table_name_73 WHERE score = "7-6"
sql_create_context
CREATE TABLE table_name_34 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was Grimsby Town the away team?
SELECT date FROM table_name_34 WHERE away_team = "grimsby town"
sql_create_context
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Attribute_Definitions ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10) ) ...
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY COUNT(catalog_entry_name)
nvbench
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 jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '55593756' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE actor ( first_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most popular first name of the actors?
SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_39 ( primary_military_speciality VARCHAR, code_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Moondancer's Primary Military Speciality?
SELECT primary_military_speciality FROM table_name_39 WHERE code_name = "moondancer"
sql_create_context
CREATE TABLE table_39559 ( "Paul McCartney" text, "Stuart" text, "McIntosh" text, "Whitten" text, "Linda McCartney" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which McIntosh has a Stuart of bass, and a Linda McCartney of keyboards or drum?
SELECT "McIntosh" FROM table_39559 WHERE "Stuart" = 'bass' AND "Linda McCartney" = 'keyboards or drum'
wikisql
CREATE TABLE table_47774 ( "Name" text, "Built" text, "Listed" text, "Location" text, "Borough" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the building listed on 1977-11-23?
SELECT "Name" FROM table_47774 WHERE "Listed" = '1977-11-23'
wikisql
CREATE TABLE table_76491 ( "Date" text, "Opponent" text, "Score" text, "Leading Scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has an Opponent of @ houston, and a Record of 2-0?
SELECT "Score" FROM table_76491 WHERE "Opponent" = '@ houston' AND "Record" = '2-0'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-8833')) AND treatment.treatmentname = 'antiretrovirals (hiv)'
eicu
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite...
SELECT stuid FROM student WHERE age > 20
spider
CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE scientists ( ssn number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of the sci...
SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
spider
CREATE TABLE table_11056278_3 ( fastest_lap VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap in the races won by Max Papis?
SELECT fastest_lap FROM table_11056278_3 WHERE winning_driver = "Max Papis"
sql_create_context
CREATE TABLE table_33741 ( "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. -- Who is the home side when the away side score is...
SELECT "Home team" FROM table_33741 WHERE "Away team score" = '8.8 (56)'
wikisql
CREATE TABLE table_name_90 ( year VARCHAR, nation_of_citizenship VARCHAR, type_of_vehicle VARCHAR, racing_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has the vehicle of open wheel and a racing series of formula one with a Nation o...
SELECT year FROM table_name_90 WHERE type_of_vehicle = "open wheel" AND racing_series = "formula one" AND nation_of_citizenship = "germany"
sql_create_context
CREATE TABLE table_28738 ( "School" text, "Nickname" text, "Location" text, "Colors" text, "Join Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most join date
SELECT MAX("Join Date") FROM table_28738
wikisql
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( ...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY Away_team DESC
nvbench
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_204_584 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many points did emer...
SELECT "points" FROM table_204_584 WHERE "driver" = 'emerson fittipaldi'
squall
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT SQKS, SQKSMC FROM jybgb WHERE BGDH = '89851265565'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.label = "Prostate Specific Antigen"
mimicsql_data
CREATE TABLE table_204_287 ( id number, "outcome" text, "no." number, "date" number, "championship" text, "surface" text, "opponent in the final" text, "score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is at the top...
SELECT "opponent in the final" FROM table_204_287 WHERE id = 1
squall
CREATE TABLE table_20918 ( "Series #" real, "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. -- What episode titles have 20....
SELECT "Title" FROM table_20918 WHERE "U.S. viewers (millions)" = '20.94'
wikisql
CREATE TABLE table_18806 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who danced 11 and finished at more than a 2.0
SELECT "Couple" FROM table_18806 WHERE "Number of dances" = '11' AND "Competition finish" > '2.0'
wikisql
CREATE TABLE table_38988 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round on average was a defensive tackle selected?
SELECT AVG("Round") FROM table_38988 WHERE "Position" = 'defensive tackle'
wikisql
CREATE TABLE table_34451 ( "Position" real, "Club (City/Town)" text, "Games Played" real, "W-L-D" text, "Goals For/Against" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position number of the club with more than 24 p...
SELECT COUNT("Position") FROM table_34451 WHERE "Points" > '24' AND "W-L-D" = '8-5-3'
wikisql
CREATE TABLE Ref_Shipping_Agents ( shipping_agent_code VARCHAR, shipping_agent_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the shipping agent code of shipping agent UPS?
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_12851 ( "Governorate" text, "Cereals" real, "Fruit Trees" real, "Olives" real, "Industrial crops" real, "Vegetables" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the cereals of the governorate with 20,753 ...
SELECT SUM("Cereals") FROM table_12851 WHERE "Vegetables" = '20,753' AND "Fruit Trees" < '123,304'
wikisql
CREATE TABLE table_203_459 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text ) -- U...
SELECT "township" FROM table_203_459 WHERE "population" < (SELECT "population" FROM table_203_459 WHERE "township" = 'sedan') ORDER BY "population" DESC LIMIT 1
squall
CREATE TABLE table_7205 ( "Rank" real, "Name" text, "Span metres" real, "Span feet" real, "Material" text, "Year opened" real, "Location" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Year opened when ...
SELECT SUM("Year opened") FROM table_7205 WHERE "Span feet" > '1247' AND "Span metres" = '384'
wikisql
CREATE TABLE table_2846320_4 ( streak VARCHAR, last_meeting VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the length where the time is 2009
SELECT streak FROM table_2846320_4 WHERE last_meeting = 2009
sql_create_context
CREATE TABLE table_42988 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player weight 235?
SELECT "Player" FROM table_42988 WHERE "Weight" = '235'
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3252548' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-04-17' AND '2019-06-12' AND t_kc21.INSU_TYPE = '儿童'
css
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 HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_13304 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text, "Netscape" text, "Other Mozilla" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using Firefox duri...
SELECT "Firefox" FROM table_13304 WHERE "Netscape" = '*0.77%'
wikisql
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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '46976563661'
css
CREATE TABLE table_17690 ( "Quattroporte IV" text, "Units Produced" real, "Production Period" text, "Engine Capacity" text, "Power" text, "Max Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When were 668 units produced?
SELECT "Production Period" FROM table_17690 WHERE "Units Produced" = '668'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Id AS "post_link" FROM Posts WHERE LOWER(Tags) = '<' + @Tag + '>'
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328...
eicu
CREATE TABLE table_74308 ( "Track no." real, "Track" text, "Original Artist" text, "Soloist(s)" text, "Vocal Percussionist(s)" text, "Arranger(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tracks have the title let love be your ene...
SELECT COUNT("Track no.") FROM table_74308 WHERE "Track" = 'Let Love Be Your Energy'
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_IN_DIAG_DIS_CD = 'E68.873'
css
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 demographic.ethnicity FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_79514 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Silver has a Rank of 1, and a Bronze smaller than 3?
SELECT SUM("Silver") FROM table_79514 WHERE "Rank" = '1' AND "Bronze" < '3'
wikisql
CREATE TABLE table_53344 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Report" FROM table_53344 WHERE "Circuit" = 'hockenheimring'
wikisql
CREATE TABLE table_name_98 ( record VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when chicago was the visiting team?
SELECT record FROM table_name_98 WHERE visitor = "chicago"
sql_create_context
CREATE TABLE table_40375 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Tie number of 14 who was the away team?
SELECT "Away team" FROM table_40375 WHERE "Tie no" = '14'
wikisql
CREATE TABLE table_name_6 ( score VARCHAR, competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score at the 2010 FIFA World Cup Qualification that results in a win?
SELECT score FROM table_name_6 WHERE competition = "2010 fifa world cup qualification" AND result = "win"
sql_create_context
CREATE TABLE table_name_56 ( date VARCHAR, road_team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of game 3 with Boston as the road team?
SELECT date FROM table_name_56 WHERE road_team = "boston" AND game = "game 3"
sql_create_context
CREATE TABLE table_62292 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was there a hard surface when the partner was Marc Gicquel?
SELECT "Date" FROM table_62292 WHERE "Surface" = 'hard' AND "Partner" = 'marc gicquel'
wikisql
CREATE TABLE table_72592 ( "Year" text, "Channel" text, "Play-by-play" text, "Color commentator(s)" text, "Courtside reporter" text, "Studio host" text, "Studio analysts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the studio anal...
SELECT "Studio analysts" FROM table_72592 WHERE "Year" = '2008-09'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id num...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, LastAccessDate FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd%' ORDER BY Reputation DESC LIMIT 250
sede
CREATE TABLE table_62577 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Home team in Tie #23?
SELECT "Home team" FROM table_62577 WHERE "Tie no" = '23'
wikisql
CREATE TABLE table_22054 ( "# s Dam and GNIS query Link" real, "# s Lake and GNIS query Link" real, "# s Reservoir and GNIS query Link" real, "Borough or Census area" text, "Comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many dams are t...
SELECT MAX("# s Dam and GNIS query Link") FROM table_22054 WHERE "Borough or Census area" = 'Lake and Peninsula'
wikisql
CREATE TABLE table_63628 ( "Rank" real, "Canton" text, "Highest point" text, "Highest elevation" text, "Lowest point" text, "Lowest elevation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wich rank is given to the Canton of Schaffhausen?
SELECT SUM("Rank") FROM table_63628 WHERE "Canton" = 'schaffhausen'
wikisql
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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '69886935' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-06-18')
css
CREATE TABLE table_1915 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wha...
SELECT "Latitude" FROM table_1915 WHERE "Water (sqmi)" = '0.288'
wikisql
CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who lived longer evelyn irons or arturo islas ?
SELECT "name" FROM table_203_449 WHERE "name" IN ('evelyn irons', 'arturo islas') ORDER BY "lifetime" - "lifetime" DESC LIMIT 1
squall
CREATE TABLE table_20799587_1 ( county VARCHAR, mccain_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many counties did McCain get 65.72% of the votes?
SELECT COUNT(county) FROM table_20799587_1 WHERE mccain_percentage = "65.72%"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "3623"
mimicsql_data
CREATE TABLE table_10434 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average tie no when the home team is stamford a.f.c.?
SELECT AVG("Tie no") FROM table_10434 WHERE "Home team" = 'stamford a.f.c.'
wikisql
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255)...
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details
nvbench
CREATE TABLE table_name_7 ( byes INTEGER, losses VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Byes have Losses larger than 0, and an Against larger than 3049?
SELECT AVG(byes) FROM table_name_7 WHERE losses > 0 AND against > 3049
sql_create_context
CREATE TABLE table_28797906_3 ( average VARCHAR, wickets VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of all the wickets that were 27?
SELECT average FROM table_28797906_3 WHERE wickets = 27
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_fli...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LAKE CITY' AND NOT fare.round_trip_cost IS NULL AND flight_fare.f...
atis
CREATE TABLE table_907 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Storyboarded by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Original air date" FROM table_907 WHERE "No. in season" = '10b'
wikisql
CREATE TABLE table_48562 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event had the record of 18 5 (1)?
SELECT "Event" FROM table_48562 WHERE "Record" = '18–5 (1)'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Posts
sede
CREATE TABLE table_3845 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What wa...
SELECT "Location Attendance" FROM table_3845 WHERE "High assists" = 'LeBron James (10)'
wikisql
CREATE TABLE table_19765685_2 ( defending_champion VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many defending champs from thailand?
SELECT COUNT(defending_champion) FROM table_19765685_2 WHERE country = "Thailand"
sql_create_context
CREATE TABLE table_204_506 ( id number, "seasons" number, "team" text, "ch.wins" number, "promotions" number, "relegations" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between the number of wins pallac . reggiana regg...
SELECT ABS((SELECT "ch.wins" FROM table_204_506 WHERE "team" = 'pallac. reggiana reggio emilia') - (SELECT "ch.wins" FROM table_204_506 WHERE "team" = 'progresso castelmaggiore'))
squall
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 CITY, COUNT(CITY) FROM locations GROUP BY CITY
nvbench
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank
nvbench
CREATE TABLE table_24313 ( "Episode" real, "Title" text, "Directed by" text, "Written by" text, "Originalairdate" text, "Viewing Figures (millions) Sourced by BARB ; includes ITV1 HD and ITV1 +1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Episode" FROM table_24313 WHERE "Title" = 'Case Two (Part 1)'
wikisql
CREATE TABLE table_67392 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Electorate is from vic, a labor party, and is David Charles a member of?
SELECT "Electorate" FROM table_67392 WHERE "State" = 'vic' AND "Party" = 'labor' AND "Member" = 'david charles'
wikisql
CREATE TABLE table_2706 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population in those place where the m...
SELECT "Population" FROM table_2706 WHERE "Market Income Per Capita" = '$17,362'
wikisql
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition ( Competition_ID int, Year real, ...
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position)
nvbench
CREATE TABLE table_name_51 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that played against Armthorpe Welfare?
SELECT home_team FROM table_name_51 WHERE away_team = "armthorpe welfare"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cpk-mb index')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TI...
eicu
CREATE TABLE table_60183 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of the player with a 71-69-66=206 score?
SELECT "Place" FROM table_60183 WHERE "Score" = '71-69-66=206'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL
mimic_iii