instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_66 ( events INTEGER, top_10 VARCHAR, cuts_made VARCHAR, top_5 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total events have cuts made over 12, more than 2 top-5s, and more than 11 top-10s?
SELECT SUM(events) FROM table_name_66 WHERE cuts_made > 12 AND top_5 > 2 AND top_10 > 11
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '蒋阳飙' AND t_kc22.STA_DATE BETWEEN '2011-10-14' AND '2020-11-19' AND t_kc22.SOC_SRT_DIRE_NM = '利可君片(薄膜衣)'
css
CREATE TABLE table_72112 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the fastest lap time in the Escort Rada...
SELECT "Fastest Lap" FROM table_72112 WHERE "Name" = 'Escort Radar Warning 200'
wikisql
CREATE TABLE table_23141 ( "County" text, "Starky #" real, "Starky %" text, "Hancock #" real, "Hancock %" text, "McCain #" real, "McCain %" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was hancock % conside...
SELECT COUNT("Hancock %") FROM table_23141 WHERE "Starky %" = '20.96%'
wikisql
CREATE TABLE table_name_39 ( points VARCHAR, goals_scored INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total number of points when the amount of goals scored was less than 20?
SELECT COUNT(points) FROM table_name_39 WHERE goals_scored < 20
sql_create_context
CREATE TABLE table_15829930_5 ( wins INTEGER, success_rate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least wins of 56.25%
SELECT MIN(wins) FROM table_15829930_5 WHERE success_rate = "56.25%"
sql_create_context
CREATE TABLE table_15187735_3 ( segment_c VARCHAR, segment_b VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the segment c for pottery
SELECT segment_c FROM table_15187735_3 WHERE segment_b = "Pottery"
sql_create_context
CREATE TABLE table_59594 ( "Rank" text, "County" text, "State" text, "Land area (km\u00b2)" text, "Land area (mi\u00b2)" text, "April 1, 2010 census" text, "April 1, 2010 density (/km\u00b2)" text, "April 1, 2010 density (/mi\u00b2)" text, "July 1, 2010 official estimate" text, "...
SELECT "Rank" FROM table_59594 WHERE "July 1, 2010 density (/km\u00b2)" = '437'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, ...
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 = '029-27704' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text,...
SELECT COUNT(DISTINCT fda_approved) FROM medicine
spider
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number,...
SELECT q.Id AS "Id", 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(15)) AS "Link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<' + @Tag + '>%' ORDER BY q.Id
sede
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...
WITH last_cte AS (SELECT UserId, MAX(Id) AS MaxId FROM Comments GROUP BY UserId), dates_cte AS (SELECT c.UserId AS odn, c.Id AS cid, c.CreationDate AS CDate FROM Comments AS c INNER JOIN last_cte ON c.Id = maxid) SELECT LAST_DATE_OF_MONTH(CDate), COUNT(odn) FROM dates_cte GROUP BY LAST_DATE_OF_MONTH(CDate) ORDER BY LAS...
sede
CREATE TABLE table_27734577_2 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was the opponent on october 21?
SELECT team FROM table_27734577_2 WHERE date = "October 21"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_50 ( sio_2 INTEGER, na_2_o VARCHAR, k_2_o VARCHAR, fe_2_o_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest SiO 2, when K 2 O is greater than 0.16, when Fe 2 O 3 is greater than 0.16, and when Na 2 O is less...
SELECT MAX(sio_2) FROM table_name_50 WHERE k_2_o > 0.16 AND fe_2_o_3 > 0.16 AND na_2_o < 7.53
sql_create_context
CREATE TABLE table_73387 ( "Year" real, "Champion" text, "Country" text, "Venue" text, "Location of venue" text, "Winners Score" text, "Winners share ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Bellerive Country Club v...
SELECT "Location of venue" FROM table_73387 WHERE "Venue" = 'Bellerive Country Club'
wikisql
CREATE TABLE table_name_96 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent for week 5?
SELECT opponent FROM table_name_96 WHERE week = 5
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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_MZ...
css
CREATE TABLE table_6902 ( "Year" text, "Playoff round" text, "Venue" text, "Winner" text, "Result" text, "Loser" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Loser when the winner was los angeles lakers (10)?
SELECT "Loser" FROM table_6902 WHERE "Winner" = 'los angeles lakers (10)'
wikisql
CREATE TABLE table_28161 ( "Village" text, "Area km\u00b2" text, "Population (2000 census )" real, "Region" text, "Pop. Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many places named asan-maina?
SELECT COUNT("Region") FROM table_28161 WHERE "Village" = 'Asan-Maina'
wikisql
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Employees ( Employee_ID INTEGER, ...
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations
nvbench
CREATE TABLE table_62593 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team in the Game with a Score of 1 0?
SELECT "Home team" FROM table_62593 WHERE "Score" = '1–0'
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-86645')) AND lab.labname = 'amylase' AND DATETIME(lab.labresulttime) <= DATETI...
eicu
CREATE TABLE table_203_721 ( id number, "school" text, "location" text, "control" text, "type" text, "enrollment" number, "founded" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what 's the number of schools represented in the table ?
SELECT COUNT("school") FROM table_203_721
squall
CREATE TABLE table_71937 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the person from the Netherlands in a Lane lower than 5, with a Rank better than 5, and a ...
SELECT "Name" FROM table_71937 WHERE "Rank" < '5' AND "Time" < '55.62' AND "Lane" < '5' AND "Nationality" = 'netherlands'
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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '70900015' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '70900015' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27'
css
CREATE TABLE table_name_45 ( runner_s__up VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the runner-up where the winning score is 8 (71-69-67-73=280)?
SELECT runner_s__up FROM table_name_45 WHERE winning_score = –8(71 - 69 - 67 - 73 = 280)
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT end_station_name, COUNT(end_station_name) FROM trip GROUP BY end_station_name ORDER BY id LIMIT 3
nvbench
CREATE TABLE table_40547 ( "Round" text, "Opposition" text, "First leg" text, "Second leg" text, "Aggregate score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round had the opponent Lyon?
SELECT "Round" FROM table_40547 WHERE "Opposition" = 'lyon'
wikisql
CREATE TABLE table_name_81 ( name_designation VARCHAR, payload VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name/designation for the 1200kg payload?
SELECT name_designation FROM table_name_81 WHERE payload = "1200kg"
sql_create_context
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, ap...
SELECT AVG(quantity) FROM stock
spider
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT Score, LENGTH(Body) FROM Posts WHERE PostTypeId = 2 AND LENGTH(Body) <= 20000
sede
CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary V...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_24791 ( "Pilot" text, "Organization" text, "Total Flights" real, "USAF space flights" real, "FAI space flights" real, "Max Mach" text, "Max speed (mph)" real, "Max altitude (miles)" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Pilot" FROM table_24791 WHERE "Max altitude (miles)" = '55.9'
wikisql
CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) ) CREA...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name
nvbench
CREATE TABLE table_7944 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Money ( $ ), when Score is '75-71-72-70=288'?
SELECT "Money ( $ )" FROM table_7944 WHERE "Score" = '75-71-72-70=288'
wikisql
CREATE TABLE table_38343 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round is the highest one that has an Overall of 32, and a Pick # smaller than 4?...
SELECT MAX("Round") FROM table_38343 WHERE "Overall" = '32' AND "Pick #" < '4'
wikisql
CREATE TABLE table_27537870_3 ( location_attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location and what was the attendance on those days when the score was 3-5-1?
SELECT location_attendance FROM table_27537870_3 WHERE record = "3-5-1"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
nvbench
CREATE TABLE table_58356 ( "Position" text, "Game 1" text, "Game 2" text, "Game 3" text, "Game 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which Game 4 did Michael O'Connor play during Game 1?
SELECT "Game 4" FROM table_58356 WHERE "Game 1" = 'michael o''connor'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-32001' AND patient.wardid = 962 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Colonoscopy"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
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 = '69103720' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-11-04')
css
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 varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTME...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_name_41 ( color_commentator_s_ VARCHAR, channel VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Color commentator has a Channel of fsn new england, and a Year of 2004-05?
SELECT color_commentator_s_ FROM table_name_41 WHERE channel = "fsn new england" AND year = "2004-05"
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 zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '60691424102' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '60691424102'
css
CREATE TABLE table_12592074_1 ( launched VARCHAR, commissioned_or_completed_ VARCHAR, _ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the ship launched when the commissioned or completed(*) is 6 june 1864?
SELECT launched FROM table_12592074_1 WHERE commissioned_or_completed_ * _ = "6 June 1864"
sql_create_context
CREATE TABLE table_64128 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the silver when the Total is 1, and Gold is 1?
SELECT AVG("Silver") FROM table_64128 WHERE "Total" = '1' AND "Gold" = '1'
wikisql
CREATE TABLE table_name_59 ( administrative_panel VARCHAR, nominated_by_the_taoiseach VARCHAR, labour_panel VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of administrative panel with labour panel more than 2, ...
SELECT COUNT(administrative_panel) FROM table_name_59 WHERE labour_panel > 2 AND total = 28 AND nominated_by_the_taoiseach > 6
sql_create_context
CREATE TABLE table_47327 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent played in game 3 before October 18?
SELECT "Opponent" FROM table_47327 WHERE "October" < '18' AND "Game" = '3'
wikisql
CREATE TABLE table_17862135_3 ( number_of_dances VARCHAR, couple VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many dances did Warren & Kym have?
SELECT number_of_dances FROM table_17862135_3 WHERE couple = "Warren & Kym"
sql_create_context
CREATE TABLE table_name_37 ( method VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the match end when his record was 15-11?
SELECT method FROM table_name_37 WHERE record = "15-11"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, ...
SELECT 'id' AS "post_link", 'score', 'creationdate', 'closeddate', 'body' FROM Posts WHERE Score < -10 ORDER BY CreationDate DESC LIMIT 50
sede
CREATE TABLE table_69299 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area of Mangamahu primary school?
SELECT "Area" FROM table_69299 WHERE "Name" = 'mangamahu primary school'
wikisql
CREATE TABLE table_2891 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT MIN("No. in series") FROM table_2891 WHERE "Original air date" = 'March 25, 2010'
wikisql
CREATE TABLE table_27631756_2 ( chairman VARCHAR, captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the chairman when teh captain is fawzi bashir?
SELECT chairman FROM table_27631756_2 WHERE captain = "Fawzi Bashir"
sql_create_context
CREATE TABLE table_40855 ( "Season" text, "Round" text, "Country" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had a game in the first round with a result of 4 1, 0 1?
SELECT "Season" FROM table_40855 WHERE "Round" = 'first round' AND "Result" = '4–1, 0–1'
wikisql
CREATE TABLE table_42044 ( "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What writer has mort drucker as the artist, an issue greater than 470, and law & order: svu as an actua...
SELECT "Writer" FROM table_42044 WHERE "Artist" = 'mort drucker' AND "Issue" > '470' AND "Actual Title" = 'law & order: svu'
wikisql
CREATE TABLE table_name_29 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Charlie Wi's To par?
SELECT to_par FROM table_name_29 WHERE player = "charlie wi"
sql_create_context
CREATE TABLE table_71103 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Set 3 has a Set 1 of 25 20?
SELECT "Set 3" FROM table_71103 WHERE "Set 1" = '25–20'
wikisql
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry
nvbench
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 All_Games, School_ID FROM basketball_match
nvbench
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT KSBM, KSMC FROM jybgb WHERE BGDH = '48779954623'
css
CREATE TABLE table_name_4 ( county VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which county is the swann covered bridge located?
SELECT county FROM table_name_4 WHERE name = "swann covered bridge"
sql_create_context
CREATE TABLE table_54424 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of laps for the driver Jo Siffert?
SELECT MIN("Laps") FROM table_54424 WHERE "Driver" = 'jo siffert'
wikisql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Fever in other diseases"
mimicsql_data
CREATE TABLE table_14594528_6 ( losses VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses for the coach that coached 19 games?
SELECT losses FROM table_14594528_6 WHERE games = 19
sql_create_context
CREATE TABLE table_name_83 ( latitude VARCHAR, year_built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Latitude of the monument built in 1901?
SELECT latitude FROM table_name_83 WHERE year_built = 1901
sql_create_context
CREATE TABLE playlists ( id number, name text ) CREATE TABLE invoices ( id number, customer_id number, invoice_date time, billing_address text, billing_city text, billing_state text, billing_country text, billing_postal_code text, total number ) CREATE TABLE albums ( id...
SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
spider
CREATE TABLE table_name_75 ( yellow_cards INTEGER, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Yellow Cards has a Season of 1999/2000?
SELECT AVG(yellow_cards) FROM table_name_75 WHERE season = "1999/2000"
sql_create_context
CREATE TABLE table_2077192_2 ( french VARCHAR, english VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the French translation for the English word 'orange'?
SELECT french FROM table_2077192_2 WHERE english = "orange"
sql_create_context
CREATE TABLE table_35542 ( "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 is the lowest overall for a quarterback with fewer than 7 rounds?
SELECT MIN("Overall") FROM table_35542 WHERE "Position" = 'quarterback' AND "Round" < '7'
wikisql
CREATE TABLE table_name_34 ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of participants in 2013 when there were more than 5 participants in 2010, less than 4 participants in 2012 and country was germany?
SELECT MIN(2013) FROM table_name_34 WHERE 2010 > 5 AND country = "germany" AND 2012 < 4
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9744702' AND IN_HOSP_DATE BETWEEN '2010-11-16' AND '2019-10-24' AND CLINIC_TYPE = '购药'
css
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 instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE table_70025 ( "Season" text, "Competition" text, "Round" text, "Club" text, "Home" text, "Away" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round did Dundee United end in?
SELECT "Round" FROM table_70025 WHERE "Club" = 'dundee united'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张秀媛' AND NOT ...
css
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 AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3003256' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-03' AND '2013-04-26'
css
CREATE TABLE table_54518 ( "Species" text, "Strain" text, "Type" text, "Base Pairs" real, "Genes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What species has more than 2,030 genes?
SELECT "Species" FROM table_54518 WHERE "Genes" > '2,030'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
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 = 24 AND date_day.month_number = 5 AND da...
atis
CREATE TABLE table_67186 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least wins for 6 points
SELECT MIN("Wins") FROM table_67186 WHERE "Points" = '6'
wikisql
CREATE TABLE table_56711 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the driver for laps of 45
SELECT "Driver" FROM table_56711 WHERE "Laps" = '45'
wikisql
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'medicine consultation' AND DATETIME(trea...
eicu
CREATE TABLE Companies ( Industry VARCHAR, Headquarters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the industries shared by companies whose headquarters are 'USA' and companies whose headquarters are 'China'.
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China"
sql_create_context
CREATE TABLE table_61457 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Opponent in the final on july 4, 2005?
SELECT "Opponent in the final" FROM table_61457 WHERE "Date" = 'july 4, 2005'
wikisql
CREATE TABLE table_11664 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year in Annecy, France?
SELECT MAX("Year") FROM table_11664 WHERE "Venue" = 'annecy, france'
wikisql
CREATE TABLE table_203_642 ( id number, "name" text, "quadrant" text, "sector" text, "ward" text, "type" text, "2012\npopulation\nrank" number, "population\n(2012)" number, "population\n(2011)" number, "% change" number, "dwellings\n(2012)" number, "area\n(km2)" number, ...
SELECT COUNT(*) FROM table_203_642 WHERE "type" = 'industrial'
squall
CREATE TABLE table_11214 ( "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 score on September 1, 199...
SELECT "Result" FROM table_11214 WHERE "Date" = 'september 1, 1996'
wikisql
CREATE TABLE table_name_63 ( first_season_in_first_division VARCHAR, first_season_after_most_recent_promotion VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Alianza's first season in first division with a promotion after 1959?
SELECT first_season_in_first_division FROM table_name_63 WHERE first_season_after_most_recent_promotion = "1959" AND name = "alianza"
sql_create_context
CREATE TABLE table_80084 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who used Gordini Straight-6 in 1956?
SELECT "Entrant" FROM table_80084 WHERE "Engine" = 'gordini straight-6' AND "Year" = '1956'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2041" AND procedures.icd9_code = "3761"
mimicsql_data
CREATE TABLE table_42688 ( "Spoofed Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the artist for Spoofed title Genteel Ben in an issue later than 74?
SELECT "Artist" FROM table_42688 WHERE "Issue" > '74' AND "Spoofed Title" = 'genteel ben'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVO500PM"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT TIME_TO_STR(p.CreationDate, '%Y') AS Year, TIME_TO_STR(p.CreationDate, '%m') AS Month, COUNT(*) AS questions FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId GROUP BY TIME_TO_STR(p.CreationDate, '%Y'), TIME_TO_STR(p.CreationDate, '%m') ORDER BY TIME_TO_STR(p.CreationDate,...
sede
CREATE TABLE table_71374 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Played" FROM table_71374 WHERE "Lost" = '5'
wikisql
CREATE TABLE table_26544 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production cod...
SELECT MIN("Production code") FROM table_26544 WHERE "No. in series" = '86'
wikisql