context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date...
Trend for relevant questions (Tag and Searchstring).
SELECT COUNT(UniqueId), WeekStart FROM (SELECT Posts.Id AS UniqueId, DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS WeekStart FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = @Tag AND (Posts.Body LIKE @Searchstring O...
sede
CREATE TABLE table_name_52 ( tie_no VARCHAR, home_team VARCHAR )
what is the tie number that has Portsmouth Home team
SELECT tie_no FROM table_name_52 WHERE home_team = "portsmouth"
sql_create_context
CREATE TABLE table_60415 ( "Knight" text, "Weapon/item" text, "External weapon" text, "Shield animal" text, "Cart" text )
What cart has a serpent shield animal?
SELECT "Cart" FROM table_60415 WHERE "Shield animal" = 'serpent'
wikisql
CREATE TABLE table_13476 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Serial numbers" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What is the quantity made number for the quantity preserved 4-6-0 ooooo ten-wheeler?
SELECT "Quantity made" FROM table_13476 WHERE "Quantity preserved" = '4-6-0 — ooooo — ten-wheeler'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
what are the procedures that are the top four most common in 2100?
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 STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ...
mimic_iii
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 prescriptions ( row_id number, subject_id number, h...
what is the name of the procedure that patient 1912 has undergone two times in 02/last year?
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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 191...
mimic_iii
CREATE TABLE table_name_92 ( award VARCHAR, role VARCHAR, year VARCHAR )
Which award was given for the role of Elphaba in 2009?
SELECT award FROM table_name_92 WHERE role = "elphaba" AND year = "2009"
sql_create_context
CREATE TABLE table_76719 ( "Newspaper/Magazine" text, "Type" text, "Language" text, "Headquarter" text, "Status" text )
What is Headquarter, when Newspaper/Magazine is Al-Ayyam?
SELECT "Headquarter" FROM table_76719 WHERE "Newspaper/Magazine" = 'al-ayyam'
wikisql
CREATE TABLE table_58653 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the Score when the set 3 is 26 28?
SELECT "Score" FROM table_58653 WHERE "Set 3" = '26–28'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id...
Search for posts by deleted user.
SELECT CreationDate, Id AS "post_link" FROM Posts AS p WHERE OwnerDisplayName = '##Name:string##' ORDER BY CreationDate
sede
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiolo...
tell me the time of hospital admission of patient 51577 until 2104?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 51577 AND STRFTIME('%y', admissions.admittime) <= '2104'
mimic_iii
CREATE TABLE table_name_8 ( drawn INTEGER, played INTEGER )
What is the largest drawn that has a played less than 38?
SELECT MAX(drawn) FROM table_name_8 WHERE played < 38
sql_create_context
CREATE TABLE table_25180 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
How many locations are listed for the winner Temple?
SELECT COUNT("Tournament Venue (City)") FROM table_25180 WHERE "Tournament Winner" = 'Temple'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
provide the number of patients whose primary disease is newborn and year of death is less than or equal to 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year <= "2112.0"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在编号为6439728的医院的入院诊断为颅脑外伤所致的精神障碍的医疗记录中,最少和最多的医疗费总额分别是多少
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '6439728' AND IN_DIAG_DIS_NM = '颅脑外伤所致的精神障碍')
css
CREATE TABLE table_61292 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
Who is week 1 if week 3 is Natasha Budhi?
SELECT "Week 1" FROM table_61292 WHERE "Week 3" = 'natasha budhi'
wikisql
CREATE TABLE table_49891 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text )
What college was the draft pick from who plays center position?
SELECT "College" FROM table_49891 WHERE "Position" = 'center'
wikisql
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name
nvbench
CREATE TABLE table_name_59 ( pick__number INTEGER, college VARCHAR, overall VARCHAR )
How many Picks have a College of tennessee, and an Overall smaller than 270?
SELECT SUM(pick__number) FROM table_name_59 WHERE college = "tennessee" AND overall < 270
sql_create_context
CREATE TABLE table_name_28 ( pole_position VARCHAR, race VARCHAR )
What is the Pole Position of the Brazilian Grand Prix race?
SELECT pole_position FROM table_name_28 WHERE race = "brazilian grand prix"
sql_create_context
CREATE TABLE table_9451 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Home Team, when Date is 18 February 1956, and when Tie No is 3?
SELECT "Home team" FROM table_9451 WHERE "Date" = '18 february 1956' AND "Tie no" = '3'
wikisql
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 PostFeedback ( Id number, PostId number, IsAnonymous...
Close votes on Tag X.
SELECT Posts.Id AS "post_link" FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = '##Tag:string##' AND Posts.CreationDate > DATEADD(year, -1, GETDATE())
sede
CREATE TABLE table_7899 ( "Week" real, "Date" text, "TV Time" text, "Opponent" text, "Result" text )
How many weeks has the opponent been san francisco 49ers?
SELECT COUNT("Week") FROM table_7899 WHERE "Opponent" = 'san francisco 49ers'
wikisql
CREATE TABLE table_name_20 ( date_of_birth__age_ VARCHAR, position VARCHAR, caps VARCHAR )
When was the lock with 10 caps born?
SELECT date_of_birth__age_ FROM table_name_20 WHERE position = "lock" AND caps = 10
sql_create_context
CREATE TABLE table_62553 ( "Year" real, "Milan \u2013 San Remo" text, "Tour of Flanders" text, "Paris\u2013Roubaix" text, "Li\u00e8ge\u2013Bastogne\u2013Li\u00e8ge" text, "Giro di Lombardia" text )
Which Giro di Lombardia has a Paris Roubaix of servais knaven ( ned )?
SELECT "Giro di Lombardia" FROM table_62553 WHERE "Paris\u2013Roubaix" = 'servais knaven ( ned )'
wikisql
CREATE TABLE table_204_308 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
country with the most bronze medals .
SELECT "nation" FROM table_204_308 ORDER BY "bronze" DESC LIMIT 1
squall
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARC...
Return a histogram on how many students are from each city, and which cities have more than one cities?
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
nvbench
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...
give the number of patients who were born before the year 1882 and whose item id is 51482
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.itemid = "51482"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
has patient 021-79544 been prescribed any prescription drugs on this hospital visit?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-79544' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_44341 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text )
What team has +119 Points diff?
SELECT "Team" FROM table_44341 WHERE "Points diff" = '+119'
wikisql
CREATE TABLE table_34781 ( "County" text, "Monument name" text, "Year built" real, "City or Town" text, "Latitude" text, "Longitude" text )
What County has a Longitude of 85 45 43 w?
SELECT "County" FROM table_34781 WHERE "Longitude" = '85°45′43″w'
wikisql
CREATE TABLE table_name_61 ( home_team VARCHAR, week VARCHAR )
What is the home team in week 1?
SELECT home_team FROM table_name_61 WHERE week = "1"
sql_create_context
CREATE TABLE table_31208 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
When la salle is the team who has the highest amount of points?
SELECT "High points" FROM table_31208 WHERE "Team" = 'La Salle'
wikisql
CREATE TABLE table_name_48 ( Id VARCHAR )
What 1953 has 2 as a 1949, and 3 as 1952?
SELECT 1953 FROM table_name_48 WHERE 1949 = "2" AND 1952 = "3"
sql_create_context
CREATE TABLE table_name_58 ( country VARCHAR, player VARCHAR )
What country does Tiger Woods come from?
SELECT country FROM table_name_58 WHERE player = "tiger woods"
sql_create_context
CREATE TABLE table_train_96 ( "id" int, "gender" string, "elevated_creatinine" float, "diabetic" string, "cerebrovascular_disease" bool, "moca_score" int, "parkinsonism" bool, "NOUSE" float )
diabetes type i and ii
SELECT * FROM table_train_96 WHERE diabetic = 'i' OR diabetic = 'ii'
criteria2sql
CREATE TABLE table_77402 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the total number of Score, when Country is 'United States', and when Player is 'Lee Trevino'?
SELECT COUNT("Score") FROM table_77402 WHERE "Country" = 'united states' AND "Player" = 'lee trevino'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
i would like to see the flights from BALTIMORE to PHILADELPHIA please
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
mine old date and time.
SELECT Id, Score FROM Posts WHERE Score >= 10 AND (Title LIKE '%date%' OR Title LIKE '%Date%' OR Title LIKE '%time%' OR Title LIKE '%Time%') AND Tags LIKE '%python%' ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE table_21198 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the final score in game 15?
SELECT "Score" FROM table_21198 WHERE "Game" = '15'
wikisql
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, val...
What are the names of the technicians and how many machines are they assigned to repair.
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name
nvbench
CREATE TABLE table_8761 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
Which Grid has Laps smaller than 22, and a Bike of honda cbr1000rr, and a Rider of luca morelli?
SELECT MIN("Grid") FROM table_8761 WHERE "Laps" < '22' AND "Bike" = 'honda cbr1000rr' AND "Rider" = 'luca morelli'
wikisql
CREATE TABLE table_name_54 ( number VARCHAR, acquisition_via VARCHAR, school_club_team VARCHAR )
What number has an acquisition via the Rookie Draft, and is part of a School/club team at Cal State Fullerton?
SELECT number FROM table_name_54 WHERE acquisition_via = "rookie draft" AND school_club_team = "cal state fullerton"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_60066 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2003\u20132004 season" text )
What club does Manuel Fernandes coach?
SELECT "Club" FROM table_60066 WHERE "Head Coach" = 'manuel fernandes'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( ...
among the patients with age 30s , what was the top five prescribed drugs?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
Get email MD5 hashes for StackExchange users.
SELECT Id, DisplayName, EmailHash FROM Users WHERE EmailHash = '5e7308ff7122df9ebbee7b52956a2ea3' LIMIT 50
sede
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
this year patient 16088 had undergone any venous cath nec procedure?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16088) AND DATETIME(procedures_...
mimic_iii
CREATE TABLE table_73254 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What is the total of blank ends at Prince Edward Island?
SELECT MAX("Blank Ends") FROM table_73254 WHERE "Locale" = 'Prince Edward Island'
wikisql
CREATE TABLE table_7829 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the game result on November 29, 1959?
SELECT "Result" FROM table_7829 WHERE "Date" = 'november 29, 1959'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
Give me a bar chart to compare the number of departments located in different cities, and rank in ascending by the x-axis.
SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY
nvbench
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...
provide the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 7?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "7"
mimicsql_data
CREATE TABLE table_50731 ( "BR No." text, "Lot No." real, "Date" real, "Built at" text, "Boiler type" text )
What year is the date when the boiler type is forward topfeed, the built at is Crewe, and lot number is less than 187?
SELECT COUNT("Date") FROM table_50731 WHERE "Boiler type" = 'forward topfeed' AND "Built at" = 'crewe' AND "Lot No." < '187'
wikisql
CREATE TABLE table_25063 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
How many height entries are there for players from bayside high school?
SELECT COUNT("Height") FROM table_25063 WHERE "High School" = 'Bayside'
wikisql
CREATE TABLE table_204_796 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
who has the most number of affiliates ?
SELECT "network name" FROM table_204_796 ORDER BY "affiliates" DESC LIMIT 1
squall
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Musi...
Return the number of music festivals of each category in a bar chart, and could you order x axis in descending order?
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY Category DESC
nvbench
CREATE TABLE table_name_63 ( player VARCHAR, to_par VARCHAR, country VARCHAR )
Which united states player had a To par of 12?
SELECT player FROM table_name_63 WHERE to_par = 12 AND country = "united states"
sql_create_context
CREATE TABLE table_203_651 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what are the number of times she came in 2nd position for the european championships ?
SELECT COUNT(*) FROM table_203_651 WHERE "position" = 2 AND "competition" = 'european championships'
squall
CREATE TABLE table_33995 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which is the lowest round to have a pick of 12 and position of linebacker?
SELECT MIN("Round") FROM table_33995 WHERE "Pick #" = '12' AND "Position" = 'linebacker'
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...
哪些人被门诊诊断为慢性龈炎?并列举出这些的患者的籍贯代码、名称以及相应人数
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, ...
Show all calendar dates and bin by year in a line chart.
SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
count the number of patients whose gender is m and diagnoses short title is ath ext ntv art gngrene?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Ath ext ntv art gngrene"
mimicsql_data
CREATE TABLE table_12513 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "First Downs" real, "Record" text, "Streak" text, "Attendance" real )
What was the streak for the game after 8 on Nov 22?
SELECT "Streak" FROM table_12513 WHERE "Game" > '8' AND "Date" = 'nov 22'
wikisql
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text )
how many records were set in beijing ?
SELECT COUNT(*) FROM table_203_102 WHERE "place" = 'beijing'
squall
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
tell me the sex of patient 55027.
SELECT patients.gender FROM patients WHERE patients.subject_id = 55027
mimic_iii
CREATE TABLE table_name_4 ( gold INTEGER, bronze VARCHAR, total VARCHAR, rank VARCHAR )
What nation won the fewest gold medals while being in Rank 1, with a total of 37 medals and more than 7 bronze medals?
SELECT MIN(gold) FROM table_name_4 WHERE total = 37 AND rank = "1" AND bronze > 7
sql_create_context
CREATE TABLE table_203_691 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
who would the next opponent be after week 4 ?
SELECT "opponent" FROM table_203_691 WHERE "week" = 4 + 1
squall
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 tim...
孙文敏病患从07年9月1日到2018年9月21日之间所有检测结果指标记录的检测员为编码02458651的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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 = jy...
css
CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text,...
Return a pie on how many books fall into each category?
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE table_5596 ( "Date Released" text, "Institute" text, "Socialist" text, "Social Democratic" text, "Green-Communist" text, "Left Bloc" text, "People's Party" text, "Lead" text )
Name the lead with left bloc of 8.4%
SELECT "Lead" FROM table_5596 WHERE "Left Bloc" = '8.4%'
wikisql
CREATE TABLE table_9840 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who was the visitor on April 2?
SELECT "Visitor" FROM table_9840 WHERE "Date" = 'april 2'
wikisql
CREATE TABLE table_name_22 ( college VARCHAR, player VARCHAR )
what college has paul seiler as a player?
SELECT college FROM table_name_22 WHERE player = "paul seiler"
sql_create_context
CREATE TABLE table_name_57 ( issue_price__bu_ VARCHAR, _clarification_needed_ VARCHAR, mintage__proof_ VARCHAR )
What's listed as the Issue Price (BU) [Clarification Needed] with a Mintage (Proof) of 29,586?
SELECT issue_price__bu_ AS "_clarification_needed_" FROM table_name_57 WHERE mintage__proof_ = "29,586"
sql_create_context
CREATE TABLE table_19995378_1 ( no_in_season VARCHAR, us_viewers__millions_ VARCHAR )
How many episodes with different series numbers were seen by 8.69 people in the US?
SELECT COUNT(no_in_season) FROM table_19995378_1 WHERE us_viewers__millions_ = "8.69"
sql_create_context
CREATE TABLE table_name_88 ( bronze VARCHAR, gold VARCHAR, total VARCHAR )
How much Bronze has a Gold larger than 0, and a Total smaller than 1?
SELECT COUNT(bronze) FROM table_name_88 WHERE gold > 0 AND total < 1
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
calculate the total number of patients who had radical neck dissection, unilateral
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral"
mimicsql_data
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of t...
Show all countries and the number of people from each country in a pie chart.
SELECT Country, COUNT(*) FROM people GROUP BY Country
nvbench
CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain ( did int, na...
return me the paper in Databases area with the most citations .
SELECT publication.title FROM domain, domain_publication, publication WHERE domain.did = domain_publication.did AND domain.name = 'Databases' AND publication.pid = domain_publication.pid ORDER BY publication.citation_num DESC LIMIT 1
academic
CREATE TABLE member ( member_id text, name text, nationality text, role text ) CREATE TABLE performance ( performance_id number, date text, host text, location text, attendance number ) CREATE TABLE member_attendance ( member_id number, performance_id number, num_of_pie...
List the names of members who did not attend any performance.
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM member_attendance)
spider
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
在医疗就诊18286029694中,查出除了科室名有产后的科室开出的所有检验报告单的编号记录
SELECT BGDH FROM jybgb WHERE JZLSH = '18286029694' AND NOT KSMC LIKE '%产后%'
css
CREATE TABLE table_13456 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZE) is the nation?
SELECT MIN("Total") FROM table_13456 WHERE "Bronze" = '1' AND "Nation" = 'czech republic (cze)'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, Last...
Posts per day versus total badges earned.
SELECT DATE(p.CreationDate) AS PostDate, COUNT(p.Id) AS Posts, (SELECT COUNT(b.Id) / 100 FROM Badges AS b WHERE b.UserId = u.Id AND b.Date <= DATE(p.CreationDate)) AS BadgesEarned FROM Posts AS p, Users AS u WHERE u.Id = @UserId AND p.OwnerUserId = u.Id GROUP BY DATE(p.CreationDate), u.Id ORDER BY DATE(p.CreationDate)
sede
CREATE TABLE table_32303 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
How many rounds have an Overall larger than 17, and a Position of quarterback?
SELECT COUNT("Round") FROM table_32303 WHERE "Overall" > '17' AND "Position" = 'quarterback'
wikisql
CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_code text, complaint_type_code text, date_complaint_raised time, date_complaint_closed time, staff_id number ) CREATE TABLE customers ( customer_id...
What are the emails and phone numbers of custoemrs who have never filed a complaint?
SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)
spider
CREATE TABLE table_66438 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
Which Surface has a score of 7-5, 5-7, 6-3?
SELECT "Surface" FROM table_66438 WHERE "Score" = '7-5, 5-7, 6-3'
wikisql
CREATE TABLE table_64276 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Which round did the bout that led to a 1-0 record end in?
SELECT "Round" FROM table_64276 WHERE "Record" = '1-0'
wikisql
CREATE TABLE table_27260 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F.L." real, "Podiums" real, "Points" text, "Position" text )
what were his points when he was in 8th position?
SELECT "Points" FROM table_27260 WHERE "Position" = '8th'
wikisql
CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text ) CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_phone text, customer_email_address text, ...
Give me the descriptions of the service types that cost more than 100.
SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_price > 100
spider
CREATE TABLE table_18140 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who is the incumbent of Florida 9?
SELECT "Incumbent" FROM table_18140 WHERE "District" = 'Florida 9'
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...
provide the number of patients whose diagnoses icd9 code is v4511 and lab test fluid is other body fluid?
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 = "V4511" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_85 ( record VARCHAR, score VARCHAR )
What was the record when the score was 11-10?
SELECT record FROM table_name_85 WHERE score = "11-10"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
find the number of medicaid patients who had transplant from live non-related donor.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Transplant from live non-related donor"
mimicsql_data
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...
在门诊诊断为混合性焦虑和抑郁障碍的甲状旁腺素名叫金睿聪的患者的结果定量和单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = j...
css
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 have a diagnosis of malignant neoplastic bladder nec along with joint fluid lab test done?
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.short_title = "Malig neo bladder NEC" AND lab.fluid = "Joint Fluid"
mimicsql_data
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, ...
give the number of patients of hispanic/latino-puerto rican ethnicity who were admitted as newborn.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
CREATE TABLE table_204_445 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what was the top position in which he finished ?
SELECT MIN("position") FROM table_204_445
squall
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 PostFeedback ( Id number, PostId number, IsAnonymous...
Rank in Germany based on reputation.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Views, AccountId, Age, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE LOWER('%Germany%') AND Reputation >= 578 ORDER BY Reputation
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is the number of patients with a diagnoses of diaphragmatic hernia without mention of obstruction or gangrene who had urine lab test?
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.long_title = "Diaphragmatic hernia without mention of obstruction or gangrene" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_17287 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many times is the score 98 90?
SELECT COUNT("Location Attendance") FROM table_17287 WHERE "Score" = '98–90'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
show the flights from PITTSBURGH to SAN FRANCISCO again on monday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = 2...
atis