context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedA...
Posts that link to reddit.com.
SELECT CreationDate, Id AS "post_link" FROM Posts WHERE LOWER(Body) LIKE '%reddit.com%' OR LOWER(Body) LIKE '%redd.it%' ORDER BY CreationDate DESC LIMIT 1000
sede
CREATE TABLE table_name_97 ( points_difference VARCHAR, drawn VARCHAR, points VARCHAR, lost VARCHAR )
What is the difference associated with more than 2 points, fewer than 3 losses, and fewer than 1 draw?
SELECT points_difference FROM table_name_97 WHERE points > 2 AND lost < 3 AND drawn < 1
sql_create_context
CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
What are the names of reviewers who had rated 3 star and 4 star?
SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 4
spider
CREATE TABLE table_1342315_17 ( district VARCHAR, incumbent VARCHAR )
How many districts for ren l. derouen?
SELECT COUNT(district) FROM table_1342315_17 WHERE incumbent = "René L. DeRouen"
sql_create_context
CREATE TABLE table_26198709_1 ( production_code VARCHAR, us_viewers__million_ VARCHAR )
What is the production code for the episode that had 18.07 million viewers?
SELECT production_code FROM table_26198709_1 WHERE us_viewers__million_ = "18.07"
sql_create_context
CREATE TABLE table_24852 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Who is the manufacturer when 150.088 is the average speed (mph)?
SELECT "Manufacturer" FROM table_24852 WHERE "Average Speed (mph)" = '150.088'
wikisql
CREATE TABLE table_name_21 ( goals_against INTEGER, position VARCHAR, points VARCHAR, club VARCHAR )
What is the highest Goals Against, when Points is greater than 25, when Club is 'SD Indautxu', and when Position is greater than 3?
SELECT MAX(goals_against) FROM table_name_21 WHERE points > 25 AND club = "sd indautxu" AND position > 3
sql_create_context
CREATE TABLE table_1651764_3 ( vacator VARCHAR, district VARCHAR )
who is the vacator whre the district is new jersey 2nd?
SELECT vacator FROM table_1651764_3 WHERE district = "New Jersey 2nd"
sql_create_context
CREATE TABLE table_name_57 ( name VARCHAR, marriage VARCHAR )
Who had a disputed marriage?
SELECT name FROM table_name_57 WHERE marriage = "disputed"
sql_create_context
CREATE TABLE d_icd_procedures ( 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 procedures_icd ( row_id number, subject_id number,...
what are the new drugs prescribed to patient 31854 today compared to that yesterday?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
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...
经过门诊诊断确诊为疾病J15.862的那个编号为93176419的患者的检测指标694263的结果定量及其单位分别是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE table_63090 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How much Total has a Rank of 5, and a Bronze larger than 3?
SELECT SUM("Total") FROM table_63090 WHERE "Rank" = '5' AND "Bronze" > '3'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_ca...
until 2102, what was the three most frequently ordered procedure for patients 30s?
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 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...
有多少检验报告单是病人48698459在00年9月24日到2010年6月21日内开出其科室编码以及名称都是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '48698459' AND jybgb.BGRQ BETWEEN '2000-09-24...
css
CREATE TABLE table_59854 ( "Year" real, "Song" text, "Artist" text, "Place" text, "Points" text, "Composer" text )
What year shows 248 (sf: 217) points?
SELECT COUNT("Year") FROM table_59854 WHERE "Points" = '248 (sf: 217)'
wikisql
CREATE TABLE table_204_738 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text )
what is the first year they scored 6th position in tier 3 division 3 ?
SELECT MIN("season") FROM table_204_738 WHERE "position" = 6 AND "level" = 3 AND "division" = 3
squall
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
calculate the one year survival rate among the patients who were prescribed albumin 5% (12.5 g) after they were diagnosed with nb obsrv suspct infect.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_22871239_5 ( score VARCHAR, team VARCHAR )
What was the score when the team was @ New Jersey?
SELECT score FROM table_22871239_5 WHERE team = "@ New Jersey"
sql_create_context
CREATE TABLE table_58251 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Which Date has an Attendance of 9,535?
SELECT "Date" FROM table_58251 WHERE "Attendance" = '9,535'
wikisql
CREATE TABLE table_51020 ( "Match" real, "Date" text, "Tournament" text, "Location" text, "Opponent team" text, "Score" text )
Where is the location of the friendly match larger than 1 where the Super Reds were the opponent?
SELECT "Location" FROM table_51020 WHERE "Match" > '1' AND "Tournament" = 'friendly' AND "Opponent team" = 'super reds'
wikisql
CREATE TABLE table_name_58 ( home VARCHAR, ground VARCHAR, time VARCHAR )
What is Home, when Ground is Humber College North, and when Time is 15:00?
SELECT home FROM table_name_58 WHERE ground = "humber college north" AND time = "15:00"
sql_create_context
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 TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Draw a bar chart about the distribution of name and meter_100 , and list in asc by the total number.
SELECT name, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what was the medication patient 013-33898 had been prescribed two or more times during this month?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013...
eicu
CREATE TABLE table_40316 ( "Season" text, "Conference" text, "Division" text, "Finish" text, "Wins" text, "Losses" text, "Win%" text, "Awards" text )
Where the wins are 46, what is the win%?
SELECT "Win%" FROM table_40316 WHERE "Wins" = '46'
wikisql
CREATE TABLE table_18945 ( "Asset Acquired" text, "Acquired From" text, "Date Announced" text, "Date Completed" text, "Reported Cost" text )
What was the reported cost of the asset acquired from Standard & Poor's?
SELECT "Reported Cost" FROM table_18945 WHERE "Acquired From" = 'Standard & Poor''s'
wikisql
CREATE TABLE table_name_49 ( studio VARCHAR, gross VARCHAR )
WHAT IS THE STUDIO WITH A GROSS $81,198,894?
SELECT studio FROM table_name_49 WHERE gross = "$81,198,894"
sql_create_context
CREATE TABLE table_name_8 ( total INTEGER, parallel_bars VARCHAR )
With a parallel bars score of 14.625 what is the average total?
SELECT AVG(total) FROM table_name_8 WHERE parallel_bars = "14.625"
sql_create_context
CREATE TABLE table_19744915_16 ( result VARCHAR, judges VARCHAR )
What is the result of judge 6?
SELECT result FROM table_19744915_16 WHERE judges = 6
sql_create_context
CREATE TABLE table_name_72 ( week VARCHAR, opponent VARCHAR )
How many weeks total did the New York Jets face the Pittsburgh Steelers?
SELECT COUNT(week) FROM table_name_72 WHERE opponent = "pittsburgh steelers"
sql_create_context
CREATE TABLE table_23292220_7 ( seans_team VARCHAR, first_broadcast VARCHAR )
Name the seans team being 13 november 2008
SELECT seans_team FROM table_23292220_7 WHERE first_broadcast = "13 November 2008"
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
病患00922703的检验结果指标均正常的检验报告单号是什么
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '00922703' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId nu...
Answer Rate for Lex Question.
WITH diffs AS (SELECT CAST(a.CreationDate - Question.CreationDate AS FLOAT) AS d FROM Posts AS Question JOIN Posts AS a ON a.Id = Question.AcceptedAnswerId WHERE (Question.Tags LIKE '%<amazon-lex%' OR Question.Tags LIKE '%<aws-lex%') AND Question.CreationDate >= '2019-01-01') SELECT AVG(d), STDEV(d) FROM diffs
sede
CREATE TABLE table_name_1 ( location VARCHAR, year VARCHAR, country VARCHAR )
What is the location for Yemen in 1994?
SELECT location FROM table_name_1 WHERE year = "1994" AND country = "yemen"
sql_create_context
CREATE TABLE table_8610 ( "Model Number" text, "Frequency" text, "L2-Cache" text, "Front Side Bus" text, "Multiplier" text, "Voltage" text, "Socket" text )
What is the multiplier for the processor with a frequency of 733MHz?
SELECT "Multiplier" FROM table_8610 WHERE "Frequency" = '733mhz'
wikisql
CREATE TABLE table_name_79 ( centerfold_model VARCHAR, date VARCHAR )
Who was the Centerfold Model on 9-03?
SELECT centerfold_model FROM table_name_79 WHERE date = "9-03"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
what airlines go from ATLANTA to BALTIMORE
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
atis
CREATE TABLE table_name_93 ( laps INTEGER, manufacturer VARCHAR, grid VARCHAR )
Which Laps have a Manufacturer of suzuki, and a Grid smaller than 16?
SELECT MAX(laps) FROM table_name_93 WHERE manufacturer = "suzuki" AND grid < 16
sql_create_context
CREATE TABLE table_name_38 ( year_built VARCHAR, length VARCHAR )
Where the length is 91', what is the year built?
SELECT year_built FROM table_name_38 WHERE length = "91'"
sql_create_context
CREATE TABLE table_38516 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Margin of victory has a Runner(s)-up of buddy gardner?
SELECT "Margin of victory" FROM table_38516 WHERE "Runner(s)-up" = 'buddy gardner'
wikisql
CREATE TABLE table_4379 ( "Model" text, "Build year" text, "Top speed (In operation) \uff08km/h\uff09" real, "Power output \uff08kW\uff09" text, "Builder" text, "Total production" real )
Tell me the model for total production of 1347
SELECT "Model" FROM table_4379 WHERE "Total production" = '1347'
wikisql
CREATE TABLE table_name_9 ( week INTEGER, date VARCHAR )
What was the attendance on October 27, 1968?
SELECT MAX(week) FROM table_name_9 WHERE date = "october 27, 1968"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
Amount of users who's last activity was during that month.
SELECT Month = DATEADD(MONTH, DATEDIFF(MONTH, 0, Last_activity), 0), 'Lost members' = COUNT(activity.UserId) FROM (SELECT UserId, Last_activity = MAX(Date) FROM Badges INNER JOIN Users ON Badges.UserId = Users.Id GROUP BY UserId) AS activity GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, Last_activity), 0) ORDER BY Month
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
did patient 012-14774 ever undergo pulmonary artery catheter placement?
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 = '012-14774')) AND treatment.treatmentname = 'pulmonary artery catheter placem...
eicu
CREATE TABLE table_name_13 ( building VARCHAR, year VARCHAR, floors VARCHAR )
For the Year 2013 what building(s) had less than 20 Floors?
SELECT building FROM table_name_13 WHERE year = "2013" AND floors < 20
sql_create_context
CREATE TABLE table_30120761_1 ( townland VARCHAR, area__acres__ VARCHAR )
What are all of the townlands that have exactly 131 acres.
SELECT townland FROM table_30120761_1 WHERE area__acres__ = 131
sql_create_context
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 int, weight int, capacity int, pay_load int, cruising_speed int, range_...
i need your help with information on ground transportation from the airport in PHILADELPHIA to downtown
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND ground_service.airport_code = airport.airport_code
atis
CREATE TABLE table_77503 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What is the High rebounds with a Series with 4 2?
SELECT "High rebounds" FROM table_77503 WHERE "Series" = '4–2'
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 ...
when is the last time that patient 19147 has had a heart rate measured on 04/05/2105?
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 = 19147)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
mimic_iii
CREATE TABLE table_37511 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the Attendance on Week 8?
SELECT AVG("Attendance") FROM table_37511 WHERE "Week" = '8'
wikisql
CREATE TABLE table_23285805_8 ( team VARCHAR, location_attendance VARCHAR )
Which team has the location attendance of American Airlines Center 19954?
SELECT team FROM table_23285805_8 WHERE location_attendance = "American Airlines Center 19954"
sql_create_context
CREATE TABLE table_name_13 ( date VARCHAR, race_title VARCHAR )
When did the Grand Prix de Monaco race?
SELECT date FROM table_name_13 WHERE race_title = "grand prix de monaco"
sql_create_context
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHA...
Show the number of document type for different document type description in a bar chart, and I want to order x axis in desc order.
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY Document_Type_Description DESC
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 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 drug code is clin150 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "CLIN150" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
五氟利多片(糖衣)在医疗机构7252912的检查记录有多少?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7252912' AND t_kc22.SOC_SRT_DIRE_NM = '五氟利多片(糖衣)' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '7252912' AND t_kc22.SOC_S...
css
CREATE TABLE table_1511 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
How many draft picks are there at the linebacker position?
SELECT COUNT("Pick #") FROM table_1511 WHERE "Position" = 'Linebacker'
wikisql
CREATE TABLE table_17386066_2 ( opponent VARCHAR, stadium VARCHAR )
Who is the opposing team when the game was played on the Shea Stadium?
SELECT opponent FROM table_17386066_2 WHERE stadium = "Shea stadium"
sql_create_context
CREATE TABLE table_name_51 ( try_bonus VARCHAR, losing_bonus VARCHAR, points_for VARCHAR )
What is Try Bonus, when Losing Bonus is '1', and when Points For is '179'?
SELECT try_bonus FROM table_name_51 WHERE losing_bonus = "1" AND points_for = "179"
sql_create_context
CREATE TABLE table_9461 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the fewest losses for teams with points of 53 and more than 73 goals for?
SELECT MIN("Lost") FROM table_9461 WHERE "Points 1" = '53' AND "Goals For" > '73'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
how many hours has passed since patient 99883 last stayed on the current hospital visit in ward 57?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL)) AND transfers...
mimic_iii
CREATE TABLE table_22031 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
If the home is Atl tico Tucum n, what is the name of the first leg?
SELECT "1st Leg" FROM table_22031 WHERE "Home (2nd leg)" = 'Atlético Tucumán'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how patient 012-68650 first entered the hospital during the previous year?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '012-68650' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_58 ( fourth_place VARCHAR, year VARCHAR )
What is the Fourth place with a Year that is 1978?
SELECT fourth_place FROM table_name_58 WHERE year = 1978
sql_create_context
CREATE TABLE table_76358 ( "Poll Source" text, "Dates administered" text, "Democrat: John Kerry" text, "Republican: Jeff Beatty" text, "Lead Margin" real )
What percent is the lead margin of 25 that Republican: Jeff Beatty has according to poll source Rasmussen Reports?
SELECT "Republican: Jeff Beatty" FROM table_76358 WHERE "Lead Margin" = '25' AND "Poll Source" = 'rasmussen reports'
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 ...
how many patients whose admission year is less than 2177 and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2177" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_32830 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the week more than 58,675 attended on october 22, 1995?
SELECT SUM("Week") FROM table_32830 WHERE "Attendance" > '58,675' AND "Date" = 'october 22, 1995'
wikisql
CREATE TABLE table_29054 ( "District" real, "Region" text, "Communes" text, "Population (2002 census)" real, "% of total population" text, "VAP" real, "Enrolled" real, "Total votes" real, "Valid votes" real, "Turnout" text, "E/VAP" text, "T/VAP" text, "V/VAP" text )
How many total votes values are associated with t/vap values of 45.3%?
SELECT COUNT("Total votes") FROM table_29054 WHERE "T/VAP" = '45.3%'
wikisql
CREATE TABLE table_10023387_1 ( singles_w_l VARCHAR, doubles_w_l VARCHAR, total_w_l VARCHAR )
what's the total number of singles w-l with doubles w-l of 0 0 and total w-l of 3 1
SELECT COUNT(singles_w_l) FROM table_10023387_1 WHERE doubles_w_l = "0–0" AND total_w_l = "3–1"
sql_create_context
CREATE TABLE table_16433 ( "English name" text, "Original name" text, "Area in km\u00b2" text, "Population at 2010 Census" real, "Number of settlements and villages" real )
What is the original name of the district with the current English name of South Bogor?
SELECT "Original name" FROM table_16433 WHERE "English name" = 'South Bogor'
wikisql
CREATE TABLE table_name_9 ( bronze INTEGER, gold VARCHAR, rank VARCHAR )
How many bronzes for the nation with 2 golds and ranked below 2?
SELECT SUM(bronze) FROM table_name_9 WHERE gold = 2 AND rank > 2
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
看看编号43758538285的检验报告单是哪个机构报告的,代码及名称分别是什么
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '43758538285'
css
CREATE TABLE table_35402 ( "Region" text, "Employment ( salaries & wages)" text, "Self employed" text, "Investment income" text, "Working tax credit" text, "State pensions" text, "Occupational pensions" text, "Disability benefits" text, "Other social security benefits" text, "Oth...
Employment ( salaries & wages) of 64%, and a Occupational pensions of 6% has what working tax credit?
SELECT "Working tax credit" FROM table_35402 WHERE "Employment ( salaries & wages)" = '64%' AND "Occupational pensions" = '6%'
wikisql
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
Find the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties?
SELECT T2.comptroller FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T1.district = 1 OR T1.district = 2
spider
CREATE TABLE diagnoses_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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id n...
what is the unabbreviated version of the burn nos finger w thumb?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'burn nos finger w thumb' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'burn nos finger w thumb'
mimic_iii
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
How old is the average person for each job. Show bar chart.
SELECT job, AVG(age) FROM Person GROUP BY job
nvbench
CREATE TABLE table_52622 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the total Crowd number for the Away team of Hawthorn?
SELECT COUNT("Crowd") FROM table_52622 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_204_822 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country was first in rank at the 1972 olympics ?
SELECT "nation" FROM table_204_822 WHERE "rank" = 1
squall
CREATE TABLE table_204_802 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "date" text )
how many replays were there in the first round proper , november 1988 ?
SELECT COUNT(*) FROM table_204_802 WHERE "tie no" = 'replay'
squall
CREATE TABLE table_4190 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What is the maximum season that has exactly 2 podiums?
SELECT MAX("Season") FROM table_4190 WHERE "Podiums" = '2'
wikisql
CREATE TABLE railway ( railway_id number, railway text, builder text, built text, wheels text, location text, objectnumber text ) CREATE TABLE railway_manage ( railway_id number, manager_id number, from_year text ) CREATE TABLE manager ( manager_id number, name text, ...
Show different locations of railways along with the corresponding number of railways at each location.
SELECT location, COUNT(*) FROM railway GROUP BY location
spider
CREATE TABLE View_Product_Availability ( product_id INTEGER, booking_id INTEGER, status_date DATETIME, available_yn VARCHAR(1) ) CREATE TABLE Discount_Coupons ( coupon_id INTEGER, date_issued DATETIME, coupon_amount DECIMAL(19,4) ) CREATE TABLE Products_for_Hire ( product_id INTEGER, ...
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a line chart
SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' GROUP BY payment_date
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the average of manufacturer , and group by attribute headquarter, and sort in ascending by the Headquarter.
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE Problems ( problem_id INTEGER, product_id INTEGER, closure_authorised_by_staff_id INTEGER, reported_by_staff_id INTEGER, date_problem_reported DATETIME, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255) ) CREATE TABLE Staff (...
Bar chart x axis log entry description y axis the number of log entry description, and I want to display in descending by the bar please.
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY log_entry_description DESC
nvbench
CREATE TABLE table_name_26 ( city VARCHAR, prize VARCHAR )
What is the City, when the Prize is 880,000?
SELECT city FROM table_name_26 WHERE prize = "€880,000"
sql_create_context
CREATE TABLE table_204_760 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
what was the first competition this competitor competed in ?
SELECT "competition" FROM table_204_760 ORDER BY "year" LIMIT 1
squall
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 the number of patients whose procedure icd9 code is 5114?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5114"
mimicsql_data
CREATE TABLE table_19550 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
what's the college/junior/club team with nhl team being california golden seals
SELECT "College/junior/club team" FROM table_19550 WHERE "NHL team" = 'California Golden Seals'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
calculate the maximum age of male patients who were admitted for 29 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "29"
mimicsql_data
CREATE TABLE table_name_22 ( total INTEGER, bronze VARCHAR, gold VARCHAR )
How many totals have a Bronze of 0, and a Gold smaller than 0?
SELECT SUM(total) FROM table_name_22 WHERE bronze = 0 AND gold < 0
sql_create_context
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...
从16年5月5日到21年10月18日之中患者华萍雅自己的医保的账户支出总共多少钱?
SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2016-05-05' AND '2021-10-18'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
what did patient 017-45919 have last as the output during the previous day?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-45919')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
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...
calculate the average age of patients with sepsis primary disease who are 72 years of age or more.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.age >= "72"
mimicsql_data
CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate n...
What are the countries of markets and their corresponding years of market estimation?
SELECT T2.country, T1.year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id
spider
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
Draw a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12
nvbench
CREATE TABLE table_10742 ( "Player" text, "Team" text, "Date" text, "Opposition" text, "Game" text, "D\u00e9but" real )
What is the year of debut when Tom Feeney plays for the Waterford team?
SELECT "D\u00e9but" FROM table_10742 WHERE "Team" = 'waterford' AND "Player" = 'tom feeney'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
Top 150 Users from Bangalore,India.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangalore%' ORDER BY Reputation DESC LIMIT 150
sede
CREATE TABLE table_11621747_1 ( tournament VARCHAR )
How many prizes were there at the transamerica?
SELECT COUNT(1 AS st_prize__) AS $__ FROM table_11621747_1 WHERE tournament = "The Transamerica"
sql_create_context
CREATE TABLE table_34598 ( "Number" real, "Name" text, "Position" text, "Height" text, "Weight" real, "Class" text, "Hometown" text )
Name of byron geis, and a Weight smaller than 195 involves what average number?
SELECT AVG("Number") FROM table_34598 WHERE "Name" = 'byron geis' AND "Weight" < '195'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose gender is f and drug name is nitroglycerin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Nitroglycerin"
mimicsql_data
CREATE TABLE table_18064020_21 ( brup VARCHAR, name VARCHAR )
What is the total brup for the team?
SELECT brup FROM table_18064020_21 WHERE name = "total"
sql_create_context
CREATE TABLE table_73757 ( "Season" real, "Winner" text, "Runner-Up" text, "Third Place" text, "Contestants" real )
In what season did Raquel Pacheco finish in third place?
SELECT "Season" FROM table_73757 WHERE "Third Place" = 'Raquel Pacheco'
wikisql