instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_65497 ( "Index" text, "Score" text, "PALOP rank" text, "CPLP rank" text, "n Africa rank" text, "World rank" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year had a score of 0.586?
SELECT COUNT("Year") FROM table_65497 WHERE "Score" = '0.586'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'entral infus nutrit sub') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26218 AND NOT admissions.di...
mimic_iii
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 prescription...
SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_63619 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Year Joined" real, "Previous Conference" text, "Year Left" real, "Conference Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Ye...
SELECT SUM("Year Left") FROM table_63619 WHERE "Location" = 'howe'
wikisql
CREATE TABLE table_name_65 ( longitude INTEGER, diameter__km_ VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of longitude for diameter being 22.6 and latitude less than -12.4
SELECT SUM(longitude) FROM table_name_65 WHERE diameter__km_ = 22.6 AND latitude < -12.4
sql_create_context
CREATE TABLE table_name_91 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has an Attendance of 20,112?
SELECT MAX(week) FROM table_name_91 WHERE attendance = 20 OFFSET 112
sql_create_context
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID...
SELECT Participant_Details, Participant_ID FROM Participants
nvbench
CREATE TABLE table_name_15 ( rounds VARCHAR, chassis VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds did geoff lees drive with chassis of n180?
SELECT rounds FROM table_name_15 WHERE chassis = "n180" AND driver = "geoff lees"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<code>' + '##WordFormattedAsCode:string##' + '</code>%' LIMIT 100
sede
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.age < "27"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - acetabulum' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_...
SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY AVG(credits)
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_64991 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is cork's rank?
SELECT "Rank" FROM table_64991 WHERE "County" = 'cork'
wikisql
CREATE TABLE table_69045 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With an Overall larger than 107, in what Round was Jim Duncan picked?
SELECT SUM("Round") FROM table_69045 WHERE "Name" = 'jim duncan' AND "Overall" > '107'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_47682 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE GRID OF HONDA, WITH 24 LAPS AND Time/Retired of +13.997?
SELECT "Grid" FROM table_47682 WHERE "Manufacturer" = 'honda' AND "Laps" = '24' AND "Time/Retired" = '+13.997'
wikisql
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...
WITH Raw AS (SELECT A.TagId AS TagA, B.TagId AS TagB, COUNT(*) AS Count FROM PostTags AS A, PostTags AS B WHERE A.PostId = B.PostId AND A.TagId != B.TagId GROUP BY A.TagId, B.TagId) SELECT A.TagName AS TagNameA, A.Count AS CountA, B.TagName AS TagNameB, B.Count AS CountB, Raw.Count AS BothCount, (1.0 * Raw.Count * @Tot...
sede
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "ACIDOSIS"
mimicsql_data
CREATE TABLE table_754 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were first elected when the incumbent was Morgan M. Moulder?
SELECT COUNT("First elected") FROM table_754 WHERE "Incumbent" = 'Morgan M. Moulder'
wikisql
CREATE TABLE table_name_4 ( week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Week that has a Date of december 5, 1959 had what week?
SELECT week FROM table_name_4 WHERE date = "december 5, 1959"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
SELECT a.Id, a.Score, q.Score, q.CreationDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.Score <= -3 AND q.CreationDate >= '2014-07-18' AND a.OwnerUserId = 1387518 ORDER BY CreationDate DESC
sede
CREATE TABLE table_204_912 ( id number, "rank" number, "athlete" text, "country" text, "time" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was faster , mikio oyama or arnulf sunde ?
SELECT "athlete" FROM table_204_912 WHERE "athlete" IN ('mikio oyama', 'arnulf sunde') ORDER BY "time" LIMIT 1
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id nu...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal tap') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND STRFTIME('%y', procedures...
mimic_iii
CREATE TABLE table_21369 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the area is 34.73, what is the census ranking?
SELECT "Census Ranking" FROM table_21369 WHERE "Area km 2" = '34.73'
wikisql
CREATE TABLE table_16488 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the english title where ...
SELECT "English title" FROM table_16488 WHERE "Premiere" < '30.0' AND "Finale" > '36.0'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Hematology"
mimicsql_data
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 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '06002285' AND t_kc22.STA_DATE BETWEEN '2015-05-16' AND '2018-08-07' AND t_kc22.SOC_SRT_DIRE_NM = '妥布霉素滴眼液'
css
CREATE TABLE table_22113 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the district of Pennsylvania 1, what is the total number of politica...
SELECT COUNT("Party") FROM table_22113 WHERE "District" = 'Pennsylvania 1'
wikisql
CREATE TABLE table_name_85 ( term_end VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date or dates did the term with the Centre Party end?
SELECT term_end FROM table_name_85 WHERE party = "centre party"
sql_create_context
CREATE TABLE table_66425 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament had Alberta Brianti as an opponent with a score of 6-4 2-6 6-2?
SELECT "Tournament" FROM table_66425 WHERE "Opponent" = 'alberta brianti' AND "Score" = '6-4 2-6 6-2'
wikisql
CREATE TABLE table_48567 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of player jay haas?
SELECT "Score" FROM table_48567 WHERE "Player" = 'jay haas'
wikisql
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '38259980479' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '38259980479'
css
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 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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
mimicsql_data
CREATE TABLE table_20042805_2 ( hadeda_ibis VARCHAR, whitefaced_duck VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hadeda Ibis when the Whitefaced Duck is Blacksmith Plover?
SELECT hadeda_ibis FROM table_20042805_2 WHERE whitefaced_duck = "Blacksmith Plover"
sql_create_context
CREATE TABLE table_64661 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when silver is more than 3, and rank is 2?
SELECT MAX("Total") FROM table_64661 WHERE "Silver" > '3' AND "Rank" = '2'
wikisql
CREATE TABLE table_5116 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party had an incumbent of W. Jasper Talbert?
SELECT "Party" FROM table_5116 WHERE "Incumbent" = 'w. jasper talbert'
wikisql
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.age, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT t.name, i.rowcnt FROM sys.tables AS t INNER JOIN sysindexes AS i ON i.id = t.object_id AND i.indid IN (0, 1) ORDER BY 2 DESC
sede
CREATE TABLE table_name_5 ( record VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record when the high rebounds was Antonio Davis (9)?
SELECT record FROM table_name_5 WHERE high_rebounds = "antonio davis (9)"
sql_create_context
CREATE TABLE table_27913160_3 ( driver VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver in round 8?
SELECT driver FROM table_27913160_3 WHERE round = 8
sql_create_context
CREATE TABLE table_204_96 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the date of the last game ?
SELECT "date" FROM table_204_96 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "5027"
mimicsql_data
CREATE TABLE table_name_13 ( baltimore_group VARCHAR, family VARCHAR, replication_site VARCHAR, virion_shape VARCHAR, envelopment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Baltimore group has a viron shape of icosahedral, replicates in...
SELECT baltimore_group FROM table_name_13 WHERE virion_shape = "icosahedral" AND envelopment = "non-enveloped" AND replication_site = "cytoplasm" AND family = "astroviridae"
sql_create_context
CREATE TABLE table_name_45 ( country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country for t3 place
SELECT country FROM table_name_45 WHERE place = "t3"
sql_create_context
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority
nvbench
CREATE TABLE albums ( id number, title text, artist_id number ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, suppo...
SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100
spider
CREATE TABLE table_52200 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In game 34 Curtis Borchardt played on which team with less than 275 rebounds?
SELECT "Team" FROM table_52200 WHERE "Rebounds" < '275' AND "Games" < '34' AND "Name" = 'curtis borchardt'
wikisql
CREATE TABLE table_name_85 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Record of 12 15 happened on what date?
SELECT date FROM table_name_85 WHERE record = "12–15"
sql_create_context
CREATE TABLE table_21548 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT("High assists") FROM table_21548 WHERE "Team" = 'San Antonio'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'dexmedetomidine 200 mcg in 50 ml ns')) AND DAT...
eicu
CREATE TABLE table_name_88 ( team VARCHAR, week_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for week 1 of 28
SELECT team FROM table_name_88 WHERE week_1 = "28"
sql_create_context
CREATE TABLE table_name_18 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game against the phoenix suns?
SELECT score FROM table_name_18 WHERE opponent = "phoenix suns"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, cha...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME...
mimic_iii
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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2299367' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-05-05' AND '2011-08-22' AND gwyjzb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2299367' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-05-05' AND '2011-08-22' AND fgwyjzb.INSURED_...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_40875 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest number of against when the...
SELECT MAX("Against") FROM table_40875 WHERE "Difference" = '58' AND "Played" > '22'
wikisql
CREATE TABLE table_9590 ( "School" text, "Base" text, "Bask" text, "Golf" text, "Soccer" text, "Swimming" text, "Tennis" text, "Indoor track" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the indoor track status for the school t...
SELECT "Indoor track" FROM table_9590 WHERE "Tennis" = 'yes' AND "Golf" = 'no'
wikisql
CREATE TABLE table_204_498 ( id number, "location" text, "building" text, "year" number, "km" number, "monument" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what other two locations have a rail bridge ?
SELECT "location" FROM table_204_498 WHERE "building" = 'rail bridge'
squall
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ACABS' AND course.number = 483 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_62694 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total...
SELECT SUM("Goals conceded") FROM table_62694 WHERE "Points" > '58' AND "Wins" < '27' AND "Draws" < '1'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T...
atis
CREATE TABLE table_43882 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Player is 'Deane Beman'?
SELECT "Score" FROM table_43882 WHERE "Player" = 'deane beman'
wikisql
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( ...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Srinivasan Iyer' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23620) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_13557843_3 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game when the team was 1-2?
SELECT score FROM table_13557843_3 WHERE record = "1-2"
sql_create_context
CREATE TABLE table_14575 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" real, "Final round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which final round had a first round of 20?
SELECT "Final round" FROM table_14575 WHERE "First round" = '20'
wikisql
CREATE TABLE table_79923 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the source of an ENG transfer that paid a 1.5m transfer fee?
SELECT "Source" FROM table_79923 WHERE "Country" = 'eng' AND "Transfer fee" = '£1.5m'
wikisql
CREATE TABLE table_name_84 ( award_description_s_ VARCHAR, format_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the award description with Format album?
SELECT award_description_s_ FROM table_name_84 WHERE format_s_ = "album"
sql_create_context
CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number ) CREATE TABLE competition ( competition_id number, year number, competition_type text, country text ) CREATE TABLE club ( club_id number, name text, region...
SELECT DISTINCT region FROM club ORDER BY region
spider
CREATE TABLE table_9476 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the skip when Tony Angiboust was a lead?
SELECT "Skip" FROM table_9476 WHERE "Lead" = 'tony angiboust'
wikisql
CREATE TABLE table_204_623 ( id number, "opponent" text, "goals" text, "wins" number, "draws" number, "losses" number, "+- goals" number, "matches" number, "qualified" number, "eliminated" number ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT COUNT("opponent") FROM table_204_623 WHERE "opponent" <> 'ks flamurtari' AND "draws" = (SELECT "draws" FROM table_204_623 WHERE "opponent" = 'ks flamurtari')
squall
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6694892' AND t_kc21.OUT_DIAG_DIS_NM = '腔隙性脑梗死')
css
CREATE TABLE table_78094 ( "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. -- Who did the Tampa Bay Buccaneers play ...
SELECT "Opponent" FROM table_78094 WHERE "Date" = 'december 23, 1995'
wikisql
CREATE TABLE table_59891 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the competition when the opponent was the Randers?
SELECT "Competition" FROM table_59891 WHERE "Opponent" = 'randers'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2198" AND lab.label = "Gamma Glutamyltransferase"
mimicsql_data
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab.itemid = "50952"
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'urinary tract infection' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT COUN...
eicu
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
CREATE TABLE table_203_288 ( id number, "season" text, "premiere date" text, "the winner" text, "runner-up" text, "finalists" text, "contestants in order of elimination" text, "number of contestants" text, "number of concerts" number ) -- Using valid SQLite, answer the following qu...
SELECT "finalists" FROM table_203_288 WHERE "season" = 'af3'
squall
CREATE TABLE table_8448 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Driver had 50+3 Point...
SELECT "Driver" FROM table_8448 WHERE "Points" = '50+3'
wikisql
CREATE TABLE table_1342218_35 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party does the incumbent from the Ohio 7 district belong to?
SELECT party FROM table_1342218_35 WHERE district = "Ohio 7"
sql_create_context
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dob_year < "2182"
mimicsql_data
CREATE TABLE table_70368 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of total with gold more than 1 and bronze more than 0
SELECT SUM("Total") FROM table_70368 WHERE "Gold" > '1' AND "Bronze" > '0'
wikisql
CREATE TABLE table_23913 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Accreditation" text, "Founded" real, "Enrollment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of schools founded that hav...
SELECT COUNT("Founded") FROM table_23913 WHERE "Enrollment" = '5634'
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', 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_35887 ( "Date" text, "Competition" text, "Opponents" text, "Venue" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the opponent at the League Play Offs at home?
SELECT "Opponents" FROM table_35887 WHERE "Venue" = 'home' AND "Competition" = 'league play offs'
wikisql
CREATE TABLE table_25921 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of jons team for 15x10
SELECT COUNT("Jons team") FROM table_25921 WHERE "Episode" = '15x10'
wikisql
CREATE TABLE table_name_43 ( comparative VARCHAR, link VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Comparative has a Link of sourcecode webserver?
SELECT comparative FROM table_name_43 WHERE link = "sourcecode webserver"
sql_create_context
CREATE TABLE table_740 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the candidates with party being democratic and dbeingtrict being no...
SELECT "Candidates" FROM table_740 WHERE "Party" = 'Democratic' AND "District" = 'North Carolina 1'
wikisql
CREATE TABLE table_3251 ( "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. -- If the writer is Mark Fink, who is the director?
SELECT "Directed by" FROM table_3251 WHERE "Written by" = 'Mark Fink'
wikisql
CREATE TABLE table_25243 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT COUNT("Laps") FROM table_25243 WHERE "Race Time" = '3:34:26'
wikisql
CREATE TABLE table_12565 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when the attendance is greater than 134 and Workington is the home team?
SELECT "Score" FROM table_12565 WHERE "Attendance" > '134' AND "Home team" = 'workington'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'neuromuscular blocking agent')
eicu
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cooling the patient' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniquepid) AS...
eicu
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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4788064' GROUP BY MED_ORG_DEPT_CD HAVING MAX(IN_HOSP_DAYS) < 20) AS T
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 WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2164.0"
mimicsql_data
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Na...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE useracct ( name VARCHAR, u_id VARCHAR ) CREATE TABLE review ( u_id VARCHAR, rating VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the user who gave the highest rating.
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1
sql_create_context