instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_77671 ( "Season" text, "Div." text, "Pos." text, "Pld." text, "Pts." text, "Play-offs" text, "Trophy" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During the play-off quarter-final which team scored position was the team...
SELECT "Pos." FROM table_77671 WHERE "Play-offs" = 'quarter-final' AND "Pts." = '56'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '58930986' AND IN_HOSP_DATE BETWEEN '2002-08-30' AND '2016-07-24' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_48671 ( "Party" text, "Seats (dissol.)" real, "Seats (2012)" real, "Gains" real, "Holds" real, "Losses" real, "Net change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Losses that has the Gains...
SELECT MIN("Losses") FROM table_48671 WHERE "Gains" < '0'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCFF 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 AND jybgb.YLJGDM = jyj...
css
CREATE TABLE table_22219 ( "Year" real, "Delegate" text, "Hometown" text, "Pageant" text, "Result" text, "Other awards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pageants were margaret ann awitan bayot the delegate of?
SELECT COUNT("Pageant") FROM table_22219 WHERE "Delegate" = 'Margaret Ann Awitan Bayot'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '007-7925'
eicu
CREATE TABLE table_20878 ( "Player" text, "VFL Games" real, "VFL Club(s)" text, "Rank held at time of death" text, "Date of death" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did ARchie Roberts die?
SELECT "Date of death" FROM table_20878 WHERE "Player" = 'Archie Roberts'
wikisql
CREATE TABLE table_name_81 ( office VARCHAR, representative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Office has a Representative of scott pelath?
SELECT office FROM table_name_81 WHERE representative = "scott pelath"
sql_create_context
CREATE TABLE table_name_56 ( lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team lost the most points
SELECT lost FROM table_name_56 WHERE "points" = "points"
sql_create_context
CREATE TABLE table_35434 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of team with Palmeiras 4-2 port...
SELECT "Team" FROM table_35434 WHERE "Last match" = 'palmeiras 4-2 portuguesa'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
mimic_iii
CREATE TABLE table_25428629_1 ( date VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the stadium name is the Thuwunna Stadium, what is the date?
SELECT date FROM table_25428629_1 WHERE stadium = "Thuwunna stadium"
sql_create_context
CREATE TABLE table_name_85 ( position VARCHAR, league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position when the League is the malaysian super league, and a Year of 2011?
SELECT position FROM table_name_85 WHERE league = "malaysian super league" AND year = "2011"
sql_create_context
CREATE TABLE table_204_173 ( id number, "rank" number, "group" text, "name" text, "nationality" text, "2.05" text, "2.15" text, "2.19" text, "2.23" text, "2.26" text, "result" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "name" FROM table_204_173 WHERE "rank" = '2.05'
squall
CREATE TABLE table_8569 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did team iurbentia bilbao have with rebounds higher than 212?
SELECT SUM("Games") FROM table_8569 WHERE "Team" = 'iurbentia bilbao' AND "Rebounds" > '212'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND intakeoutput.cellpath LIKE '%intake%' ORDER...
eicu
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 varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_58228 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a time of 20:10?
SELECT "Date" FROM table_58228 WHERE "Time" = '20:10'
wikisql
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_name_70 ( transfer_fee VARCHAR, transfer_window VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer fee of assoumani, who has a summer transfer window?
SELECT transfer_fee FROM table_name_70 WHERE transfer_window = "summer" AND name = "assoumani"
sql_create_context
CREATE TABLE table_name_66 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest game on February 10?
SELECT MIN(game) FROM table_name_66 WHERE date = "february 10"
sql_create_context
CREATE TABLE table_name_77 ( category_3 VARCHAR, category_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If category 1 is 0.05, what is category 3?
SELECT category_3 FROM table_name_77 WHERE category_1 = 0.05
sql_create_context
CREATE TABLE table_12584173_1 ( population__glengallan_ VARCHAR, population__region_total_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many population figures are given for Glengallen for the year when the region's total is 30554?
SELECT COUNT(population__glengallan_) FROM table_12584173_1 WHERE population__region_total_ = 30554
sql_create_context
CREATE TABLE table_204_453 ( id number, "#" number, "date" text, "venue" text, "opponents" text, "score" text, "comp" text, "denmark scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference in score between the two...
SELECT ABS("score" - "score") FROM table_204_453 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_197286_4 ( direction VARCHAR, further_cities VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of direction for debrecen
SELECT COUNT(direction) FROM table_197286_4 WHERE further_cities = "Debrecen"
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 ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID)
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 yea...
eicu
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.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 table_6672 ( "Mission" text, "Resident Country" text, "Local Location" text, "Local Mission" text, "Local Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the local location that has senegal as the resident county, and a...
SELECT "Local Location" FROM table_6672 WHERE "Resident Country" = 'senegal' AND "Mission" = 'mali'
wikisql
CREATE TABLE table_55128 ( "Name" text, "Actual version" text, "System" text, "Platform" text, "License" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which License has a System of amiga, and a Name of pocketuae?
SELECT "License" FROM table_55128 WHERE "System" = 'amiga' AND "Name" = 'pocketuae'
wikisql
CREATE TABLE table_20972 ( "Runs" text, "Wicket" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What batting partners played in sydney?
SELECT "Batting partners" FROM table_20972 WHERE "Venue" = 'Sydney'
wikisql
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE band ( id number, firstname text, lastname text ) C...
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "back"
spider
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time
nvbench
CREATE TABLE table_6553 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the road team of the game with Philadelphia as the home team with a result of 105-102?
SELECT "Road Team" FROM table_6553 WHERE "Home Team" = 'philadelphia' AND "Result" = '105-102'
wikisql
CREATE TABLE table_52212 ( "Year" real, "Theme" text, "Artist" text, "Mintage" text, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the issue price of a Year 2000 coin by artist John Mardon of the Included in Steam Buggy mintag...
SELECT "Issue Price" FROM table_52212 WHERE "Artist" = 'john mardon' AND "Year" = '2000' AND "Mintage" = 'included in steam buggy'
wikisql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE View_Unit_Status ( apt_id INTEG...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_name_7 ( _number_of_bids INTEGER, win__percentage VARCHAR, conference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bids were there for the .500 win percentage in the Ohio Valley conference?
SELECT SUM(_number_of_bids) FROM table_name_7 WHERE win__percentage = ".500" AND conference = "ohio valley"
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 COUNT(*) FROM t_kc21 WHERE PERSON_NM = '彭雅蕊' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
css
CREATE TABLE table_43569 ( "landsv\u00e6\u00f0i" text, "(English)" text, "Population 2011-01-01" text, "Area (km\u00b2)" text, "Pop./ km\u00b2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What area has less than 0.97 mil in population and is on t...
SELECT "Area (km\u00b2)" FROM table_43569 WHERE "Pop./ km\u00b2" < '0.97' AND "(English)" = 'east'
wikisql
CREATE TABLE table_name_33 ( venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue where the result was 2-1?
SELECT venue FROM table_name_33 WHERE result = "2-1"
sql_create_context
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '喻英朗' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Chordae tendineae ops"
mimicsql_data
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 LENGTH(twe.Body), t.TagName, twe.Body FROM Posts AS twe JOIN Tags AS t ON twe.Id = t.ExcerptPostId WHERE twe.PostTypeId = 4 AND LENGTH(twe.Body) > 300 ORDER BY 1 DESC
sede
CREATE TABLE table_name_32 ( overall INTEGER, round VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average overall value for a round less than 4 associated with the College of Georgia?
SELECT AVG(overall) FROM table_name_32 WHERE round < 4 AND college = "georgia"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
SELECT SUM(UpVotes), SUM(DownVotes) FROM Users WHERE Reputation >= 100 AND Reputation < 10000 GROUP BY Reputation / 50 * 50 ORDER BY Reputation / 50 * 50
sede
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT OwnerUserId, OwnerDisplayName, Id, PostTypeId, AnswerCount, CommentCount, Score, ViewCount, FavoriteCount FROM Posts WHERE OwnerUserId IN (12960) AND PostTypeId = 1
sede
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.days_stay = "14"
mimicsql_data
CREATE TABLE table_40290 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Runner-up with the tier was tier ii, and a Winner of gigi fern ndez natalia zvereva ...
SELECT "Runner-up" FROM table_40290 WHERE "Tier" = 'tier ii' AND "Winner" = 'gigi fernández natalia zvereva 5–7, 6–1, 6–4'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Lidocaine 1%"
mimicsql_data
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), ...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC
nvbench
CREATE TABLE table_58181 ( "Nationality" text, "Position" text, "Tottenham Hotspur career" text, "Club Apps" text, "Goals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player from England with 62 goals?
SELECT "Position" FROM table_58181 WHERE "Nationality" = 'england' AND "Goals" = '62'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "WBC, Other Fluid"
mimicsql_data
CREATE TABLE table_name_68 ( round INTEGER, school_club_team VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a School/Club Team of arizona, and a Pick smaller than 298?
SELECT MAX(round) FROM table_name_68 WHERE school_club_team = "arizona" AND pick < 298
sql_create_context
CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only country to not receive a gold medal ?
SELECT "nation" FROM table_204_785 WHERE "gold" = 0
squall
CREATE TABLE table_15844 ( "State/territory" text, "Text/background colour" text, "Format" text, "Current slogan" text, "Current series" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the background colour for the Australian C...
SELECT "Text/background colour" FROM table_15844 WHERE "State/territory" = 'Australian Capital Territory'
wikisql
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_54 ( pennant_number INTEGER, ships_in_class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pennant number with ships in raahe class?
SELECT MAX(pennant_number) FROM table_name_54 WHERE ships_in_class = "raahe"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(((CAST((DownVotes * 100) AS FLOAT)) / (CAST((UpVotes + DownVotes) AS FLOAT))), 2) AS PercentDownvotes FROM Users WHERE Reputation >= '##MinReputation##' AND Reputation <= '##MaxReputation##' AND (UpVotes + DownVotes > 0) ORDER BY PercentDownvotes DESC
sede
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name
nvbench
CREATE TABLE table_15748 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with a production code greater than 1.4 direcyed by rick wall...
SELECT "Written by" FROM table_15748 WHERE "Prod. code" > '1.4' AND "Directed by" = 'rick wallace'
wikisql
CREATE TABLE table_name_26 ( goals INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Goals have a Result of 0 4?
SELECT AVG(goals) FROM table_name_26 WHERE result = "0 – 4"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '水清懿' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM person_info JO...
css
CREATE TABLE table_name_32 ( republican_ticket VARCHAR, communist_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Republican ticket with a Communist ticket of elizabeth gurley flynn?
SELECT republican_ticket FROM table_name_32 WHERE communist_ticket = "elizabeth gurley flynn"
sql_create_context
CREATE TABLE table_13657883_2 ( gtu_winning_team VARCHAR, gto_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the gtu winning team when the gto winning team was #48 greenwood racing?
SELECT gtu_winning_team FROM table_13657883_2 WHERE gto_winning_team = "#48 Greenwood Racing"
sql_create_context
CREATE TABLE table_name_89 ( winner VARCHAR, stage VARCHAR, points_classification VARCHAR, intergiro_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winner for adriano baffi and integiro classification of j n svorada for stage ...
SELECT winner FROM table_name_89 WHERE points_classification = "adriano baffi" AND intergiro_classification = "ján svorada" AND stage = "13"
sql_create_context
CREATE TABLE table_name_15 ( pick INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mark Joseph Kong's pick?
SELECT AVG(pick) FROM table_name_15 WHERE player = "mark joseph kong"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ...
SELECT Id, Title, Score FROM Posts WHERE Title LIKE '/%/'
sede
CREATE TABLE table_31109 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 75849 is the production...
SELECT "Production in 2011 (1,000 ton)" FROM table_31109 WHERE "Production in 2010 (1,000 ton)" = '75849'
wikisql
CREATE TABLE table_15869204_9 ( high_rebounds VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored the most rebounds in the game against Chicago?
SELECT high_rebounds FROM table_15869204_9 WHERE team = "Chicago"
sql_create_context
CREATE TABLE table_1301373_7 ( captain VARCHAR, international_marquee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the captain for emile heskey
SELECT captain FROM table_1301373_7 WHERE international_marquee = "Emile Heskey"
sql_create_context
CREATE TABLE table_name_74 ( malaysia_cup INTEGER, player VARCHAR, fa_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Zamri Hassan's lowest Malaysia Cup when there were an FA Cup of 0?
SELECT MIN(malaysia_cup) FROM table_name_74 WHERE player = "zamri hassan" AND fa_cup < 0
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'W44.704' AND jyjgzbb.JCZBMC = '游离前列腺特异性...
css
CREATE TABLE table_77767 ( "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 was the lowest Crowd during the Away Team S...
SELECT MIN("Crowd") FROM table_77767 WHERE "Away team score" = '10.11 (71)'
wikisql
CREATE TABLE department ( school_code VARCHAR, dept_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of departments in each school.
SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code
sql_create_context
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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '袁文栋' AND t_kc22.STA_DATE BETWEEN '2004-09-29' AND '2021-10-04' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ...
css
CREATE TABLE table_24954 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most rank
SELECT MAX("Rank") FROM table_24954
wikisql
CREATE TABLE table_13576 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the player from the United States, with a total larger than 145?
SELECT "Player" FROM table_13576 WHERE "Country" = 'united states' AND "Total" > '145'
wikisql
CREATE TABLE table_50118 ( "Points" real, "Score" text, "Premiers" text, "Runners Up" text, "Details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which premier team played the 1951 NSWRFL Grand Final?
SELECT "Premiers" FROM table_50118 WHERE "Details" = '1951 nswrfl grand final'
wikisql
CREATE TABLE table_32558 ( "Week" text, "Date" text, "Location" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who one in the Tampa Bay Buccaneers?
SELECT "Result" FROM table_32558 WHERE "Opponent" = 'tampa bay buccaneers'
wikisql
CREATE TABLE table_67830 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college when the over is larger than 15 in round 7?
SELECT "College" FROM table_67830 WHERE "Overall" > '15' AND "Round" = '7'
wikisql
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE ...
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
CREATE TABLE table_name_97 ( winner VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo is the Winner of andre agassi Finalist?
SELECT winner FROM table_name_97 WHERE finalist = "andre agassi"
sql_create_context
CREATE TABLE table_72800 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the points for ktm-vmc equipment?
SELECT "Points" FROM table_72800 WHERE "Equipment" = 'KTM-VMC'
wikisql
CREATE TABLE table_name_81 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Player is 'Vijay Singh'?
SELECT score FROM table_name_81 WHERE player = "vijay singh"
sql_create_context
CREATE TABLE table_30235 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was t...
SELECT "Round" FROM table_30235 WHERE "Winners from previous round" = '32'
wikisql
CREATE TABLE table_name_37 ( nation VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nation with a Record that is 7.39?
SELECT nation FROM table_name_37 WHERE record = "7.39"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
SELECT Id, DisplayName, DATEDIFF(dd, CreationDate, GETDATE()), Reputation FROM Users WHERE Id = 186134
sede
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dor...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) 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), fam...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish"
nvbench
CREATE TABLE table_203_512 ( id number, "release date" text, "album" text, "catalog number" text, "chart position" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- pulse was the first album what was the second ?
SELECT "album" FROM table_203_512 WHERE id = 2
squall
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station...
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY name
nvbench
CREATE TABLE table_19786 ( "English gloss" text, "Santee-Sisseton" text, "Yankton-Yanktonai" text, "Northern Lakota" text, "Southern Lakota" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the yankton yanktonai for wi h a
SELECT "Yankton-Yanktonai" FROM table_19786 WHERE "Southern Lakota" = 'wičháša'
wikisql
CREATE TABLE Staff ( first_name VARCHAR ) CREATE TABLE Lessons ( staff_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first name of the staff who did not give any lesson?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
sql_create_context
CREATE TABLE table_name_66 ( country VARCHAR, value_in_usd VARCHAR, currency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country uses pound sterling with a value higher than 1.33 USD?
SELECT country FROM table_name_66 WHERE value_in_usd > 1.33 AND currency = "pound sterling"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '00619973238' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '00619973238'
css
CREATE TABLE table_name_43 ( ihsaa_class___football___soccer VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is teh ihsaa class/football/soccer when the location is alexandria?
SELECT ihsaa_class___football___soccer FROM table_name_43 WHERE location = "alexandria"
sql_create_context