context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_861 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "date" text )
who had a better score , manchester united or wolverhampton wanderers ?
SELECT "home team" FROM table_204_861 WHERE "home team" IN ('manchester united', 'wolverhampton wanderers') ORDER BY "score" DESC LIMIT 1
squall
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
门诊诊断病人方鹏云为精神分裂症的检测指标162731的结果定量及其单位各是什么呀?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
列出患者蒋清淑门诊诊断名称不包含维生素的在医院6779932中有哪些门诊就诊记录?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '蒋清淑' AND hz_info.YLJGDM = '6779932' AND NOT mzjzjlb.JZZDSM LIKE '%维生素%'
css
CREATE TABLE table_8585 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator" text, "Sideline reporters" text, "Pregame host" text, "Pregame analysts" text )
Which network broadcasted the cup after 2011?
SELECT "Network" FROM table_8585 WHERE "Year" > '2011'
wikisql
CREATE TABLE table_name_90 ( cuts_made INTEGER, top_25 VARCHAR, top_10 VARCHAR, top_5 VARCHAR )
Name the least cuts for top-5 more than 2 with top 25 less than 6 and top 10 less than 11
SELECT MIN(cuts_made) FROM table_name_90 WHERE top_10 < 11 AND top_5 > 2 AND top_25 < 6
sql_create_context
CREATE TABLE table_25325 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text )
How many records were there when opponents were 9?
SELECT COUNT("Record") FROM table_25325 WHERE "Opponents" = '9'
wikisql
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), ...
A bar chart about how many professors have a Ph.D. in each department?
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE
nvbench
CREATE TABLE student ( dept_name VARCHAR )
Find the name of department has the highest amount of students?
SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_73641 ( "Year" real, "Oscars" text, "Noms" real, "Wins" real, "Film" text, "Leading Actor" text, "Leading Actress" text, "Supporting Actor" text, "Supporting Actress" text )
Who was the supporting actress in a film with Diane Keaton as the leading actress?
SELECT "Supporting Actress" FROM table_73641 WHERE "Leading Actress" = 'Diane Keaton'
wikisql
CREATE TABLE table_name_99 ( black__both_hispanic_and_non_hispanic_ INTEGER, hispanic__of_any_race_ VARCHAR, white__both_hispanic_and_non_hispanic_ VARCHAR, multiracial__both_hispanic_and_non_hispanic_ VARCHAR )
What is the average black value (Hispanic/Non-Hispanic) having a white (Hispanic/Non-Hispanic) under 61.9, Multiracial (Hispanic/Non-Hispanic) under 12.5 and Hispanic under 99.4?
SELECT AVG(black__both_hispanic_and_non_hispanic_) FROM table_name_99 WHERE white__both_hispanic_and_non_hispanic_ < 61.9 AND multiracial__both_hispanic_and_non_hispanic_ < 12.5 AND hispanic__of_any_race_ < 99.4
sql_create_context
CREATE TABLE table_271 ( "Series no." real, "Season no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real )
What is the title for season 2?
SELECT "Title" FROM table_271 WHERE "Season no." = '2'
wikisql
CREATE TABLE table_name_62 ( venue VARCHAR, away_team VARCHAR )
At what venue was richmond the away team?
SELECT venue FROM table_name_62 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
what is the least expensive flight today from ATLANTA to SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da...
atis
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
Find the number of customers in the banks at New York City.
SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City'
spider
CREATE TABLE table_name_92 ( amount__millions_ VARCHAR, payee VARCHAR )
How much money, in millions, is paid to Infotalent?
SELECT amount__millions_ FROM table_name_92 WHERE payee = "infotalent"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose primary disease is pituitary bleed and year of death is less than or equal to 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE AssignedTo ( Name VARCHAR, Code VARCHAR, Project VARCHAR ) CREATE TABLE Projects ( Name VARCHAR, Code VARCHAR, Project VARCHAR )
Select the project names which are not assigned yet.
SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
参保人编号75766226在2000年1月12日到2019年3月30日内小金额结算次数,10元以内为小金额有多少?
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.PERSON_ID = '75766226' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-01-12' AND '2019-03-30' AND t_kc24.MED_AMOUT <= 10
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients whose diagnoses short title is chr syst/diastl hrt fail and drug route is iv bolus?
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 = "Chr syst/diastl hrt fail" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREAT...
How many flights in each destination city? Return a bar chart, and display x-axis in asc order please.
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination
nvbench
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
Bar chart of the total number from each country, and I want to order names from high to low order.
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE table_203_266 ( id number, "group" text, "members" number, "caucusing" number, "total" number )
how many groups have above 100 members ?
SELECT COUNT("group") FROM table_203_266 WHERE "members" > 100
squall
CREATE TABLE table_3238 ( "Character" text, "English version" text, "Cinderella" text, "Cinderella II: Dreams Come True" text, "Cinderella III: A Twist in Time" text )
Who voiced Drizella in the English version?
SELECT "English version" FROM table_3238 WHERE "Character" = 'Drizella'
wikisql
CREATE TABLE table_name_87 ( athlete VARCHAR, country VARCHAR )
Who was the athlete from Lithuania?
SELECT athlete FROM table_name_87 WHERE country = "lithuania"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
get me the number of patients admitted via emergency hospital room who have long term (current) use of anticoagulants diagnoses.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Long-term use anticoagul"
mimicsql_data
CREATE TABLE table_21808535_1 ( round VARCHAR, date VARCHAR )
How many rounds were on July 10?
SELECT COUNT(round) FROM table_21808535_1 WHERE date = "July 10"
sql_create_context
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
Show the number of climbers for each mountain in a bar chart, could you display in desc by the the number of name?
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
nvbench
CREATE TABLE table_43701 ( "Poll Source" text, "Dates administered" text, "Democrat: Mark Begich" text, "Republican: Ted Stevens" text, "Lead Maragin" real )
What was the poll source for october 6, 2008?
SELECT "Poll Source" FROM table_43701 WHERE "Dates administered" = 'october 6, 2008'
wikisql
CREATE TABLE table_79609 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is bronze when the rank is 3 and the total is more than 2?
SELECT SUM("Bronze") FROM table_79609 WHERE "Rank" = '3' AND "Total" > '2'
wikisql
CREATE TABLE table_name_8 ( Local VARCHAR, mission VARCHAR )
What is Local Mission, when Mission is 'Mauritius'?
SELECT Local AS mission FROM table_name_8 WHERE mission = "mauritius"
sql_create_context
CREATE TABLE table_5114 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
What year did they get 4 points with Suzuki?
SELECT AVG("Year") FROM table_5114 WHERE "Team" = 'suzuki' AND "Points" = '4'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
tell me the top five most common diagnoses in patients in the age of 60 or above?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_37615 ( "Length/Fuel" text, "Model" text, "Year Built" text, "Quantity" real, "Floor Styling" text, "Wheelchair access" text )
What is the Length/Fuel of the bus with a Quantity of 30?
SELECT "Length/Fuel" FROM table_37615 WHERE "Quantity" = '30'
wikisql
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, V...
Return the number of music festivals of each category, order from high to low by the Y.
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_26919_7 ( geez VARCHAR, proto_semitic VARCHAR )
If the proto-semitic is *bayt-, what are the geez?
SELECT geez FROM table_26919_7 WHERE proto_semitic = "*bayt-"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, ...
Do you know if SPANISH 299 is being offered next semester ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 299 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE l...
what are the four most frequently given laboratory tests for patients who had previously had spinal struct repair nec within 2 months since 2100?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
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...
从03年7月12日到2018年11月19日,病患葛曼妮医保的医疗费总额是多少?
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '葛曼妮' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-07-12' AND '2018-11-19'
css
CREATE TABLE table_name_17 ( player VARCHAR, opponent VARCHAR )
which athlete played against Queensland?
SELECT player FROM table_name_17 WHERE opponent = "queensland"
sql_create_context
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
Bar graph to show mean memory in g from different carrier
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE table_36297 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which November is the lowest one that has a Record of 12 2 4 1?
SELECT MIN("November") FROM table_36297 WHERE "Record" = '12–2–4–1'
wikisql
CREATE TABLE table_204_153 ( id number, "tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "2014" text, "w-l" text ...
what is the difference in wins between wimbledon and the us open for this player ?
SELECT ABS((SELECT "w-l" FROM table_204_153 WHERE "tournament" = 'wimbledon') - (SELECT "w-l" FROM table_204_153 WHERE "tournament" = 'us open'))
squall
CREATE TABLE table_name_95 ( location VARCHAR, rank VARCHAR )
Which location has a rank of 147?
SELECT location FROM table_name_95 WHERE rank = 147
sql_create_context
CREATE TABLE table_name_32 ( guns INTEGER, class VARCHAR, year VARCHAR )
What were the fewest amount of guns possessed by a frigate that served in 1815?
SELECT MIN(guns) FROM table_name_32 WHERE class = "frigate" AND year = "1815"
sql_create_context
CREATE TABLE table_43790 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
Name the No. 3 which has a No. 7 of logan, and a No. 5 of jackson?
SELECT "No. 3" FROM table_43790 WHERE "No. 7" = 'logan' AND "No. 5" = 'jackson'
wikisql
CREATE TABLE table_name_31 ( total INTEGER, silver VARCHAR, rank VARCHAR )
What is the lowest total for those receiving less than 18 but more than 14?
SELECT MIN(total) FROM table_name_31 WHERE silver < 18 AND rank = "14"
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 All_Games_Percent over the All_Neutral .
SELECT All_Neutral, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_29328 ( "Greek national account" text, "1970" text, "1980" text, "1990" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001 1" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, ...
What is 2006 when 1997 is 6.8?
SELECT "2006" FROM table_29328 WHERE "1997" = '6.8'
wikisql
CREATE TABLE table_72122 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
How many fastest laps were there for a rd that equals 10?
SELECT COUNT("Fastest Lap") FROM table_72122 WHERE "Rd" = '10'
wikisql
CREATE TABLE table_name_40 ( date VARCHAR, result VARCHAR )
What date had a result of 8-0?
SELECT date FROM table_name_40 WHERE result = "8-0"
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, ...
what is minimum age of patients whose primary disease is pituitary bleed and days of hospital stay is 69?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.days_stay = "69"
mimicsql_data
CREATE TABLE table_72416 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What party did incumbent Brooks Hays belong to?
SELECT "Party" FROM table_72416 WHERE "Incumbent" = 'Brooks Hays'
wikisql
CREATE TABLE table_name_94 ( losses VARCHAR, total VARCHAR, wins VARCHAR )
How many losses had a total of 17 and more than 10 wins?
SELECT COUNT(losses) FROM table_name_94 WHERE total = 17 AND wins > 10
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
how many times patient 029-7028 had received a cardiac angiography - with stent placement procedure.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028')) AND treatment.treatmentname = 'cardiac angiography - with stent plac...
eicu
CREATE TABLE table_36692 ( "Rank" real, "Name" text, "Height* m (ft)" text, "Floors" real, "Year* (est.)" text, "City" text )
What city has a building ranked greater than 15 with floors greater than 43?
SELECT "City" FROM table_36692 WHERE "Rank" > '15' AND "Floors" > '43'
wikisql
CREATE TABLE table_204_357 ( id number, "year" number, "div." text, "pos." text, "cup" text, "top scorer (league)" text, "score" number )
total times vokhid shodiev was the league scorer ?
SELECT COUNT(*) FROM table_204_357 WHERE "top scorer (league)" = 'vokhid shodiev'
squall
CREATE TABLE mzb ( 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...
一个叫戚清佳的患者,在医院3389620的某次出院诊断结果里医生姓窦的那次诊断是啥时候?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '戚清佳' AND qtb.MED_SER_ORG_NO = '3389620' AND qtb.OUT_DIAG_DOC_NM LIKE '窦%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '戚清佳' AND gyb.MED_SER_ORG_NO = '3389620' AND gyb.OUT_DIAG_DOC_NM LIKE '窦%' UNION ...
css
CREATE TABLE table_name_85 ( laps INTEGER, rider VARCHAR, grid VARCHAR )
with a Rider of marco melandri, and a Grid smaller than 10, what is the highest lap count?
SELECT MAX(laps) FROM table_name_85 WHERE rider = "marco melandri" AND grid < 10
sql_create_context
CREATE TABLE table_name_35 ( silver VARCHAR, total INTEGER )
What is the number of silver when the total is less than 1?
SELECT COUNT(silver) FROM table_name_35 WHERE total < 1
sql_create_context
CREATE TABLE table_3453 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
What was the original air date of the episode directed by gloria muzio?
SELECT "Original air date" FROM table_3453 WHERE "Directed by" = 'Gloria Muzio'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId...
Recent questions with no answers, no comments, nonnegative score.
SELECT CreationDate, Id AS "post_link", Score FROM Posts WHERE PostTypeId = 1 AND Score > 0 AND COALESCE(AnswerCount, 0) = 0 AND COALESCE(CommentCount, 0) = 0 AND ClosedDate IS NULL ORDER BY CreationDate DESC, Score DESC LIMIT 1000
sede
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Visualize a bar chart about the distribution of meter_600 and ID , and I want to display X-axis in desc order please.
SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC
nvbench
CREATE TABLE table_48627 ( "Team" text, "Head coach" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text )
Who is the team captain of the team that L bzer is the shirt sponsor for?
SELECT "Team captain" FROM table_48627 WHERE "Shirt sponsor" = 'lübzer'
wikisql
CREATE TABLE table_32234 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which competition had the score 1-0?
SELECT "Competition" FROM table_32234 WHERE "Score" = '1-0'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a pie on what is the average age for a male in each job?
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
nvbench
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...
What is the easiest course that meets the Other requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
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...
在医疗机构6356555里面现在有多少在院的人?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '6356555' AND HOSP_STS > 0
css
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
until 1 year ago patient 77676 had a procedure?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77676) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_76082 ( "Name" text, "Year commissioned" real, "Gross head (metres)" real, "Installed capacity (megawatts)" real, "Average annual output (million KWh)" real )
What is the earliest Year commissioned wiht an Average annual output greater than 58 and Installed capacity of 20?
SELECT MIN("Year commissioned") FROM table_76082 WHERE "Average annual output (million KWh)" > '58' AND "Installed capacity (megawatts)" = '20'
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, ...
count the number of patients whose admission type is elective and diagnoses long title is acute glomerulonephritis with other specified pathological lesion in kidney?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney"
mimicsql_data
CREATE TABLE table_16340 ( "Model" text, "RU" real, "Max processors" text, "Processor frequency" text, "Max memory" text, "Max disk capacity" text, "GA Date" text )
What is the lowest ru?
SELECT MIN("RU") FROM table_16340
wikisql
CREATE TABLE table_1337 ( "Series #" real, "Season #" real, "Title" text, "Directed by:" text, "Written by:" text, "Original air date" text )
Who wrote the episode where the series number is 74?
SELECT "Written by:" FROM table_1337 WHERE "Series #" = '74'
wikisql
CREATE TABLE table_name_26 ( total_seats INTEGER, regional_seats VARCHAR, constituency_seats VARCHAR, party VARCHAR )
What is the full number of Total Seats with a constituency seat number bigger than 0 with the Liberal Democrat party, and the Regional seat number is smaller than 6?
SELECT SUM(total_seats) FROM table_name_26 WHERE constituency_seats > 0 AND party = "liberal democrat" AND regional_seats < 6
sql_create_context
CREATE TABLE table_1354 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the score for washington
SELECT "Score" FROM table_1354 WHERE "Team" = 'Washington'
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, ...
Give me the number of patients born before the year 2092 whose lab test item id is 61358.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2092" AND lab.itemid = "51358"
mimicsql_data
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 )
Find the number of products for each manufacturer, showing the name of each company Show bar chart, display by the bar in desc.
SELECT T2.Name, COUNT(*) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_r...
calculate the number of current patients.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL
mimic_iii
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
整理出来患者水茉莉在二零零一年一月四日到二零二一年十二月九日内被开出的所有检验报告单的科室编码以及名称
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_...
css
CREATE TABLE table_name_60 ( oberliga_südwest VARCHAR, oberliga_baden_württemberg VARCHAR, season VARCHAR )
which Oberliga S dwes has an Oberliga Baden-W rttemberg of sv sandhausen in 1984-85?
SELECT oberliga_südwest FROM table_name_60 WHERE oberliga_baden_württemberg = "sv sandhausen" AND season = "1984-85"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
what is the yearly minimum eosinophils level of patient 50286 since 09/2104?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'eosinophils') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-09' GROUP...
mimic_iii
CREATE TABLE table_27676 ( "Position" text, "Number" real, "Horse" text, "Jockey" text, "Age" real, "Handicap" text, "SP" text, "Distance" text )
what position is number 22?
SELECT "Position" FROM table_27676 WHERE "Number" = '22'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comme...
Get comments posted after 2010.
SELECT Id, PostId, Score, Text, CreationDate, UserId, UserDisplayName FROM Comments WHERE CreationDate > 01 / 01 / 2010 ORDER BY Id
sede
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
Draw a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by time.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_203_4 ( id number, "medal" text, "name" text, "sport" text, "event" text, "date" text )
how many earned their gold medals in rowing ?
SELECT COUNT("name") FROM table_203_4 WHERE "medal" = 'gold' AND "sport" = 'rowing'
squall
CREATE TABLE table_62635 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2002-2003 season" text )
What city is the Stadium est dio dr. magalh es pessoa in?
SELECT "City" FROM table_62635 WHERE "Stadium" = 'estádio dr. magalhães pessoa'
wikisql
CREATE TABLE table_42315 ( "Country" text, "Automobile Name" text, "Manufacturer" text, "Engine Make/Capacity" text, "Year" text )
What is the name of the car manufactured by Letecke Zavody N.P., Jinonice?
SELECT "Automobile Name" FROM table_42315 WHERE "Manufacturer" = 'letecke zavody n.p., jinonice'
wikisql
CREATE TABLE table_28227 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What position was Parsons in for 1992?
SELECT "Position" FROM table_28227 WHERE "Year" = '1992'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
查一下范升荣这个病人的医疗记录中,有哪几次医疗记录中被开出过金额超过5540.22元的药品?列出医疗就诊编码
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '范升荣' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 5540.22)
css
CREATE TABLE table_72213 ( "Taxonomy" text, "Species in the world" real, "Species in Peru" real, "Species in the Peruvian Amazon" real, "Peru Vs. world (Percent)" real, "Peruvian Amazon Vs. Peru (Percent)" real )
what's the species in the world with peruvian amazon vs. peru (percent) of 63
SELECT "Species in the world" FROM table_72213 WHERE "Peruvian Amazon Vs. Peru (Percent)" = '63'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varcha...
show me the flights from PHILADELPHIA to BALTIMORE
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'B...
atis
CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CRE...
Compute the average profits companies make.
SELECT AVG(profits_billion) FROM companies
spider
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( ro...
when last did patient 31482 have the minimum arterial bp mean during a day before?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_21503 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was the game held and what was the attendance when they played Orlando?
SELECT "Location Attendance" FROM table_21503 WHERE "Team" = 'Orlando'
wikisql
CREATE TABLE table_9810 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
What is the class of 2009?
SELECT "Class" FROM table_9810 WHERE "Year" = '2009'
wikisql
CREATE TABLE table_12454156_1 ( losing_hand VARCHAR, year VARCHAR )
How many losing hands are there before 2007?
SELECT COUNT(losing_hand) FROM table_12454156_1 WHERE year = 2007
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
which patients have sl route of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "SL"
mimicsql_data
CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE companies ( id number, name text, headquarters text, indu...
What are the names of companies whose headquarters are not 'USA'?
SELECT name FROM companies WHERE headquarters <> 'USA'
spider
CREATE TABLE table_70577 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Name the most cuts made with top-25 more than 4 and top 5 of 1 with wins more than 0
SELECT MAX("Cuts made") FROM table_70577 WHERE "Top-25" > '4' AND "Top-5" = '1' AND "Wins" > '0'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For all employees who have the letters D or S in their first name, give me the comparison about the sum of employee_id over the job_id , and group by attribute job_id by a bar chart, I want to show X in desc order.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE gyb ( 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...
在2000年12月21日到2008年1月25日期间5823598这个医疗机构的消耗的统筹金额是多少?
SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5823598' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-12-21' AND '2008-01-25' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '...
css