context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_52047 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which away team has a Home team score of 15.14 (104)?
SELECT "Away team" FROM table_52047 WHERE "Home team score" = '15.14 (104)'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
give me the flights for AA from DALLAS to SAN FRANCISCO
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_78475 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
Which Opponent was played on 1991-10-13?
SELECT "Opponent" FROM table_78475 WHERE "Date" = '1991-10-13'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment ...
i'd like a list of the flights from OAKLAND to DALLAS FORT WORTH on sunday
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2...
atis
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
since 171 months ago has the heart rate of patient 14154 been normal?
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 = 14154)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE table_12164707_1 ( mixed_doubles VARCHAR, mens_singles VARCHAR )
How many Mixed Doubles won when Oliver Pongratz won the Men's Singles?
SELECT COUNT(mixed_doubles) FROM table_12164707_1 WHERE mens_singles = "Oliver Pongratz"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevent...
indicate the monthly minimum arterial bp mean of patient 26195 since 1199 days ago.
SELECT MIN(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 = 26195)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_24826 ( "Institution" text, "Location" text, "Enrollment" text, "Athletic nickname" text, "School Colors" text, "Founded" real )
How many locations are there for the athletic nickname is blue crusaders?
SELECT COUNT("Location") FROM table_24826 WHERE "Athletic nickname" = 'Blue Crusaders'
wikisql
CREATE TABLE table_5277 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text )
On what date was there an International Friendly competition?
SELECT "Date" FROM table_5277 WHERE "Competition" = 'international friendly'
wikisql
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 lab ( subject_id text, hadm_id text, ...
what is the number of patients whose year of birth is less than 1846 and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_82 ( record VARCHAR, date VARCHAR )
On December 25, what was the record?
SELECT record FROM table_name_82 WHERE date = "december 25"
sql_create_context
CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code ...
Show the ids and details of the investors who have at least two transactions with type code 'SALE'. Show a pie chart.
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE"
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what are the average monthly number of patients diagnosed with svt - re-entrant?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'svt - re-entrant' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_10303 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the date of the Red Wings home game against Anaheim?
SELECT "Date" FROM table_10303 WHERE "Visitor" = 'anaheim'
wikisql
CREATE TABLE table_name_18 ( to_par VARCHAR, score VARCHAR )
What is To par, when Score is '70-68-68-71=277'?
SELECT to_par FROM table_name_18 WHERE score = 70 - 68 - 68 - 71 = 277
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is procedure icd9 code and drug name of subject id 10317?
SELECT procedures.icd9_code, prescriptions.drug FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "10317"
mimicsql_data
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 number of patients whose lab test fluid is cerebrospinal fluid (csf) were born before 2060?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the diagnosis and procedure for patient id 83678?
SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678"
mimicsql_data
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
What is minimum age for different job title, show in descending by the total number.
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age) DESC
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
i'd like to fly from COLUMBUS to NASHVILLE tomorrow morning
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 = 'NASHVILLE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN...
atis
CREATE TABLE table_21995420_6 ( school VARCHAR, stunts VARCHAR )
What is every school with stunts of 48?
SELECT school FROM table_21995420_6 WHERE stunts = "48"
sql_create_context
CREATE TABLE table_25084227_1 ( us_viewers__in_millions_ VARCHAR, directed_by VARCHAR )
If the episode was directed by Michael Offer, how many US Viewers watched it?
SELECT us_viewers__in_millions_ FROM table_25084227_1 WHERE directed_by = "Michael Offer"
sql_create_context
CREATE TABLE table_20845 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" rea...
what is the maximum 18 to 19 and 30-34 is 1203?
SELECT MAX("18 to 19") FROM table_20845 WHERE "30 to 34" = '1203'
wikisql
CREATE TABLE table_204_163 ( id number, "airline" text, "icao" text, "iata" text, "callsign" text, "commenced\noperations" number )
what is the difference between the time air uganda commenced operations and skyjet airlines commenced operations ?
SELECT ABS((SELECT "commenced\noperations" FROM table_204_163 WHERE "airline" = 'air uganda') - (SELECT "commenced\noperations" FROM table_204_163 WHERE "airline" = 'skyjet airlines'))
squall
CREATE TABLE table_64422 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What is Italy's rank?
SELECT "Rank" FROM table_64422 WHERE "Country" = 'italy'
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 male patients who have atherosclerosis of native arteries of the extremities with gangrene diagnoses.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Atherosclerosis of native arteries of the extremities with gangrene"
mimicsql_data
CREATE TABLE table_203_429 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what was the last competition he was in before the 2012 olympics ?
SELECT "competition" FROM table_203_429 WHERE id = (SELECT id FROM table_203_429 WHERE "year" = 2012 AND "competition" = 'olympic games') - 1
squall
CREATE TABLE table_name_1 ( score VARCHAR, date VARCHAR )
Name th score for may 11, 2003
SELECT score FROM table_name_1 WHERE date = "may 11, 2003"
sql_create_context
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 ...
what is the amount of days it has elapsed since the last time patient 25733 had a d5w intake on the current intensive care unit visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_name_18 ( author VARCHAR, company VARCHAR )
Who was the author for company Buzz Productions Theater?
SELECT author FROM table_name_18 WHERE company = "buzz productions theater"
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...
what is the number of patients whose lab test chart time is 2108-10-04 05:05:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2108-10-04 05:05:00"
mimicsql_data
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
what is the total average cost of a hospital that includes a uric acid lab test in 2102?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'uric acid')) AND STRFTIME('%y', cost.chargetime) = '2102' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_57988 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who played home team at Victoria Park?
SELECT "Home team" FROM table_57988 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
What is the age of the friend of Zach with longest year relationship?
SELECT T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE name = 'Zach')
spider
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStat...
Get old unanswered questions with no answers asked by users with recent activity.
SELECT question.Id AS "post_link", question.Score, question.CreationDate, question.OwnerUserId AS "user_link", question.Tags, question.FavoriteCount FROM Posts AS question WHERE question.PostTypeId = 1 AND question.AnswerCount < 1 AND question.AcceptedAnswerId IS NULL AND question.ClosedDate IS NULL AND NOT EXISTS(SELE...
sede
CREATE TABLE table_203_672 ( id number, "week" number, "date" text, "opponent" text, "result" text, "venue" text, "attendance" number )
what was the difference in score in week 7 ?
SELECT ABS("result" - "result") FROM table_203_672 WHERE "week" = 7
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
列出患者奚妮娜的检验报告单中结果指标均正常的检验报告单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚...
css
CREATE TABLE table_name_44 ( top_10 INTEGER, cuts_made VARCHAR, top_25 VARCHAR, tournament VARCHAR )
What is the lowest Top-10 when the Top-25 is 6, and a Tournament of u.s. open, and a Cut made larger than 9?
SELECT MIN(top_10) FROM table_name_44 WHERE top_25 = 6 AND tournament = "u.s. open" AND cuts_made > 9
sql_create_context
CREATE TABLE table_name_88 ( date VARCHAR, team VARCHAR, player VARCHAR )
On which date did Ger Loughnane from Team Clare have a match?
SELECT date FROM table_name_88 WHERE team = "clare" AND player = "ger loughnane"
sql_create_context
CREATE TABLE table_61224 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
Which team was team 1 in the match where team 2 was olympique lyonnais (d2)?
SELECT "Team 1" FROM table_61224 WHERE "Team 2" = 'olympique lyonnais (d2)'
wikisql
CREATE TABLE table_name_63 ( name VARCHAR, location VARCHAR, notes VARCHAR )
What is the Name of the dinosaur that was discovered in the Location, China, and whose Notes are, 'described from a single tooth'?
SELECT name FROM table_name_63 WHERE location = "china" AND notes = "described from a single tooth"
sql_create_context
CREATE TABLE table_43 ( "Scheme" text, "Tariff code" text, "BTs retail price (regulated)" text, "Approx premium" text, "Prefixes" text )
How many tariff codes have a bts retail price of 2p/min or inclusive?
SELECT COUNT("Tariff code") FROM table_43 WHERE "BTs retail price (regulated)" = '2p/min or inclusive'
wikisql
CREATE TABLE table_name_7 ( record VARCHAR, score VARCHAR )
Which record has a score of 135 134?
SELECT record FROM table_name_7 WHERE score = "135–134"
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
What is the total number of different nationalities of all ships? Give me a bar graph, and I want to list by the Y from low to high.
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality)
nvbench
CREATE TABLE table_name_69 ( coach VARCHAR, location VARCHAR )
Who is the coach located in Oakden?
SELECT coach FROM table_name_69 WHERE location = "oakden"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) 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, pre...
Of the upper-level classes , how many are 14 credits ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 14 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_74318 ( "Nationality" text, "Celebrity" text, "Occupation" text, "Charity" text, "Status" text )
What is the charity for the celebrity with an occupation title of actor and singer?
SELECT "Charity" FROM table_74318 WHERE "Occupation" = 'Actor and Singer'
wikisql
CREATE TABLE table_10704 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
What is the lowest number of people in attendance when the record was 9 26?
SELECT MIN("Attendance") FROM table_10704 WHERE "Record" = '9–26'
wikisql
CREATE TABLE table_64747 ( "Team" text, "Winners" real, "Runners-up" real, "Years won" text, "Years runner-up" text )
What year(s) was Duisburg runner-up?
SELECT "Years runner-up" FROM table_64747 WHERE "Team" = 'duisburg'
wikisql
CREATE TABLE table_17031 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the original air date of season 18?
SELECT "Original air date" FROM table_17031 WHERE "No. in season" = '18'
wikisql
CREATE TABLE table_name_77 ( hdtv VARCHAR, television_service VARCHAR )
What is the HDTV for the Rai Nettuno Sat Uno Television service?
SELECT hdtv FROM table_name_77 WHERE television_service = "rai nettuno sat uno"
sql_create_context
CREATE TABLE table_203_873 ( id number, "model name" text, "length" text, "width" text, "height" text, "riders" number, "capacity" number, "description" text, "portable" text, "notes" number )
how many riders does the skater model include ?
SELECT "riders" FROM table_203_873 WHERE "model name" = 'skater'
squall
CREATE TABLE railway_manage ( railway_id number, manager_id number, from_year text ) CREATE TABLE train ( train_id number, train_num text, name text, from text, arrival text, railway_id number ) CREATE TABLE railway ( railway_id number, railway text, builder text, b...
List the object number of railways that do not have any trains.
SELECT objectnumber FROM railway WHERE NOT railway_id IN (SELECT railway_id FROM train)
spider
CREATE TABLE table_name_24 ( south VARCHAR, west VARCHAR, east VARCHAR )
What is the south with ev lindau as the west and svg burgkirchen as the east?
SELECT south FROM table_name_24 WHERE west = "ev lindau" AND east = "svg burgkirchen"
sql_create_context
CREATE TABLE table_24949 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
What's the minimal rank of a athlete shown in the chart?
SELECT MIN("Rank") FROM table_24949
wikisql
CREATE TABLE table_33495 ( "Date" text, "Name" text, "Party" text, "Province" text, "Details" text )
Which party had a member on August 26, 2008?
SELECT "Party" FROM table_33495 WHERE "Date" = 'august 26, 2008'
wikisql
CREATE TABLE table_name_92 ( laps INTEGER, grid VARCHAR, time VARCHAR )
What is the lowest laps a grid less than 22 with a time of +35.268 has?
SELECT MIN(laps) FROM table_name_92 WHERE grid < 22 AND time = "+35.268"
sql_create_context
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
从2014年2月8日到2016年4月24日,4804151这个医疗机构在外地门诊的就诊记录具体是多少
SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZSEBZ = '4804151' AND bdmzjzjlb.JZKSRQ BETWEEN '2014-02-08' AND '2016-04-24'
css
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
统计一下医疗记录中患者年龄不高于17岁的平均治病费总额一共是多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 17)
css
CREATE TABLE table_name_62 ( reg_gp VARCHAR, player VARCHAR, rd__number VARCHAR )
How many reg GP for nathan barrett in a round less than 8?
SELECT COUNT(reg_gp) FROM table_name_62 WHERE player = "nathan barrett" AND rd__number < 8
sql_create_context
CREATE TABLE table_name_79 ( sunday VARCHAR, friday VARCHAR )
On the series in which Emma Willis Jamie East presented on Friday, who was the presenter on Sunday?
SELECT sunday FROM table_name_79 WHERE friday = "emma willis jamie east"
sql_create_context
CREATE TABLE table_name_88 ( winning_constructor VARCHAR, winning_driver VARCHAR )
What was the constructor when riccardo patrese was the winning driver?
SELECT winning_constructor FROM table_name_88 WHERE winning_driver = "riccardo patrese"
sql_create_context
CREATE TABLE table_63908 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "Notes" text )
What is the lowest time for Paulo Villar in lane 9?
SELECT MIN("Time") FROM table_63908 WHERE "Athlete" = 'paulo villar' AND "Lane" < '9'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose admission location is transfer from hosp/extram and diagnoses icd9 code is 99591?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.icd9_code = "99591"
mimicsql_data
CREATE TABLE table_name_20 ( date VARCHAR, week VARCHAR )
What is the date of week 11?
SELECT date FROM table_name_20 WHERE week = 11
sql_create_context
CREATE TABLE table_name_39 ( position VARCHAR, player VARCHAR, height VARCHAR, year_born VARCHAR )
What position does Sergio Rodr guez, who is less than 1.96 tall and was born after 1980, play?
SELECT position FROM table_name_39 WHERE height < 1.96 AND year_born > 1980 AND player = "sergio rodríguez"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
what is the average hospital cost that involves the procedure known as skin closure nec since 2105?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'skin closure nec')) AND STRFTIME('%y', cost.chargetime) >...
mimic_iii
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id, and show X-axis in desc order.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_98 ( pick VARCHAR, college VARCHAR, round VARCHAR, position VARCHAR, overall VARCHAR )
What is the total number of Pick, when Position is OT, when Overall is greater than 91, when Round is greater than 21, and when College is Mississippi?
SELECT COUNT(pick) FROM table_name_98 WHERE position = "ot" AND overall > 91 AND round > 21 AND college = "mississippi"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayNa...
Comments by a user with a word.
SELECT CreationDate, Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE LOWER('%##word##%') AND UserId = '##userid##' ORDER BY CreationDate
sede
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Tota...
Stacked bar chart of the number of country for with each Competition_type in each country, and show by the y axis in asc.
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY COUNT(Country)
nvbench
CREATE TABLE table_name_7 ( year VARCHAR, ratings VARCHAR )
How many Years have Ratings of 10.9/23?
SELECT COUNT(year) FROM table_name_7 WHERE ratings = "10.9/23"
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 demographic (...
calculate the minimum age of government health insurance patients who were hospitalized for 2 days.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "2"
mimicsql_data
CREATE TABLE table_name_16 ( earnings___ INTEGER, wins INTEGER )
What is the highest earnings of a player with more than 19 wins?
SELECT MAX(earnings___) AS $__ FROM table_name_16 WHERE wins > 19
sql_create_context
CREATE TABLE table_72659 ( "Year" text, "Best Film" text, "Best Director" text, "Best Actor" text, "Best Actress" text, "Best Supporting Actor" text, "Best Supporting Actress" text )
Name the best director for mother
SELECT "Best Director" FROM table_72659 WHERE "Best Film" = 'Mother'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose gender is f and lab test name is calculated bicarbonate, whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Calculated Bicarbonate, Whole Blood"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ) ...
what was the last time patient 86792 had the maximum creatinine value until 18 months ago?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-18...
mimic_iii
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...
60676464号病人的检验报告单对应的检验结果指标均异常的检验报告单号有哪些
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
CREATE TABLE table_24961421_1 ( series__number VARCHAR, season__number VARCHAR )
What number in the series was episode 7 in the season?
SELECT series__number FROM table_24961421_1 WHERE season__number = 7
sql_create_context
CREATE TABLE table_71469 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score on December 3 when Detroit was the home team and Legace took the decision?
SELECT "Score" FROM table_71469 WHERE "Home" = 'detroit' AND "Decision" = 'legace' AND "Date" = 'december 3'
wikisql
CREATE TABLE table_22295 ( "No. overall" real, "No. in series" real, "Title" text, "Director" text, "Writer" text, "Original air date" text, "Production code" real )
Name the number in series for number 38
SELECT MIN("No. in series") FROM table_22295 WHERE "No. overall" = '38'
wikisql
CREATE TABLE table_name_13 ( episodes VARCHAR, japanese_title VARCHAR )
What episodes had the title 6 3 2 in Japanese?
SELECT episodes FROM table_name_13 WHERE japanese_title = "ロト6で3億2千万円当てた男"
sql_create_context
CREATE TABLE wrestler ( Reign VARCHAR, LOCATION VARCHAR )
What are the distinct reigns of wrestlers whose location is not 'Tokyo,Japan' ?
SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> "Tokyo , Japan"
sql_create_context
CREATE TABLE table_21563298_1 ( external_link VARCHAR, location VARCHAR )
What school is in Brechin?
SELECT external_link FROM table_21563298_1 WHERE location = "Brechin"
sql_create_context
CREATE TABLE table_name_47 ( centerfold_model VARCHAR, pictorials VARCHAR )
Who's the Centerfold model with a Pictorials of adrianne curry, girls of tuscany?
SELECT centerfold_model FROM table_name_47 WHERE pictorials = "adrianne curry, girls of tuscany"
sql_create_context
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int )
A bar chart for showing the number of the names of editors that are on the committee of journals with sales bigger than 3000, and could you rank by the y axis in descending?
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_204_514 ( id number, "date" text, "sub" number, "flight" text, "dead" number, "hurt" number, "pax." number, "type" text, "perpetrator" text, "description" text )
what is the only attack on an airline to involve grenade and small arms fire ?
SELECT "date" FROM table_204_514 WHERE "type" = 'grenade & small arms fire'
squall
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...
count the number of patients whose ethnicity is white and drug route is oral?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE table_52576 ( "Name" text, "Period" text, "Matches" real, "Wins" real, "Draws" real, "Losses" real )
What are the names of those who made less than 3 wins in 15 matches?
SELECT "Name" FROM table_52576 WHERE "Wins" < '3' AND "Matches" < '15'
wikisql
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
How many routes end in a Canadian airport?
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
spider
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255)...
Return the ids and details corresponding to projects for which there are more than two documents Show bar chart, sort by the y axis in ascending please.
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_ID
nvbench
CREATE TABLE table_name_79 ( home VARCHAR, season VARCHAR )
What was the home for season 1949-50?
SELECT home FROM table_name_79 WHERE season = "1949-50"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( mea...
i would like to find the cheapest one way fare from BOSTON to OAKLAND
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
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 ) ...
Find out the average age of widow patients who are or more than 41 years of age.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "41"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
since 24 months ago, nafcillin, dextrose 50%-water or clonidine hcl 0.1 mg po tabs had been prescribed to patient 016-30273?
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 = '016-30273')) AND medication.drugname IN ('nafcillin', 'dextrose 50%-water'...
eicu
CREATE TABLE table_name_60 ( position_in_table VARCHAR, outgoing_manager VARCHAR )
What is the position that has the outgoing manager l szl Dajka?
SELECT position_in_table FROM table_name_60 WHERE outgoing_manager = "lászló dajka"
sql_create_context
CREATE TABLE table_name_29 ( goals_against INTEGER, points VARCHAR, draws VARCHAR )
what is the goals against when the points is 43 and draws is more than 9?
SELECT AVG(goals_against) FROM table_name_29 WHERE points = 43 AND draws > 9
sql_create_context
CREATE TABLE table_395 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What date did the Bulls play the LA Lakers?
SELECT "Date" FROM table_395 WHERE "Team" = 'LA Lakers'
wikisql
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...
在2007-03-13之后,患者潘锐泽有哪些住院就诊的检验报告单?查查住院就诊的流水号
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '潘锐泽' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2007-03-1...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what is the percentile of 16.0 in a lab test of anion gap given the same age of patient 028-47306 during the last hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'anion gap' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '028-47306' AND NOT pat...
eicu