context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_3841 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had high assists in game number 9?
SELECT "High assists" FROM table_3841 WHERE "Game" = '9'
wikisql
CREATE TABLE table_name_35 ( rank VARCHAR, goals VARCHAR, scorer VARCHAR )
Which Rank has Goals larger than 10, and a Scorer of choi sang-kuk?
SELECT rank FROM table_name_35 WHERE goals > 10 AND scorer = "choi sang-kuk"
sql_create_context
CREATE TABLE table_1272033_1 ( championship VARCHAR, previous_champion_s_ VARCHAR )
What tourmament has Genesis won previously?
SELECT championship FROM table_1272033_1 WHERE previous_champion_s_ = "Genesis"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute headquarter, show bar from low to high order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_59801 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total that wehn Lithuania is the nation, and Silver is more than 0?
SELECT MIN("Total") FROM table_59801 WHERE "Nation" = 'lithuania' AND "Silver" > '0'
wikisql
CREATE TABLE table_1423 ( "Candidate" text, "State Delegate" real, "Percentage" text, "Delegates" real, "Counties Carries" real )
Candidate John Mccain had how many delegates?
SELECT "Delegates" FROM table_1423 WHERE "Candidate" = 'John McCain'
wikisql
CREATE TABLE table_name_31 ( name VARCHAR, borough VARCHAR, type VARCHAR )
In what Borough is the Anchorage museum of Natural History?
SELECT name FROM table_name_31 WHERE borough = "anchorage" AND type = "natural history"
sql_create_context
CREATE TABLE table_name_87 ( season VARCHAR, round VARCHAR, result VARCHAR )
What season had a game in the first round with a result of 4 1, 0 1?
SELECT season FROM table_name_87 WHERE round = "first round" AND result = "4–1, 0–1"
sql_create_context
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...
EECS 790 workload is like ?
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 790 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_69019 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the date of the match when Detroit is the home team and Colorado is the visiting team?
SELECT "Date" FROM table_69019 WHERE "Home" = 'detroit' AND "Visitor" = 'colorado'
wikisql
CREATE TABLE table_73287 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text )
What coach premiered February 16, 2008 later than episode 21.0?
SELECT "Coach" FROM table_73287 WHERE "Premier date" = 'February 16, 2008' AND "Episode" > '21.0'
wikisql
CREATE TABLE table_23248910_6 ( location_attendance VARCHAR, team VARCHAR )
What location and it's attendance was the game against the Nets?
SELECT location_attendance FROM table_23248910_6 WHERE team = "Nets"
sql_create_context
CREATE TABLE table_name_27 ( region VARCHAR, catalog VARCHAR )
What is the Region with a Catalog that is vlmx 1087-3?
SELECT region FROM table_name_27 WHERE catalog = "vlmx 1087-3"
sql_create_context
CREATE TABLE table_63546 ( "Children of Earth" text, "Run time" text, "Writer" text, "Director" text, "Original airdate" text, "Viewers (including HD) in millions" text )
Who was the director of the episode written by Russell T Davies and James Moran?
SELECT "Director" FROM table_63546 WHERE "Writer" = 'russell t davies and james moran'
wikisql
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...
投保人潘若云从2004年2月29日起直到2019年2月16号为止起单一药物的最大购买次数有多少次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '潘若云' AND t_kc22.STA_DATE BETWEEN '2004-02-29' AND '2019-02-16' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22....
css
CREATE TABLE table_19179 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
How many 2nd legs had an aggregate of 2-4?
SELECT COUNT("2nd leg") FROM table_19179 WHERE "Aggregate" = '2-4'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
患者15176126为精神分裂症,门诊诊断的补体C4的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '精神分裂症' AND hz_info.RYBH ...
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
看看参保人华俊迈从2007.7.28到2017.9.6这期间,在门诊发生的检查费有多少总额
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '华俊迈' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-07-28' AND '2017-09-06' AND t_kc22.MED_INV_IT...
css
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_des...
Find login_name and gender_mf , and visualize them by a bar chart.
SELECT login_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_1108394_43 ( total INTEGER )
what is the minimum total
SELECT MIN(total) FROM table_1108394_43
sql_create_context
CREATE TABLE table_58616 ( "Rank 2014" real, "Rank 2013" real, "Mvmt" text, "Club" text, "Country" text, "2009\u201310" real, "2010\u201311" real, "2011\u201312" real, "2012\u201313" real, "2013\u201314" real, "Coeff." real )
Which Rank 2014 has a 2009 10 of 21.233?
SELECT AVG("Rank 2014") FROM table_58616 WHERE "2009\u201310" = '21.233'
wikisql
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 varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
In Transactional Drafting , who have all the teachers been past present and future ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
advising
CREATE TABLE table_name_7 ( stage VARCHAR, team_classification VARCHAR, points_classification VARCHAR )
Which stage corresponds to Banesto and Tony Rominger?
SELECT stage FROM table_name_7 WHERE team_classification = "banesto" AND points_classification = "tony rominger"
sql_create_context
CREATE TABLE table_18893428_1 ( report VARCHAR, driver VARCHAR )
How many times did Charles Jarrott report?
SELECT COUNT(report) FROM table_18893428_1 WHERE driver = "Charles Jarrott"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, show me about the correlation between price and manufacturer in a scatter chart.
SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
when was first time patient 010-20205 had the maximum sao2 value on the first intensive care unit visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-20205') AND NOT patient.unitdischargetime IS NU...
eicu
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 number of patients whose discharge location is disch-tran to psych hosp and admission year is less than 2145?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2145"
mimicsql_data
CREATE TABLE table_name_67 ( home VARCHAR, attendance VARCHAR, away VARCHAR )
Who was the home team for the game with Platense as the away team and attendance under 529?
SELECT home FROM table_name_67 WHERE attendance < 529 AND away = "platense"
sql_create_context
CREATE TABLE table_204_26 ( id number, "name" text, "position" text, "birth date/age at start of campaign" text, "games in campaign" text, "club" text )
what was the average age of the grasshoppers ?
SELECT AVG("birth date/age at start of campaign") FROM table_204_26 WHERE "club" = 'grasshoppers'
squall
CREATE TABLE table_204_299 ( id number, "name of place" text, "number of counties" number, "principal county" text, "lower zip code" number )
does pulaski county have more cities beginning with the letter a than montgomery county ?
SELECT (SELECT COUNT(*) FROM table_204_299 WHERE "principal county" = 'pulaski county') > (SELECT COUNT(*) FROM table_204_299 WHERE "principal county" = 'montgomery county')
squall
CREATE TABLE table_42222 ( "Former kingdom" text, "Province" text, "Hangul" text, "Hanja" text, "Capital" text, "Modern equivalent" text )
What is the capital of the province with in Hangul?
SELECT "Capital" FROM table_42222 WHERE "Hangul" = '양주'
wikisql
CREATE TABLE table_13133 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
How much Total has a Player of todd hamilton, and a To par smaller than 15?
SELECT COUNT("Total") FROM table_13133 WHERE "Player" = 'todd hamilton' AND "To par" < '15'
wikisql
CREATE TABLE table_69109 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
What is the result of the London 2012 Women's Olympic Football Tournament?
SELECT "Result" FROM table_69109 WHERE "Location" = 'london 2012 women''s olympic football tournament'
wikisql
CREATE TABLE table_1245148_1 ( location VARCHAR, year_opened VARCHAR )
What is the location of the track that opened in 1950?
SELECT location FROM table_1245148_1 WHERE year_opened = 1950
sql_create_context
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...
看一下病患鲁同济的医疗记录中哪几次开的药品金额大于8376.61元?列出医疗就诊编码
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '鲁同济' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 8376.61)
css
CREATE TABLE table_name_24 ( venue VARCHAR, away_team VARCHAR )
what was the venue that hosted Carlton as the away team?
SELECT venue FROM table_name_24 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE table_2985714_2 ( _number INTEGER )
What is the maximum overall number?
SELECT MAX(_number) FROM table_2985714_2
sql_create_context
CREATE TABLE table_57584 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Record" text )
What is the date with Ellis as the decision and St. Louis as the visitor?
SELECT "Date" FROM table_57584 WHERE "Decision" = 'ellis' AND "Visitor" = 'st. louis'
wikisql
CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amo...
Which Payments were processed with Visa? List the date and the amount using a bar chart, order by the y axis in desc.
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Amount_Payment DESC
nvbench
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
Numbers most used in posts. totally useless. more of an experiment.
SELECT OwnerUserId AS "user_link", OwnerUserId, SUM(LENGTH(Body)) AS totalLen, SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '1', ''))) AS "1", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '2', ''))) AS "2", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '3', ''))) AS "3", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Bod...
sede
CREATE TABLE table_1046454_1 ( league VARCHAR, regular_season VARCHAR )
what's the league where regular season is 2nd, northwest
SELECT league FROM table_1046454_1 WHERE regular_season = "2nd, Northwest"
sql_create_context
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, ...
count the number of patients whose death status is 1 and diagnoses short title is dermatitis nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Dermatitis NOS"
mimicsql_data
CREATE TABLE table_64875 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What rank is Bulgaria with less than 3 silver and more than 1 bronze?
SELECT "Rank" FROM table_64875 WHERE "Silver" < '3' AND "Bronze" > '1' AND "Nation" = 'bulgaria'
wikisql
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of commission_pct over hire_date, and sort X in asc order.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_27 ( away_team VARCHAR, tie_no VARCHAR )
In Tie #19, what was the name of the away team?
SELECT away_team FROM table_name_27 WHERE tie_no = "19"
sql_create_context
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, fi...
how many patients were diagnosed with hx of bladder malignancy in this year after being diagnosed with fx condyl proc mandib-cl within 2 months?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of bladder mali...
mimic_iii
CREATE TABLE table_19788 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text )
What college did steve justice attend?
SELECT "College" FROM table_19788 WHERE "Player" = 'Steve Justice'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many emergency hospital admission patients have lab test item id 51259?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "51259"
mimicsql_data
CREATE TABLE table_203_353 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "time" text )
how many songs were produced by chaos ?
SELECT COUNT("title") FROM table_203_353 WHERE "producer(s)" = 'chaos'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the primary disease for the patient id 92796?
SELECT demographic.diagnosis FROM demographic WHERE demographic.subject_id = "92796"
mimicsql_data
CREATE TABLE table_79809 ( "Club" text, "Manager" text, "Captain" text, "Manufacturer" text, "Sponsor" text )
In which club is Ledley King a captain?
SELECT "Club" FROM table_79809 WHERE "Captain" = 'ledley king'
wikisql
CREATE TABLE phone ( Memory_in_G VARCHAR, Carrier VARCHAR )
What are the memories and carriers of phones?
SELECT Memory_in_G, Carrier FROM phone
sql_create_context
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 demographic ( subject_id text, hadm_id t...
What is the minimum age of patients whose admission location is trsf within this facility and primary disease is ruq pain?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "RUQ PAIN"
mimicsql_data
CREATE TABLE table_name_51 ( first_class_team VARCHAR, player VARCHAR )
What first class team does sanath jayasuriya play for?
SELECT first_class_team FROM table_name_51 WHERE player = "sanath jayasuriya"
sql_create_context
CREATE TABLE table_286271_1 ( election VARCHAR, _percentage_of_popular_vote VARCHAR )
Name the election for the percent of popular vote being 4.48%
SELECT election FROM table_286271_1 WHERE _percentage_of_popular_vote = "4.48%"
sql_create_context
CREATE TABLE table_66090 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
Where is the location of Game 4?
SELECT "Location/Attendance" FROM table_66090 WHERE "Game" = '4'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
count the numbers of patients who were diagnosed with acute respiratory distress and did not come back to the hospital within 2 months in 2105.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT C...
eicu
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, ...
find the number of patients who were born before the year 2123 and their lab test fluid is cerebrospinal fluid (csf).
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2123" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREA...
How many items in each participant type code? Show me a pie chart!
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code
nvbench
CREATE TABLE table_46958 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What is the league cup apps when the league goals are greater than 3, there are 30 (2) total apps, and has a position of mf?
SELECT "League Cup Apps" FROM table_46958 WHERE "Position" = 'mf' AND "League Goals" > '3' AND "Total Apps" = '30 (2)'
wikisql
CREATE TABLE table_name_37 ( year INTEGER, weight_class__kg_ VARCHAR, event VARCHAR, venue VARCHAR )
What is the highest year that has fila world championships as the event, with toledo, united states as the venue, and a weight class (kg) less than 97?
SELECT MAX(year) FROM table_name_37 WHERE event = "fila world championships" AND venue = "toledo, united states" AND weight_class__kg_ < 97
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 the number of elective hospital admission patients who had urethral catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Ureteral catheterization"
mimicsql_data
CREATE TABLE table_16072430_1 ( viewers VARCHAR, share VARCHAR, weekly_rank VARCHAR )
What is the total number of viewers where the share is 7 and the week rank is 64?
SELECT COUNT(viewers) FROM table_16072430_1 WHERE share = 7 AND weekly_rank = "64"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give the number of patients whose admission type is elective and primary disease is abdominal abscess.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "ABDOMINAL ABSCESS"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
what are the four most commonly ordered procedures for patients who had previously received anticonvulsant - levetiracetam in the same hospital visit, in 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antic...
eicu
CREATE TABLE table_22879323_10 ( high_points VARCHAR, high_rebounds VARCHAR )
What was the high points when rebounds were Terrence Williams (8)?
SELECT high_points FROM table_22879323_10 WHERE high_rebounds = "Terrence Williams (8)"
sql_create_context
CREATE TABLE table_25800134_12 ( director VARCHAR, airdate VARCHAR )
How many people directed the episode that aired on February 5, 1968?
SELECT COUNT(director) FROM table_25800134_12 WHERE airdate = "February 5, 1968"
sql_create_context
CREATE TABLE table_72005 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What's the total of Goals Scored with Points that's smaller than 27, and a Team of C.D. Atl tico Balboa?
SELECT SUM("Goals Scored") FROM table_72005 WHERE "Points" < '27' AND "Team" = 'c.d. atlético balboa'
wikisql
CREATE TABLE table_204_698 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text )
how old was pierre vallieres before he died ?
SELECT "lifetime" - "lifetime" FROM table_204_698 WHERE "name" = 'pierre vallieres'
squall
CREATE TABLE table_23316034_23 ( dismissals VARCHAR, player VARCHAR )
Name the number of dismissals for adam gilchrist
SELECT COUNT(dismissals) FROM table_23316034_23 WHERE player = "Adam Gilchrist"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
帮我列举出所有检验指标的代码、名称、结果定性、结果定量、结果定量单位和参考值范围下限与上限,要26969338360这个检验报告单的
SELECT JCZBDM, JCZBMC, JCZBJGDX, JCZBJGDL, JCZBJGDW, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE BGDH = '26969338360'
css
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Video_Games ( GameID INTEGER, GName VARCHAR(40), ...
Scatter plot to show min(age) on x axis and maximal age on y axis for different majors.
SELECT MIN(Age), MAX(Age), Major FROM Student GROUP BY Major
nvbench
CREATE TABLE Addresses ( zip_postcode VARCHAR, address_id VARCHAR ) CREATE TABLE Student_Addresses ( address_id VARCHAR )
What are the id and zip code of the address with the highest monthly rental?
SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1
sql_create_context
CREATE TABLE table_6322 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text )
What is the finish for the chip ganassi racing team that was later than 2010 and a Start of 17?
SELECT "Finish" FROM table_6322 WHERE "Team" = 'chip ganassi racing' AND "Year" > '2010' AND "Start" = '17'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
tell me the top four most frequent diagnoses that patients were diagnosed with within 2 months after receiving cardioversion in the previous year.
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cardioversion' AND DATETIME(treatment.tr...
eicu
CREATE TABLE table_52907 ( "Ship" text, "Date Commissioned" real, "Gross Tonnage" real, "Propulsion" text, "Material" text )
Name the sum of gross tonnage for wood on date more tahn 1846 for comissioned and ship of esk
SELECT SUM("Gross Tonnage") FROM table_52907 WHERE "Material" = 'wood' AND "Date Commissioned" > '1846' AND "Ship" = 'esk'
wikisql
CREATE TABLE table_16971 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What was the season number for the episode with the series number 61?
SELECT MAX("Season #") FROM table_16971 WHERE "Series #" = '61'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
when was the last time that was patient 007-15837 had the maximum -monos in the current hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = '-monos' O...
eicu
CREATE TABLE products ( code number, name text, price number, manufacturer number ) CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number )
What are the names and headquarters of all manufacturers, ordered by revenue descending?
SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC
spider
CREATE TABLE table_41437 ( "Date" text, "Location" text, "Country" text, "Event" text, "Winner" text, "Runner-up" text )
What is Date when Runner-up is Sof a Mul novich ( per )?
SELECT "Date" FROM table_41437 WHERE "Runner-up" = 'sofía mulánovich ( per )'
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...
Provide the admission location as well as discharge location of Elizabeth Bateman.
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Elizabeth Bateman"
mimicsql_data
CREATE TABLE table_46147 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
In which location did he win the Superbrawl 16 event?
SELECT "Location" FROM table_46147 WHERE "Res." = 'win' AND "Event" = 'superbrawl 16'
wikisql
CREATE TABLE table_name_43 ( pick__number INTEGER, reg_gp VARCHAR, rd__number VARCHAR, player VARCHAR )
What is the highest Pick number that had a road number that was less than 6, featured Bob Dailey as a player, and which had a Reg GP bigger than 257?
SELECT MAX(pick__number) FROM table_name_43 WHERE rd__number < 6 AND player = "bob dailey" AND reg_gp > 257
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Show me about the distribution of Sex and the sum of Height , and group by attribute Sex in a bar chart, and list X in descending order.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
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, ...
how many of the patients aged below 74 were discharged after short term hospital care?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "74"
mimicsql_data
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, ...
Among patients admitted in the year or after 2187, calculate the minimum age of patients with brain mass intracranial hemorrhage as their primary disease
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.admityear >= "2187"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients less than 27 years of age have been diagnosed with hypoxemia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.long_title = "Hypoxemia"
mimicsql_data
CREATE TABLE item ( title VARCHAR, i_id VARCHAR ) CREATE TABLE review ( i_id VARCHAR, rating INTEGER )
Find the titles of items that received both a rating higher than 8 and a rating below 5.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
sql_create_context
CREATE TABLE table_name_50 ( date VARCHAR, venue VARCHAR )
What dates had matches at the venue Sabina Park?
SELECT date FROM table_name_50 WHERE venue = "sabina park"
sql_create_context
CREATE TABLE table_204_854 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "notes" text )
what is the number of times that miracle man has held the belt ?
SELECT COUNT(*) FROM table_204_854 WHERE "wrestlers" = 'miracle man'
squall
CREATE TABLE table_name_76 ( opponent VARCHAR, attendance VARCHAR )
Which Opponent has an Attendance of bye?
SELECT opponent FROM table_name_76 WHERE attendance = "bye"
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...
count the number of patients whose admission year is less than 2138 and diagnoses long title is unspecified schizophrenia, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2138" AND diagnoses.long_title = "Unspecified schizophrenia, unspecified"
mimicsql_data
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venue...
conferences in 2013
SELECT DISTINCT venueid FROM paper WHERE year = 2013
scholar
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 varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday by a bar chart, and show by the y axis in ascending.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_21806 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real, "2000 result" text )
When Kerry# was 199060, what was the percentage?
SELECT "Kerry%" FROM table_21806 WHERE "Kerry#" = '199060'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide me the number of female patients born before 2087.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "2087"
mimicsql_data
CREATE TABLE table_name_50 ( home_team VARCHAR, date VARCHAR )
what team played on may 20 on the home side
SELECT home_team FROM table_name_50 WHERE date = "may 20"
sql_create_context
CREATE TABLE table_name_2 ( money___ INTEGER, score VARCHAR )
WHAT IS THE LOWEST MONEY WITH 74-74-76-74=298 SCORE?
SELECT MIN(money___) AS $__ FROM table_name_2 WHERE score = 74 - 74 - 76 - 74 = 298
sql_create_context
CREATE TABLE table_40147 ( "Value" text, "\u20ac equiv." text, "Diameter" text, "Weight" text, "Composition" text )
What is the coin that weighs 3 g made of?
SELECT "Composition" FROM table_40147 WHERE "Weight" = '3 g'
wikisql
CREATE TABLE table_21839208_4 ( record VARCHAR, opponent VARCHAR )
What was their record when they played the stampeders?
SELECT record FROM table_21839208_4 WHERE opponent = "Stampeders"
sql_create_context