context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
how many days have passed since the last time that patient 027-188709 has received a rbc laboratory test during the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-188709' AND patient.hosp...
eicu
CREATE TABLE table_name_25 ( stepping VARCHAR, release_date VARCHAR )
What is the stepping for the processor released June 5, 2007?
SELECT stepping FROM table_name_25 WHERE release_date = "june 5, 2007"
sql_create_context
CREATE TABLE table_52379 ( "Player" text, "Tackles" real, "Solo" real, "Assisted" real, "Sack" real, "Yards" real, "TD's" real )
How many yards for the player with 20 solo tackles and under 0 TDs?
SELECT SUM("Yards") FROM table_52379 WHERE "Solo" = '20' AND "TD's" < '0'
wikisql
CREATE TABLE table_name_10 ( date_of_inauguration VARCHAR, age_at_inauguration VARCHAR )
What is the Date of inauguration of the President with an Age at inauguration of 73years, 262days?
SELECT date_of_inauguration FROM table_name_10 WHERE age_at_inauguration = "73years, 262days"
sql_create_context
CREATE TABLE table_79987 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Where was the tournament played on Oct. 8, 2006?
SELECT "Tournament" FROM table_79987 WHERE "Date" = 'oct. 8, 2006'
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...
从01年3月9号到14年4月7号,患者姜和玉,836622这个指标怎么样
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_78153 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the date of the game with a goal of 7?
SELECT "Date" FROM table_78153 WHERE "Goal" = '7'
wikisql
CREATE TABLE table_1560673_1 ( first_season VARCHAR, club VARCHAR )
What was the first season for Syrianska FC
SELECT first_season FROM table_1560673_1 WHERE club = "Syrianska FC"
sql_create_context
CREATE TABLE table_44478 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the lowest Overall, when College is Hardin-Simmons, and when Round is greater than 26?
SELECT MIN("Overall") FROM table_44478 WHERE "College" = 'hardin-simmons' AND "Round" > '26'
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
How many different locations does each school have Show bar chart, and I want to sort by the X-axis in asc please.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY SCHOOL_CODE
nvbench
CREATE TABLE table_66105 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the away team when 6 was the tie no?
SELECT "Away team" FROM table_66105 WHERE "Tie no" = '6'
wikisql
CREATE TABLE table_33407 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text )
What was the most recent year when a g-force chassis started in 1st?
SELECT MAX("Year") FROM table_33407 WHERE "Start" = '1st' AND "Chassis" = 'g-force'
wikisql
CREATE TABLE table_60659 ( "Season" text, "League" text, "Finish" text, "Wins" text, "Losses" text, "Pct." text )
What is the number of wins in the playoffs league?
SELECT "Wins" FROM table_60659 WHERE "League" = 'playoffs'
wikisql
CREATE TABLE table_1161 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
What was the competition when there was no competition for mens doubles?
SELECT "Womens doubles" FROM table_1161 WHERE "Mens doubles" = 'No competition'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在2019-05-06之前,患者42116254有哪些住院就诊的检验报告单?看一下住院就诊流水号
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '42116254' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-05-06')
css
CREATE TABLE table_name_75 ( total VARCHAR, country VARCHAR )
What was England's total?
SELECT total FROM table_name_75 WHERE country = "england"
sql_create_context
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), ...
Show the number of documents created in each day and bin document date by weekday and group by document type with a stacked bar chart, and could you order Y in descending order?
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY COUNT(Document_Date) DESC
nvbench
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
Show the number of customers for different customer last name in a bar chart, show by the the number of customer last name in ascending.
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY COUNT(customer_last_name)
nvbench
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 diagnoses ( ...
what is death status of subject id 2560?
SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
Top 100 Users From The Philippines.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%philippines%' OR UPPER(Location) LIKE '%PHI' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_train_188 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
bmi of 25 _ 39.9 kg / m2 both inclusive.
SELECT * FROM table_train_188 WHERE body_mass_index_bmi > 25 AND body_mass_index_bmi < 39.9
criteria2sql
CREATE TABLE table_53675 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the average year they finished 5th in santiago, chile?
SELECT AVG("Year") FROM table_53675 WHERE "Position" = '5th' AND "Venue" = 'santiago, chile'
wikisql
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
How old is each gender, on average?
SELECT AVG(age), gender FROM person GROUP BY gender
spider
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
how many patients whose age is less than 67 and year of death is less than or equal to 2122?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "67" AND demographic.dod_year <= "2122.0"
mimicsql_data
CREATE TABLE table_name_52 ( grid INTEGER, laps VARCHAR, driver VARCHAR )
What is the lowest grid that has over 67 laps with stefan bellof driving?
SELECT MIN(grid) FROM table_name_52 WHERE laps > 67 AND driver = "stefan bellof"
sql_create_context
CREATE TABLE table_12441518_1 ( portrayed_by VARCHAR, character VARCHAR )
How many people named Nick Lucas are on the show?
SELECT COUNT(portrayed_by) FROM table_12441518_1 WHERE character = "Nick Lucas"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
how many times patient 15905 until 3 years ago visited the hospital.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 15905 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_name_88 ( casting_at__°c_ VARCHAR, hardness VARCHAR )
What is the casting temperature for a hardness of 22?
SELECT casting_at__°c_ FROM table_name_88 WHERE hardness = "22"
sql_create_context
CREATE TABLE table_name_72 ( frequency_mhz INTEGER, city_of_license VARCHAR )
What is the average Frequency MHz that is on farwell, texas?
SELECT AVG(frequency_mhz) FROM table_name_72 WHERE city_of_license = "farwell, texas"
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, ...
how many patients whose ethnicity is white 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.ethnicity = "WHITE" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_20704243_6 ( directed_by VARCHAR, original_air_date VARCHAR )
Who directed the episode that aired on july15,2012?
SELECT directed_by FROM table_20704243_6 WHERE original_air_date = "July15,2012"
sql_create_context
CREATE TABLE table_22170495_6 ( position_in_channel_4s_ratings_a VARCHAR, original_airing_on_channel_4 VARCHAR )
How many position in channel 4s ratings a have February 24, 2010 as the original airing on channel 4?
SELECT COUNT(position_in_channel_4s_ratings_a) FROM table_22170495_6 WHERE original_airing_on_channel_4 = "February 24, 2010"
sql_create_context
CREATE TABLE table_54287 ( "Name" text, "Model" text, "Park" text, "Country" text, "Opened" real )
What is the name of the roller coaster that opened in 2000 in Brighton Pier?
SELECT "Name" FROM table_54287 WHERE "Opened" = '2000' AND "Park" = 'brighton pier'
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...
count the number of patients whose primary disease is abdominal abscess and who have died in or before the year 2179.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.dod_year <= "2179.0"
mimicsql_data
CREATE TABLE table_45626 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What is the Date of the game where the Cavaliers have a Record of 15-27?
SELECT "Date" FROM table_45626 WHERE "Record" = '15-27'
wikisql
CREATE TABLE table_name_81 ( years_for_grizzlies VARCHAR, school_club_team VARCHAR )
What year did the Grizzlies play for the UNLV team?
SELECT years_for_grizzlies FROM table_name_81 WHERE school_club_team = "unlv"
sql_create_context
CREATE TABLE table_32123 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver drove a Ferrari in the 2007 European Grand Prix with a grid less than 3?
SELECT "Driver" FROM table_32123 WHERE "Constructor" = 'ferrari' AND "Grid" < '3'
wikisql
CREATE TABLE table_name_1 ( date VARCHAR, margin_of_victory VARCHAR )
What is Date, when Margin Of Victory is 4 Strokes?
SELECT date FROM table_name_1 WHERE margin_of_victory = "4 strokes"
sql_create_context
CREATE TABLE table_204_427 ( id number, "creature (other planes)" text, "page" text, "other appearances" text, "variants" text, "description" text )
how many creatures are included before page 42 ?
SELECT COUNT("creature (other planes)") FROM table_204_427 WHERE "page" < 42
squall
CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, Tourist_ID INTEGER, Visit_Date DATETIME, Visit_Details VARCHAR(40) ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Mark...
A bar chart for what are the number of the distinct visit dates?, and rank total number from low to high order.
SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY COUNT(Visit_Date)
nvbench
CREATE TABLE table_name_75 ( coach VARCHAR, most_improved VARCHAR )
Which Coach has a Most Improved of rory thompson?
SELECT coach FROM table_name_75 WHERE most_improved = "rory thompson"
sql_create_context
CREATE TABLE table_name_31 ( top_25 INTEGER, cuts_made INTEGER )
What is the fewest number of top-25s for events with more than 13 cuts made?
SELECT MIN(top_25) FROM table_name_31 WHERE cuts_made > 13
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
what is the five most commonly ordered procedure in patients aged 20s in 2104?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', treatment.treatmenttime) = '2104' GROUP BY treatment.t...
eicu
CREATE TABLE table_2846320_4 ( rival VARCHAR, first_meeting VARCHAR )
what are all the adversary where the beginning is 1899
SELECT rival FROM table_2846320_4 WHERE first_meeting = 1899
sql_create_context
CREATE TABLE table_18475946_2 ( erp__kw_ VARCHAR )
What are the 2fm's for erp 16?
SELECT 2 AS fm__mhz_ FROM table_18475946_2 WHERE erp__kw_ = "16"
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 fzzmzjzjlb ( HXPLC number, HZ...
患者编号是61727301,有哪些门诊就诊记录对应的检验报告单的报告日期均在03年9月15日以后?出门诊就诊流水号都列出来?
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '61727301' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2003-09-15') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE Customer_Orders ( customer_id VARCHAR, order_date INTEGER, order_status_code VARCHAR )
Find the ids of all distinct customers who made order after some orders that were Cancelled.
SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = "Cancelled")
sql_create_context
CREATE TABLE table_45180 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
what is the highest attendance for week 3?
SELECT MAX("Attendance") FROM table_45180 WHERE "Week" = '3'
wikisql
CREATE TABLE table_51056 ( "Channel" real, "Video" text, "Aspect" text, "PSIP Short Name" text, "Programming" text )
What is the PSIP Short name for the Channel that is less than 51.6?
SELECT "PSIP Short Name" FROM table_51056 WHERE "Channel" < '51.6'
wikisql
CREATE TABLE table_78885 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
What is the week 1 with candice hunnicutt in week 3?
SELECT "Week 1" FROM table_78885 WHERE "Week 3" = 'candice hunnicutt'
wikisql
CREATE TABLE table_14242137_4 ( oberliga_südwest VARCHAR, oberliga_bayern VARCHAR, season VARCHAR )
Name the oberliga sudwest for spvgg unterhaching for 1988-89
SELECT oberliga_südwest FROM table_14242137_4 WHERE oberliga_bayern = "SpVgg Unterhaching" AND season = "1988-89"
sql_create_context
CREATE TABLE table_name_26 ( opponent VARCHAR, date VARCHAR )
What opponent played on 07-09-2012?
SELECT opponent FROM table_name_26 WHERE date = "07-09-2012"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABL...
Most popular StackOverflow tags in 2011 & 2012.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND P...
sede
CREATE TABLE table_23281862_10 ( date VARCHAR, score VARCHAR )
Name the total number of date for score being l 106 116 (ot)
SELECT COUNT(date) FROM table_23281862_10 WHERE score = "L 106–116 (OT)"
sql_create_context
CREATE TABLE table_203_494 ( id number, "party" text, "votes" number, "%" number, "swing" number, "seats" number, "change" number )
how many votes were not attributed to the australian labor party ?
SELECT SUM("votes") FROM table_203_494 WHERE "party" <> 'australian labor party'
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...
Provide the number of urgent hospital admission patients who have syncope telemetry as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
mimicsql_data
CREATE TABLE table_30716 ( "First air date" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text )
What is the name of immunity when the finish is 3rd voted out day 9?
SELECT "Immunity" FROM table_30716 WHERE "Finish" = '3rd Voted Out Day 9'
wikisql
CREATE TABLE table_53677 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
Which country is Leo Najorda from?
SELECT "Country of origin*" FROM table_53677 WHERE "Player" = 'leo najorda'
wikisql
CREATE TABLE table_name_12 ( year VARCHAR, runner_up VARCHAR, winner VARCHAR, venue VARCHAR )
When is the winner olympiacos, the venue is georgios karaiskakis stadium and the runner-up is iraklis?
SELECT year FROM table_name_12 WHERE winner = "olympiacos" AND venue = "georgios karaiskakis stadium" AND runner_up = "iraklis"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
Death to 'Belongs on SF'. Comments from migrations into Server Fault about migrating to Server Fault
SELECT c.PostId AS "post_link", c.Text AS Commented FROM Comments AS C WHERE C.Text LIKE '%belongs on server fault%' OR C.Text LIKE '%belongs on serverfault%' OR C.Text LIKE '%belongs on sf%' ORDER BY c.CreationDate DESC LIMIT 300
sede
CREATE TABLE table_62103 ( "Club" text, "Season's Last Head Coach" text, "City" text, "Stadium" text, "2004-2005 season" text )
What is the stadium for the city of Braga?
SELECT "Stadium" FROM table_62103 WHERE "City" = 'braga'
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 demographic (...
what number of patients who had exteriorization of small intestine stayed in the hospital for more than 2 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.long_title = "Exteriorization of small intestine"
mimicsql_data
CREATE TABLE t_kc21 ( 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, ...
在05年4月2日到17年9月13日期间,看看医院9519124的小儿青光眼科科室涉及的医疗总额有多少
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9519124' AND t_kc21.MED_ORG_DEPT_NM = '小儿青光眼科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-04-02' AND '2017-09-13'
css
CREATE TABLE table_71970 ( "Call sign" text, "Frequency" text, "City of license" text, "Facility ID" real, "ERP / Power W" real, "Height m ( ft )" text, "Class" text )
Name the city of license with frequency of 90.1 fm
SELECT "City of license" FROM table_71970 WHERE "Frequency" = '90.1 fm'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
How many of the patients admitted before the year 2180 had a liver transplant ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.admityear < "2180"
mimicsql_data
CREATE TABLE table_name_65 ( score VARCHAR, tie_no VARCHAR )
What is the score when the tie no is 29?
SELECT score FROM table_name_65 WHERE tie_no = "29"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
在医疗就诊37475427497中,为病患96815436的检验报告做审核的人员姓名及工号
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '37475427497'
css
CREATE TABLE table_name_78 ( date VARCHAR, game VARCHAR )
On what day was Game 7 of this season played?
SELECT date FROM table_name_78 WHERE game = "game 7"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
how many patients received chest x-ray within 2 months after being diagnosed with hypoxemia since 2 years ago?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoxemia' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT ...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
when was the last time patient 007-9853 had been prescribed senna-docusate and chlorhexidine gluconate ud liq 15ml at the same time in 10/2102?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'senna-docusate' AND patient.uniquepid = '007-9853' AND STRFTIME('%y-%m', medication.drugstarttime) = '2102-10') AS t1 JOI...
eicu
CREATE TABLE table_20712 ( "Number in series" real, "Broadcast Order" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production Code" real )
Who directed the episode with the production code 209?
SELECT "Directed by" FROM table_20712 WHERE "Production Code" = '209'
wikisql
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
门诊诊断病人方鹏云为精神分裂症的检测指标162731的结果定量及其单位各是什么呀?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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.JZ...
css
CREATE TABLE table_1930857_1 ( language VARCHAR, year_founded VARCHAR )
What's the language of the school founded in 1949?
SELECT language FROM table_1930857_1 WHERE year_founded = "1949"
sql_create_context
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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
Get the number of posts there are.
SELECT COUNT(Votes.Id) FROM Votes WHERE VoteTypeId = 4
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
Are there any Adv Hlth Assess courses of 18 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Adv Hlth Assess%' OR name LIKE '%Adv Hlth Assess%') AND credits = 18
advising
CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE students ( student...
What is the name of each course and the corresponding number of student enrollment?
SELECT T1.course_name, COUNT(*) FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name
spider
CREATE TABLE table_name_39 ( year INTEGER, album___song VARCHAR )
What year was the Album/Song Speaking louder than before?
SELECT SUM(year) FROM table_name_39 WHERE album___song = "speaking louder than before"
sql_create_context
CREATE TABLE table_name_65 ( attendance VARCHAR, date VARCHAR )
What was the Attendance on November 6, 1960?
SELECT attendance FROM table_name_65 WHERE date = "november 6, 1960"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
how many times lactated ringers iv : 1000 ml bag is prescribed?
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'lactated ringers iv : 1000 ml bag'
eicu
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...
Show me about the distribution of name and meter_100 in a bar chart, and display y axis in asc order.
SELECT name, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the difference between germany and spains total medals ?
SELECT (SELECT "total" FROM table_203_374 WHERE "nation" = 'germany') - (SELECT "total" FROM table_203_374 WHERE "nation" = 'spain')
squall
CREATE TABLE table_name_58 ( damage__millions_usd__ VARCHAR, storm_name VARCHAR )
What is the damage of storm three?
SELECT damage__millions_usd__ FROM table_name_58 WHERE storm_name = "three"
sql_create_context
CREATE TABLE table_name_42 ( total INTEGER, first VARCHAR )
What was the total when the first was November 1966?
SELECT SUM(total) FROM table_name_42 WHERE first = "november 1966"
sql_create_context
CREATE TABLE table_22156 ( "Year (Ceremony)" text, "Original title" text, "Film title used in nomination" text, "Director" text, "Result" text )
Name the total number of director for oro diablo
SELECT COUNT("Director") FROM table_22156 WHERE "Original title" = 'Oro Diablo'
wikisql
CREATE TABLE table_26584 ( "Processor" text, "Brand Name" text, "Model (list)" text, "Cores" real, "L2 Cache" text, "Socket" text, "TDP" text )
what is the name of the processor for model x33x0?
SELECT "Processor" FROM table_26584 WHERE "Model (list)" = 'X33x0'
wikisql
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text )
which envoy was the first appointed by woodrow wilson ?
SELECT "representative" FROM table_203_778 WHERE "appointed by" = 'woodrow wilson' ORDER BY "termination\nof mission" LIMIT 1
squall
CREATE TABLE table_2850912_10 ( nhl_team VARCHAR, player VARCHAR )
Which team drafted Michael Orn?
SELECT nhl_team FROM table_2850912_10 WHERE player = "Michael Orn"
sql_create_context
CREATE TABLE table_21636599_2 ( security_forces VARCHAR, period VARCHAR )
How many figures are named for security forces in 1998?
SELECT COUNT(security_forces) FROM table_21636599_2 WHERE period = 1998
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...
Show sum team id from each all home, and list Y in ascending order.
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID)
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
until 1 year ago, what are the four most frequent medications prescribed within 2 months to the patients aged 40s after they have been diagnosed with seizures?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'seizures' AND DATETIME(diagnosis.diagnosistime) <=...
eicu
CREATE TABLE table_name_57 ( february INTEGER, opponent VARCHAR )
What day in February had an opponent of @ Colorado Rockies?
SELECT SUM(february) FROM table_name_57 WHERE opponent = "@ colorado rockies"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
TOP VBA PERFORMERS for date range. Top VBA/Excel Users for specified date range (or enter 0 in both for 'last 10 days with data'). Ranked by Overall: Sum of ( comments + score + (Answers * 2) )
SELECT c.UserId, COUNT(c.Id) AS qComments FROM Comments AS c JOIN Posts AS q ON c.PostId = q.Id WHERE c.CreationDate >= DATEADD(d, -10, (SELECT MAX(CreationDate) FROM Posts)) AND (q.Tags LIKE '%vba>%' OR q.Tags LIKE '%excel%') GROUP BY c.UserId ORDER BY COUNT(c.Id) DESC
sede
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
what is the average total cost of a hospital that includes a medicine called heparin flush since 2102?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'heparin flush') AND STRFTIME('%y', cost.chargetime) >= '2102' GROUP BY cost.hadm_id) AS t1
mimic_iii
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...
在06-12-30到18-12-15内,患者38274476被开出的哪些药品,把所有药品的编码、名称、数量、单价、金额列出来
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '38274476' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-12-30' AND '2018-12-15'
css
CREATE TABLE table_1028356_3 ( score VARCHAR, opponents VARCHAR )
What is the score of the match with opponents Gretchen Magers Kelly Jones?
SELECT score FROM table_1028356_3 WHERE opponents = "Gretchen Magers Kelly Jones"
sql_create_context
CREATE TABLE table_80233 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the most points when Maserati made the engine, and a Entrant of owen racing organisation?
SELECT MAX("Points") FROM table_80233 WHERE "Engine" = 'maserati' AND "Entrant" = 'owen racing organisation'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
Dead users with less than 200 rep, grouped by month they joined.
SELECT YEAR(Users.CreationDate), MONTH(Users.CreationDate), COUNT(Users.CreationDate) FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Users.Reputation < 200 GROUP BY YEAR(Users.CreationDate), MONTH(Users.CreationDate) ORDER BY YEAR(Users.CreationDate), MONTH(Users.CreationDate)
sede
CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text )
Sort all captain names by their ages from old to young.
SELECT name FROM captain ORDER BY age DESC
spider
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...
在18625680009医疗就诊的时候其个人自理的金额有多少钱?
SELECT PER_SOL FROM t_kc24 WHERE MED_CLINIC_ID = '18625680009'
css
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE certificate ( eid number, aid number )...
Return the minimum, average and maximum distances traveled across all aircrafts.
SELECT MIN(distance), AVG(distance), MAX(distance) FROM aircraft
spider