context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
门诊给患者67854437诊断为疾病N63.585,那检测指标342923的结果定量及单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y...
css
CREATE TABLE fgwyjzb ( 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, ...
60373690552被医疗就诊的出院日期是那一天?
SELECT gwyjzb.OUT_HOSP_DATE FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '60373690552' UNION SELECT fgwyjzb.OUT_HOSP_DATE FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '60373690552'
css
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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_...
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, ...
may i have a list of flights going from BOSTON to DENVER on the 29 of 7
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 = 'DENVER' AND date_day.day_number = 29 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_15796054_3 ( song_choice VARCHAR, week__number VARCHAR )
Name the song choice when week number is hollywood
SELECT song_choice FROM table_15796054_3 WHERE week__number = "Hollywood"
sql_create_context
CREATE TABLE table_name_32 ( opponent VARCHAR, attendance VARCHAR )
Which opponent had 73,428 in attendance?
SELECT opponent FROM table_name_32 WHERE attendance = "73,428"
sql_create_context
CREATE TABLE table_45282 ( "Series Number" real, "Number of Episodes" real, "Original Air Date" real, "DVD Region 2 release date" text, "DVD Region 1 release date" text )
What's the lowest series number that originally aired before 2009 with more than 7 episodes and had a DVD Region 2 release date of 26 july 2004?
SELECT MIN("Series Number") FROM table_45282 WHERE "Original Air Date" < '2009' AND "DVD Region 2 release date" = '26 july 2004' AND "Number of Episodes" > '7'
wikisql
CREATE TABLE table_73459 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the record in the game against Memphis?
SELECT "Record" FROM table_73459 WHERE "Team" = 'Memphis'
wikisql
CREATE TABLE table_19495707_1 ( license VARCHAR, latest_release_date_and_version VARCHAR )
Name the license for 2009-05-25 v 7.61
SELECT license FROM table_19495707_1 WHERE latest_release_date_and_version = "2009-05-25 v 7.61"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
what was the name of the drug which patient 007-15837 was prescribed within the same hospital visit after being diagnosed with metabolic acidosis - moderate in 02/this year?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE zyb ( 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...
列出病患蒋丹彤去6374436医院做入院诊断的疾病结果中包含粥样的医疗就诊记录的编码
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '蒋丹彤' AND qtb.MED_SER_ORG_NO = '6374436' AND qtb.IN_DIAG_DIS_NM LIKE '%粥样%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '蒋丹彤' AND gyb.MED_SER_ORG_NO = '6374436' AND gyb.IN_DIAG_DIS_NM LIKE '%粥样%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb....
css
CREATE TABLE table_42115 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
What is the Date of Birth with a Block that is larger than 342?
SELECT "Date of Birth" FROM table_42115 WHERE "Block" > '342'
wikisql
CREATE TABLE table_204_750 ( id number, "team" text, "stadium" text, "capacity" number, "seated" number )
what is the total number of seating for the yate town ?
SELECT "capacity" FROM table_204_750 WHERE "team" = 'yate town'
squall
CREATE TABLE supplier_addresses ( supplier_id number, address_id number, date_from time, date_to time ) CREATE TABLE departments ( department_id number, dept_store_id number, department_name text ) CREATE TABLE product_suppliers ( product_id number, supplier_id number, date_sup...
Give the id and product type of the product with the lowest price.
SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1
spider
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 mzjzjlb ( HXPLC number, HZXM ...
两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition ( Competition_ID in...
List the positions of players whose average number of points scored by that position is larger than 20, give me a bar chart showing the number of different positions, could you show by the X-axis in desc?
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY Position DESC
nvbench
CREATE TABLE table_name_23 ( episode INTEGER, netflix VARCHAR )
What largest episode number's Netflix is S05E23?
SELECT MAX(episode) FROM table_name_23 WHERE netflix = "s05e23"
sql_create_context
CREATE TABLE table_33720 ( "Coach" text, "Years" text, "Record" text, "Conference Record" text, "Overall Win Percentage" text )
In what years, when the conference record was 63-9, was the coach Walter Meanwell?
SELECT "Years" FROM table_33720 WHERE "Coach" = 'walter meanwell' AND "Conference Record" = '63-9'
wikisql
CREATE TABLE table_36879 ( "Source" text, "Date" text, "MARTIN" text, "GR\u00dcNE" text, "Others" text, "Undecided" text )
What percent of others did ogm/news count when MARTIN had 9%?
SELECT "Others" FROM table_36879 WHERE "MARTIN" = '9%' AND "Source" = 'ogm/news'
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...
how many patients are below 77 years of age and use the drug sodium fluoride (dental gel)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "77" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
mimicsql_data
CREATE TABLE table_2452 ( "N\u00ba" real, "Cabinet (Nickname)" text, "Took office" text, "Left office" text, "Duration" text, "Coalition parties" text, "ministers" text, "ministries" real, "King" text )
When n is 3, what are all the coaliton parties?
SELECT "Coalition parties" FROM table_2452 WHERE "N\u00ba" = '3'
wikisql
CREATE TABLE table_name_65 ( country VARCHAR, score VARCHAR )
What country did the player with the score line 73-74-72-64=283 from?
SELECT country FROM table_name_65 WHERE score = 73 - 74 - 72 - 64 = 283
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Who has answered your questions most?.
SELECT answer.OwnerUserId AS "user_link", answer.OwnerUserId, COUNT(*) AS number FROM Posts AS question INNER JOIN Posts AS answer ON question.PostTypeId = 1 AND answer.PostTypeId = 2 AND question.OwnerUserId = '##userid##' AND answer.ParentId = question.Id GROUP BY answer.OwnerUserId ORDER BY number DESC
sede
CREATE TABLE table_name_99 ( game INTEGER, nuggets_points VARCHAR )
Which Game has a Nugget points of 89?
SELECT MIN(game) FROM table_name_99 WHERE nuggets_points = 89
sql_create_context
CREATE TABLE table_name_30 ( place VARCHAR, player VARCHAR )
What place is Fred Funk in?
SELECT place FROM table_name_30 WHERE player = "fred funk"
sql_create_context
CREATE TABLE table_name_66 ( scored INTEGER, competition VARCHAR )
What is the highest scored in the 2010 east asian football championship?
SELECT MAX(scored) FROM table_name_66 WHERE competition = "2010 east asian football championship"
sql_create_context
CREATE TABLE table_30256 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What is every CFL team for the college of Calgary?
SELECT "CFL Team" FROM table_30256 WHERE "College" = 'Calgary'
wikisql
CREATE TABLE table_name_3 ( home VARCHAR, visitor VARCHAR, record VARCHAR )
What team did the Montreal Canadiens visit when the record was 0-3?
SELECT home FROM table_name_3 WHERE visitor = "montreal canadiens" AND record = "0-3"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, U...
Date Distribution of Answer Votes Grouped by Date.
SELECT Votes.CreationDate, COUNT(Votes.CreationDate) FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.PostId = 47089 GROUP BY Votes.CreationDate
sede
CREATE TABLE table_train_177 ( "id" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "creatinine_clearance_cl" float, "urine_protein" int, "proteinuria" int, "fasting_glucose" int, "NOUSE" float )
proteinuria ( urine protein > 200 mg / dl ) or a creatinine > 2 mg / dl
SELECT * FROM table_train_177 WHERE proteinuria = 1 OR (urine_protein > 200 OR creatinine_clearance_cl > 2)
criteria2sql
CREATE TABLE table_name_93 ( l2_cache VARCHAR, frequency VARCHAR )
What is the L2 cache for the processor with a 750MHz frequency?
SELECT l2_cache FROM table_name_93 WHERE frequency = "750mhz"
sql_create_context
CREATE TABLE table_61685 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
On what date is there a status of Five Nations and an against of 23?
SELECT "Date" FROM table_61685 WHERE "Status" = 'five nations' AND "Against" = '23'
wikisql
CREATE TABLE table_name_30 ( away_team VARCHAR, venue VARCHAR )
What did the team score while away in moorabbin oval?
SELECT away_team AS score FROM table_name_30 WHERE venue = "moorabbin oval"
sql_create_context
CREATE TABLE table_204_174 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text )
which person medaled , but was not from south korea ?
SELECT "name" FROM table_204_174 WHERE "rank" IS NULL AND "nationality" <> 'south korea'
squall
CREATE TABLE table_204_974 ( id number, "season" number, "level" text, "division" text, "section" text, "administration" text, "position" text, "movements" text )
when was the last year they placed 2nd ?
SELECT "season" FROM table_204_974 WHERE "position" = 2 ORDER BY "season" DESC LIMIT 1
squall
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about ACC_Percent over the ACC_Regular_Season by a bar chart, and order Y-axis in asc order.
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text )
how many times was fabio fabiani jay ten winner ?
SELECT COUNT(*) FROM table_204_137 WHERE "jay-ten winner" = 'fabio fabiani'
squall
CREATE TABLE table_31675 ( "Player" text, "Country" text, "Caps" real, "Goals" text, "Years Active" text )
What is the largest caps value for Glen Moss?
SELECT MAX("Caps") FROM table_31675 WHERE "Player" = 'glen moss'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
开出检验报告单85054686577的科室编码以及名称能不能说一下?
SELECT KSBM, KSMC FROM jybgb WHERE BGDH = '85054686577'
css
CREATE TABLE table_name_67 ( lowest INTEGER, stadium VARCHAR, average VARCHAR )
What's the highest lowest number of capacity that ibrox stadium has when the average is larger than 49,143?
SELECT MAX(lowest) FROM table_name_67 WHERE stadium = "ibrox stadium" AND average > 49 OFFSET 143
sql_create_context
CREATE TABLE table_test_28 ( "id" int, "positive_shock_index" bool, "anemia" bool, "serum_potassium" float, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "malignant_hypertension" bool, "severe_hypertension" bool, "hemoglobin_a1c_hba1c" float, "...
aspirin, thienopyridine, or heparin allergy;
SELECT * FROM table_test_28 WHERE allergy_to_aspirin = 1 OR allergy_to_thienopyridine = 1 OR allergy_to_heparin = 1
criteria2sql
CREATE TABLE table_name_56 ( march INTEGER, score VARCHAR, game VARCHAR )
What is the sum of March, when Score is '2 - 2', and when Game is greater than 67?
SELECT SUM(march) FROM table_name_56 WHERE score = "2 - 2" AND game > 67
sql_create_context
CREATE TABLE table_name_81 ( int_yards INTEGER, assts VARCHAR, player VARCHAR )
What is the sum for the int yards that has an assts more than 3, and player Jay Alford?
SELECT SUM(int_yards) FROM table_name_81 WHERE assts > 3 AND player = "jay alford"
sql_create_context
CREATE TABLE table_name_39 ( bronze INTEGER, rank VARCHAR, silver VARCHAR )
Which Bronze has a Rank of 3, and a Silver larger than 0?
SELECT MIN(bronze) FROM table_name_39 WHERE rank = 3 AND silver > 0
sql_create_context
CREATE TABLE table_75385 ( "Polling Firm" text, "Date" text, "PSD - PC" text, "UDMR" text, "Elena B\u0103sescu" text, "Others" text, "Undecided" text )
When the other is n/a and the psc-pc is 30% what is the date?
SELECT "Date" FROM table_75385 WHERE "Others" = 'n/a' AND "PSD - PC" = '30%'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
how many hours have it been since the admission to the icu of patient 49176?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49176) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how many hours have elapsed since patient 12726 first received an intake of lipids 20% on the current icu visit?
SELECT 24 * (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 = 12726) AND icustays.outtime IS NULL)...
mimic_iii
CREATE TABLE table_54820 ( "Number" real, "Opponent" text, "Box Score" text, "Points" real, "FGM - FGA" text, "3PM - 3PA" text, "FTM - FTA" text, "Assists" real, "Rebounds" real, "Steals" real, "Blocks" real )
What is the point average for the game that has FGM-FGA of 11-28 and a number smaller than 7?
SELECT AVG("Points") FROM table_54820 WHERE "FGM - FGA" = '11-28' AND "Number" < '7'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday v...
What teacher taught Pamela Campbell when he took PAT 513 ?
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_32612 ( "Couple" text, "Score" text, "Dance" text, "Music" text, "Result" text )
What is the Music for the Dance that Scored 25 (9, 8, 8) and a Result of bottom 2?
SELECT "Music" FROM table_32612 WHERE "Score" = '25 (9, 8, 8)' AND "Result" = 'bottom 2'
wikisql
CREATE TABLE table_22357065_1 ( league VARCHAR, nation VARCHAR )
Name the league cup for northern ireland
SELECT league AS Cup FROM table_22357065_1 WHERE nation = "Northern Ireland"
sql_create_context
CREATE TABLE table_203_258 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, "interceptions" n...
team he played most games with .
SELECT "team" FROM table_203_258 GROUP BY "team" ORDER BY SUM("games") DESC LIMIT 1
squall
CREATE TABLE table_1520 ( "Engine" text, "Exhaust Ports" text, "Bypass Ports" real, "Bypass Boosters" text, "SPI" text, "Tapered Grind" text, "Number on cyl." text )
What is the minimum number of bypass ports listed?
SELECT MIN("Bypass Ports") FROM table_1520
wikisql
CREATE TABLE table_45038 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Time" text )
What Competition has an Event of 4x100 m relay and has the Time of 38.89?
SELECT "Competition" FROM table_45038 WHERE "Event" = '4x100 m relay' AND "Time" = '38.89'
wikisql
CREATE TABLE table_37030 ( "Model" text, "Engine" text, "Displacement" text, "Valvetrain" text, "Fuel system" text, "Max. power at rpm" text, "Max. torque at rpm" text )
What is the Displacement of the Iveco F1CE3481E Engine?
SELECT "Displacement" FROM table_37030 WHERE "Engine" = 'iveco f1ce3481e'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients whose drug name is levetiracetam?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Levetiracetam"
mimicsql_data
CREATE TABLE table_31449 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the score for march 8
SELECT "Score" FROM table_31449 WHERE "Date" = 'March 8'
wikisql
CREATE TABLE table_36059 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many golds does the nation having a rank of 8, fewer than 5 bronzes and more than 1 silver have?
SELECT COUNT("Gold") FROM table_36059 WHERE "Bronze" < '5' AND "Silver" > '1' AND "Rank" > '8'
wikisql
CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE transactions_lots ( tra...
Show the average amount of transactions with type code 'SALE'.
SELECT AVG(amount_of_transaction) FROM transactions WHERE transaction_type_code = "SALE"
spider
CREATE TABLE table_204_774 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what opponent is listed in the top of the table ?
SELECT "opponent" FROM table_204_774 WHERE id = 1
squall
CREATE TABLE table_name_58 ( position VARCHAR, player VARCHAR, squad_no VARCHAR, points VARCHAR, tries VARCHAR )
Which position has more than 4 points, less than 12 tries, a squad number of more than 1, and where Ali Lauitiiti is a player?
SELECT position FROM table_name_58 WHERE points > 4 AND tries < 12 AND squad_no > 1 AND player = "ali lauitiiti"
sql_create_context
CREATE TABLE table_52279 ( "Years" text, "Winners" text, "Runners-Up" text, "Score" text, "Third" text )
What was the year of the competition in which Odd Grenland was the runner-up?
SELECT "Years" FROM table_52279 WHERE "Runners-Up" = 'odd grenland'
wikisql
CREATE TABLE table_4671 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
What was the host of the round at Hammons Student Center?
SELECT "Host" FROM table_4671 WHERE "Venue" = 'hammons student center'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number...
Users accusing other users of plagiarism (double-sigh).
SELECT c.PostId AS "post_link", c.Text FROM Comments AS c WHERE c.Text LIKE '%http%plagiari%e%http%' OR c.Text LIKE '%http%cop%http%' OR c.Text LIKE '%http%stole%http%'
sede
CREATE TABLE table_27700375_10 ( high_rebounds VARCHAR, game VARCHAR )
who had high rebounds at game 69?
SELECT high_rebounds FROM table_27700375_10 WHERE game = 69
sql_create_context
CREATE TABLE customers ( email_address VARCHAR, customer_id VARCHAR ) CREATE TABLE complaints ( customer_id VARCHAR )
Find the emails of customers who has filed a complaints of the product with the most complaints.
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients are discharged to home with age below 62?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.age < "62"
mimicsql_data
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
how many hours is it since the last time patient 31854 had a criticare hn intake on the current icu visit?
SELECT 24 * (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 = 31854) AND icustays.outtime IS NULL)...
mimic_iii
CREATE TABLE table_2026548_1 ( order_in_office VARCHAR, vice_president VARCHAR )
Name the order in office for spiro agnew
SELECT order_in_office FROM table_2026548_1 WHERE vice_president = "Spiro Agnew"
sql_create_context
CREATE TABLE table_name_68 ( venue VARCHAR, position VARCHAR, year VARCHAR )
What was the venue of the competition that held the 1st position in 2011?
SELECT venue FROM table_name_68 WHERE position = "1st" AND year = 2011
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about Team_ID over the ACC_Road , and group by attribute All_Home, and display in ascending by the x-axis.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) ...
Tags where I have an answer with score 5 or more.
SELECT DISTINCT '<' + CAST(Tags.TagName AS TEXT) + '>' AS "tags", Ans.Id AS "post_link", Ans.Score FROM (((SELECT Posts.* FROM Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id WHERE Posts.OwnerUserId = @userId AND PostTypes.Name = 'Answer' AND Posts.Score > 5) AS Ans JOIN Posts ON Ans.ParentId = Posts.Id) JOIN P...
sede
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 ...
Give me a bar chart that bins the payment date into the day of the week interval and then shows the amount of each payment categorized by the payment method code, and then sort the bars in ascending order of date.
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made
nvbench
CREATE TABLE table_1342149_3 ( district VARCHAR, incumbent VARCHAR )
What district has Albert Rains as their representative?
SELECT district FROM table_1342149_3 WHERE incumbent = "Albert Rains"
sql_create_context
CREATE TABLE table_202_279 ( id number, "year" number, "title" text, "role" text, "notes" text )
how many movies has morrison acted in after 2010 ?
SELECT COUNT("title") FROM table_202_279 WHERE "year" > 2010
squall
CREATE TABLE table_12484 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
What is the lowest Draft, when Nationality is 'Canada', when Player is 'Shane Doan Category:Articles with hCards', and when Round is less than 1?
SELECT MIN("Draft") FROM table_12484 WHERE "Nationality" = 'canada' AND "Player" = 'shane doan category:articles with hcards' AND "Round" < '1'
wikisql
CREATE TABLE table_name_47 ( team_classification VARCHAR, stage VARCHAR )
Name the team classification for stage of 6
SELECT team_classification FROM table_name_47 WHERE stage = "6"
sql_create_context
CREATE TABLE table_name_88 ( points_1 VARCHAR, lost VARCHAR )
WHAT POINTS 1 HAD A 22 LOST?
SELECT points_1 FROM table_name_88 WHERE lost = 22
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, ...
在门诊诊断患者为抽动秽语综合征的籍贯代码是多少?籍贯名称叫啥?相应人数分别是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDSM = '抽动秽语综合征' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_203_40 ( id number, "p.s. #" number, "school name" text, "neighborhood" text, "low grade" text, "high grade" number, "year closed" text, "building status" text )
what is the total number of schools that were demolished ?
SELECT COUNT("school name") FROM table_203_40 WHERE "building status" = 'demolished'
squall
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...
患者64170409以前有某些异常情况她还记得么?
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.RYBH = '...
css
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE job...
Can I enroll in 400 -level classes for the Fall or Winter term ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
advising
CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text ) CREATE TABLE election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number )
List the dates and vote percents of elections.
SELECT date, vote_percent FROM election
spider
CREATE TABLE table_26916717_1 ( name VARCHAR, team_school VARCHAR )
What player attended california university?
SELECT name FROM table_26916717_1 WHERE team_school = "California"
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 (...
how many black/cape verdean patients had mcv lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_2801185_2 ( former_county VARCHAR, district VARCHAR )
What are the former counties of the Great Grimsby district?
SELECT former_county FROM table_2801185_2 WHERE district = "Great Grimsby"
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, applica...
which NW flights stop in DENVER before 1200
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'NW' AND flight.flight_id = flight_sto...
atis
CREATE TABLE users ( user_name VARCHAR, password VARCHAR, role_code VARCHAR )
List all the username and passwords of users with the most popular role.
SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_203_589 ( id number, "protein" text, "natural host" text, "normal function" text, "prion state" text, "prion phenotype" text, "year identified" number )
what yea had more proteins 2008 or 1997 ?
SELECT "year identified" FROM table_203_589 WHERE "year identified" IN (2008, 1997) GROUP BY "year identified" ORDER BY COUNT("protein") DESC LIMIT 1
squall
CREATE TABLE VOTING_RECORD ( Election_Cycle VARCHAR ) CREATE TABLE STUDENT ( StuID VARCHAR, Sex VARCHAR )
How many male (sex is M) students have class senator votes in the fall election cycle?
SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = "M" AND T2.Election_Cycle = "Fall"
sql_create_context
CREATE TABLE table_1253 ( "Year" real, "Events played" real, "Cuts made" real, "Wins" real, "2nds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Rank" text, "Scoring average" text, "Scoring rank" text )
What is the best finish where the scoring rank is 97?
SELECT "Best finish" FROM table_1253 WHERE "Scoring rank" = '97'
wikisql
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customer_Orders ( order_i...
Show the number of customer address history in each month and bin date to by month interval with a bar chart, and I want to sort in asc by the y axis.
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id ORDER BY COUNT(date_to)
nvbench
CREATE TABLE table_name_9 ( country VARCHAR, year VARCHAR, publication VARCHAR )
What country had a paste publication in 2009?
SELECT country FROM table_name_9 WHERE year = 2009 AND publication = "paste"
sql_create_context
CREATE TABLE table_name_78 ( crowd VARCHAR, venue VARCHAR )
What was the attendance at the game played at Moorabbin Oval?
SELECT crowd FROM table_name_78 WHERE venue = "moorabbin oval"
sql_create_context
CREATE TABLE table_name_12 ( score VARCHAR, opponent VARCHAR, time VARCHAR, location VARCHAR )
What was the score of the 7:00pm game at Scotiabank Place against the Philadelphia Flyers?
SELECT score FROM table_name_12 WHERE time = "7:00pm" AND location = "scotiabank place" AND opponent = "philadelphia flyers"
sql_create_context
CREATE TABLE table_name_19 ( races VARCHAR, poles VARCHAR, team VARCHAR )
What is the number of races associated with Team ASM and 0 poles?
SELECT races FROM table_name_19 WHERE poles = "0" AND team = "asm"
sql_create_context
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...
95419647222这次医疗就诊,大病支付金额的总数是多少
SELECT t_kc24.ILL_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '95419647222'
css
CREATE TABLE table_26609958_1 ( rainfall_totals__million_m_3__ VARCHAR, hydrographic_basin VARCHAR )
When martha brae, river is the hydrographic basin what is the rainfall totals (million m 3)?
SELECT rainfall_totals__million_m_3__ FROM table_26609958_1 WHERE hydrographic_basin = "Martha Brae, River"
sql_create_context
CREATE TABLE PlaylistTrack ( PlaylistId integer, TrackId integer ) CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, ...
List the number of the phone numbers of all employees, I want to show in descending by the y axis.
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
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 procedures ( ...
what is age and admission time of subject id 2560?
SELECT demographic.age, demographic.admittime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data