context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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, ...
what is the hospital's average total cost when it includes remov ext immobilization since 2104?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remov ext immobilization')) AND STRFTIME('%y', cost.charg...
mimic_iii
CREATE TABLE table_14091 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" text, "Average Ratings" text )
What's the ratings of TBS of Episode 10 and had a Japanese title of Scandal?
SELECT "Average Ratings" FROM table_14091 WHERE "TV Station" = 'tbs' AND "Episodes" = '10' AND "Japanese Title" = 'scandal'
wikisql
CREATE TABLE table_61583 ( "Minister" text, "Party" text, "Governments" text, "Term start" text, "Term end" text )
What term end had minister Danny Ayalon?
SELECT "Term end" FROM table_61583 WHERE "Minister" = 'danny ayalon'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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 time ) CREATE TABLE d_lab...
what was the three most frequently done surgeries for patients 20s?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is gender and religion of subject id 71798?
SELECT demographic.gender, demographic.religion FROM demographic WHERE demographic.subject_id = "71798"
mimicsql_data
CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text )
Return the names of entrepreneurs.
SELECT T2.name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id
spider
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, a bar chart shows the distribution of name and the average of code , and group by attribute name, and could you list bar in descending order?
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_name_20 ( date VARCHAR, record VARCHAR )
Name the date for record of 74-84
SELECT date FROM table_name_20 WHERE record = "74-84"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and salary , and order by the X in descending.
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_2142 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
where is the private/presbyterian institute
SELECT "Location" FROM table_2142 WHERE "Type" = 'Private/Presbyterian'
wikisql
CREATE TABLE table_20753 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real )
When the crowd was 8642 what was the away team's score?
SELECT "Away team score" FROM table_20753 WHERE "Crowd" = '8642'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Give me the comparison about meter_100 over the Time by a bar chart, show in ascending by the total number.
SELECT Time, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_36728 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
How many Points have a Record of 25 10 11, and a January larger than 28?
SELECT COUNT("Points") FROM table_36728 WHERE "Record" = '25–10–11' AND "January" > '28'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
make a count of the number of patients who are discharged from the hospital in 2105.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2105'
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Your RANK on STACKOVERFLOW.COM Worldwide,in india,in mumbai.
SELECT d.Reputation, d.RANK AS RANK_INDIA FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS RANK FROM Users WHERE LOWER(Location) LIKE '%india%') AS d WHERE d.Id = @UserId
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
find the diagnoses of jane dillard.
SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jane Dillard"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( progr...
Which Fall or Winter classes can I take in order to meet my Other requirement ?
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, program_course AS PROGRAM_COURSEalias0...
advising
CREATE TABLE table_name_24 ( losses INTEGER, gains INTEGER )
Can you tell me the lowest Losses that has the Gains smaller than 0?
SELECT MIN(losses) FROM table_name_24 WHERE gains < 0
sql_create_context
CREATE TABLE table_name_76 ( republican VARCHAR, dates_administered VARCHAR )
Who is the republican Jon Huntsman that was administered June 19, 2008?
SELECT republican AS :_jon_huntsman FROM table_name_76 WHERE dates_administered = "june 19, 2008"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
how long was the last of patient 015-66570's stay in the hospital?
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '015-66570' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
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...
从二零一五年十二月二十二日到二零二零年八月二十五日这段时间里,患者97737667的哪些药品自付比例低于0.04的,把数量统计出来
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '97737667' AND t_kc22.STA_DATE BETWEEN '2015-12-22' AND '2020-08-25' AND t_kc22.SELF_PAY_PRO < 0.04 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb...
css
CREATE TABLE table_50862 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text )
WHich Tournament has a Finalist of gustavo kuerten (4)?
SELECT "Tournament" FROM table_50862 WHERE "Finalist" = 'gustavo kuerten (4)'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGui...
upvote/downvote ratio: 2015 through 2020. Look at the Graph, to see the evolution of the upvote/downvote ratio.
SELECT DATEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), 1) AS YearMonth, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT), 0)) AS Ratio FROM Votes WHERE CreationDate > '01-01-2015' AND CreationDate < '12-31-2020' GROUP BY DATEF...
sede
CREATE TABLE table_203_501 ( id number, "title" text, "genre" text, "sub\u00addivisions" text, "libretto" text, "premiere date" text, "place, theatre" text )
what was the year of the last title ?
SELECT MAX("premiere date") FROM table_203_501
squall
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
自二零一零年八月七日到二零一五年二月三日,挂医生26801950的号看门诊的病人是多少
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in...
css
CREATE TABLE table_79138 ( "Pick #" real, "Player" text, "Nationality" text, "Position" text, "Team from" text, "League from" text )
What is the position of the team player from Aik?
SELECT "Position" FROM table_79138 WHERE "Team from" = 'aik'
wikisql
CREATE TABLE campuses ( Id VARCHAR )
How many CSU campuses are there?
SELECT COUNT(*) FROM campuses
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...
看看这位患者入院时诊断出来的疾病编号和名称,编号是01456680839的医疗就诊
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '01456680839' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '01456680839'
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home
nvbench
CREATE TABLE table_57659 ( "Date" text, "Location" text, "Opponent" text, "Score" text, "Competition" text )
When was the 2014 World Cup Qualification in Kampala that had Angola as an opponent
SELECT "Date" FROM table_57659 WHERE "Competition" = '2014 world cup qualification' AND "Location" = 'kampala' AND "Opponent" = 'angola'
wikisql
CREATE TABLE table_name_10 ( home_team VARCHAR, venue VARCHAR )
What was the name of the home team playing at the Junction Oval venue?
SELECT home_team FROM table_name_10 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_16715 ( "Season" real, "Premier" text, "Runner Up" text, "Score" text, "Venue" text, "Attendance" real, "Premiership" text )
What venue has an attendance of 30824 at Essendon in 1984?
SELECT "Venue" FROM table_16715 WHERE "Premier" = 'Essendon' AND "Attendance" = '30824'
wikisql
CREATE TABLE table_58667 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What is Tournament, when Date is '6 October 2008'?
SELECT "Tournament" FROM table_58667 WHERE "Date" = '6 october 2008'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE...
show me all the flights from CHARLOTTE to CLEVELAND
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEV...
atis
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
i would like information on flights from PHILADELPHIA to OAKLAND california on friday afternoon
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 = 'OAKLAND' AND date_day.day_number = 25 AND date_day.month_number = 6 AND ...
atis
CREATE TABLE Students_in_Detention ( student_id VARCHAR )
How many distinct students have been in detention?
SELECT COUNT(DISTINCT student_id) FROM Students_in_Detention
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescript...
Votes on questions and answers for [rust] per day averaged over months since 2013.
SELECT MIN(Votes.CreationDate), (COUNT(*) + 0.0) / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(Votes.CreationDate)), '%d') AS "votes per day" FROM Posts LEFT JOIN PostTags AS qTags ON qTags.PostId = Posts.Id LEFT JOIN PostTags AS aTags ON aTags.PostId = Posts.ParentId INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE (VoteTypeI...
sede
CREATE TABLE table_16617025_1 ( season__number VARCHAR, directed_by VARCHAR )
In what seasons did Kate Woods direct Without A Trace?
SELECT season__number FROM table_16617025_1 WHERE directed_by = "Kate Woods"
sql_create_context
CREATE TABLE table_69175 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Writer(s)" text, "Date" text, "Award" text )
What award did Andrew Ryder win as producer?
SELECT "Award" FROM table_69175 WHERE "Producer(s)" = 'andrew ryder'
wikisql
CREATE TABLE table_name_23 ( first_time_as_hc_climb VARCHAR, height__m_ VARCHAR, most_recent VARCHAR, no_of_times_visited VARCHAR, no_of_hc_climbs VARCHAR )
When was the first HC climb before 2013 with more than 3 times visited, more than 4 HC climbs, and a height of 1669?
SELECT first_time_as_hc_climb FROM table_name_23 WHERE no_of_times_visited > 3 AND no_of_hc_climbs = 4 AND most_recent < 2013 AND height__m_ = "1669"
sql_create_context
CREATE TABLE table_70522 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Name the finish which has qual of 144.817
SELECT "Finish" FROM table_70522 WHERE "Qual" = '144.817'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what is patient 62977's first visit to the hospital in 2101?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 62977 AND STRFTIME('%y', admissions.admittime) = '2101' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_83 ( player VARCHAR, chng VARCHAR, rating VARCHAR, prev VARCHAR )
What player has a rating greater than 2746, with a prev less than 4, and +4 as the chng?
SELECT player FROM table_name_83 WHERE rating > 2746 AND prev < 4 AND chng = "+4"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolea...
Get user list of SO whose bio contains given words.
SELECT 'id' AS "user_link" FROM Users WHERE AboutMe LIKE '%##SearchText##%' LIMIT 10
sede
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( days_code varchar, da...
show me all all flights from PITTSBURGH to ATLANTA on wednesday which leave before 1200 and serve BREAKFAST
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, food_service WHERE (((flight.departure_time < 1200 AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'BREAKFAST') AND ...
atis
CREATE TABLE table_17693171_1 ( time_retired VARCHAR, driver VARCHAR )
What is the time/retired if the driver is Ed Carpenter?
SELECT time_retired FROM table_17693171_1 WHERE driver = "Ed Carpenter"
sql_create_context
CREATE TABLE table_20803241_1 ( cash_fare VARCHAR, type_of_fare VARCHAR )
When fort irwin-barstow/victorville is the type of fare what is the cash fare?
SELECT cash_fare FROM table_20803241_1 WHERE type_of_fare = "Fort Irwin-Barstow/Victorville"
sql_create_context
CREATE TABLE table_name_58 ( affiliation VARCHAR, owned_since VARCHAR, channel___tv___rf__ VARCHAR )
What affiliation has an owned since larger than 1991, and also has a channel (tv/rf) of 42?
SELECT affiliation FROM table_name_58 WHERE owned_since > 1991 AND channel___tv___rf__ = "42"
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...
what is the number of patients less than 80 years who had urine lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Urine"
mimicsql_data
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 wdmzjzjlb ( CYBQDM text, CYBQ...
在医院4385705中列出患者褚芳泽入院科室名称不包含青光眼的住院就诊记录各是哪几条?
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '褚芳泽' AND hz_info.YLJGDM = '4385705' AND NOT wdmzjzjlb.JZKSMC LIKE '%青光眼%' UNION SELECT * FROM person_info J...
css
CREATE TABLE table_4706 ( "Tournament" text, "1943" text, "1944" text, "1945" text, "1948" text, "1949" text, "1951" text, "1954" text, "1956\u20131968" text, "1969" text, "Career SR" text )
What did the tournament with an A in 1956-1958, an A in 1954, and an F in 1948 get in 1969?
SELECT "1969" FROM table_4706 WHERE "1956\u20131968" = 'a' AND "1954" = 'a' AND "1948" = 'f'
wikisql
CREATE TABLE table_2562572_54 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name_other_names VARCHAR )
What is the largest ethnic group in 2002 for the cyrillic name, other name of ?
SELECT largest_ethnic_group__2002_ FROM table_2562572_54 WHERE cyrillic_name_other_names = "Бешка"
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...
从06年1月27日至2008年10月10日内病患11575009的所有检验结果指标记录中的仪器编号都是啥?名称都叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 = ...
css
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...
Bar chart x axis acc road y axis how many acc road
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
How many papers has dominik moritz written ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'dominik moritz' AND writes.authorid = author.authorid
scholar
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
what was the last drug patient 006-195316 was prescribed via intravenou in this hospital visit?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hospitaldischargetime IS NULL)) AND medicat...
eicu
CREATE TABLE table_25007 ( "Character" text, "Original Manchester Performer" text, "Original West End Performer" text, "Original Broadway Performer" text, "Original UK Tour Performer" text, "Original Non-Equity US Tour Performer" text, "Original Italian Tour Performer" text, "Original So...
Who was the Manchester performer of Lisa Davina Phillip's character?
SELECT "Original Manchester Performer" FROM table_25007 WHERE "Original West End Performer" = 'Lisa Davina Phillip'
wikisql
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
What is the number of cities in each country? Return a bar chart, and sort x-axis in descending order.
SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_colors ( color_code text, ...
Return the characteristic names of the 'sesame' product.
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
spider
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...
参保人编号44574940在2010年10月26日到2011年2月3日内门诊西药费是多少?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '44574940' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-10-26' AND '2011-02-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
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, give me the comparison about price over the name , and group by attribute headquarter by a bar chart, and I want to order Y in ascending order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_name_33 ( date VARCHAR, venue VARCHAR )
What was the date for Westport?
SELECT date FROM table_name_33 WHERE venue = "westport"
sql_create_context
CREATE TABLE table_name_6 ( Id VARCHAR )
What is the average 1940 value where 1929 values are 101.4 and 1933 values are over 68.3?
SELECT AVG(1940) FROM table_name_6 WHERE 1929 = 101.4 AND 1933 > 68.3
sql_create_context
CREATE TABLE table_10614 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did Melbourne play as the home team?
SELECT "Venue" FROM table_10614 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_44719 ( "Year" text, "Winner" text, "Country" text, "Score" text, "Runner(s)-up" text )
What are the Runner(s)-up of the 1972 Championship?
SELECT "Runner(s)-up" FROM table_44719 WHERE "Year" = '1972'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
Which Capstone American Culture classes satisfy the ULCS requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Capstone American Culture%' OR course.description LIKE '%Capstone American Culture%' OR course.n...
advising
CREATE TABLE table_name_6 ( decile INTEGER, area VARCHAR )
What is the total Decile with Waikanae Area?
SELECT SUM(decile) FROM table_name_6 WHERE area = "waikanae"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is lab test fluid of subject name jerry deberry?
SELECT lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who was hired before 2002-06-21, draw a line chart about the change of department_id over hire_date , and rank from high to low by the X-axis.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_11991 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
When was the swiss grand prix?
SELECT "Date" FROM table_11991 WHERE "Race" = 'swiss grand prix'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose age is less than 89 and drug route is pb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "89" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_name_58 ( result VARCHAR, date VARCHAR, venue VARCHAR )
What is Result, when Date is 'June 11, 1994', and when Venue is 'Miami, United States'?
SELECT result FROM table_name_58 WHERE date = "june 11, 1994" AND venue = "miami, united states"
sql_create_context
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME var...
Draw a pie chart for how many classes are held in each department?
SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_7677 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Which Entrant had the Bugatti T35B Chassis and the Driver, Heinrich-Joachim Von Morgen?
SELECT "Entrant" FROM table_7677 WHERE "Chassis" = 'bugatti t35b' AND "Driver" = 'heinrich-joachim von morgen'
wikisql
CREATE TABLE table_name_17 ( rounds VARCHAR, engine_† VARCHAR )
what is the rounds when the engine is mercedes fo110m?
SELECT rounds FROM table_name_17 WHERE engine_† = "mercedes fo110m"
sql_create_context
CREATE TABLE table_16642 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
What is the pole position for the ferrari at the austrian grand prix?
SELECT "Pole Position" FROM table_16642 WHERE "Constructor" = 'Ferrari' AND "Grand Prix" = 'Austrian Grand Prix'
wikisql
CREATE TABLE table_name_59 ( year INTEGER, developer_s_ VARCHAR )
What year was the developer(s) Bioware?
SELECT AVG(year) FROM table_name_59 WHERE developer_s_ = "bioware"
sql_create_context
CREATE TABLE table_23824 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
What is the season number for Series #23, the Runway Job?
SELECT "Season #" FROM table_23824 WHERE "Series #" = '23'
wikisql
CREATE TABLE table_53997 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text )
What is the call sign of 1200 am?
SELECT "Call sign" FROM table_53997 WHERE "Frequency" = '1200 am'
wikisql
CREATE TABLE table_name_42 ( type VARCHAR, year VARCHAR, title VARCHAR )
What is the type earlier than 1968, and a Title of stretchin' out?
SELECT type FROM table_name_42 WHERE year < 1968 AND title = "stretchin' out"
sql_create_context
CREATE TABLE table_50926 ( "Winner" text, "Country" text, "Winter Olympics" real, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
What country was ole ellefs ter from?
SELECT "Country" FROM table_50926 WHERE "Winner" = 'ole ellefsæter'
wikisql
CREATE TABLE city ( city_id VARCHAR ) CREATE TABLE hosting_city ( host_city VARCHAR )
What are the GDP and population of the city that already served as a host more than once?
SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.host_city HAVING COUNT(*) > 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many patients whose age is less than 36 and lab test name is theophylline?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "36" AND lab.label = "Theophylline"
mimicsql_data
CREATE TABLE table_27722734_7 ( date VARCHAR, team VARCHAR )
Name the date for washington
SELECT date FROM table_27722734_7 WHERE team = "Washington"
sql_create_context
CREATE TABLE table_19897294_8 ( family_families VARCHAR, no_overall VARCHAR )
Name the number of families for uk30
SELECT COUNT(family_families) FROM table_19897294_8 WHERE no_overall = "UK30"
sql_create_context
CREATE TABLE table_name_69 ( rating VARCHAR, share VARCHAR, viewers__millions_ VARCHAR )
What is the Rating/Share (18-49) that also has a Share greater than 10 and 12.42 million Viewers?
SELECT rating / SHARE(18 - 49) FROM table_name_69 WHERE share > 10 AND viewers__millions_ = 12.42
sql_create_context
CREATE TABLE table_71553 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What venue was the 11 September 2012 game?
SELECT "Venue" FROM table_71553 WHERE "Date" = '11 september 2012'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
list flights from MILWAUKEE to SAN JOSE on wednesday
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 = 'SAN JOSE' AND date_day.day_number = 23 AND date_day.month_number = 4 AND ...
atis
CREATE TABLE table_17355820_1 ( title VARCHAR, season__number VARCHAR )
How many episodes were there in season 19?
SELECT COUNT(title) FROM table_17355820_1 WHERE season__number = 19
sql_create_context
CREATE TABLE table_60835 ( "Player" text, "Pos." text, "Nationality" text, "Previous team" text, "Years of NBA experience [a ]" real, "Career with the franchise" text )
What is the nationality of the player who was previously with the Detroit Pistons?
SELECT "Nationality" FROM table_60835 WHERE "Previous team" = 'detroit pistons'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
住院就诊81908444288的入院科室代码是什么?入院科室名称是什么?
SELECT wdmzjzjlb.JZKSDM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '81908444288' UNION SELECT bdmzjzjlb.JZKSDM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '81908444288'
css
CREATE TABLE table_11597 ( "Year" real, "English title" text, "Korean title" text, "Role" text, "Network" text )
What network is the Korean title of mbc - on?
SELECT "Network" FROM table_11597 WHERE "Korean title" = 'mbc 베스트극장 - 작은 도둑'
wikisql
CREATE TABLE tryout ( cName VARCHAR ) CREATE TABLE college ( cName VARCHAR )
Find the states where have some college students in tryout.
SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName
sql_create_context
CREATE TABLE table_name_96 ( high_assists VARCHAR, record VARCHAR )
Which High assists have a Record of 4-2?
SELECT high_assists FROM table_name_96 WHERE record = "4-2"
sql_create_context
CREATE TABLE table_34317 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which Position has a College/Junior/Club Team (League) of estevan bruins (wchl), and a Round of 3?
SELECT "Position" FROM table_34317 WHERE "College/Junior/Club Team (League)" = 'estevan bruins (wchl)' AND "Round" = '3'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
provide the number of patients whose year of birth is less than 2087 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_24600 ( "Season no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. Viewers (millions)" text )
What was the number of US Viewers in the episode directed by Steve Shill and having a production code of E2102?
SELECT "U.S. Viewers (millions)" FROM table_24600 WHERE "Directed by" = 'Steve Shill' AND "Production code" = 'E2102'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
查一下患者吕秀媛之前是在哪个医院看病的
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND per...
css
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the total number of captains with different classes?, I want to rank from low to high by the the number of class.
SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class)
nvbench
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREAT...
What are the names and budgets of departments with budgets greater than the average Plot them as bar chart, and could you order Y-axis from high to low order?
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget DESC
nvbench