context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_60 ( music VARCHAR, record_label VARCHAR )
Which Music has a Record label of moviebox/ speed records / music waves?
SELECT music FROM table_name_60 WHERE record_label = "moviebox/ speed records / music waves"
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 ...
give me the number of patients whose age is less than 62 and drug code is morp2i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.formulary_drug_cd = "MORP2I"
mimicsql_data
CREATE TABLE table_52779 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real )
What is the maximum goals conceded for a team with 2 draws, more than 29 goals and a diff larger than 15?
SELECT MAX("Goals Conceded (GC)") FROM table_52779 WHERE "Draw (PE)" = '2' AND "Goals Scored (GF)" > '29' AND "+/- (Dif.)" > '15'
wikisql
CREATE TABLE table_37985 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real )
Who was the opponent after week 9 with over 49,221 attending, and a Result of w 38-20?
SELECT "Opponent" FROM table_37985 WHERE "Week" > '9' AND "Attendance" > '49,221' AND "Result" = 'w 38-20'
wikisql
CREATE TABLE table_204_994 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what is the difference in attendance between november 5 and november 25
SELECT ABS((SELECT "attendance" FROM table_204_994 WHERE "date" = 'november 5') - (SELECT "attendance" FROM table_204_994 WHERE "date" = 'november 25'))
squall
CREATE TABLE table_name_68 ( record VARCHAR, visitor VARCHAR )
What was the record when Minnesota was the visiting team?
SELECT record FROM table_name_68 WHERE visitor = "minnesota"
sql_create_context
CREATE TABLE table_32489 ( "Name" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the highest numbered grid with a time or retired time of 52:52.1881?
SELECT MAX("Grid") FROM table_32489 WHERE "Time/Retired" = '52:52.1881'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
did patient 027-149724 undergo surgery in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND STRFTIME('%y', treatment.treatmenttime) = '2105'
eicu
CREATE TABLE table_75875 ( "Rank" real, "Main span metres" text, "Main span feet" text, "Year opened" real, "Country" text )
What is the main span in feet from a year of 2009 or more recent with a rank less than 94 and 1,310 main span metres?
SELECT "Main span feet" FROM table_75875 WHERE "Year opened" > '2009' AND "Rank" < '94' AND "Main span metres" = '1,310'
wikisql
CREATE TABLE table_77234 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the highest overall pick number for george nicula who had a pick smaller than 9?
SELECT MAX("Overall") FROM table_77234 WHERE "Name" = 'george nicula' AND "Pick" < '9'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
how many patients admitted before the year 2124 had the lab test category blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2124" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Questions per month, for a tag. How do Scala web frameworks compare to each other? I'm restricting the questions to those tagged Scala, to avoid polluting Playframework's result. It might be unfair, but I can't think of any other way to do it. At least all frameworks are being equally discriminated against.
SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##TagName##...
sede
CREATE TABLE table_79547 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
Which team had a rank under 4 with a time of 1:14.04.88?
SELECT "Team" FROM table_79547 WHERE "Rank" < '4' AND "Time" = '1:14.04.88'
wikisql
CREATE TABLE table_2167 ( "Map number" real, "English name" text, "Finnish name" text, "Swedish name" text, "Residence city" text, "Dates of existence" text, "Notes" text )
What is the highest value for map number?
SELECT MAX("Map number") FROM table_2167
wikisql
CREATE TABLE table_203_252 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "place" number, "points" number )
what is the difference in points between first and last place ?
SELECT (SELECT "points" FROM table_203_252 ORDER BY "points" DESC LIMIT 1) - (SELECT "points" FROM table_203_252 ORDER BY "points" LIMIT 1)
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
count the number of patients who in 2104 had an intake of enteral novasource renal.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral novasource renal' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2104')
eicu
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 employees ( EMPLO...
For all employees who have the letters D or S in their first name, for salary, hire_date, visualize the trend, and order in asc by the x axis.
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_73594 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
How many dates for the week of 4?
SELECT COUNT("Date") FROM table_73594 WHERE "Week" = '4'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
What is the number of patients who have 2154-10-11 16:00:00 as the lab test chart time?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2154-10-11 16:00:00"
mimicsql_data
CREATE TABLE table_72285 ( "Name" text, "Alt name" text, "Launch date" text, "ID" text, "Mass (kg)" real, "Decay date" text, "Perigee (km)" real, "Apogee (km)" real, "Inclination" text )
How many alt names does 1964-011a have?
SELECT COUNT("Alt name") FROM table_72285 WHERE "ID" = '1964-011A'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
In next semester when is 480 offered ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose days of hospital stay is greater than 16 and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_54 ( director VARCHAR, role VARCHAR )
Who directed the movie when John Wayne played the role of John Travers?
SELECT director FROM table_name_54 WHERE role = "john travers"
sql_create_context
CREATE TABLE table_72655 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
how many segments involve wood boring augers
SELECT "Segment A" FROM table_72655 WHERE "Segment D" = 'Wood Boring Augers'
wikisql
CREATE TABLE table_58916 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text )
Who was the Winner in the AMC Round 4 at Lakeside International Raceway?
SELECT "Winner" FROM table_58916 WHERE "Circuit" = 'lakeside international raceway' AND "Series" = 'amc round 4'
wikisql
CREATE TABLE table_17851 ( "Candidate" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Result" text )
What background does the person from New york, New york, have?
SELECT "Background" FROM table_17851 WHERE "Hometown" = 'New York, New York'
wikisql
CREATE TABLE table_23937219_3 ( directed_by VARCHAR, season__number VARCHAR )
How many people directed episode 7 In the season?
SELECT COUNT(directed_by) FROM table_23937219_3 WHERE season__number = 7
sql_create_context
CREATE TABLE table_12961 ( "Year" real, "Delegate" text, "Hometown" text, "Placement in Miss World" text, "Other awards" text )
What are the other awards for 1995?
SELECT "Other awards" FROM table_12961 WHERE "Year" = '1995'
wikisql
CREATE TABLE table_38018 ( "2005" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2013" text, "Total" real )
What was the 2009 value for a total over 1 and 4th on 2010?
SELECT "2009" FROM table_38018 WHERE "Total" > '1' AND "2010" = '4th'
wikisql
CREATE TABLE table_name_95 ( winner VARCHAR, length VARCHAR )
Who is the Winner when the Length is 21.27km?
SELECT winner FROM table_name_95 WHERE length = "21.27km"
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, ...
provide the number of patients whose marital status is married and procedure short title is other phototherapy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Other phototherapy"
mimicsql_data
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 ...
门诊诊断为由于使用酒精引起的精神病性障碍的患者的检测指标172184的参考值范围下限还有上限的具体数值是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '由于使用酒精引起的精神病性障碍' AND jyjgzbb.JCZBDM = '172184'
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...
在编号为1323917的这个医院的出院诊断为关节炎的医疗记录中,最低和最高医疗费总额分别是多少
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '1323917' AND qtb.OUT_DIAG_DIS_NM = '关节炎' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '1323917' AND gyb.OUT_DIAG_DIS_NM = '关节炎' UNION SELECT ...
css
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 prescriptions ( subject_id text, hadm_id...
count the number of patients whose year of death is less than or equal to 2174 and procedure long title is infusion of vasopressor agent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2174.0" AND procedures.long_title = "Infusion of vasopressor agent"
mimicsql_data
CREATE TABLE table_4712 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When North Melbourne played as the away team, what was the crowd numbers?
SELECT "Crowd" FROM table_4712 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE weekly_weather ( day_of_week VARCHAR, high_temperature INTEGER )
What is the average high temperature for each day of week?
SELECT AVG(high_temperature), day_of_week FROM weekly_weather GROUP BY day_of_week
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
what are some good places in mountain view for arabic food ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, C...
Users with highest reputation and no gold badge.
WITH badges_cte AS (SELECT UserId AS uid, SUM(CASE WHEN Class = 1 THEN 1 ELSE 0 END) AS gold, SUM(CASE WHEN Class = 2 THEN 1 ELSE 0 END) AS silver, SUM(CASE WHEN Class = 3 THEN 1 ELSE 0 END) AS bronze, COUNT(Id) AS total FROM Badges GROUP BY UserId) SELECT u.Id AS "user_link", u.Reputation, b.gold, b.silver, b.bronze F...
sede
CREATE TABLE table_203_452 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many laps did paul tracy complete ?
SELECT "laps" FROM table_203_452 WHERE "driver" = 'paul tracy'
squall
CREATE TABLE table_name_6 ( nation VARCHAR, total VARCHAR, rank VARCHAR )
What nation was number 1 and had a total larger than 5?
SELECT nation FROM table_name_6 WHERE total > 5 AND rank = "1"
sql_create_context
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE...
List all customer status codes and the number of customers having each status code.
SELECT customer_status_code, COUNT(*) FROM customers GROUP BY customer_status_code
spider
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
what was patient 003-37225 first diagnosis time of s/p exploratory laparotomy.
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-37225')) AND diagnosis.diagnosisname = 's/p exploratory lapar...
eicu
CREATE TABLE table_57539 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What was the circuit when Jochen Rindt won?
SELECT "Circuit" FROM table_57539 WHERE "Winning driver" = 'jochen rindt'
wikisql
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name...
What is the id and trade name of the medicines can interact with at least 3 enzymes. Show the proportion.
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
找出患者75327735从二零零六年二月二十四开始一直到一二年九月二十六在医院3248711看病医生给开的所有药物名字和药物编号
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75327735' AND t_kc21.MED_SER_ORG_NO = '3248711' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-02-24' AND '2012-09-26')
css
CREATE TABLE building ( building_id text, name text, street_address text, years_as_tallest text, height_feet number, floors number ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage number, accession_number text, sequence_length numbe...
Show the name of buildings that do not have any institution.
SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)
spider
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
what were the four most commonly performed specimen tests since 3 years ago?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_76183 ( "Club" text, "Home city" text, "Stadium" text, "Founded" real, "Joined PRSL" real )
When is the club founded that founed prsl in 2008 and the home city is carolina 1?
SELECT MAX("Founded") FROM table_76183 WHERE "Joined PRSL" = '2008' AND "Home city" = 'carolina 1'
wikisql
CREATE TABLE table_204_104 ( id number, "title" text, "genre" text, "sub\u00addivisions" text, "libretto" text, "premiere date" text, "place, theatre" text, "notes" text )
which opera has the most acts , la fortezza al cimento or astarto ?
SELECT "title" FROM table_204_104 WHERE "title" IN ('la fortezza al cimento', 'astarto') ORDER BY "sub\u00addivisions" DESC LIMIT 1
squall
CREATE TABLE table_25231 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text )
In what round did Al Unser win at Wisconsin State Fair Park Speedway?
SELECT MIN("Rnd") FROM table_25231 WHERE "Winning Driver" = 'Al Unser' AND "Track" = 'Wisconsin State Fair Park Speedway'
wikisql
CREATE TABLE table_77713 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
How many caps have a Position of prop, and a Player of rui cordeiro?
SELECT COUNT("Caps") FROM table_77713 WHERE "Position" = 'prop' AND "Player" = 'rui cordeiro'
wikisql
CREATE TABLE table_201_39 ( id number, "no" number, "title" text, "directed by" text, "released" number )
which year is the year with the most titles ?
SELECT "released" FROM table_201_39 GROUP BY "released" ORDER BY COUNT("title") DESC LIMIT 1
squall
CREATE TABLE table_name_14 ( total VARCHAR, gold VARCHAR, bronze VARCHAR, nation VARCHAR )
What is the total number of medals when the bronze is more than 1, and Germany is the nation, and gold medals less than 1?
SELECT COUNT(total) FROM table_name_14 WHERE bronze > 1 AND nation = "germany" AND gold < 1
sql_create_context
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
从2005年12月14日至2010年2月5日这期间里,编码为98519847的患者曾在医院就诊多少次?
SELECT (SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '98519847' AND wdmzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl...
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
i mean what was patient 027-82318's first wbc x 1000 value on their current hospital visit?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'wbc x 1000' O...
eicu
CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Tra...
A bar chart for listing the number of the builders of railways in ascending alphabetical order.
SELECT Builder, COUNT(Builder) FROM railway GROUP BY Builder ORDER BY Builder
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is minimum age of patients whose gender is m and year of death is less than 2164?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2164.0"
mimicsql_data
CREATE TABLE table_17360840_6 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on December 27?
SELECT opponent FROM table_17360840_6 WHERE date = "December 27"
sql_create_context
CREATE TABLE table_name_48 ( nationality VARCHAR, player VARCHAR )
What is the nationality of Stromile Swift?
SELECT nationality FROM table_name_48 WHERE player = "stromile swift"
sql_create_context
CREATE TABLE table_20573232_1 ( county VARCHAR, others_number VARCHAR )
What county has others at 5?
SELECT county FROM table_20573232_1 WHERE others_number = 5
sql_create_context
CREATE TABLE table_21564794_3 ( began_in_st_louis INTEGER, league VARCHAR )
What year did Negro American League join?
SELECT MIN(began_in_st_louis) FROM table_21564794_3 WHERE league = "Negro American league"
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, ...
what is the number of patients whose year of death is less than or equal to 2131 and lab test name is neutrophils?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2131.0" AND lab.label = "Neutrophils"
mimicsql_data
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
If sample 6480 is imported, which country is it originally from?
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
pesticide
CREATE TABLE table_13873 ( "Rank" real, "Date" text, "Attendance" real, "Opponent" text, "Florida Result" text )
Which Rank has an Attendance larger than 24,102, and a Date of september 15, 2012?
SELECT "Rank" FROM table_13873 WHERE "Attendance" > '24,102' AND "Date" = 'september 15, 2012'
wikisql
CREATE TABLE table_name_26 ( opponent VARCHAR, outcome VARCHAR, date VARCHAR )
Which opponent has an Outcome of winner, and a Date of 5 november 2011?
SELECT opponent FROM table_name_26 WHERE outcome = "winner" AND date = "5 november 2011"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is age and diagnoses icd9 code of subject name estrella carroll?
SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Estrella Carroll"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
i mean, how many hours has it been since patient 19412 was admitted to the hospital?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 19412 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numc...
How many papers does Andrew King have ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Andrew King' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_203_371 ( id number, "round" number, "opponent" text, "result" text, "bro." number, "opp." number, "date" text, "venue" text, "crowd" number, "position" text )
the round after round 3
SELECT "round" FROM table_203_371 WHERE "round" > 3 ORDER BY "round" LIMIT 1
squall
CREATE TABLE clients ( client_id number, address_id number, customer_email_address text, customer_name text, customer_phone text, other_details text ) CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text...
What are the names of the drama workshop groups with address in Feliciaberg city?
SELECT T2.store_name FROM addresses AS T1 JOIN drama_workshop_groups AS T2 ON T1.address_id = T2.address_id WHERE T1.city_town = "Feliciaberg"
spider
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Find time difference between 1st and second post on the site.
SELECT ph.UserId, ph.PostId, pht.Id, pht.Name, ph.CreationDate, ph.Text FROM PostHistory AS ph INNER JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId WHERE ph.UserId > 0 AND NOT ph.UserId IS NULL ORDER BY ph.UserId LIMIT 100
sede
CREATE TABLE table_35295 ( "Round" real, "Player" text, "Nationality" text, "NHL team" text, "College/Junior/Club Team (League)" text )
How many Rounds have a Nationality of canada, and a College/Junior/Club Team (League) of fort mcmurray oil barons (ajhl)?
SELECT COUNT("Round") FROM table_35295 WHERE "Nationality" = 'canada' AND "College/Junior/Club Team (League)" = 'fort mcmurray oil barons (ajhl)'
wikisql
CREATE TABLE table_26042 ( "Direction" text, "Number" real, "Trigram" text, "24 Mountains" text, "Bearing / Degrees" text, "Nature" text )
How many values for 24 mountains when the bearing or degrees is 67.6 - 82.5 82.6 - 97.5 97.6 - 112.5?
SELECT COUNT("24 Mountains") FROM table_26042 WHERE "Bearing / Degrees" = '67.6 - 82.5 82.6 - 97.5 97.6 - 112.5'
wikisql
CREATE TABLE table_34823 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
What is the highest wins that has 350cc as the class, yamaha for the team, with points less than 37, and a year after 1979?
SELECT MAX("Wins") FROM table_34823 WHERE "Class" = '350cc' AND "Team" = 'yamaha' AND "Points" < '37' AND "Year" > '1979'
wikisql
CREATE TABLE table_22167196_1 ( dfb_pokal VARCHAR, player VARCHAR )
How many dfb-pokal did kevin-prince boateng have?
SELECT COUNT(dfb_pokal) FROM table_22167196_1 WHERE player = "Kevin-Prince Boateng"
sql_create_context
CREATE TABLE table_name_83 ( silver INTEGER, gold VARCHAR, bronze VARCHAR, total VARCHAR )
Bronze smaller than 3, and a Total smaller than 2, and a Gold larger than 1 has how many average silvers?
SELECT AVG(silver) FROM table_name_83 WHERE bronze < 3 AND total < 2 AND gold > 1
sql_create_context
CREATE TABLE table_name_41 ( event VARCHAR, meet VARCHAR, time VARCHAR )
What is Event, when Meet is 'World Championships', and when Time is '20.51'?
SELECT event FROM table_name_41 WHERE meet = "world championships" AND time = "20.51"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Count num...
Tags assoc. with users with answered questions.
WITH P AS (SELECT ParentId, Id, OwnerUserId, CASE WHEN PostTypeId = 1 THEN Id WHEN PostTypeId = 2 THEN ParentId END AS PID FROM Posts WHERE OwnerUserId IN (SELECT OwnerUserId FROM Posts WHERE Id IN (SELECT P1.AcceptedAnswerId FROM Posts AS P1 WHERE P1.PostTypeId = 1 AND NOT P1.AcceptedAnswerId IS NULL))) SELECT P.PID, ...
sede
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, ...
编码为37183972735的检验报告单的检验项目代码和名称分别是啥?
SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '37183972735'
css
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
柳娟秀这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '柳...
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 ) ...
Get the list of patients with a lab test category of chemistry who have diagnoses icd9 code 2764.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2764" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_62533 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the event with a 2:08 time?
SELECT "Event" FROM table_62533 WHERE "Time" = '2:08'
wikisql
CREATE TABLE table_53548 ( "Player" text, "Competition" text, "Team" text, "Opponent" text, "Year" real, "Score" text )
Tell me the player for ballarat football league
SELECT "Player" FROM table_53548 WHERE "Competition" = 'ballarat football league'
wikisql
CREATE TABLE table_27105 ( "Total" real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Viewers" text, "Air date" text, "Production code" real )
When 7.08 is the amount of viewers how many directors are there?
SELECT COUNT("Director") FROM table_27105 WHERE "Viewers" = '7.08'
wikisql
CREATE TABLE table_69653 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text )
Name the catalogue with song title of love me tonight
SELECT "Catalogue" FROM table_69653 WHERE "Song Title" = 'love me tonight'
wikisql
CREATE TABLE table_11727969_1 ( species_in_the_peruvian_amazon INTEGER, peru_vs_world__percent_ VARCHAR )
what's the minimum species in the peruvian amazon with peru vs. world (percent) value of 7
SELECT MIN(species_in_the_peruvian_amazon) FROM table_11727969_1 WHERE peru_vs_world__percent_ = 7
sql_create_context
CREATE TABLE table_name_45 ( team VARCHAR, year VARCHAR )
Which Team has a Year of 1978?
SELECT team FROM table_name_45 WHERE year = 1978
sql_create_context
CREATE TABLE table_1507852_1 ( attribute VARCHAR, type VARCHAR )
What are the attributes when the type is 'DOMNodeRemoved'?
SELECT attribute FROM table_1507852_1 WHERE type = "DOMNodeRemoved"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title te...
how much is the minimum hospital cost with aut neuropthy in oth dis during this year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aut neuropthy in oth dis')) AND DATETIME(cost.chargetime, 'star...
mimic_iii
CREATE TABLE table_50815 ( "Number" real, "Player" text, "Position" text, "Height" text, "Weight" real, "Years Exp" text, "College" text )
What is Postion, when Weight is greater than 220, and when Player is 'Travis Knight'?
SELECT "Position" FROM table_50815 WHERE "Weight" > '220' AND "Player" = 'travis knight'
wikisql
CREATE TABLE table_275162_1 ( course VARCHAR, location VARCHAR )
How many courses are located in carmel, indiana?
SELECT COUNT(course) FROM table_275162_1 WHERE location = "Carmel, Indiana"
sql_create_context
CREATE TABLE table_204_225 ( id number, "rank" number, "country/territory" text, "miss supranational" number, "1st runner-up" number, "2nd runner-up" number, "3rd runner-up" number, "4th runner-up" number, "semifinalists" number, "total" number )
who had more semifinalists , brazil or poland ?
SELECT "country/territory" FROM table_204_225 WHERE "country/territory" IN ('brazil', 'poland') ORDER BY "semifinalists" DESC LIMIT 1
squall
CREATE TABLE table_14172 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Release price ( USD )" tex...
What is the GPU model when the L3 cache is standard power?
SELECT "GPU model" FROM table_14172 WHERE "L3 cache" = 'standard power'
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...
在11年2月3日到19年7月25日内的C反应蛋白在患者21776586身上是什么情况?
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_name_72 ( place VARCHAR, score VARCHAR )
What place had a score of 67-67=134?
SELECT place FROM table_name_72 WHERE score = 67 - 67 = 134
sql_create_context
CREATE TABLE table_train_100 ( "id" int, "systolic_blood_pressure_sbp" int, "stroke" bool, "body_weight" float, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
history of clinically significant stroke
SELECT * FROM table_train_100 WHERE stroke = 1
criteria2sql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number...
in 2105 what was the five most frequent specimen tests given to patients in the same month after the diagnosis of immunotherapy encounter?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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_...
mimic_iii
CREATE TABLE table_1555308_1 ( prothrombin_time VARCHAR, platelet_count VARCHAR )
How many entries for prothrombin time are there where platelet count is 'decreased or unaffected'?
SELECT COUNT(prothrombin_time) FROM table_1555308_1 WHERE platelet_count = "Decreased or unaffected"
sql_create_context
CREATE TABLE table_3395 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
How many skip's are listed for 30 ends won?
SELECT COUNT("Skip (Club)") FROM table_3395 WHERE "Ends Won" = '30'
wikisql
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...
医疗就诊35250331641花费的医疗费总费用
SELECT qtb.MED_AMOUT FROM qtb WHERE qtb.MED_CLINIC_ID = '35250331641' UNION SELECT gyb.MED_AMOUT FROM gyb WHERE gyb.MED_CLINIC_ID = '35250331641' UNION SELECT zyb.MED_AMOUT FROM zyb WHERE zyb.MED_CLINIC_ID = '35250331641' UNION SELECT mzb.MED_AMOUT FROM mzb WHERE mzb.MED_CLINIC_ID = '35250331641'
css