context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text )
in 2008 in track and field events how many world records did usain bolt break ?
SELECT COUNT(*) FROM table_203_102 WHERE "athlete" = 'usain bolt'
squall
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
Just show employees' salaries by their first name in a bar chart.
SELECT FIRST_NAME, SALARY FROM employees
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_CLINIC_ID text, MED_DIRE_CD tex...
自零六年六月七日起,截止到零八年二月六日,病患水悦心在医院住过几次
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '水悦心' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-06-07' AND '2008-02-06' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '水悦心' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2006-06-07' AND '2008-02-06' AND fgwyjzb.CLINIC_TYPE = '住院'
css
CREATE TABLE table_203_665 ( id number, "name" text, "municipality" text, "established" number, "tower height\nin meters (ft)" text, "focal plane\nin meters (ft)" text, "current status" text, "current condition" text )
what is the largest tower
SELECT "name" FROM table_203_665 ORDER BY "tower height\nin meters (ft)" DESC LIMIT 1
squall
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATE...
A bar chart for what are the number of the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh'?, and sort in descending by the y-axis.
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number,...
when did patient 022-6959 come to the hospital via acute care/floor, the first time in 2105?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-6959' AND patient.hospitaladmitsource = 'acute care/floor' AND STRFTIME('%y', patient.hospitaladmittime) = '2105' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_47200 ( "Model" text, "A300" text, "A310" text, "A320" text, "A330" text, "A340" text )
What is the A330 for A310 B10?
SELECT "A330" FROM table_47200 WHERE "A310" = 'b10'
wikisql
CREATE TABLE table_name_95 ( position VARCHAR, school_club_team VARCHAR )
Which position has a player at Arizona state?
SELECT position FROM table_name_95 WHERE school_club_team = "arizona state"
sql_create_context
CREATE TABLE table_18457 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
which affiliation is james h. morrison part of
SELECT "Party" FROM table_18457 WHERE "Incumbent" = 'James H. Morrison'
wikisql
CREATE TABLE table_61345 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
What was the score of the 2nd leg when Newell's Old Boys played at home?
SELECT "2nd leg" FROM table_61345 WHERE "Home (2nd leg)" = 'newell''s old boys'
wikisql
CREATE TABLE table_name_88 ( hosts VARCHAR, host_city VARCHAR, theme VARCHAR )
Who are the hosts from the event with a theme of codehunters and the host city of Bangkok?
SELECT hosts FROM table_name_88 WHERE host_city = "bangkok" AND theme = "codehunters"
sql_create_context
CREATE TABLE table_14942535_1 ( result VARCHAR, week VARCHAR )
What was the team's result in week 4?
SELECT result FROM table_14942535_1 WHERE week = 4
sql_create_context
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 ...
The 414 class , how big is it ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 414
advising
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Draw a bar chart of name versus height, I want to sort bars in asc order.
SELECT Name, Height FROM people ORDER BY Name
nvbench
CREATE TABLE table_25059 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
How many weight stats are there for players from San Francisco, CA?
SELECT COUNT("Weight") FROM table_25059 WHERE "Home Town" = 'San Francisco, CA'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is maximum days of hospital stay of patients whose insurance is medicare?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.insurance = "Medicare"
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, ...
provide the number of patients whose drug route is ivpca?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IVPCA"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
Provide the number of patients with hyperglycemis as the primary disease who are given the drug albuterol 0.083% neb soln.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND prescriptions.drug = "Albuterol 0.083% Neb Soln"
mimicsql_data
CREATE TABLE table_204_430 ( id number, "model" text, "origin" text, "type" text, "version" text, "in service" text, "notes" text )
what is the last model and its origin ?
SELECT "model", "origin" FROM table_204_430 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_77 ( matches INTEGER, prize_money VARCHAR )
What is are the highest matches with 5,000 in prize money?
SELECT MAX(matches) FROM table_name_77 WHERE prize_money = "£5,000"
sql_create_context
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, ...
count the number of patients whose year of birth is less than 2121 and drug route is nu?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2121" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
how much difference was made in patient 7112's ptt levels last measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') ORDER BY labevents.charttime DESC ...
mimic_iii
CREATE TABLE table_52875 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the Set 3 with a Date of 04 oct, and a Set 2 with 15 5?
SELECT "Set 3" FROM table_52875 WHERE "Date" = '04 oct' AND "Set 2" = '15–5'
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, ...
what is the dose size for the drug ciprofloxacin hcl ?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ciprofloxacin HCl"
mimicsql_data
CREATE TABLE table_48399 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What region goes along with January 1974?
SELECT "Region" FROM table_48399 WHERE "Date" = 'january 1974'
wikisql
CREATE TABLE table_30237 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
What was the round when there were 16 winners from the previous round?
SELECT "Round" FROM table_30237 WHERE "Winners from previous round" = '16'
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...
find the number of russian speaking patients who are diagnosed with proteus infection nos.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "RUSS" AND diagnoses.short_title = "Proteus infection NOS"
mimicsql_data
CREATE TABLE table_55554 ( "Weight Class (kg)" real, "World Record (kg)" text, "Sinclair Coefficient" real, "Sinclair Total" real, "Rank" real )
What is the average sinclair coefficient with a Sinclair Total of 477.2772023, and a Weight Class (kg) larger than 105?
SELECT AVG("Sinclair Coefficient") FROM table_55554 WHERE "Sinclair Total" = '477.2772023' AND "Weight Class (kg)" > '105'
wikisql
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE...
i need flight information between ATLANTA and BOSTON
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 = 'BOSTON...
atis
CREATE TABLE table_35686 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What Tournament had a Score of 6 3, 2 6, 6 3?
SELECT "Tournament" FROM table_35686 WHERE "Score" = '6–3, 2–6, 6–3'
wikisql
CREATE TABLE table_203_191 ( id number, "year" number, "group" text, "award" text, "result" text, "notes" text )
how many times did erbedija win best actor between 1994 and 2012 ?
SELECT COUNT(*) FROM table_203_191 WHERE "award" = 'best actor'
squall
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer...
what flights leave CHICAGO and arrive in DETROIT around 6pm next tuesday
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 ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 22 AND da...
atis
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
Show the names and heights of buildings with at least two institutions founded after 1880 by a bar chart, and sort by the names from low to high.
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Name
nvbench
CREATE TABLE table_11300 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
When did the score of 2-0 take place?
SELECT "Date" FROM table_11300 WHERE "Score" = '2-0'
wikisql
CREATE TABLE table_name_19 ( sixth_place VARCHAR, fifth_place VARCHAR )
Who was sixth place when Hugo Salazar was fifth place?
SELECT sixth_place FROM table_name_19 WHERE fifth_place = "hugo salazar"
sql_create_context
CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real ) CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text )
Show different publishers together with the number of publications they have in a bar chart, I want to display names in descending order.
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY Publisher DESC
nvbench
CREATE TABLE table_41158 ( "Track" real, "Recorded" text, "Catalogue" text, "Release date" text, "Song title" text, "Time" text )
What catalogue was recorded on 9/10/67 and a release date of 1/9/68?
SELECT "Catalogue" FROM table_41158 WHERE "Recorded" = '9/10/67' AND "Release date" = '1/9/68'
wikisql
CREATE TABLE table_name_58 ( years VARCHAR, name VARCHAR, authority VARCHAR, roll VARCHAR )
What are the years available at Bayview School, which has state authority and a roll number larger than 333?
SELECT years FROM table_name_58 WHERE authority = "state" AND roll > 333 AND name = "bayview school"
sql_create_context
CREATE TABLE table_name_57 ( tournament VARCHAR, margin_of_victory VARCHAR )
What is the Tournament with a Margin of victory that was 4 strokes?
SELECT tournament FROM table_name_57 WHERE margin_of_victory = "4 strokes"
sql_create_context
CREATE TABLE table_name_77 ( sound VARCHAR, publisher VARCHAR, language VARCHAR, classifaction VARCHAR )
What sound has cantonese as the language, N/A as the classification, and spectrum dvd as the publisher?
SELECT sound FROM table_name_77 WHERE language = "cantonese" AND classifaction = "n/a" AND publisher = "spectrum dvd"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Chris's 'use a reference' comments.
SELECT CreationDate, Id AS "comment_link" FROM Comments WHERE UserId = 962089 AND Text LIKE '%a reference%' ORDER BY CreationDate
sede
CREATE TABLE table_38449 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Points have an Opponent of vancouver canucks, and a November smaller than 11?
SELECT AVG("Points") FROM table_38449 WHERE "Opponent" = 'vancouver canucks' AND "November" < '11'
wikisql
CREATE TABLE table_14345690_15 ( uk_co_presenter VARCHAR, co_presenter VARCHAR, series VARCHAR )
Who is the UK co-presenters that have Joe Swash as a co-presenter of the series Eleven (2011)?
SELECT uk_co_presenter FROM table_14345690_15 WHERE co_presenter = "Joe Swash" AND series = "Eleven (2011)"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
从07年9月24日到19年9月4日患者钱建章的检测指标535180的情况是什么样的?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_46 ( country VARCHAR, player VARCHAR )
What country is Lee Janzen from?
SELECT country FROM table_name_46 WHERE player = "lee janzen"
sql_create_context
CREATE TABLE table_48643 ( "Discipline" text, "Circuit" text, "Event" text, "Session" text, "Cause" text )
The 1997 Japanese Formula 3 Championship is part of what circuit?
SELECT "Circuit" FROM table_48643 WHERE "Event" = '1997 japanese formula 3 championship'
wikisql
CREATE TABLE table_26090 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text )
What was the Tues 25 Aug time and speed when Mon 24 Aug was 22' 24.56 101.021mph?
SELECT "Tues 25 Aug" FROM table_26090 WHERE "Mon 24 Aug" = '22'' 24.56 101.021mph'
wikisql
CREATE TABLE table_31335 ( "Manufacturer" text, "Model" text, "Intro Date" text, "Interface" text, "OS" text, "Price (USD)" real, "Price" text, "Throughput" text )
Who is the manufacturer whose intro date is 2006 and their throughput is 4 mbit/s?
SELECT "Manufacturer" FROM table_31335 WHERE "Intro Date" = '2006' AND "Throughput" = '4 Mbit/s'
wikisql
CREATE TABLE table_43299 ( "Name" text, "Years" text, "League a" text, "FA Cup" text, "League Cup" text, "Other b" text, "Total" text )
What is the League for 1952 1960?
SELECT "League a" FROM table_43299 WHERE "Years" = '1952–1960'
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, ...
count the number of medicines that were prescribed to patient 51605 in 2103.
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51605) AND STRFTIME('%y', prescriptions.startdate) = '2103'
mimic_iii
CREATE TABLE table_24714 ( "Rank" real, "Team Name" text, "Basic Elements" text, "Tumbling" text, "Stunts" text, "Tosses/Pyramids" text, "Deductions" text, "Total" text )
What is the total if 44 is tosses/pyramids?
SELECT "Total" FROM table_24714 WHERE "Tosses/Pyramids" = '44'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
what is the first value of the sodium lab test of patient 006-14121 since 12/2105?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-14121')) AND lab.labname = 'sodium' AND STRFTIME('%y-%m', lab.labresulttime) >= '21...
eicu
CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_product_cost number, derived_vat_payable number, derived_total_cost number ) CREATE TABLE products ( product...
What are the customer ids for customers who do not have an account?
SELECT customer_id FROM customers EXCEPT SELECT customer_id FROM accounts
spider
CREATE TABLE table_41774 ( "Built" real, "Number" real, "Type" text, "SLM Number" real, "Wheel arrangement" text, "Location" text, "Notes" text )
Which type of locomotive was built in 1923?
SELECT "Type" FROM table_41774 WHERE "Built" = '1923'
wikisql
CREATE TABLE table_name_35 ( winner VARCHAR, country VARCHAR, date VARCHAR )
On the date november 24-december 6 what's the winner when the country is united states?
SELECT winner FROM table_name_35 WHERE country = "united states" AND date = "november 24-december 6"
sql_create_context
CREATE TABLE table_15640 ( "Rank" real, "Team" text, "Country" text, "Value ($M)" real, "% change on year" real, "Revenue ($M)" real )
What is the lowest revenue for the rank of 14?
SELECT MIN("Revenue ($M)") FROM table_15640 WHERE "Rank" = '14'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Of all courses that satisfy the MDE requirement , which courses cover Ecology of Streams and Rivers ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Ecology of Streams and Rivers%' OR course.description LIKE '%Ecology of Streams and Rivers%' OR ...
advising
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose days of hospital stay is greater than 29 and procedure short title is other phototherapy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.short_title = "Other phototherapy"
mimicsql_data
CREATE TABLE table_6436 ( "Year" real, "Class" text, "Vehicle" text, "Position" text, "Stages won" text )
What year did he compete in the car class and win 0 stages?
SELECT "Year" FROM table_6436 WHERE "Class" = 'car' AND "Stages won" = '0'
wikisql
CREATE TABLE table_name_66 ( venue VARCHAR, competition VARCHAR )
what is the venue when the competition is 1996 afc asian cup group stage?
SELECT venue FROM table_name_66 WHERE competition = "1996 afc asian cup group stage"
sql_create_context
CREATE TABLE table_15285 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
where did arron oberholser play?
SELECT "Country" FROM table_15285 WHERE "Player" = 'arron oberholser'
wikisql
CREATE TABLE table_36786 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which Tournament has a Date of 22 january 1979?
SELECT "Tournament" FROM table_36786 WHERE "Date" = '22 january 1979'
wikisql
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Plot the total number by grouped by nationality as a bar graph, and sort Y-axis in desc order.
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
能不能告诉我患者施志业在医疗记录中药品消费在1613.81元以上的医疗就诊有哪几次?医疗就诊的编号是多少
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 <= 1613.81)
css
CREATE TABLE table_32087 ( "Original week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text )
Tell me the date for original week less than 16 and result of l 23 22
SELECT "Date" FROM table_32087 WHERE "Original week" < '16' AND "Result" = 'l 23–22'
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 ...
查一下在医疗就诊41430407750中给患者55801049做检验的科室名称及编码
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '41430407750' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '41430407750'
css
CREATE TABLE table_name_57 ( opponent_in_the_final VARCHAR, date VARCHAR )
What Opponent in the final has a Date of 19 september 1988?
SELECT opponent_in_the_final FROM table_name_57 WHERE date = "19 september 1988"
sql_create_context
CREATE TABLE table_203_773 ( id number, "season" number, "network" text, "play-by-play" text, "color commentator(s)" text, "sideline reporter(s)" text )
who was the last color commentator ?
SELECT "color commentator(s)" FROM table_203_773 ORDER BY "season" DESC LIMIT 1
squall
CREATE TABLE table_204_694 ( id number, "year" text, "name" text, "date" text, "stages" number, "distance" text, "winner" text, "time" text )
what was the largest distance traveled for the marlboro tour ?
SELECT MAX("distance") FROM table_204_694
squall
CREATE TABLE table_22197 ( "Year" real, "Date" text, "Type" text, "Species" text, "Author Species" text, "Value" text, "Afinsa" real, "Scott" text, "Mitchell" real, "Yvert" text, "Sta. & Gib." real, "Order" text, "Family" text )
How many orders when the species is Pavo Cristatus?
SELECT COUNT("Order") FROM table_22197 WHERE "Species" = 'Pavo cristatus'
wikisql
CREATE TABLE table_4332 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text )
Tell me the nhl team for 74
SELECT "NHL team" FROM table_4332 WHERE "Pick" = '74'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
what flights do you have between PITTSBURGH and ATLANTA
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL...
atis
CREATE TABLE table_name_63 ( away_team VARCHAR, home_team VARCHAR )
What was the away team score when the home team essendon was playing?
SELECT away_team AS score FROM table_name_63 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE table_name_13 ( pick__number INTEGER, player VARCHAR )
What pick number was player Greg McKegg?
SELECT AVG(pick__number) FROM table_name_13 WHERE player = "greg mckegg"
sql_create_context
CREATE TABLE table_name_28 ( sub_millisecond_cycle VARCHAR )
What is the millisecond cycle for the Fieldbus?
SELECT sub_millisecond_cycle FROM table_name_28 WHERE "fieldbus" = "fieldbus"
sql_create_context
CREATE TABLE table_59462 ( "Club" text, "Coach" text, "City" text, "Stadium" text, "2007-2008 season" text )
Which stadium had the club Kuwait?
SELECT "Stadium" FROM table_59462 WHERE "Club" = 'kuwait'
wikisql
CREATE TABLE table_73215 ( "Shareholder" text, "s A share" real, "s B share" real, "Percent of capital" text, "Percent of votes" text )
What is the s B share for the shareholder that has 2.12 percent of votes?
SELECT MIN("s B share") FROM table_73215 WHERE "Percent of votes" = '2.12'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients aged below 36 years have stayed in the hospital for more than 14 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "36" AND demographic.days_stay > "14"
mimicsql_data
CREATE TABLE table_name_33 ( home VARCHAR, date VARCHAR )
What is the Home on december 10?
SELECT home FROM table_name_33 WHERE date = "december 10"
sql_create_context
CREATE TABLE table_203_512 ( id number, "release date" text, "album" text, "catalog number" text, "chart position" number, "notes" text )
how many albums held a chart position of at least 10 or less ?
SELECT COUNT("album") FROM table_203_512 WHERE "chart position" <= 10
squall
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,...
what is the number of medicare patients who have procedure icd9 code 9703?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.icd9_code = "9703"
mimicsql_data
CREATE TABLE table_2429942_2 ( top_goalscorer VARCHAR, season VARCHAR )
Who is the top goalscorer for the season 2010-11?
SELECT top_goalscorer FROM table_2429942_2 WHERE season = "2010-11"
sql_create_context
CREATE TABLE table_10760 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the match where the crowd was greater than 14,000 and the home team scored 15.14 (104) who was the away team?
SELECT "Away team score" FROM table_10760 WHERE "Crowd" > '14,000' AND "Home team score" = '15.14 (104)'
wikisql
CREATE TABLE table_204_362 ( id number, "episode" number, "airdate" text, "game 1" text, "game 2" text, "game 3" text, "viewers" text )
which episode of the whole 19 yards had the least amount of viewers ?
SELECT "episode" FROM table_204_362 ORDER BY "viewers" LIMIT 1
squall
CREATE TABLE table_29347 ( "Rank" real, "Total USD" real, "Project name" text, "Creator" text, "Category" text, "% funded" real, "Backers" real, "Closing date" text )
What was the category of the project name Mighty No. 9?
SELECT "Category" FROM table_29347 WHERE "Project name" = 'Mighty No. 9'
wikisql
CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_...
, and order by the y axis in ascending.
SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY COUNT(*)
nvbench
CREATE TABLE table_36295 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Record has a Game of 19?
SELECT "Record" FROM table_36295 WHERE "Game" = '19'
wikisql
CREATE TABLE table_63485 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
Where was the fight that took a time of 1:37?
SELECT "Location" FROM table_63485 WHERE "Time" = '1:37'
wikisql
CREATE TABLE table_name_89 ( venue VARCHAR, away_team VARCHAR )
Which Venue has an Away team of south melbourne?
SELECT venue FROM table_name_89 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_2226343_1 ( manufacturer VARCHAR, average_speed__mph_ VARCHAR )
Who is the manufacturer when 150.088 is the average speed (mph)?
SELECT manufacturer FROM table_2226343_1 WHERE average_speed__mph_ = "150.088"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Get me the number of married patients who have been diagnosed with uncontrolled diabetes with hyperosmolarity, type II or unspecified.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "DMII hprosmlr uncontrold"
mimicsql_data
CREATE TABLE table_name_88 ( venue VARCHAR, season VARCHAR )
What was the venue during the Season of 2010 11?
SELECT venue FROM table_name_88 WHERE season = "2010–11"
sql_create_context
CREATE TABLE table_31175 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" real, "Earnings ($)" real )
What is the best finish record for Carl Paulson?
SELECT "Best finish" FROM table_31175 WHERE "Player" = 'Carl Paulson'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在医疗记录中那个病号蒋蕴藉购买了金额超过8634.98元的药品几次?记录的就诊编号是多些?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '蒋蕴藉' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 8634.98)
css
CREATE TABLE table_name_18 ( builder VARCHAR, railway VARCHAR )
Which builder has a railway of Rhodesia Railways?
SELECT builder FROM table_name_18 WHERE railway = "rhodesia railways"
sql_create_context
CREATE TABLE table_74407 ( "Institution" text, "Location" text, "Mascot" text, "Colors" text, "Affiliation" text, "9\u201312 enrollment" real, "School website" text )
What location has 363 students enrolled in the 9th to 12th grades?
SELECT "Location" FROM table_74407 WHERE "9\u201312 enrollment" = '363'
wikisql
CREATE TABLE table_15827397_1 ( name VARCHAR, livery VARCHAR )
How many locomotives have a livery that is highland railway green
SELECT COUNT(name) FROM table_15827397_1 WHERE livery = "Highland Railway green"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( I...
Percent of Questions with an answer.
SELECT questions.Id, COUNT(answers.Id) AS AnswerCount FROM Posts AS questions LEFT JOIN Posts AS answers ON questions.Id = answers.ParentId INNER JOIN PostTags ON questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'javascript' GROUP BY questions.Id ORDER BY RAND()
sede
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ...
How many papers does benjamin mako hill have ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'benjamin mako hill' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_21829580_1 ( classification__judges_ VARCHAR, detailed_grades VARCHAR )
Name the classification for 9, 9, 8, 9
SELECT classification__judges_ FROM table_21829580_1 WHERE detailed_grades = "9, 9, 8, 9"
sql_create_context