context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number, customer_policy_id number ) CREATE TABLE claims ( claim_id number, policy_id number, date_claim_made time, date_clai...
List the method, date and amount of all the payments, in ascending order of date.
SELECT payment_method_code, date_payment_made, amount_payment FROM payments ORDER BY date_payment_made
spider
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...
给患者杨莹华92252701748这次医疗就诊的检验报告作审核的人有哪些?工号是什么
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '92252701748'
css
CREATE TABLE table_70630 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries for were there while having 479 points against?
SELECT "Tries for" FROM table_70630 WHERE "Points against" = '479'
wikisql
CREATE TABLE table_3714 ( "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Originalairdate" text, "Ratings" text )
Name the least episode number for jonathan harvey
SELECT MIN("Episode #") FROM table_3714 WHERE "Written by" = 'Jonathan Harvey'
wikisql
CREATE TABLE table_name_37 ( shot_diameter__cm_ VARCHAR, shot_volume__cm_3__ INTEGER )
How many times is the shot volume (cm3) less than 172.76?
SELECT COUNT(shot_diameter__cm_) FROM table_name_37 WHERE shot_volume__cm_3__ < 172.76
sql_create_context
CREATE TABLE table_66597 ( "Rank" real, "City" text, "Population" real, "Year of Census or Estimate" real, "Country" text )
In what Year of Census or Estimate is the Toronto Population larger than 1,556,396?
SELECT SUM("Year of Census or Estimate") FROM table_66597 WHERE "Population" > '1,556,396' AND "City" = 'toronto'
wikisql
CREATE TABLE table_name_78 ( l2_cache VARCHAR, frequency VARCHAR )
What's amount of L2 Cache on a device that has a Frequency of 1500mhz?
SELECT l2_cache FROM table_name_78 WHERE frequency = "1500mhz"
sql_create_context
CREATE TABLE table_name_22 ( political_party VARCHAR, name VARCHAR )
Which Political Party has a Name of rexhep bej mitrovica?
SELECT political_party FROM table_name_22 WHERE name = "rexhep bej mitrovica"
sql_create_context
CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE tasks ( task_id number, project_id number, task_details text, eg agree objectives text ) CREATE TABLE project_staff ( staff_id number, project_id number, role_c...
For each project id, how many staff does it have? List them in increasing order.
SELECT T1.project_id, COUNT(*) FROM project_staff AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)
spider
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...
out of total number of patients diagnosed with crbl art ocl nos w infrc, how many of them belonged to hispanic or latino ethnic origin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Crbl art ocl NOS w infrc"
mimicsql_data
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE ground_service ( ...
i want to go from BALTIMORE to SAN FRANCISCO with a stopover in DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_21749 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
What is the call sign of the station with the frequency of 90.3mhz
SELECT "Callsign" FROM table_21749 WHERE "Frequency" = '90.3MHz'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
this year what is the first careunit of patient 97314?
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
51074072254这个检验的报告单的日期是哪一天
SELECT BGRQ FROM jybgb WHERE BGDH = '51074072254'
css
CREATE TABLE table_name_56 ( record VARCHAR, visitor VARCHAR )
What is the record when St. Louis is the visitor?
SELECT record FROM table_name_56 WHERE visitor = "st. louis"
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 ...
以前69072554这个患者是在哪就真的
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '69072554' UNION SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmz...
css
CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE keyword ( id int, keyword text ) CREATE TABLE actor ( aid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABL...
List all the movies directed by ' Asghar Farhadi ' in which ' Taraneh Alidoosti ' played
SELECT movie.title FROM actor, cast, directed_by, director, movie WHERE actor.name = 'Taraneh Alidoosti' AND cast.aid = actor.aid AND director.did = directed_by.did AND director.name = 'Asghar Farhadi' AND movie.mid = cast.msid AND movie.mid = directed_by.msid
imdb
CREATE TABLE table_27734286_6 ( record VARCHAR, game VARCHAR )
List records for game 29.
SELECT record FROM table_27734286_6 WHERE game = 29
sql_create_context
CREATE TABLE table_55404 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the sum of gold where silver is more than 2 and the total is 12?
SELECT SUM("Gold") FROM table_55404 WHERE "Silver" > '2' AND "Total" = '12'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
The last time ARMENIAN 171 was offered was when ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARMENIAN' AND course.number = 171 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
advising
CREATE TABLE table_79583 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
What is the average number of draws for losses over 8 and Against values under 1344?
SELECT AVG("Draws") FROM table_79583 WHERE "Losses" > '8' AND "Against" < '1344'
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what was the first value of an osmolality, urine lab test in patient 72107 until 02/2103?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72107) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'osmolality, urine') AND STRFTIME('%y-%m', labevents.charttime) <= '2103-02' ORDE...
mimic_iii
CREATE TABLE table_3005450_1 ( station VARCHAR, metlink_code VARCHAR )
what is the name of the station where the metlink code is mata?
SELECT station FROM table_3005450_1 WHERE metlink_code = "MATA"
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...
从00年八月二十六日到一一年三月二日,医疗机构2367774给患者任秀竹做过多少次检查
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '任秀竹' AND t_kc22.STA_DATE BETWEEN '2000-08-26' AND '2011-03-02' AND gwyjzb.MED_SER_ORG_NO = '2367774' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_name_78 ( home_team VARCHAR, venue VARCHAR )
Who was the home team at Kardinia Park?
SELECT home_team FROM table_name_78 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Draw a scatterplot of team id vs all_games_percent where team id is on the x-axis and points are colored by ACC_Home
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
有哪些总费用不少于1137.71元的医疗费医疗记录是袁修雅患者的,当时入院期间确诊的疾病序列号和名称都啥?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '袁修雅' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1137.71)
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, item...
when was patient 20441 last prescribed both potassium chl 20 meq / 1000 ml d5 1/2 ns and vial at the same time in 03/this year?
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 20 meq / 1000 ml d5 1/2 ns' AND admissions.subject_id = 20441 AND DATETIME(prescriptions.startdate, 'start of year') ...
mimic_iii
CREATE TABLE table_1341973_3 ( incumbent VARCHAR, district VARCHAR )
Who is the incumbent in the Alabama 6 voting district?
SELECT incumbent FROM table_1341973_3 WHERE district = "Alabama 6"
sql_create_context
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...
how many patients less than 31 years of age have been diagnosed with crnry athrscl natve vssl?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.short_title = "Crnry athrscl natve vssl"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
how much is the difference in body weight of patient 12726 last measured on the current hospital visit compared to the value first measured on the current hospital visit?
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 = 12726 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE table_26168687_5 ( no_in_season VARCHAR, vessel_operator VARCHAR )
Name the number of season for beluga shipping
SELECT COUNT(no_in_season) FROM table_26168687_5 WHERE vessel_operator = "Beluga Shipping"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate tim...
how many prescriptions of methylprednisolone na succ had been issued this year?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'methylprednisolone na succ' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_name_33 ( earnings___ VARCHAR, player VARCHAR, wins VARCHAR )
What are the earnings for jim colbert with under 4 wins?
SELECT COUNT(earnings___) AS $__ FROM table_name_33 WHERE player = "jim colbert" AND wins < 4
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
count the number of times that patient 005-76912 had had an ns ivf intake on 08/02/this year.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-76912')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE table_30747 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who wrote 'the diaper incident'?
SELECT "Written by" FROM table_30747 WHERE "Title" = 'The Diaper Incident'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE T...
Will 334 have a lab ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 334
advising
CREATE TABLE table_57030 ( "Team" text, "Location" text, "Venue" text, "League and position in 1991" text, "Coach" text )
Which team has Yuriy Hruznov as coach?
SELECT "Team" FROM table_57030 WHERE "Coach" = 'yuriy hruznov'
wikisql
CREATE TABLE table_63651 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
How many clubs are involved when the clubs remaining are 2?
SELECT SUM("Clubs involved") FROM table_63651 WHERE "Clubs remaining" = '2'
wikisql
CREATE TABLE table_21602734_1 ( division INTEGER )
What is the lowest division number?
SELECT MIN(division) FROM table_21602734_1
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and could you show x axis in descending order?
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_18944 ( "Asset Acquired" text, "Acquired From" text, "Date Announced" text, "Date Completed" text, "Reported Cost" text )
It is was announced on July 2, 2006 that what asset had been acquired?
SELECT "Asset Acquired" FROM table_18944 WHERE "Date Announced" = 'July 2, 2006'
wikisql
CREATE TABLE table_name_17 ( author VARCHAR, title VARCHAR )
who is the author for harry potter and the deathly hallows?
SELECT author FROM table_name_17 WHERE title = "harry potter and the deathly hallows"
sql_create_context
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_B...
A bar chart for what are the number of the facility codes of the apartments with more than four bedrooms?, and list Y in descending order.
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
Find the average gpa of all students in each department with a bar chart, sort from high to low by the Y please.
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA) DESC
nvbench
CREATE TABLE table_28119 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text )
What is the title of #33?
SELECT "Title" FROM table_28119 WHERE "Season #" = '33'
wikisql
CREATE TABLE table_name_88 ( season VARCHAR, qualities VARCHAR, sign VARCHAR )
What is the south season of the scorpio sign, which has cold & wet qualities?
SELECT season AS :_south FROM table_name_88 WHERE qualities = "cold & wet" AND sign = "scorpio"
sql_create_context
CREATE TABLE table_44920 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What was the venue for the dates 1,2,3,4,6,7 jan 1908?
SELECT "Venue" FROM table_44920 WHERE "Date" = '1,2,3,4,6,7 jan 1908'
wikisql
CREATE TABLE table_22637 ( "Years covered" text, "All bills sponsored" real, "All amendments sponsored" real, "All bills cosponsored" real, "All amendments cosponsored" real, "Bills originally cosponsored" real, "Amendments originally cosponsored" real )
How many bills where originally cosponsored in those years where the total of all amendments cosponsored was 0?
SELECT "Bills originally cosponsored" FROM table_22637 WHERE "All amendments cosponsored" = '0'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
how many patients have undergone cont inv mec ven 96+ hrs within the same month after the previous nephroureterectomy in this year?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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_title = 'nephrourete...
mimic_iii
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
Top reputation users - ordered by Id.
SELECT Id AS "user_link", DisplayName, Reputation FROM Users ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE table_13280 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real )
What is the average ranking for a react of 0.17300000000000001 and less than 5 lanes?
SELECT AVG("Rank") FROM table_13280 WHERE "React" = '0.17300000000000001' AND "Lane" < '5'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
what is the latest flight from SALT LAKE CITY to ST. PETERSBURG
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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE table_8070 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the most money United States player Bob Gilder won?
SELECT MAX("Money ( $ )") FROM table_8070 WHERE "Country" = 'united states' AND "Player" = 'bob gilder'
wikisql
CREATE TABLE table_27434_2 ( live_births_per_year VARCHAR, life_expectancy_total VARCHAR )
How many live births per year do people with a life expectancy of 65.1 have?
SELECT live_births_per_year FROM table_27434_2 WHERE life_expectancy_total = "65.1"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, C...
在多少次的医疗记录里面记录了患者吕格菲使用了均价不足2770.51元的药物?当时就诊的编号都是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '吕格菲' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 2770.51)
css
CREATE TABLE table_23333 ( "District" real, "Representative" text, "Party" text, "Residence" text, "Counties represented" text, "Term ends" real, "First Elected" real )
Name the term ends for bethlehem
SELECT COUNT("Term ends") FROM table_23333 WHERE "Residence" = 'Bethlehem'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
Answers by the given user with the given phrase (case insensitive, accent insensitive).
SELECT Id AS "post_link", Score FROM Posts WHERE (PostTypeId = 2) AND (OwnerUserId = '##userid?25510##') AND (Body LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY Id
sede
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
What classes do n't have lab sessions ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE addresses ( state_province_county VARCHAR )
Show each state and the number of addresses in each state.
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county
sql_create_context
CREATE TABLE table_20159025_1 ( part_3 VARCHAR, driver VARCHAR )
What was the time in part 3 when Heikki Kovalainen was the driver?
SELECT part_3 FROM table_20159025_1 WHERE driver = "Heikki Kovalainen"
sql_create_context
CREATE TABLE table_name_99 ( track INTEGER, song_title VARCHAR )
I want the sum of tracks for raised on rock
SELECT SUM(track) FROM table_name_99 WHERE song_title = "raised on rock"
sql_create_context
CREATE TABLE VoteTypes ( 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 ReviewT...
Users don't like to accept.
SELECT OwnerUserId AS "user_link", COUNT(*) AS N FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND NOT OwnerUserId IS NULL AND NOT ClosedDate IS NULL AND Posts.Id IN (SELECT DISTINCT ParentId FROM Posts) GROUP BY OwnerUserId ORDER BY N DESC LIMIT 100
sede
CREATE TABLE table_name_98 ( competition VARCHAR, position VARCHAR )
What's the name of the competition in 8th position?
SELECT competition FROM table_name_98 WHERE position = "8th"
sql_create_context
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, ...
count the number of patients whose admission type is emergency and procedure long title is other partial resection of small intestine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Other partial resection of small intestine"
mimicsql_data
CREATE TABLE table_57663 ( "Athlete" text, "Country" text, "Wins" real, "Years" text, "Distance" text )
I want the years for marathon distance and wins of 3
SELECT "Years" FROM table_57663 WHERE "Distance" = 'marathon' AND "Wins" = '3'
wikisql
CREATE TABLE table_76659 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text )
What is the number of podiums with 0 wins, 0 F.L. and 35 points?
SELECT "Podiums" FROM table_76659 WHERE "Wins" = '0' AND "F.L." = '0' AND "Points" = '35'
wikisql
CREATE TABLE table_train_188 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
bmi between 25 & 45 kg / m2
SELECT * FROM table_train_188 WHERE body_mass_index_bmi > 25 AND body_mass_index_bmi < 45
criteria2sql
CREATE TABLE table_train_204 ( "id" int, "systolic_blood_pressure_sbp" int, "plasma_glucose_concentration" int, "fasting_plasma_glucose_fpg" float, "increase_risk_of_intervention" bool, "diastolic_blood_pressure_dbp" int, "life_span" bool, "body_mass_index_bmi" float, "NOUSE" float )
2 _ h plasma glucose > 200 mg / dl based on 75 _ g ogtt
SELECT * FROM table_train_204 WHERE plasma_glucose_concentration > 200
criteria2sql
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 ) ...
what is the number of patients whose age is less than 72 and drug route is po/ng?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_63603 ( "Medal count" real, "Date" text, "Athlete" text, "Nation" text, "Sport" text, "Record medal event" text )
Which sport has 17 as the medal count?
SELECT "Sport" FROM table_63603 WHERE "Medal count" = '17'
wikisql
CREATE TABLE table_50764 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is Points, when Draws is less than 7, when Wins is less than 16, and when Goals For is '35'?
SELECT "Points" FROM table_50764 WHERE "Draws" < '7' AND "Wins" < '16' AND "Goals for" = '35'
wikisql
CREATE TABLE table_56489 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who constructed the car that has a Time/Retired of +2:06.0?
SELECT "Constructor" FROM table_56489 WHERE "Time/Retired" = '+2:06.0'
wikisql
CREATE TABLE table_50594 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What is Tournament, when Opponent In The Final is 'Andre Agassi'?
SELECT "Tournament" FROM table_50594 WHERE "Opponent in the final" = 'andre agassi'
wikisql
CREATE TABLE table_name_81 ( draws INTEGER, byes INTEGER )
What is the lowest number of draws with more than 2 byes?
SELECT MIN(draws) FROM table_name_81 WHERE byes > 2
sql_create_context
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...
how many days have passed since the last time patient 003-10080 on their current hospital encounter received a wbc x 1000 lab test?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-10080' AND patient.hospi...
eicu
CREATE TABLE table_19064 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
what's the bleeding time with platelet count being decreased or unaffected
SELECT "Bleeding time" FROM table_19064 WHERE "Platelet count" = 'Decreased or unaffected'
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...
show the number of female patients whose primary disease was overdose.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列出患者70892680所有检验结果指标记录中的检测方法在2012年3月29日到2020年7月23日之间都是什么?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how many patients were diagnosed with syst rheum arthritis nec did not return to the hospital within 2 months?
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'syst rheum...
mimic_iii
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of Team_Name and School_ID , could you order by the X-axis in ascending?
SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_61024 ( "Year" real, "Award" text, "Category" text, "Role" text, "Result" text )
Which Category has an Award of monte carlo tv festival awards, and a Year larger than 2010?
SELECT "Category" FROM table_61024 WHERE "Award" = 'monte carlo tv festival awards' AND "Year" > '2010'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
what are the four most commonly ordered specimen tests for patients who were previously diagnosed with gen cnv epil w/o intr ep within 2 months in a year before?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_23309 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
How many different players did the high assists in games where the high rebounds were done by Sales (10)?
SELECT COUNT("High assists") FROM table_23309 WHERE "High rebounds" = 'Sales (10)'
wikisql
CREATE TABLE table_name_25 ( original_canadian_air_date VARCHAR, director VARCHAR )
What was the Original Canadian air-date for the episode directed by mark rydell?
SELECT original_canadian_air_date FROM table_name_25 WHERE director = "mark rydell"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
list all the takeoffs and landings at MKE airport
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
atis
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 ) ...
what is the minimum age of patients whose gender is female and ethnicity is black/haitian?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
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, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( ro...
what are the five most commonly prescribed drugs for patients the previous year that are also prescribed with nitroglycerin at the same time?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nitroglycerin' AND DATETIME(prescriptions.startdate, 'start of ye...
mimic_iii
CREATE TABLE table_name_58 ( away_team VARCHAR, home_team VARCHAR, score VARCHAR )
Which Away team has a Home team of al-ain fc, and a Score of 1 1?
SELECT away_team FROM table_name_58 WHERE home_team = "al-ain fc" AND score = "1–1"
sql_create_context
CREATE TABLE table_1341690_13 ( first_elected VARCHAR, incumbent VARCHAR )
what year was the first elected incumbant Sidney R. Yates?
SELECT first_elected FROM table_1341690_13 WHERE incumbent = "Sidney R. Yates"
sql_create_context
CREATE TABLE table_45609 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
what was valentino rossi's rider time?
SELECT "Time" FROM table_45609 WHERE "Rider" = 'valentino rossi'
wikisql
CREATE TABLE table_29692554_2 ( entered VARCHAR, time VARCHAR )
How many entries are shown for entered at 21:09?
SELECT COUNT(entered) FROM table_29692554_2 WHERE time = "21:09"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
what is the number of patients whose diagnoses long title is cerebral aneurysm, nonruptured and drug route is dialys?
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.long_title = "Cerebral aneurysm, nonruptured" AND prescriptions.route = "DIALYS"
mimicsql_data
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...
查一下患者53607326踝部检验的各项指标结果
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_29023 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What was the nationality of player picked no. 179?
SELECT "Nationality" FROM table_29023 WHERE "Pick #" = '179'
wikisql
CREATE TABLE table_65878 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What is the Reserved for (SC / ST /None) when the constituency number is 203?
SELECT "Reserved for ( SC / ST /None)" FROM table_65878 WHERE "Constituency number" = '203'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id...
i need a friday flight from NEWARK to TAMPA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat...
atis
CREATE TABLE table_24852622_1 ( class_d_winner VARCHAR, round VARCHAR )
Who was the Class D winner in round 6?
SELECT class_d_winner FROM table_24852622_1 WHERE round = "6"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
what is the distance from SFO airport to SAN FRANCISCO
SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'SFO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO'
atis
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Find all users with skill and location.
SELECT * FROM Users WHERE Users.Location = 'Sydney' AND LOWER(Users.DisplayName) LIKE '%recordpoint%' ORDER BY Reputation DESC
sede