context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25374338_1 ( theme VARCHAR, original_artist VARCHAR )
What is the theme where the original artist is Noemi feat. Fiorella Mannoia?
SELECT theme FROM table_25374338_1 WHERE original_artist = "Noemi feat. Fiorella Mannoia"
sql_create_context
CREATE TABLE table_19897294_11 ( location_s_ VARCHAR, family_families VARCHAR )
How many locations featured the Webb Family?
SELECT COUNT(location_s_) FROM table_19897294_11 WHERE family_families = "The Webb Family"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
Can I take 792 when ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 792 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste...
advising
CREATE TABLE table_68180 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text )
What was the race time of the horse with jockey Ramon Dominguez?
SELECT "Time" FROM table_68180 WHERE "Jockey" = 'ramon dominguez'
wikisql
CREATE TABLE table_27902171_9 ( score VARCHAR, record VARCHAR )
What were the scores of the games with a record of 47-34?
SELECT score FROM table_27902171_9 WHERE record = "47-34"
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( ro...
the previous year how many people were diagnosed with pure hypercholesterolem within the same month after the first diagnosis of streptococcus group b?
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 = 'pure hypercholeste...
mimic_iii
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Desc...
How many accounts for different statement details? Plot a pie chart.
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
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 bdmzjzjlb ( CYBQDM text, CYBQ...
了解一下29461728这个病人的上臂各项指标检验的结果
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 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 ) ...
what is primary disease of subject name theresa vedovelli?
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Theresa Vedovelli"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and salary , and could you order by the y-axis in ascending?
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
nvbench
CREATE TABLE table_31188 ( "Year" text, "Universities" real, "No. of Students Signed up" real, "% electricity reduction" text, "Tonnes of CO2 Saved" real, "\u00a3 Saved" text )
When 1522 is the tonnes of co2 saved what is the year?
SELECT "Year" FROM table_31188 WHERE "Tonnes of CO2 Saved" = '1522'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
药品427326在医疗就诊74317278858里面的医疗机构三大目录编码和名称分别是什么?
SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '74317278858' AND SOC_SRT_DIRE_CD = '427326'
css
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 ethnicity is Hispanic or Latino and were born before the year 1850.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "1850"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients whose death status is 0 and procedure long title is allogeneic hematopoietic stem cell transpant without purging?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging"
mimicsql_data
CREATE TABLE table_name_54 ( _number___county VARCHAR, school VARCHAR )
Name the # country for new palestine
SELECT _number___county FROM table_name_54 WHERE school = "new palestine"
sql_create_context
CREATE TABLE table_26240046_1 ( season_3 INTEGER, played_by VARCHAR )
How many season 3 appearances by the character played by Stefan Van Ray?
SELECT MIN(season_3) FROM table_26240046_1 WHERE played_by = "Stefan van Ray"
sql_create_context
CREATE TABLE table_1679 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" text, "Points 2" real )
How many values of goal average 1 occur when the value of goals against is 92?
SELECT COUNT("Goal Average 1") FROM table_1679 WHERE "Goals Against" = '92'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what was the name of the specimen test that patient 031-19622 received until 46 months ago first?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRE...
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...
患者出院进行66169377142医疗就诊时,诊断出的疾病编号及名称是什么
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '66169377142' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '66169377142' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '66169377142' UNION SELECT mzb....
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Top users for each tag.
WITH TotalScore AS (SELECT Ans.OwnerUserId, SUM(Ans.Score) AS Score, Tags.TagName, (ROW_NUMBER() OVER (PARTITION BY Tags.TagName ORDER BY SUM(Ans.Score) DESC)) AS Pos FROM Posts AS Ans INNER JOIN Posts AS Q ON Q.Id = Ans.ParentId INNER JOIN PostTags ON PostTags.PostId = Ans.ParentId INNER JOIN Tags ON Tags.Id = PostTag...
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
what was the last time patient 005-4471 had intake of insulin on the current icu visit?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471') AND patient.unitdischargetime IS NULL) AND...
eicu
CREATE TABLE table_40243 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "FCC info" text )
What city does call sign K248am have its license in?
SELECT "City of license" FROM table_40243 WHERE "Call sign" = 'k248am'
wikisql
CREATE TABLE table_1620397_5 ( doctor VARCHAR, series_sorted VARCHAR )
What was the doctor for sorted series 6eb/b?
SELECT doctor FROM table_1620397_5 WHERE series_sorted = "6EB/B"
sql_create_context
CREATE TABLE table_11742 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text )
What's the chassis for alexander wurz's playlife fb02 engine?
SELECT "Chassis" FROM table_11742 WHERE "Engine \u2020" = 'playlife fb02' AND "Driver" = 'alexander wurz'
wikisql
CREATE TABLE table_17432028_1 ( score VARCHAR, record VARCHAR )
Name the score for record of 2-5
SELECT score FROM table_17432028_1 WHERE record = "2-5"
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 All_Home , and group by attribute ACC_Home by a bar chart, and list from low to high by the All_Home please.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_27700530_9 ( record VARCHAR, team VARCHAR )
What was the team's record when they played minnesota?
SELECT record FROM table_27700530_9 WHERE team = "Minnesota"
sql_create_context
CREATE TABLE table_38697 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the overall of the running back player?
SELECT "Overall" FROM table_38697 WHERE "Position" = 'running back'
wikisql
CREATE TABLE table_name_23 ( drivers VARCHAR, laps VARCHAR, class VARCHAR )
Who are the drivers with 133 laps in OC class?
SELECT drivers FROM table_name_23 WHERE laps = 133 AND class = "oc"
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Subject...
A bar chart for finding the number of the enrollment date for all the tests that have 'Pass' result, could you sort by the the number of date of enrolment in ascending?
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment)
nvbench
CREATE TABLE constructorresults ( constructorresultsid number, raceid number, constructorid number, points number, status number ) CREATE TABLE driverstandings ( driverstandingsid number, raceid number, driverid number, points number, position number, positiontext text, ...
How many drivers participated in the race Australian Grand Prix held in 2009?
SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND year = 2009
spider
CREATE TABLE table_35809 ( "Year" real, "Dates" text, "Venue" text, "Champion" text, "Country" text, "Score" real, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Purse ( $ )" real, "Winner's share ($)" real )
What year was the score 269?
SELECT COUNT("Year") FROM table_35809 WHERE "Score" = '269'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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, ...
患者任同和的地高辛情况在05年7月20日到2016年2月21日内啥样?
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 table_58527 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd attendance when the home team scored 13.17 (95)?
SELECT SUM("Crowd") FROM table_58527 WHERE "Home team score" = '13.17 (95)'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE studen...
What are the faculty ids of all the male faculty members?
SELECT facid FROM faculty WHERE sex = 'M'
spider
CREATE TABLE table_1824 ( "Episodes" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text )
which episode was Transmitted on friday if the episode of '414 insanely twisted shadow planet' was transmitted on tuesday?
SELECT "Friday" FROM table_1824 WHERE "Tuesday" = '414 Insanely Twisted Shadow Planet'
wikisql
CREATE TABLE table_20190 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Name the nationality of number 9
SELECT "Nationality" FROM table_20190 WHERE "No." = '9'
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, ...
Calculate the number of patients who had coronary artery disease or coronary artery bypass graft sda as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what was the name of that output that patient 007-849 first had since 11/07/2104?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND intakeoutput.cellpath LIKE '%output%' AND STR...
eicu
CREATE TABLE table_10556257_1 ( team VARCHAR, season VARCHAR )
What is the team for season 1911-12?
SELECT team FROM table_10556257_1 WHERE season = "1911-12"
sql_create_context
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 ) ...
what is drug name of subject id 6983?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "6983"
mimicsql_data
CREATE TABLE table_52471 ( "Productions" text, "Rose" text, "Louise" text, "Dainty June" text, "Herbie" text, "Director" text )
Who was Dainty June when Boyd Gaines was Herbie?
SELECT "Dainty June" FROM table_52471 WHERE "Herbie" = 'boyd gaines'
wikisql
CREATE TABLE table_name_35 ( Id VARCHAR )
Name the 2011 with 2010 of 1r and 2012 of sf
SELECT 2011 FROM table_name_35 WHERE 2010 = "1r" AND 2012 = "sf"
sql_create_context
CREATE TABLE staff ( staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR ) CREATE TABLE Staff_Department_Assignments ( staff_id VARCHAR, job_title_code VARCHAR )
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.
SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Sales Person" EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ...
sql_create_context
CREATE TABLE table_name_87 ( grid VARCHAR, team VARCHAR )
What is the Grid number for the Team from Italy?
SELECT COUNT(grid) FROM table_name_87 WHERE team = "italy"
sql_create_context
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
Which room has the highest rate? List the room's full name, rate, check in and check out date.
SELECT T2.roomname, T1.rate, T1.checkin, T1.checkout FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T1.room ORDER BY T1.rate DESC LIMIT 1
spider
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text,...
may i have a listing of flights from MILWAUKEE to TACOMA WASHINGTON departing in the evening
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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name...
atis
CREATE TABLE table_35521 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
What is the average number conceded for hte team that had less than 19 points, played more than 18 games and had a position less than 10?
SELECT AVG("Conceded") FROM table_35521 WHERE "Points" < '19' AND "Position" < '10' AND "Played" > '18'
wikisql
CREATE TABLE table_17941032_1 ( tries_for VARCHAR, tries_against VARCHAR )
When 60 is the tries against what is the tries for?
SELECT tries_for FROM table_17941032_1 WHERE tries_against = "60"
sql_create_context
CREATE TABLE table_name_14 ( years_as_tallest VARCHAR, floors VARCHAR )
How many years was the building with 24 floors the tallest?
SELECT years_as_tallest FROM table_name_14 WHERE floors = 24
sql_create_context
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and show by the bar in ascending please.
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name
nvbench
CREATE TABLE table_6518 ( "Nation" text, "Removal treaty (year signed)" text, "Years of major emigration" text, "Total number emigrated or forcibly removed" text, "Number stayed in Southeast" text, "Deaths from warfare" text )
Which Number stayed in Southeast has over 4,000 emigrated or forcibly removed?
SELECT "Number stayed in Southeast" FROM table_6518 WHERE "Total number emigrated or forcibly removed" = 'over 4,000'
wikisql
CREATE TABLE table_name_80 ( team VARCHAR, points VARCHAR )
Which Team has Points of 15?
SELECT team FROM table_name_80 WHERE points = "15"
sql_create_context
CREATE TABLE table_name_90 ( venue VARCHAR, against VARCHAR, status VARCHAR )
Which venue has more than 9 against and a status of second test?
SELECT venue FROM table_name_90 WHERE against > 9 AND status = "second test"
sql_create_context
CREATE TABLE table_57667 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
I want to know the lowest week with a date of december 19, 2004
SELECT MIN("Week") FROM table_57667 WHERE "Date" = 'december 19, 2004'
wikisql
CREATE TABLE table_name_41 ( hot_100_reaction VARCHAR, week VARCHAR, performer_s_ VARCHAR )
What is the hot 100 reaction in week of top 13 for Kanye West?
SELECT hot_100_reaction FROM table_name_41 WHERE week = "top 13" AND performer_s_ = "kanye west"
sql_create_context
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
How many delegates in each committee? Return a bar chart, and display by the y-axis in descending.
SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY COUNT(Committee) DESC
nvbench
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...
把患者水康成在3230609医院门诊看诊时,诊断内容书上无张力的就诊记录找出来
SELECT * 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 person_info.XM = '水康成' AND hz_info.YLJGDM = '3230609' AND NOT zzmzjzjlb.JZZDSM LIKE '%张力%' UNION SELECT * FROM person_info JO...
css
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...
通过进行不同的科室编码然后加上入院诊断疾病名称的筛选得到在1104291号医院记载的所有医疗就诊记录中患者的平均年龄是多少呢?
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1104291' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '11042...
css
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 primary disease is st elevated myocardial infarction\cardiac cath and admission year is less than 2135?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2135"
mimicsql_data
CREATE TABLE table_203_277 ( id number, "entered" number, "wrestler" text, "place" text, "eliminated by" text, "time" text )
which wrestler lasted the least amount of time in part two of battle royal ?
SELECT "wrestler" FROM table_203_277 ORDER BY "time" LIMIT 1
squall
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 diagnoses short title is status autm crd dfbrltr and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_56096 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the smallest crowd at a game when Richmond was the away team?
SELECT MIN("Crowd") FROM table_56096 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_name_42 ( number_on_map INTEGER, name VARCHAR, construction_commenced VARCHAR )
What is the average number for Northgate which commenced its construction before 1951?
SELECT AVG(number_on_map) FROM table_name_42 WHERE name = "northgate" AND construction_commenced < 1951
sql_create_context
CREATE TABLE table_63613 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
Which To par is of thomas aiken?
SELECT "To par" FROM table_63613 WHERE "Player" = 'thomas aiken'
wikisql
CREATE TABLE table_name_46 ( rank INTEGER, attempts VARCHAR, year VARCHAR )
What is the lowest Rank when Attempts was 319, and the Year was larger than 2000?
SELECT MIN(rank) FROM table_name_46 WHERE attempts = 319 AND year > 2000
sql_create_context
CREATE TABLE table_name_82 ( visitor VARCHAR, record VARCHAR )
Whose Visitor has a Record of 10 11 5?
SELECT visitor FROM table_name_82 WHERE record = "10–11–5"
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_det...
Plot date of transaction by mean share count as a trend line, and I want to show from high to low by the x-axis.
SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY date_of_transaction DESC
nvbench
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 Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE T...
What are the number of the dates of transactions with at least 100 share count or amount bigger than 100?
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100
nvbench
CREATE TABLE table_42063 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
When My Name is Earl played at 8:00 what aired at 9:30?
SELECT "9:30" FROM table_42063 WHERE "8:00" = 'my name is earl'
wikisql
CREATE TABLE table_48931 ( "Year" real, "Category" text, "President" text, "Nominee" text, "Film or Television Series or Miniseries" text )
In what year was Martin Sheen nominated?
SELECT "Year" FROM table_48931 WHERE "Nominee" = 'martin sheen'
wikisql
CREATE TABLE table_7690 ( "Regulator" text, "Rights of audience" text, "Conduct of litigation" text, "Reserved instruments" text, "Probate activities" text, "Notarial activities" text, "Administration of oaths" text )
What is Administration of Oaths, when Rights of Audience is Yes, and when Reserved Instruments is Yes?
SELECT "Administration of oaths" FROM table_7690 WHERE "Rights of audience" = 'yes' AND "Reserved instruments" = 'yes'
wikisql
CREATE TABLE table_name_21 ( females VARCHAR, males VARCHAR )
What females have males of 1 234?
SELECT females FROM table_name_21 WHERE males = "1 234"
sql_create_context
CREATE TABLE table_name_14 ( uyghur_latin___uly__ VARCHAR, population__2010_census_ VARCHAR )
What is the Uyghur Latin with a population of 69,361?
SELECT uyghur_latin___uly__ FROM table_name_14 WHERE population__2010_census_ = "69,361"
sql_create_context
CREATE TABLE table_2167226_3 ( date VARCHAR, tournament VARCHAR )
What is the date for the tournament McDonald's wpga championship?
SELECT date FROM table_2167226_3 WHERE tournament = "McDonald's WPGA Championship"
sql_create_context
CREATE TABLE table_1984697_85 ( school VARCHAR, size VARCHAR )
Name the school/s with is size of 604.
SELECT school FROM table_1984697_85 WHERE size = 604
sql_create_context
CREATE TABLE table_30418 ( "Year" real, "Song (s)" text, "Producer (s)" text, "Written By" text, "Artist" text, "Title/Label" text )
what was the first year that kid creole and the coconuts recorded with I Too Have Seen The Woods / Sire Records?
SELECT MIN("Year") FROM table_30418 WHERE "Artist" = 'Kid Creole and the Coconuts'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
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, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id by a bar chart, and sort y-axis in asc order.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
nvbench
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, ...
患者51519970入院诊断疾病名称不含有喉在医院2900289的医疗就诊记载编号都是什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '51519970' AND gwyjzb.MED_SER_ORG_NO = '2900289' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%喉%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '51519970' AND fgwyjzb.MED_SER_ORG_NO = '2900289' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%喉%'
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the one thing patient 013-11660 was diagnosed with on this hospital visit for the last time?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660' AND patient.hospitaldischargetime IS NULL)) ORDER BY d...
eicu
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 ) ...
how many patients are admitted before the year 2184 and used the drug fluoxetine hcl?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2184" AND prescriptions.drug = "Fluoxetine HCl"
mimicsql_data
CREATE TABLE table_39976 ( "Week" real, "Date" text, "Time" text, "Opponent" text, "Result" text, "Game site" text, "Record" text )
What was the final score of the game on November 23, 2008?
SELECT "Result" FROM table_39976 WHERE "Date" = 'november 23, 2008'
wikisql
CREATE TABLE table_12321 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real, "League position" text )
What is the smallest Attendance with H / A of h, and Opponents of nottingham forest?
SELECT MIN("Attendance") FROM table_12321 WHERE "H / A" = 'h' AND "Opponents" = 'nottingham forest'
wikisql
CREATE TABLE table_name_17 ( gender VARCHAR, name VARCHAR, roll VARCHAR, years VARCHAR, authority VARCHAR )
Which gender has Years of 1 8, an Authority of state, a Roll less than 184, and a Name of matatoki school?
SELECT gender FROM table_name_17 WHERE years = "1–8" AND authority = "state" AND roll < 184 AND name = "matatoki school"
sql_create_context
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...
患者魏冠宇在二00九年九月二日到二0一八年十二月二十八日期间,总共到医院就诊过多少次
SELECT (SELECT COUNT(*) 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 person_info.XM = '魏冠宇' AND zzmzjzjlb.JZKSRQ BETWEEN '2009-09-02' AND '2018-12-28' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE table_75243 ( "Rank" real, "Name" text, "Headquarters" text, "Primary industry" text, "Market value ( USD million)" real )
How many ranks have an industry of health care?
SELECT COUNT("Rank") FROM table_75243 WHERE "Primary industry" = 'health care'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
i'd like to have some information on a ticket from DENVER to PITTSBURGH and ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci...
atis
CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE band ( id number, firstname text, la...
What are the types of vocals that the band member with the first name 'Solveig' played the most?
SELECT type FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name tex...
For each position, what is the average number of points for players in that position Plot them as bar chart, I want to order x axis in asc order.
SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
医疗机构2299367从零五年五月五号到一一年八月二十二期间就诊总量里患者是未就业人员有多少
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '2299367' AND IN_HOSP_DATE BETWEEN '2005-05-05' AND '2011-08-22' AND INSURED_STS = '未就业'
css
CREATE TABLE table_79747 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
In 1970, what entrant had a cosworth v8 engine?
SELECT "Entrant" FROM table_79747 WHERE "Engine" = 'cosworth v8' AND "Year" = '1970'
wikisql
CREATE TABLE table_64754 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
What was the rank of flori lang when his time was less than 22.27
SELECT SUM("Rank") FROM table_64754 WHERE "Name" = 'flori lang' AND "Time" < '22.27'
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...
病号56549574药品金额不低于6975.76元的在哪几次医疗记录中被开出过?医疗就诊编号是多少呢?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '56549574' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6975.76) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '56549574' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE table_9944 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score of the game on February 8?
SELECT "Score" FROM table_9944 WHERE "Date" = 'february 8'
wikisql
CREATE TABLE table_15533 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many golds for west germany with over 8 total?
SELECT MIN("Gold") FROM table_15533 WHERE "Nation" = 'west germany' AND "Total" > '8'
wikisql
CREATE TABLE table_name_55 ( population__2008_ INTEGER, korean VARCHAR )
What is the 2008 population in (Ham Hyung)?
SELECT SUM(population__2008_) FROM table_name_55 WHERE korean = "함흥"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many of the male patients received rosiglitazone maleate for treatment.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Rosiglitazone Maleate"
mimicsql_data
CREATE TABLE table_18365784_3 ( arrival VARCHAR, departure VARCHAR )
What was the arrival time of the train that departed at 18.16?
SELECT arrival FROM table_18365784_3 WHERE departure = "18.16"
sql_create_context
CREATE TABLE table_14423274_3 ( opponent VARCHAR, game_site VARCHAR )
Which team did they play at Rich Stadium?
SELECT opponent FROM table_14423274_3 WHERE game_site = "Rich Stadium"
sql_create_context
CREATE TABLE table_57965 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What day is carlton the home side?
SELECT "Date" FROM table_57965 WHERE "Home team" = 'carlton'
wikisql