instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Cu...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) DESC
nvbench
CREATE TABLE table_name_82 ( candidate VARCHAR, share_of_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which candidate won 61.47% of the votes?
SELECT candidate FROM table_name_82 WHERE share_of_votes = "61.47%"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE table_62603 ( "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 Player, when Country is 'United States', and when Place is '6'?
SELECT "Player" FROM table_62603 WHERE "Country" = 'united states' AND "Place" = '6'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2768334' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 16) AS T
css
CREATE TABLE table_203_9 ( id number, "state" text, "last execution date" text, "name" text, "crime" text, "method" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- alabama last put someone to death in 2013 what was its means of execution ?
SELECT "method" FROM table_203_9 WHERE "state" = 'alabama'
squall
CREATE TABLE table_78583 ( "Season" text, "Division North" text, "Division South" text, "Division East" text, "Division West" text, "Division Southwest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won Division West when Division North was...
SELECT "Division West" FROM table_78583 WHERE "Division North" = 'alumina'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2114" AND lab.itemid = "50806"
mimicsql_data
CREATE TABLE table_26389 ( "Branding" text, "Callsign" text, "Frequency" text, "Power kW" text, "Coverage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the radio station branding when the power km is 5kw?
SELECT "Branding" FROM table_26389 WHERE "Power kW" = '5kW'
wikisql
CREATE TABLE table_75901 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team of the game at the time of 15:00?
SELECT "Home" FROM table_75901 WHERE "Time" = '15:00'
wikisql
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STEMI" AND demographic.dod_year <= "2111.0"
mimicsql_data
CREATE TABLE table_31570 ( "Number" real, "Minister" text, "Took office" text, "Left office" text, "Government" text, "Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the mInister who left office during 1960?
SELECT "Minister" FROM table_31570 WHERE "Left office" = '1960'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
CREATE TABLE table_34979 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For an IATA of MLE, what is the ICAO?
SELECT "ICAO" FROM table_34979 WHERE "IATA" = 'mle'
wikisql
CREATE TABLE table_59123 ( "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 Tie no when Crystal Palace is the Away team?
SELECT "Tie no" FROM table_59123 WHERE "Away team" = 'crystal palace'
wikisql
CREATE TABLE table_76543 ( "Year" real, "Date" text, "Race name" text, "Winner" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race did Bill Holland win in 1946?
SELECT "Race name" FROM table_76543 WHERE "Year" = '1946' AND "Winner" = 'bill holland'
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "27"
mimicsql_data
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 445 AND instructor.name LIKE '%Simon Wojczyszyn%' AND offering_instructor.instructor_id = instructor.instructor_id AND offerin...
advising
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 = '6425807' AND IN_HOSP_DATE BETWEEN '2001-07-03' AND '2018-10-02' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_204_99 ( id number, "#" number, "club" text, "winner" number, "last win" number, "runner-up" number, "last losing final" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what club is before saipa ?
SELECT "club" FROM table_204_99 WHERE id = (SELECT id FROM table_204_99 WHERE "club" = 'saipa') - 1
squall
CREATE TABLE table_name_65 ( year INTEGER, sideline_reporters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average year that sara orlesky and farhan lalji are the sideline reporters?
SELECT AVG(year) FROM table_name_65 WHERE sideline_reporters = "sara orlesky and farhan lalji"
sql_create_context
CREATE TABLE table_2528382_2 ( Co VARCHAR, singers VARCHAR, movie_album VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which co-singers appear in the movie Pyaasa?
SELECT Co - singers FROM table_2528382_2 WHERE movie_album = "Pyaasa"
sql_create_context
CREATE TABLE table_name_59 ( location VARCHAR, college_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the kanyakumari government medical college?
SELECT location FROM table_name_59 WHERE college_name = "kanyakumari government medical college"
sql_create_context
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 countries ( COUNTRY_ID...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
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.dod_year <= "2186.0" AND procedures.short_title = "Chordae tendineae ops"
mimicsql_data
CREATE TABLE table_name_80 ( points_against VARCHAR, drawn VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Points Against, when Drawn is '2', and when Points Of is '32'?
SELECT points_against FROM table_name_80 WHERE drawn = "2" AND points = "32"
sql_create_context
CREATE TABLE table_70297 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for august 28
SELECT "Record" FROM table_70297 WHERE "Date" = 'august 28'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
SELECT YEAR(Posts.CreationDate), COUNT(Posts.Id) FROM Posts INNER JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = @question AND PH.PostHistoryTypeId = @closed AND CAST(PH.Comment AS TEXT) IN ('1', '101') GROUP BY YEAR(Posts.CreationDate) ORDER BY YEAR(Posts.CreationDate)
sede
CREATE TABLE fgwyjzb ( 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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '潘天蓝' AND gwyjzb.MED_SER_ORG_NO = '0395177' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '柳%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '潘天蓝' AND fgwyjzb.MED_SER_ORG_NO = '0395177' AN...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "99659" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12221')) AND NOT vitalperiodic.sao2 IS NULL AND STRFTIME('...
eicu
CREATE TABLE table_name_56 ( drawn VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was drawn for llanishen rfc?
SELECT drawn FROM table_name_56 WHERE club = "llanishen rfc"
sql_create_context
CREATE TABLE table_14118521_1 ( primary_payload_s_ VARCHAR, launch_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the primary payload(s) with launch date being july 8, 1994
SELECT primary_payload_s_ FROM table_14118521_1 WHERE launch_date = "July 8, 1994"
sql_create_context
CREATE TABLE table_name_40 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg that has a Rc Cannes Team 1?
SELECT 1 AS st_leg FROM table_name_40 WHERE team_1 = "rc cannes"
sql_create_context
CREATE TABLE table_14948647_1 ( bhofen_number2__rk_ VARCHAR, ga_pa__rk_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Bhofen #2 score and rank for the player whose GA-PA score and rank was 227.5 (19)?
SELECT bhofen_number2__rk_ FROM table_14948647_1 WHERE ga_pa__rk_ = "227.5 (19)"
sql_create_context
CREATE TABLE table_43087 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Giants' points" text, "Opponents' Points" text, "Record" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many...
SELECT "Giants' points" FROM table_43087 WHERE "Attendance" = '78,673'
wikisql
CREATE TABLE table_203_783 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has internacional de madrid cf been playing in the 3 division ?
SELECT COUNT(*) FROM table_203_783 WHERE "division" = '3a'
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "94756"
mimicsql_data
CREATE TABLE table_name_47 ( opponent VARCHAR, record VARCHAR, game VARCHAR, february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in games over 58, after Feb 16, and having a record of 40-20-4?
SELECT opponent FROM table_name_47 WHERE game > 58 AND february > 16 AND record = "40-20-4"
sql_create_context
CREATE TABLE table_train_189 ( "id" int, "alt" float, "hyperglycemia" bool, "liver_disease" bool, "smoking" bool, "alcohol_abuse" bool, "drug_abuse" bool, "triglyceride_tg" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_189 WHERE smoking = 1
criteria2sql
CREATE TABLE table_14230 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tries against has Points against la...
SELECT AVG("Tries against") FROM table_14230 WHERE "Points against" > '156' AND "Points for" = '127' AND "Tries for" > '17'
wikisql
CREATE TABLE table_46040 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest gold with a total over 15 and less than 16 silver?
SELECT MIN("Gold") FROM table_46040 WHERE "Total" > '15' AND "Silver" < '16'
wikisql
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
SELECT Name, Total_Passengers FROM station WHERE Location <> 'London'
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT 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 '2000-07-27' AND '2006-10-24' AND t_kc22.SELF_PAY_AMO > 1217.85
css
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of t...
SELECT Open_Date, COUNT(Open_Date) FROM church
nvbench
CREATE TABLE table_name_19 ( branding VARCHAR, location VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Branding of the Metro Manila Frequency with a Callsign of DWBL?
SELECT branding FROM table_name_19 WHERE location = "metro manila" AND callsign = "dwbl"
sql_create_context
CREATE TABLE table_55245 ( "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. -- I want to know the home team score for essendon ...
SELECT "Home team score" FROM table_55245 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE table_name_78 ( source VARCHAR, remainder VARCHAR, topinka__r_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Source has a Remainder of 15%, and a Topinka of 26%?
SELECT source FROM table_name_78 WHERE remainder = "15%" AND topinka__r_ = "26%"
sql_create_context
CREATE TABLE table_29033869_3 ( round INTEGER, result__includes_margin_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest round where collingswood lost by 36 points?
SELECT MIN(round) FROM table_29033869_3 WHERE result__includes_margin_ = "Lost by 36 points"
sql_create_context
CREATE TABLE table_name_76 ( entered_service VARCHAR, gauge VARCHAR, serial_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of entered service for the locomotive with a broad gauge and a serial no of 83-1018?
SELECT entered_service FROM table_name_76 WHERE gauge = "broad" AND serial_no = "83-1018"
sql_create_context
CREATE TABLE table_name_40 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team's score in the game played at glenferrie oval?
SELECT home_team AS score FROM table_name_40 WHERE venue = "glenferrie oval"
sql_create_context
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 (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7543247' AND IN_HOSP_DATE BETWEEN '2011-06-26' AND '2014-08-15') - (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7543247' AND IN_HOSP_DATE BETWEEN '2011-06-26' AND '2014-08-15' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, ...
SELECT * FROM Tags WHERE TagName LIKE '%^-+a-z0-9.%'
sede
CREATE TABLE table_52175 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team when the home team was South Melbourne?
SELECT "Away team" FROM table_52175 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_77490 ( "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. -- With a...
SELECT "High points" FROM table_77490 WHERE "Series" = '0-2'
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 JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text...
SELECT SUM(enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation
spider
CREATE TABLE table_5590 ( "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 team scored 17
SELECT "Date" FROM table_5590 WHERE "Game" = '17'
wikisql
CREATE TABLE table_17888 ( "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. -- Which club had a player born in 1983?
SELECT "Current Club" FROM table_17888 WHERE "Year born" = '1983'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT u.Age, COUNT(CASE WHEN p.PostTypeId = 1 AND p.Score = 0 THEN 1 END) AS equals, COUNT(CASE WHEN p.PostTypeId = 1 AND p.Score > 0 THEN 1 END) AS bolshe FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId GROUP BY u.Age HAVING COUNT(CASE WHEN p.PostTypeId = 1 THEN 1 END) > 50
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-40637') AND diagnosis.diagnos...
eicu
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 * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '蒋清淑' AND hz_info.YLJGDM = '6779932' AND NOT mzjzjlb.JZZDSM LIKE '%维生素%'
css
CREATE TABLE device ( Software_Platform VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the software platform shared by the greatest number of devices.
SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_75017 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Type of game was played on Date of July 29?
SELECT "Type of game" FROM table_75017 WHERE "Date" = 'july 29'
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 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 WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "WHITE - RUSSIAN"
mimicsql_data
CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player ( ...
SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY COUNT(Occupation) DESC
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND intakeoutput.cellpath LIKE '%in...
eicu
CREATE TABLE table_name_4 ( venue VARCHAR, championships VARCHAR, established VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Venue has more than 1 Championship and was Established after 1957?
SELECT venue FROM table_name_4 WHERE championships = 1 AND established > 1957
sql_create_context
CREATE TABLE table_name_57 ( outcome VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the outcome with tournament of mexico f12, obreg n
SELECT outcome FROM table_name_57 WHERE tournament = "mexico f12, obregón"
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, ...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_22274 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many callings of trains arriving at 09.06
SELECT COUNT("Calling at") FROM table_22274 WHERE "Arrival" = '09.06'
wikisql
CREATE TABLE table_name_34 ( soccer VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does Detroit have a soccer team?
SELECT soccer FROM table_name_34 WHERE school = "detroit"
sql_create_context
CREATE TABLE table_202_236 ( id number, "bank" text, "foundation" number, "# of branches\nas of 30 september 2012" number, "total assets (million tl)\nas of 30 september 2012" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which bank has four time...
SELECT "bank" FROM table_202_236 WHERE "total assets (million tl)\nas of 30 september 2012" = (SELECT "total assets (million tl)\nas of 30 september 2012" FROM table_202_236 WHERE "bank" = 'taib yatırım bank') * 4
squall
CREATE TABLE table_name_76 ( year_s__won VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years won when the to par is +5?
SELECT year_s__won FROM table_name_76 WHERE to_par = "+5"
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '53441764' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44)
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND patient.unitdischargetime IS N...
eicu
CREATE TABLE table_4048 ( "Year" real, "Host Nation(s)" text, "Final Venue" text, "Winner" text, "Result" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the winning records when the result is Scotland won on points...
SELECT "Winner" FROM table_4048 WHERE "Result" = 'Scotland won on points table' AND "Runner-up" = '[[|]] 4 points'
wikisql
CREATE TABLE table_2127933_3 ( year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years had scores of 10 12, 6 1, 6 3?
SELECT COUNT(year) FROM table_2127933_3 WHERE score = "10–12, 6–1, 6–3"
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.days_stay FROM demographic WHERE demographic.name = "Sheila Riley"
mimicsql_data
CREATE TABLE table_39179 ( "Date" real, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of competition had an attendance of more than 914 people and the Wigh...
SELECT "Competition" FROM table_39179 WHERE "Attendance" > '914' AND "Opponent" = 'wightlink raiders'
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 AVG(t_kc24.PER_ACC_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2770364' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-07' AND '2017-04-04'
css
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 demographic.age < "41" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)"
mimicsql_data
CREATE TABLE table_name_57 ( away VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team of the game at the time 15:00?
SELECT away FROM table_name_57 WHERE time = "15:00"
sql_create_context
CREATE TABLE table_79 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the original air date with title 'hell
SELECT "Original air date" FROM table_79 WHERE "Title" = 'Hell'
wikisql
CREATE TABLE table_37133 ( "Games" real, "Drawn" real, "Lost" real, "Goal difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of drawn with lost more than 1 and games less than 5
SELECT SUM("Drawn") FROM table_37133 WHERE "Lost" > '1' AND "Games" < '5'
wikisql
CREATE TABLE table_name_45 ( pos VARCHAR, height VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pos., when Height is 'm (ft 10in)', and when Date of Birth is '1983-05-29'?
SELECT pos FROM table_name_45 WHERE height = "m (ft 10in)" AND date_of_birth = "1983-05-29"
sql_create_context
CREATE TABLE table_name_69 ( city VARCHAR, first_season_of_current_spell_in_segunda_división INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has a First season of current spell in Segunda Divisi n smaller than 2013?
SELECT city FROM table_name_69 WHERE first_season_of_current_spell_in_segunda_división < 2013
sql_create_context
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 COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25847) AND prescriptions.drug IN ('neostigmine', 'ns', 'morphine sulfate') AND STRFTIME('%y-%m', prescriptions.startdate) >= '2101-02'
mimic_iii
CREATE TABLE railway ( Builder VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show different builders of railways, along with the corresponding number of railways using each builder.
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id n...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_name_82 ( losses VARCHAR, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of losses for years with fewer than 9 wins?
SELECT COUNT(losses) FROM table_name_82 WHERE wins < 9
sql_create_context
CREATE TABLE table_15467476_2 ( points VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points for pontrhydyfen rfc
SELECT points FROM table_15467476_2 WHERE club = "Pontrhydyfen RFC"
sql_create_context
CREATE TABLE table_10412 ( "Class" text, "Type" text, "Quantity" real, "Date" text, "LNER Class" text, "1946 LNER nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class has less in quantity than 174 between the years 1921 23?
SELECT "Class" FROM table_10412 WHERE "Quantity" < '174' AND "Date" = '1921–23'
wikisql
CREATE TABLE table_41606 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Title written by Terri Hughes & Ron Milbauer, and an Original air ...
SELECT "Title" FROM table_41606 WHERE "Written by" = 'terri hughes & ron milbauer' AND "Original air date" = 'march 6, 2001'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
SELECT Id AS "comment_link", Score, CreationDate, LENGTH(Text) FROM Comments WHERE Text LIKE '%accepting%' AND LENGTH(Text) >= '##MinLength:int?40##' AND LENGTH(Text) < '##MaxLength:int?55##' AND (Text LIKE 'Thank%' OR Text LIKE 'Please%' OR Text LIKE '%-1%') ORDER BY Score DESC, LENGTH(Text)
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-78423' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
SELECT COUNT(*) FROM Posts WHERE YEAR(Posts.CreationDate) = 2017
sede
CREATE TABLE table_31690 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player from dallas burn
SELECT "Player" FROM table_31690 WHERE "MLS team" = 'dallas burn'
wikisql