context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Faculty ( lname VARCHAR, facID VARCHAR ) CREATE TABLE Faculty_participates_in ( facID VARCHAR, actid VARCHAR ) CREATE TABLE activity ( activity_name VARCHAR )
Find the first names of the faculty members who are playing Canoeing or Kayaking.
SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, ...
患者对应的住院就诊中开出的检验报告单59958686158上的姓名是什么?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Group and count the durations for each actor with a bar graph.
SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration
nvbench
CREATE TABLE table_name_7 ( time_retired VARCHAR, driver VARCHAR )
What was the time/retired of Darren Manning?
SELECT time_retired FROM table_name_7 WHERE driver = "darren manning"
sql_create_context
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_ty...
what is the daily minimum amount of chest tubes cticu ct 1 that patient 26057 had on this hospital encounter?
SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057 AND admissions.dischtime IS NULL)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d...
mimic_iii
CREATE TABLE table_59073 ( "Edition" text, "Round" text, "Date" text, "Partner" text, "Surface" text, "Opponents" text, "Result" text )
What was the surface on march 2, 1997?
SELECT "Surface" FROM table_59073 WHERE "Date" = 'march 2, 1997'
wikisql
CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE teaches ( ...
Given the titles of all courses, in order of titles and credits.
SELECT title FROM course ORDER BY title, credits
spider
CREATE TABLE invoices ( id number, customer_id number, invoice_date time, billing_address text, billing_city text, billing_state text, billing_country text, billing_postal_code text, total number ) CREATE TABLE customers ( id number, first_name text, last_name text, ...
Eduardo Martins is a customer at which company?
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"
spider
CREATE TABLE table_name_68 ( away_team VARCHAR, venue VARCHAR )
Who was the away team at Lake Oval?
SELECT away_team AS score FROM table_name_68 WHERE venue = "lake oval"
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 died in or before year 2180 had pituitary bleed as the primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName...
How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, I want to order in descending by the y-axis.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC
nvbench
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 patient ( uniquep...
what was the name of the drug prescribed to patient 029-19659 within the same day after having been in 04/2104 diagnosed with acute respiratory failure - etiology unknown?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-19659') AND diagnosis.diagnos...
eicu
CREATE TABLE table_8269 ( "Name" text, "Date" text, "Defending forces" text, "Brigade" text, "Population" text )
What defending forces have a population of 650?
SELECT "Defending forces" FROM table_8269 WHERE "Population" = '650'
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...
how much is patient 010-17316's weight for the first time since 21 months ago?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17316') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-21 month') ORDER BY patient.unita...
eicu
CREATE TABLE table_5166 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
Which opponent's event was sb 24 - return of the heavyweights 2, and had a method of TKO (knee and punches)?
SELECT "Opponent" FROM table_5166 WHERE "Event" = 'sb 24 - return of the heavyweights 2' AND "Method" = 'tko (knee and punches)'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Creation...
Top 50 users from New Zealand.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%zealand' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE table_201_38 ( id number, "season" text, "winner" text, "team" text, "position" text, "age" number )
who was the first calder memorial trophy winner from the boston bruins ?
SELECT "winner" FROM table_201_38 WHERE "team" = 'boston bruins' ORDER BY "season" LIMIT 1
squall
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, heavy_papers int, cares_for_students int, heavy_assignments ...
What upper-level STRATEGY classes are offering this Spring ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'STRATEGY' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sp...
advising
CREATE TABLE table_2134521_1 ( pop__2006_ INTEGER )
What is the largest population count in any of the census divisions in 2006?
SELECT MAX(pop__2006_) FROM table_2134521_1
sql_create_context
CREATE TABLE table_9101 ( "Year" real, "Manufacturer" text, "Start" real, "Finish" real, "Team" text )
Smaller than 37, the highest year for Ford?
SELECT MAX("Year") FROM table_9101 WHERE "Manufacturer" = 'ford' AND "Finish" < '37'
wikisql
CREATE TABLE table_203_61 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country was ranked as the top in the 1999 all africa games ?
SELECT "nation" FROM table_203_61 ORDER BY "rank" LIMIT 1
squall
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
For artist names who are not from the United States, how many names in each year?
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Name
nvbench
CREATE TABLE table_18583 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the the candidates with incumbent being alfred j. elliott
SELECT "Candidates" FROM table_18583 WHERE "Incumbent" = 'Alfred J. Elliott'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName te...
Questions sorted by Favorite count.
SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER J...
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
how many hours had passed since patient 016-18575 had been admitted to the icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '016-18575' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
TeX.SX \\ corruption (grouped by id).
SELECT COUNT(q.Body), q.OwnerUserId, q.OwnerDisplayName FROM Posts AS q WHERE (REPLACE(REPLACE(q.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND q.OwnerUserId IN (SELECT p.OwnerUserId FROM Posts AS p WHERE (REPLACE(REPLACE(p.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND q.AcceptedAnswerId != q.Id GROUP BY p.OwnerUserId...
sede
CREATE TABLE table_name_29 ( start VARCHAR, laps VARCHAR )
What is the start of the race with 676 laps?
SELECT start FROM table_name_29 WHERE laps = "676"
sql_create_context
CREATE TABLE table_name_18 ( Web VARCHAR, client VARCHAR, project VARCHAR )
who is the web client when the client is x and the project is goto servers vnc java server (gsvncj)?
SELECT Web AS client FROM table_name_18 WHERE client = "x" AND project = "goto servers vnc java server (gsvncj)"
sql_create_context
CREATE TABLE table_22542179_3 ( total_apps INTEGER, player VARCHAR )
Name the least total apaps for txema
SELECT MIN(total_apps) FROM table_22542179_3 WHERE player = "Txema"
sql_create_context
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...
Tag badges with links to tag edit history.
SELECT UserId AS "user_link", Name, Date FROM Badges WHERE Badges.TagBased = 'true' AND Badges.Class <= 1 LIMIT 100
sede
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...
列出患者金夏彤的出院科室名称包含计划生育在医院9134683中的住院就诊记录一共有哪几条?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '金夏彤' AND hz_info.YLJGDM = '9134683' AND zyjzjlb.CYKSMC LIKE '%计划生育%'
css
CREATE TABLE table_24898 ( "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 (millions)" text )
Who directed the episode written by patrick meighan?
SELECT "Directed by" FROM table_24898 WHERE "Written by" = 'Patrick Meighan'
wikisql
CREATE TABLE table_12139 ( "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 48 points?
SELECT "Tries For" FROM table_12139 WHERE "Points" = '48'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
the flights from ONTARIO to WESTCHESTER COUNTY that stop in CHICAGO
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 = 'CHICAGO' AND CITY_2.ci...
atis
CREATE TABLE table_38305 ( "Rank" text, "Film" text, "Director(s)" text, "Country" text, "Prize" text )
What Rank is the director of maximilian jezo-parovsky?
SELECT "Rank" FROM table_38305 WHERE "Director(s)" = 'maximilian jezo-parovsky'
wikisql
CREATE TABLE Documents ( Id VARCHAR )
Show the number of documents.
SELECT COUNT(*) FROM Documents
sql_create_context
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE ref_budget_codes ( budget_type_code text, budget_t...
List all statement ids and statement details.
SELECT statement_id, statement_details FROM statements
spider
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
讲一下名为孙欣艳的病人在哪几次医疗记录中被开过金额高于532.62元的药,把医疗就诊编号列出来
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙欣艳' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 532.62)
css
CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_t...
Show the role code with the least employees.
SELECT role_code FROM employees GROUP BY role_code ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, chartt...
was normal the heart rate of patient 31482 since 09/08/2104?
SELECT COUNT(*) > 0 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 = 31482)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE table_test_30 ( "id" int, "ejection_fraction_ef" int, "multiple_long_bone_fractures" bool, "extracellular_volume_expansion" bool, "pregnancy_or_lactation" bool, "bleeding" int, "serum_potassium" float, "prosthetic_heart_valve" bool, "hbg" int, "anticoagulation" bool,...
subjects who do not meet any of the following contraindications: spinal infection or inflammation, morbid obesity, mental illness, alcoholism, drug abuse, pregnancy, metal sensitivity, foreign body sensitivity, patients with inadequate tissue coverage over the operative site, open wounds local to the operative area, an...
SELECT * FROM table_test_30 WHERE spinal_infection = 1 OR inflammation = 1 OR morbid_obesity = 1 OR mental_illness = 1 OR alcohol_abuse = 1 OR drug_abuse = 1 OR pregnancy_or_lactation = 1 OR metal_sensitivity = 1 OR foreign_body_sensitivity = 1 OR (inadequate_tissue_coverage = 1 AND operative_area = 1) OR (open_wounds ...
criteria2sql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
编码为73645436209检验报告单相对应的审核人工号以及姓名都是什么?
SELECT SHRGH, SHRXM FROM jybgb WHERE BGDH = '73645436209'
css
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code ...
Show the trend about the frequency of the claim dates, and I want to order in desc by the X.
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled ORDER BY Date_Claim_Settled DESC
nvbench
CREATE TABLE table_name_91 ( athlete VARCHAR, run_1 VARCHAR, run_2 VARCHAR )
Who is the athlete with a run 1 larger than 54.95 and a 56.19 run 2?
SELECT athlete FROM table_name_91 WHERE run_1 > 54.95 AND run_2 = 56.19
sql_create_context
CREATE TABLE table_name_40 ( drobo__2nd_ VARCHAR, drobo_fs VARCHAR )
Which Drobo (2nd) has a Drobo FS of up to 32?
SELECT drobo__2nd_ FROM table_name_40 WHERE drobo_fs = "up to 32"
sql_create_context
CREATE TABLE table_name_77 ( label VARCHAR, date VARCHAR )
What is the Label that shows on april 7, 1967?
SELECT label FROM table_name_77 WHERE date = "april 7, 1967"
sql_create_context
CREATE TABLE table_36155 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text )
What is the alternate of the nation with hubert gr ndhammer as the second?
SELECT "Alternate" FROM table_36155 WHERE "Second" = 'hubert gründhammer'
wikisql
CREATE TABLE table_29264 ( "No. in series" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Who directed the episode named 'Don't just do it'?
SELECT "Directed by" FROM table_29264 WHERE "Title" = 'Don''t Just Do It'
wikisql
CREATE TABLE table_name_14 ( points INTEGER, extra_points VARCHAR, player VARCHAR )
What are the average points White made with 0 extra points?
SELECT AVG(points) FROM table_name_14 WHERE extra_points = 0 AND player = "white"
sql_create_context
CREATE TABLE table_203_33 ( id number, "conference" text, "date" text, "place" text, "attendance" number, "archive of presentations" text )
when is the next wikimania 2014 ?
SELECT "date" FROM table_203_33 WHERE "conference" = 'wikimania 2014'
squall
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, rank by the x axis from low to high.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_10812938_3 ( position VARCHAR, cfl_team VARCHAR )
What is the position for the player with cfl team Winnipeg blue bombers?
SELECT position FROM table_10812938_3 WHERE cfl_team = "Winnipeg Blue Bombers"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, ...
i'd like information on a flight from ATLANTA to DENVER a morning flight
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
atis
CREATE TABLE table_name_45 ( presentation_of_credentials VARCHAR, appointed_by VARCHAR, representative VARCHAR )
Name the presentation of credentials for appointed by of grover cleveland and representative of charles w. buck
SELECT presentation_of_credentials FROM table_name_45 WHERE appointed_by = "grover cleveland" AND representative = "charles w. buck"
sql_create_context
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...
count the number of patients whose days of hospital stay is greater than 4 and procedure long title is angioplasty of other non-coronary vessel(s)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.long_title = "Angioplasty of other non-coronary vessel(s)"
mimicsql_data
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
Plot mean meter 100 by grouped by meter 200 as a bar graph, display in descending by the X-axis please.
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
nvbench
CREATE TABLE table_name_67 ( place VARCHAR, to_par VARCHAR, player VARCHAR )
What place did jacky cupit take when his To par was under 13?
SELECT place FROM table_name_67 WHERE to_par < 13 AND player = "jacky cupit"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE code_description ( code varchar, description text ) C...
are there any airlines that have flights from BOSTON to PHILADELPHIA that leave before 630
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.departure_time < 630 AND flight.to_airport = AIRPOR...
atis
CREATE TABLE driver ( driver_id number, name text, party text, home_city text, age number ) CREATE TABLE school ( school_id number, grade text, school text, location text, type text ) CREATE TABLE school_bus ( school_id number, driver_id number, years_working number...
Show the type of school and the number of buses for each type.
SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
spider
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 cost ( costid num...
the first time patient 013-28507 was prescribed lidocaine and zofran at the same time this month?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'zofran' AND patient.uniquepid = '013-28507' AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE table_11222744_3 ( format VARCHAR, title VARCHAR )
what is the format of 'callanetics: 10 years younger in 10 hours'?
SELECT format FROM table_11222744_3 WHERE title = "Callanetics: 10 years Younger In 10 Hours"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
查一下患者朱高翰在医院2154200中从二零年一月二十五日到二一年九月十五日的这段时间里开的所有的药和药品编码
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '朱高翰' AND MED_SER_ORG_NO = '2154200' AND IN_HOSP_DATE BETWEEN '2020-01-25' AND '2021-09-15')
css
CREATE TABLE table_23820 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
What is the maximum Obama supporters in Wayne county?
SELECT MAX("Obama#") FROM table_23820 WHERE "County" = 'Wayne'
wikisql
CREATE TABLE table_name_88 ( crowd INTEGER, venue VARCHAR )
In the match where the venue was arden street oval, what was the crowd attendance?
SELECT SUM(crowd) FROM table_name_88 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE table_203_27 ( id number, "number" number, "serial no" number, "entered service" text, "withdrawn" text, "kilometres travelled" number )
how many kilometers did number 4110 travel ?
SELECT "kilometres travelled" FROM table_203_27 WHERE "number" = 4110
squall
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text...
i need a flight from BOSTON to SAN FRANCISCO via DALLAS FORT WORTH
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1...
atis
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text...
Find the average number of bedrooms of all the apartments.
SELECT AVG(bedroom_count) FROM apartments
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...
what is the number of patients whose admission year is less than 2164 and lab test name is lactate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2164" AND lab.label = "Lactate"
mimicsql_data
CREATE TABLE table_name_64 ( instant_messaging VARCHAR, telephony VARCHAR )
What is Instant Messaging, when Telephony is 'Yes with integrated Sametime'?
SELECT instant_messaging FROM table_name_64 WHERE telephony = "yes with integrated sametime"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Show me the average of weight by sex in a histogram, and show by the Y-axis from low to high.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
nvbench
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_items ( row_id num...
what was the name of the procedure, which patient 41393 was last received until 2 years ago?
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 = 41393) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Student_Course_Attendance ( student_id INTEGER, course_id INTEGER, date_of_attendance DATETIME ) CREATE TABLE Candidate_Assessments ( cand...
what is the total number of last names of all candidates?, and could you sort by the names in descending?
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
which language does cynthia gomez understand?
SELECT demographic.language FROM demographic WHERE demographic.name = "Cynthia Gomez"
mimicsql_data
CREATE TABLE table_43616 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Who had a best time of 1:00.870?
SELECT "Name" FROM table_43616 WHERE "Best" = '1:00.870'
wikisql
CREATE TABLE table_37581 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What is the pick number for tulane university?
SELECT SUM("Pick") FROM table_37581 WHERE "School" = 'tulane university'
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...
what is admission time of subject name dona cole?
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Dona Cole"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose discharge location is rehab/distinct part hosp and procedure long title is incision of vessel, lower limb arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.long_title = "Incision of vessel, lower limb arteries"
mimicsql_data
CREATE TABLE table_25537 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" text, "Original air date" text )
When is the original air date written by sean whitesell?
SELECT "Original air date" FROM table_25537 WHERE "Written by" = 'Sean Whitesell'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
从07年9月24日到19年9月4日患者钱建章的检测指标535180的情况是什么样的?
SELECT * 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 = jyjgzbb.BGDH WHERE hz_info.person_i...
css
CREATE TABLE table_name_59 ( report VARCHAR, home_team VARCHAR )
What is the report corresponding to the game that had the Townsville Crocodiles as home team?
SELECT report FROM table_name_59 WHERE home_team = "townsville crocodiles"
sql_create_context
CREATE TABLE table_63957 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest against of the wimmera fl warrack eagles, which have less than 16 wins?
SELECT MIN("Against") FROM table_63957 WHERE "Wins" < '16' AND "Wimmera FL" = 'warrack eagles'
wikisql
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
从2015年5月16日到2018年8月7日,患者06002285看病时被开出妥布霉素滴眼液的次数总共有多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '06002285' AND t_kc22.STA_DATE BETWEEN '2015-05-16' AND '2018-08-07' AND t_kc22.SOC_SRT_DIRE_NM = '妥布霉素滴眼液' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = ...
css
CREATE TABLE table_20187 ( "Class" text, "Wheel Arrangement" text, "Railway" text, "Number at Doncaster" real, "Number at Pyewipe" real, "Number at March" real )
Name the railway when class is j19
SELECT "Railway" FROM table_20187 WHERE "Class" = 'J19'
wikisql
CREATE TABLE table_name_97 ( party VARCHAR, result VARCHAR )
Which party had a Retired Democratic hold?
SELECT party FROM table_name_97 WHERE result = "retired democratic hold"
sql_create_context
CREATE TABLE table_name_71 ( goals VARCHAR, current_club VARCHAR, debut_year VARCHAR )
How many goals were achieved when Chievo was the club and the debut year was before 2002?
SELECT COUNT(goals) FROM table_name_71 WHERE current_club = "chievo" AND debut_year < 2002
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients less than 58 years who have drug code maal30l.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "58" AND prescriptions.formulary_drug_cd = "MAAL30L"
mimicsql_data
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_...
count the number of times patient 28099 received a lab test for bilirubin, direct since 2105.
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, direct') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28099) AND STRFTIME('%y', labevents.charttime) >= '2105'
mimic_iii
CREATE TABLE table_32493 ( "School" text, "09-10 FCAT" text, "09-10 Points" real, "09-10 Graduation" text, "08-09 FCAT" text )
What 09-10 class, with a graduate percentage of 85% had the least amount of points?
SELECT MIN("09-10 Points") FROM table_32493 WHERE "09-10 Graduation" = '85%'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
When Annette Le took HEBREW 568 , who taught it ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id INNER JOIN course_...
advising
CREATE TABLE table_203_145 ( id number, "position" number, "club" text, "played" number, "points" text, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
how many clubs had a positive goal difference ?
SELECT COUNT("club") FROM table_203_145 WHERE "goals for" - "goals against" > 0
squall
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
how many times do patient 033-3992's urine come out today.
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 = '033-3992')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.cel...
eicu
CREATE TABLE table_25645 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "GPU frequency" text, "Cores" real, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "...
What is every part number with model number core i5-670?
SELECT "Part number(s)" FROM table_25645 WHERE "Model number" = 'Core i5-670'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
患者卫夏岚以前出现过哪些异常的反应
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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.YLJG...
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
please give me ground transportation information between DFW airport and downtown DALLAS
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor...
atis
CREATE TABLE table_name_64 ( country VARCHAR )
What is the 2010 total for ghana?
SELECT COUNT(2010) FROM table_name_64 WHERE country = "ghana"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
when they visited the hospital first time, has patient 022-89058 been ordered with acetaminophen, 50 ml vial : dextrose 50 % iv soln or acetaminophen (tylenol) tablet 650 mg?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
eicu
CREATE TABLE table_28178595_2 ( mystic_arte VARCHAR, character VARCHAR )
How many mystic arte have hisui (jadeite) hearts 1 as the character?
SELECT COUNT(mystic_arte) FROM table_28178595_2 WHERE character = "Hisui (Jadeite) Hearts 1"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, chartti...
what is the last diagnosed diagnosis of patient 96365 since 6 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96365) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_name_92 ( nordbayern VARCHAR, year VARCHAR, württemberg VARCHAR )
What's the Nordbayern with a W rttemberg of Union B ckingen in the year before 1932?
SELECT nordbayern FROM table_name_92 WHERE year < 1932 AND württemberg = "union böckingen"
sql_create_context
CREATE TABLE table_79600 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the smallest lane number of Xue Ruipeng?
SELECT MIN("Lane") FROM table_79600 WHERE "Name" = 'xue ruipeng'
wikisql