context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_4 ( games INTEGER, rank VARCHAR, rebounds VARCHAR )
How few games are there for a rank more than 1 and more than 212 rebounds?
SELECT MIN(games) FROM table_name_4 WHERE rank > 1 AND rebounds > 212
sql_create_context
CREATE TABLE table_19853 ( "Category" text, "Type" text, "Attribute" text, "Description" text, "Bubbles" text, "Cancelable" text )
How many descriptions are there when the attribute is 'ondragstart'?
SELECT COUNT("Description") FROM table_19853 WHERE "Attribute" = 'ondragstart'
wikisql
CREATE TABLE table_22854436_1 ( population__2002_census_data_ INTEGER )
Name the most population 2002
SELECT MAX(population__2002_census_data_) FROM table_22854436_1
sql_create_context
CREATE TABLE city ( city VARCHAR, GDP VARCHAR )
Which city has the lowest GDP? Please list the city name and its GDP.
SELECT city, GDP FROM city ORDER BY GDP LIMIT 1
sql_create_context
CREATE TABLE table_2380 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Name the total number of results for octubre
SELECT COUNT("Result") FROM table_2380 WHERE "Original title" = 'Octubre'
wikisql
CREATE TABLE table_name_45 ( frequency_mhz VARCHAR, call_sign VARCHAR )
What frequency has call sign w228bg?
SELECT frequency_mhz FROM table_name_45 WHERE call_sign = "w228bg"
sql_create_context
CREATE TABLE table_42541 ( "Result" text, "Opponent" text, "Type" text, "Round" text, "Date" text )
When has a Type of tko, and a Round of 1 (6)
SELECT "Date" FROM table_42541 WHERE "Type" = 'tko' AND "Round" = '1 (6)'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
病号冯文轩做的颅部检查各项指标结果怎么样?
SELECT * 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
给患者患有疾病L27.784的开出的药品的编号是多少名称是什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'L27.784'
css
CREATE TABLE table_42449 ( "Year" real, "Title" text, "Producer" text, "Actor" text, "Role" text )
What role was played in 2007?
SELECT "Role" FROM table_42449 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_50101 ( "Order" real, "Name dates" text, "Princess Royal from (date) to (date)" text, "Parent" text, "Date married" text, "Husband dates" text )
Who was the parent on the order of 6?
SELECT "Parent" FROM table_50101 WHERE "Order" = '6'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
PHILADELPHIA to SAN FRANCISCO 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
CREATE TABLE table_41764 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which country had 1 Bronze, 1 Silver, with a total of 3 medals?
SELECT "Nation" FROM table_41764 WHERE "Bronze" = '1' AND "Total" = '3' AND "Silver" = '1'
wikisql
CREATE TABLE table_19283806_4 ( representative VARCHAR )
What is the 2012 election results for locations whose representative is Barbara Lee?
SELECT 2012 AS _election_results FROM table_19283806_4 WHERE representative = "Barbara Lee"
sql_create_context
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 ( ...
provide the number of patients whose year of birth is less than 2043 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
what diagnosis did patient 54825 receive last in a year before?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C...
mimic_iii
CREATE TABLE table_43683 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
What is the total number of ranks that had vestron as the studio?
SELECT COUNT("Rank") FROM table_43683 WHERE "Studio" = 'vestron'
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 ...
count the number of patients diagnosed with sepsis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sepsis"
mimicsql_data
CREATE TABLE table_18600760_12 ( land___sqmi__ VARCHAR, geo_id VARCHAR )
What is the land (sqmi) at geo id 3801947380?
SELECT land___sqmi__ FROM table_18600760_12 WHERE geo_id = 3801947380
sql_create_context
CREATE TABLE table_66379 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text )
What sport was played by the team founded in 2010?
SELECT "Sport" FROM table_66379 WHERE "Founded" = '2010'
wikisql
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
Give me the title and highest price for each film. Show bar chart.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party ( party_id number, minister text, took_office text, l...
Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?
SELECT minister, took_office, left_office FROM party ORDER BY left_office
spider
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, ...
when was the last time patient 002-62161 was measured sao2 greater than 97.0 on the last intensive care unit visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-62161') AND NOT patient.unitdischargetime IS NU...
eicu
CREATE TABLE table_35127 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest rank of Venezuela, which has more than 9 bronze medals?
SELECT MIN("Rank") FROM table_35127 WHERE "Nation" = 'venezuela' AND "Bronze" > '9'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
门诊81008457398是在哪一天结束就诊呢
SELECT txmzjzjlb.JZJSSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '81008457398' UNION SELECT ftxmzjzjlb.JZJSSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '81008457398'
css
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, ap...
Show the booking status code and the corresponding number of bookings Show bar chart, and order in ascending by the Y.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*)
nvbench
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_...
What is the id and detail of the vehicle used in lessons for most of the times?
SELECT T1.vehicle_id, T1.vehicle_details FROM vehicles AS T1 JOIN lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_692 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
who 2 players had at least 6 goals ?
SELECT "name" FROM table_203_692 WHERE "goals" >= 6
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
what was the name of the intake that patient 17953 had a last on the first icu visit?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17953) AND NOT icustays.outtime IS N...
mimic_iii
CREATE TABLE table_name_86 ( percentage VARCHAR, district VARCHAR, party VARCHAR )
Which Percentage has a District larger than 2, and a Party of independent?
SELECT percentage FROM table_name_86 WHERE district > 2 AND party = "independent"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
what are the drugs that patient 013-30085 has an allergic reaction to this month?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-30085')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(...
eicu
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, born_state tex...
Show average of budget in different year and group by department creation time with a line chart, and order by the X-axis in descending.
SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC
nvbench
CREATE TABLE table_name_82 ( security_forces VARCHAR, year VARCHAR )
Name the security forces for 2009
SELECT security_forces FROM table_name_82 WHERE year = "2009"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose gender is f and admission year is less than 2105?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2105"
mimicsql_data
CREATE TABLE table_2266 ( "County" text, "McCain#" real, "McCain%" text, "Obama#" real, "Obama%" text, "Barr#" real, "Barr%" text, "Nader#" real, "Nader%" text, "McKinney#" real, "McKinney%" text, "Others#" real, "Others%" text, "Total ballots" real, "Total el...
What is Nader's percentage when Obama is 44.6%?
SELECT "Nader%" FROM table_2266 WHERE "Obama%" = '44.6%'
wikisql
CREATE TABLE table_58638 ( "2 twee" text, "3 dree" text, "4 vea" text, "5 fiew" text, "6 sas" text, "7 s\u00e4wen" text, "8 acht" text, "9 n\u00e4ajen" text )
What is 3 dree if 8 acht is 8th achta?
SELECT "3 dree" FROM table_58638 WHERE "8 acht" = '8th achta'
wikisql
CREATE TABLE table_22340 ( "City of license /Market" text, "Station" text, "Channel ( TV / RF )" text, "Owned Since" real, "Affiliation" text )
What city of license/market has the channel of 41?
SELECT "City of license /Market" FROM table_22340 WHERE "Channel ( TV / RF )" = '41'
wikisql
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition_result ( Competition...
what is the number of players who have points less than 30 for each position?, and could you list from high to low by the y axis?
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
find questions posted on a date.
SELECT Id AS "post_link", CreationDate FROM Posts WHERE CreationDate >= '02.07.2018' AND CreationDate <= '02.08.2018'
sede
CREATE TABLE table_name_35 ( opponent VARCHAR, date VARCHAR )
Which opponent has a date of July 7?
SELECT opponent FROM table_name_35 WHERE date = "july 7"
sql_create_context
CREATE TABLE table_name_56 ( position VARCHAR, home_town VARCHAR )
What is the position of the player from New York City, NY?
SELECT position FROM table_name_56 WHERE home_town = "new york city, ny"
sql_create_context
CREATE TABLE table_47115 ( "Game" real, "3PM-A" text, "Percent Made" real, "Total Made" real, "Total Attempted" real, "Series Percent" real )
what is the total series percent that has total attempted less than 49, and a percent made of 0.777
SELECT COUNT("Series Percent") FROM table_47115 WHERE "Total Attempted" < '49' AND "Percent Made" = '0.777'
wikisql
CREATE TABLE table_3154 ( "Tie no" real, "Home team" text, "Score 1" text, "Away team" text, "Attendance" real, "Date" text )
What was the attendance of the game where Stoke city was the away team?
SELECT MIN("Attendance") FROM table_3154 WHERE "Away team" = 'Stoke City'
wikisql
CREATE TABLE table_27031 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponent" text, "Score" text )
What championships had a match where Natasha Zvereva played as partner?
SELECT "Championship" FROM table_27031 WHERE "Partner" = 'Natasha Zvereva'
wikisql
CREATE TABLE table_204_712 ( id number, "rank" number, "athlete" text, "nationality" text, "time" text, "notes" text )
who placed in the top spot ?
SELECT "athlete" FROM table_204_712 WHERE id = 1
squall
CREATE TABLE table_name_90 ( total INTEGER, rank VARCHAR, bronze VARCHAR, silver VARCHAR )
What is the Total number of medals for the Nation with 7 or less Bronze medals and 1 Silver medal with a Rank of 9 or larger?
SELECT MIN(total) FROM table_name_90 WHERE bronze < 7 AND silver = 1 AND rank > 9
sql_create_context
CREATE TABLE table_name_20 ( date VARCHAR, home_team VARCHAR )
What day did Footscray play as the home team?
SELECT date FROM table_name_20 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
Is Winter the only time DENT 532 is offered ?
SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'DENT' AND course.number = 532 AND semester.semester <> 'Winter'
advising
CREATE TABLE table_60144 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What was the finish for England?
SELECT "Finish" FROM table_60144 WHERE "Country" = 'england'
wikisql
CREATE TABLE table_name_87 ( home_team VARCHAR, date VARCHAR )
What home team has june 22 as the date?
SELECT home_team FROM table_name_87 WHERE date = "june 22"
sql_create_context
CREATE TABLE table_name_52 ( pick VARCHAR, player VARCHAR )
What is the pick number for Ray Giroux?
SELECT pick FROM table_name_52 WHERE player = "ray giroux"
sql_create_context
CREATE TABLE table_train_128 ( "id" int, "vascular" bool, "mania" bool, "pulmonary_disease" bool, "cardiac" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "cerebrovascular_disease" bool, "hematologic_disease" bool, "adverse_reactions_venlaflaxine" boo...
seizure disorder, history of stroke, focal brain lesion, traumatic brain injury, substance abuse, malignancy.
SELECT * FROM table_train_128 WHERE seizure_disorder = 1 OR (stroke = 1 OR focal_brain_lesion = 1 OR traumatic_brain_injury = 1 OR substance_dependence = 1 OR malignancy = 1)
criteria2sql
CREATE TABLE table_73710 ( "Model" text, "Launch" text, "Model Number" text, "Code name" text, "Fab ( nm )" text, "Bus interface" text, "Memory ( MiB )" text, "Core clock ( MHz )" text, "Memory clock ( MHz )" text, "Config core 1" text, "Pixel ( GP /s)" text, "Texture ( G...
What is every code name for the model Radeon HD 6650m?
SELECT "Code name" FROM table_73710 WHERE "Model" = 'Radeon HD 6650M'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE ...
Count of the positively scored, open questions with a positively scored, accepted answer, by month.
SELECT DATEFROMPARTS(TIME_TO_STR(Q.CreationDate, '%Y'), TIME_TO_STR(Q.CreationDate, '%M'), 1) AS Month, COUNT(*) AS Count FROM Posts AS Q, Posts AS A WHERE Q.AcceptedAnswerId = A.Id AND Q.CreationDate < @TsNow AND Q.ClosedDate IS NULL AND Q.Score > 0 AND A.Score > 0 GROUP BY DATEFROMPARTS(TIME_TO_STR(Q.CreationDate, '%...
sede
CREATE TABLE table_name_48 ( set_1 VARCHAR, set_2 VARCHAR )
What is Set 1, when Set 2 is '21:18'?
SELECT set_1 FROM table_name_48 WHERE set_2 = "21:18"
sql_create_context
CREATE TABLE table_name_55 ( year VARCHAR, class VARCHAR )
Tell me the year for class of 125cc
SELECT year FROM table_name_55 WHERE class = "125cc"
sql_create_context
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
Show me the total number by origin in a histogram
SELECT origin, COUNT(*) FROM train GROUP BY origin
nvbench
CREATE TABLE table_name_17 ( score VARCHAR, player VARCHAR )
What is the score of Player Tom Kite?
SELECT score FROM table_name_17 WHERE player = "tom kite"
sql_create_context
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 number ofpatients with ventricular tachcardia had the year of death in or before the year 2111?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "VENTRICULAR TACHYCARDIA" AND demographic.dod_year <= "2111.0"
mimicsql_data
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE manager ( Manager_ID int, Name text, Country te...
A line chart for showing the number of the working years of managers in descending order of their level.
SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC
nvbench
CREATE TABLE table_name_32 ( july VARCHAR, plant_hardiness_zone VARCHAR, january VARCHAR )
What is the July temperature where plant hardiness zone is 2B and January figure is 12/ 23 c (10-9 f)?
SELECT july FROM table_name_32 WHERE plant_hardiness_zone = "2b" AND january = "−12/−23°c (10-9°f)"
sql_create_context
CREATE TABLE table_41016 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text )
Which Tries against have Points against larger than 109?
SELECT MAX("Tries against") FROM table_41016 WHERE "Points against" > '109'
wikisql
CREATE TABLE table_2237 ( "No" real, "Season" real, "Ep" real, "Title" text, "Writer" text, "Director" text, "Original airdate" text, "Archive" text )
Name the original airdate for guy verney
SELECT "Original airdate" FROM table_2237 WHERE "Director" = 'Guy Verney'
wikisql
CREATE TABLE table_55043 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the losing score on September 1?
SELECT "Loss" FROM table_55043 WHERE "Date" = 'september 1'
wikisql
CREATE TABLE table_11043 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Marty Riessen played as a partner during a match with what kind of surface?
SELECT "Surface" FROM table_11043 WHERE "Partner" = 'marty riessen'
wikisql
CREATE TABLE table_5322 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What is the average attendance of the game where the home team was the Blues?
SELECT AVG("Attendance") FROM table_5322 WHERE "Home" = 'blues'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_i...
calculate the number of people who died after being diagnosed with esoph varice oth dis nos within the same hospital visit since 1 year ago.
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
CREATE TABLE table_68938 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
Name the drawn for tries for of 42
SELECT "Drawn" FROM table_68938 WHERE "Tries for" = '42'
wikisql
CREATE TABLE table_name_88 ( place VARCHAR, score VARCHAR )
What is the Place of the Player with a Score of 73-67-74-71=285?
SELECT place FROM table_name_88 WHERE score = 73 - 67 - 74 - 71 = 285
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
provide the number of patients whose admission location is phys referral/normal deli and lab test item id is 51035.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51035"
mimicsql_data
CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE locations ( location_id number, location_name text, address text, other_details text ) CREATE TABLE staff ( staff_id number, tourist_attraction_id number, name text, other_details text ) CREATE TABL...
Which tourist attractions can we get to by bus? Tell me the names of the attractions.
SELECT name FROM tourist_attractions WHERE how_to_get_there = "bus"
spider
CREATE TABLE table_19273 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Na,e the number of field goals for right tackle
SELECT COUNT("Field goals") FROM table_19273 WHERE "Position" = 'Right tackle'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients are diagnosed with icd9 code 44020 and tested under category hematology in lab?
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 = "44020" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE addresses ( state_province_county VARCHAR, country VARCHAR, zip_postcode VARCHAR )
Find the state and country of all cities with post code starting with 4.
SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE "4%"
sql_create_context
CREATE TABLE table_50172 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the home country of the player who placed t5 and had a score of 69-71=140?
SELECT "Country" FROM table_50172 WHERE "Place" = 't5' AND "Score" = '69-71=140'
wikisql
CREATE TABLE table_204_242 ( id number, "season" text, "record" text, "finish" text, "manager" text, "notes" text )
which year did they win their least amount of games ?
SELECT "season" FROM table_204_242 ORDER BY "record" LIMIT 1
squall
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( unique...
in 2103, what were the four most common input events?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2103' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_54189 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real )
What is the lowest 1978 Veteran membership with less than 48,000 in sept. 1943, a late 1941 of vojvodina, and a late 1942 bigger than 1,000?
SELECT MIN("1978 Veteran membership") FROM table_54189 WHERE "Sept. 1943" < '48,000' AND "! Late 1941" = 'vojvodina' AND "Late 1942" > '1,000'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, ...
give me the total amount of d10w that patient 31854 took on this month/29.
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
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...
calculate the maximum days for which white ethnic background patients stayed in hospital.
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "WHITE"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
Give me the number of patients less than 81 years who had an insertion of endotracheal tube procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "81" AND procedures.long_title = "Insertion of endotracheal tube"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
门诊就诊中开出的检验报告单47110365099是谁的
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE zyjybgb.BGDH = '47110...
css
CREATE TABLE table_name_98 ( location VARCHAR, date VARCHAR, year VARCHAR, loser VARCHAR )
What was the location after 1934 that Philadelphia Eagles lost on October 15?
SELECT location FROM table_name_98 WHERE year > 1934 AND loser = "philadelphia eagles" AND date = "october 15"
sql_create_context
CREATE TABLE table_51363 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
What was the final score for the game at giants stadium when the indianapolis colts were the visiting team?
SELECT "Final Score" FROM table_51363 WHERE "Visiting Team" = 'indianapolis colts' AND "Stadium" = 'giants stadium'
wikisql
CREATE TABLE table_73823 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
What are the cyrillic and other names of the settlement whose population is 6591?
SELECT "Cyrillic Name Other Names" FROM table_73823 WHERE "Population (2011)" = '6591'
wikisql
CREATE TABLE table_34053 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What Time/Retired has a Laps of 86 and the Team of HVM Racing?
SELECT "Time/Retired" FROM table_34053 WHERE "Laps" = '86' AND "Team" = 'hvm racing'
wikisql
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 employee ( eid number, name text, ...
Show names for all aircrafts with distances more than the average.
SELECT name FROM aircraft WHERE distance > (SELECT AVG(distance) FROM aircraft)
spider
CREATE TABLE table_13762472_3 ( score VARCHAR, date VARCHAR )
What was the score on November 25?
SELECT score FROM table_13762472_3 WHERE date = "November 25"
sql_create_context
CREATE TABLE table_68722 ( "Year" text, "Edition" text, "Host city" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest VIII Edition Gold with a Silver of 4?
SELECT MIN("Gold") FROM table_68722 WHERE "Silver" = '4' AND "Edition" = 'viii'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
病号13405731在19年2月9日到20年11月19日内被开出过哪些检验报告单它们的检验报告单号都是啥?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE teaches ( ID varchar(5), cours...
Find the sum of credits of courses that have more than one prerequisite for each title with a bar chart, sort sum credits in desc order please.
SELECT title, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY SUM(credits) DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) 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 ...
Kinda newcomers with reputation and more than one post.
SELECT OwnerUserId AS "user_id", COUNT(OwnerUserId) AS "number_of_posts" FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE Reputation < 1000 AND Reputation NOT IN (1, 101)) GROUP BY OwnerUserId HAVING COUNT(OwnerUserId) > 1
sede
CREATE TABLE table_1754531_4 ( domestic_freight VARCHAR, international_mail VARCHAR, domestic_mail VARCHAR )
Namw the total number for domestic freight for international mail is larger than 1.0 with domestic mail for 260
SELECT COUNT(domestic_freight) FROM table_1754531_4 WHERE international_mail > 1.0 AND domestic_mail = 260
sql_create_context
CREATE TABLE table_43329 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real )
What is the total number of Rank with 100 goals, and less than 300 matches?
SELECT COUNT("Rank") FROM table_43329 WHERE "Goals" = '100' AND "Matches" < '300'
wikisql
CREATE TABLE table_name_12 ( hdtv VARCHAR, television_service VARCHAR )
What is the HDTV status of the r-light television service?
SELECT hdtv FROM table_name_12 WHERE television_service = "r-light"
sql_create_context
CREATE TABLE table_63333 ( "Athlete" text, "Nation" text, "Olympics" real, "Substance" text, "Punishment" text )
Which athlete had a six month suspension from IIHF?
SELECT "Athlete" FROM table_63333 WHERE "Punishment" = 'six month suspension from iihf'
wikisql
CREATE TABLE table_name_73 ( venue VARCHAR, home_team VARCHAR )
Which Venue is the one for the footscray Home team?
SELECT venue FROM table_name_73 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_64658 ( "English" text, "German" text, "Dutch" text, "Latin" text, "Romanian" text, "Portuguese" text, "Spanish" text, "Italian" text, "French" text, "Greek (Modern)" text, "Bulgarian" text, "Macedonian" text, "Polish (extinct)" text )
What's the German Pluperfect when the Macedonian is /- /- ?
SELECT "German" FROM table_64658 WHERE "Macedonian" = 'беше слушнал/-а/-о'
wikisql
CREATE TABLE table_203_780 ( id number, "rank" number, "diver" text, "preliminary\npoints" number, "preliminary\nrank" number, "final\npoints" number, "final\nrank" number, "final\ntotal" number )
how many total points did ingrid kr mer score in the final ?
SELECT "final\npoints" FROM table_203_780 WHERE "diver" = 'ingrid kramer'
squall
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
6774238这所医疗机构自2004年5月2日开始到2011年6月21的记录里医疗费超过745.28元的未就业人员就诊记录有多少
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '6774238' AND IN_HOSP_DATE BETWEEN '2004-05-02' AND '2011-06-21' AND INSURED_STS = '未就业' AND MED_AMOUT >= 745.28
css