context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, ...
Find the names of courses taught by the tutor who has personal name 'Julio'.
SELECT T2.course_name FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio"
spider
CREATE TABLE table_23862 ( "Party" text, "Seats Contested" real, "Seats Won" real, "No. of Votes" real, "% of Votes" text, "% in Seats contested" text, "Seats Forfeited" real, "2003 Seats" real )
How many seats were won, when the seats contested was 48?
SELECT "Seats Won" FROM table_23862 WHERE "Seats Contested" = '48'
wikisql
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
查一下病患91780713在医院1411436中就诊科室名中有母乳喂养这几个字的门诊就诊记录的流水号
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 = '91780713' AND hz_info.YLJGDM = '1411436' AND zzmzjzjlb.JZKSMC LIKE '%母乳喂养%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info.YL...
css
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 bdmzjzjlb ( CYBQDM text, CYBQ...
41736838这位患者的妊娠相关性血浆蛋白-A指标在08年4月18日至10月22日期间的情况
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_27766 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What is the production code of the episode directed by Michael McDonald?
SELECT "Production code" FROM table_27766 WHERE "Directed by" = 'Michael McDonald'
wikisql
CREATE TABLE table_11088 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Which away team that had 48 as a Tie no?
SELECT "Away team" FROM table_11088 WHERE "Tie no" = '48'
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 ) ...
Give the number of patients diagnosed with acute glomerulonephritis with other specified pathological lesion in kidney and their drug route is iv drip?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney" AND prescripti...
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name te...
answer count greater than 50.
SELECT * FROM Posts WHERE AnswerCount > 50
sede
CREATE TABLE table_13494 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
what is the geo id when the land (sqmi) is less than 36.112, the latitude is more than 47.536618, the township is west bay and water (sqmi) is more than 0.209?
SELECT SUM("GEO ID") FROM table_13494 WHERE "Land ( sqmi )" < '36.112' AND "Latitude" > '47.536618' AND "Township" = 'west bay' AND "Water (sqmi)" > '0.209'
wikisql
CREATE TABLE table_17355408_4 ( high_assists VARCHAR, high_points VARCHAR )
Name the high assists for chauncey billups , carmelo anthony (18)
SELECT high_assists FROM table_17355408_4 WHERE high_points = "Chauncey Billups , Carmelo Anthony (18)"
sql_create_context
CREATE TABLE table_name_26 ( last_match VARCHAR, date_of_vacancy VARCHAR, outgoing_manager VARCHAR )
What is the last match with a vacancy date of round 2 and Ney Franco as outgoing manager?
SELECT last_match FROM table_name_26 WHERE date_of_vacancy = "round 2" AND outgoing_manager = "ney franco"
sql_create_context
CREATE TABLE table_2987 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
Name the title for 446913
SELECT "Title" FROM table_2987 WHERE "Production code" = '446913'
wikisql
CREATE TABLE table_name_64 ( decile INTEGER, authority VARCHAR, name VARCHAR )
What is the average decile of Ruapehu college, which has a state authority?
SELECT AVG(decile) FROM table_name_64 WHERE authority = "state" AND name = "ruapehu college"
sql_create_context
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
看看哪些检查病人鲁雅丽之前已经做了
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '鲁雅丽' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P...
css
CREATE TABLE table_27700530_9 ( team VARCHAR, game VARCHAR )
How many games were numbered 13?
SELECT COUNT(team) FROM table_27700530_9 WHERE game = 13
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 item id is 51269?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51269"
mimicsql_data
CREATE TABLE table_name_81 ( to_par VARCHAR, country VARCHAR )
What is the To par of the Player from Spain?
SELECT to_par FROM table_name_81 WHERE country = "spain"
sql_create_context
CREATE TABLE table_name_77 ( crowd INTEGER, venue VARCHAR )
What was the lowest attendance at Windy Hill?
SELECT MIN(crowd) FROM table_name_77 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
Draw a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by weekday.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_46 ( laps VARCHAR, driver VARCHAR )
How many laps does driver dario franchitti have?
SELECT laps FROM table_name_46 WHERE driver = "dario franchitti"
sql_create_context
CREATE TABLE table_name_94 ( Left VARCHAR, location VARCHAR )
What left office date happened in Washington?
SELECT Left AS office FROM table_name_94 WHERE location = "washington"
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 ) ...
What is the number of patients with an abnormal uric acid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Uric Acid"
mimicsql_data
CREATE TABLE table_name_98 ( date_of_replacement VARCHAR, date_outgoing VARCHAR )
When did the manager take over for the manager that left on August 20, 2008?
SELECT date_of_replacement FROM table_name_98 WHERE date_outgoing = "august 20, 2008"
sql_create_context
CREATE TABLE table_11478 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text )
What is the date of the tournament with 5 strokes as the margin of victory?
SELECT "Date" FROM table_11478 WHERE "Margin of victory" = '5 strokes'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Any morning classes for ARMENIAN 171 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'ARMENIAN' AND course.number = 171 AND semester.semester = 'WN' AND semester.semester_id = course...
advising
CREATE TABLE table_34346 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real )
What is the Date of the tournament with a score of 199 ( 17)?
SELECT "Date" FROM table_34346 WHERE "Score" = '199 (–17)'
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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
what would be cost of a round trip from PITTSBURGH to SAN FRANCISCO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
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 mzjybgb ( BBCJBW text, BBDM t...
这个编号为89851265565的检验报告单是哪个科室申请的,科室的名称是什么?对应的编码是什么
SELECT zyjybgb.SQKS, zyjybgb.SQKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '77243094215' UNION SELECT mzjybgb.SQKS, mzjybgb.SQKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '77243094215'
css
CREATE TABLE table_name_48 ( goals_for VARCHAR, wins VARCHAR, ties VARCHAR, goals_against VARCHAR )
what is the total number of goals for when the ties is more than 0, the goals against is more than 35 and the wins is less than 2?
SELECT COUNT(goals_for) FROM table_name_48 WHERE ties > 0 AND goals_against > 35 AND wins < 2
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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 t...
患者29261183在2011年5月8日至18年3月30日内被开出的所有检验报告单的科室编码还有名称能列出都是什么吗?
SELECT jybgb.KSBM, jybgb.KSMC 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...
css
CREATE TABLE table_65742 ( "Original NFL team" text, "Player" text, "Pos." text, "College" text, "Conf." text )
What is the College of the WR Player from SWC Conf?
SELECT "College" FROM table_65742 WHERE "Conf." = 'swc' AND "Pos." = 'wr'
wikisql
CREATE TABLE table_name_21 ( player VARCHAR, to_par VARCHAR, country VARCHAR )
Which Player has a To par of 12, and a Country of fiji?
SELECT player FROM table_name_21 WHERE to_par = 12 AND country = "fiji"
sql_create_context
CREATE TABLE table_name_17 ( date VARCHAR, tie_no VARCHAR )
When has a Tie no of 15?
SELECT date FROM table_name_17 WHERE tie_no = "15"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_na...
lowest fare from SAN FRANCISCO to LOS ANGELES
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Return a bar chart on what are the different card types, and how many transactions have been made with each?, sort Y-axis in asc order please.
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_1140103_6 ( date VARCHAR, circuit VARCHAR )
How many dates have silverstone circuit
SELECT COUNT(date) FROM table_1140103_6 WHERE circuit = "Silverstone"
sql_create_context
CREATE TABLE table_12161822_5 ( grand_prix VARCHAR, winning_driver VARCHAR )
what's the grand prix with winning driver being jenson button
SELECT grand_prix FROM table_12161822_5 WHERE winning_driver = "Jenson Button"
sql_create_context
CREATE TABLE table_name_69 ( name VARCHAR, year VARCHAR, home_town VARCHAR )
What is the Name of the Junior from Fayetteville, NC?
SELECT name FROM table_name_69 WHERE year = "junior" AND home_town = "fayetteville, nc"
sql_create_context
CREATE TABLE table_204_579 ( id number, "code" text, "district" text, "headquarters" text, "population (as of 2011)" number, "area (km2)" number, "density (/km2)" number )
which has a larger population , dehradun or nainital ?
SELECT "district" FROM table_204_579 WHERE "district" IN ('dehradun', 'nainital') ORDER BY "population (as of 2011)" DESC LIMIT 1
squall
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
患者朱湛英曾经去过什么地方看病?
(SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '朱湛英') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h...
css
CREATE TABLE table_53248 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What was the date of the Circuit of Indianapolis?
SELECT "Date" FROM table_53248 WHERE "Circuit" = 'indianapolis'
wikisql
CREATE TABLE table_72667 ( "#" real, "Minnesota River Conference" text, "Records" text, "Pct." text, "MRC Championships" real, "Solo" real, "Co-Champions" real, "State Champions" real )
How many teams are #2 on the list?
SELECT COUNT("Records") FROM table_72667 WHERE "#" = '2'
wikisql
CREATE TABLE table_name_63 ( away_team VARCHAR, home_team VARCHAR )
What is the away team when solon was the home team?
SELECT away_team FROM table_name_63 WHERE home_team = "solon"
sql_create_context
CREATE TABLE VOTING_RECORD ( CLASS_President_VOTE VARCHAR ) CREATE TABLE STUDENT ( LName VARCHAR, StuID VARCHAR )
Find the distinct last names of the students who have class president votes.
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
sql_create_context
CREATE TABLE table_name_21 ( entrants VARCHAR, year VARCHAR )
How many entrants were there in 2011?
SELECT COUNT(entrants) FROM table_name_21 WHERE year = 2011
sql_create_context
CREATE TABLE table_37629 ( "Date" text, "Title" text, "Origin" text, "Label & Cat. no." text, "Chart no." real )
What is the average chart number for 11/1965?
SELECT AVG("Chart no.") FROM table_37629 WHERE "Date" = '11/1965'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
67143371696医疗就诊的出院日期是哪一年几月几日
SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '67143371696'
css
CREATE TABLE table_25823 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What were the scores of the Wimbledon final matches where Newcombe was the runner-up?
SELECT "Score in the final" FROM table_25823 WHERE "Outcome" = 'Runner-up' AND "Championship" = 'Wimbledon'
wikisql
CREATE TABLE table_name_31 ( pick__number VARCHAR, round VARCHAR )
What is the pick number for the player(s) drafted in round 8?
SELECT pick__number FROM table_name_31 WHERE round = "round 8"
sql_create_context
CREATE TABLE table_261642_3 ( c__nf_km_ VARCHAR, r__ω_km_ VARCHAR )
What is the c (nf/km) when the r ( /km) is 463.59?
SELECT c__nf_km_ FROM table_261642_3 WHERE r__ω_km_ = "463.59"
sql_create_context
CREATE TABLE table_79895 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the Attendance high on August 28?
SELECT MAX("Attendance") FROM table_79895 WHERE "Date" = 'august 28'
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 ground_service ( city_code text, airport_code text, transport_type text, ground_f...
show me all the flights between DALLAS FORT WORTH and either SAN FRANCISCO or OAKLAND that depart between 1700 and 1900
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight WHERE ((flight.departure_time <= 1900 AND flight.departure_...
atis
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text...
To whom do I answer on average?.
SELECT COUNT(1) AS nbe_answers, Questions.OwnerUserId AS "user_link", AVG(Answers.Score) AS A_score, AVG(Questions.Score) AS Q_score FROM Posts AS Questions, Posts AS Answers WHERE Questions.PostTypeId = 1 AND Answers.PostTypeId = 2 AND Answers.ParentId = Questions.Id AND Answers.OwnerUserId = '##UserId1##' GROUP BY Qu...
sede
CREATE TABLE table_name_71 ( decision VARCHAR, visitor VARCHAR )
What was the decision of the Kings game when Chicago was the visiting team?
SELECT decision FROM table_name_71 WHERE visitor = "chicago"
sql_create_context
CREATE TABLE table_51348 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text )
which spans had a drop of 0?
SELECT "Span" FROM table_51348 WHERE "Drop" = '0'
wikisql
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 me about the distribution of All_Home and Team_ID , and group by attribute ACC_Home in a bar chart, and rank x-axis from low to high order.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
nvbench
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 mzjzjlb ( HXPLC number, HZXM ...
患者27615170在13年4月2日到21年3月6日内被开出的所有检验报告单的科室编码以及名称都是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02' AND '2021-...
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
Days with at least one vote by Mathematics moderators.
SELECT DATE(v.CreationDate) FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id WHERE u.Id IN (2, 3, 66, 121, 1409, 2000, 2926) GROUP BY DATE(v.CreationDate) ORDER BY DATE(v.CreationDate) DESC
sede
CREATE TABLE APPELLATIONS ( Area VARCHAR, Appelation VARCHAR ) CREATE TABLE WINE ( Appelation VARCHAR, year VARCHAR )
What is the area of the appelation that produces the highest number of wines before the year of 2010?
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
How many exhibitions has each artist had Plot them as bar chart, I want to order bar in desc order please.
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
provide the date of birth and gender of the subject name bessie giordano.
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE table_train_85 ( "id" int, "mini_mental_state_examination_mmse" int, "elevated_serum_phenylalanine" int, "elevated_creatinine" float, "renal_disease" bool, "geriatric_depression_scale_gds" int, "NOUSE" float )
mini _ mental status exam score < 25 .
SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse < 25
criteria2sql
CREATE TABLE table_65346 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Tie no when Wimbledon is the home team?
SELECT "Tie no" FROM table_65346 WHERE "Home team" = 'wimbledon'
wikisql
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_des...
Find the number of courses for each subject in a bar chart, and I want to list in descending by the y-axis.
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_9 ( state VARCHAR, name VARCHAR )
Which state was Dai from?
SELECT state FROM table_name_9 WHERE name = "dai"
sql_create_context
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...
川石斛颗粒的检查记录在医疗机构1380649有多少?
SELECT COUNT(*) 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.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒'
css
CREATE TABLE table_66363 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How many losses have 11 points?
SELECT COUNT("Losses") FROM table_66363 WHERE "Points" = '11'
wikisql
CREATE TABLE table_63396 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
Who has a constituency of 84?
SELECT "Name" FROM table_63396 WHERE "Constituency number" = '84'
wikisql
CREATE TABLE table_65043 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text )
What years did Marienhof run, which featured Leonore Capell and lasted 10 years?
SELECT "Years" FROM table_65043 WHERE "Soap Opera" = 'marienhof' AND "Duration" = '10 years' AND "Actor" = 'leonore capell'
wikisql
CREATE TABLE table_30047613_13 ( streak VARCHAR, date VARCHAR )
How many games had they won or lost in a row on May 9?
SELECT streak FROM table_30047613_13 WHERE date = "May 9"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
what were the four most frequent prescriptions of medications for patients who were also prescribed opium tincture at the same time a year before?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'opium tincture' AND DATETIME(prescriptions.startdate, 'start of y...
mimic_iii
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...
病患36963389检测丙戊酸在2012年2月7日起到2019年5月3日结束的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE Rating ( mID VARCHAR, stars INTEGER ) CREATE TABLE Reviewer ( rID VARCHAR, name VARCHAR )
Find the average rating star for each movie that are not reviewed by Brittany Harris.
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
sql_create_context
CREATE TABLE table_73329 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text, "National Open" text )
What league was involved in 2010?
SELECT "League" FROM table_73329 WHERE "Year" = '2010'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) 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...
For each record in schedule, show the number of films for each day in a bar chart, display by the y axis in ascending.
SELECT Date, COUNT(Date) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY COUNT(Date)
nvbench
CREATE TABLE table_name_92 ( merconorte INTEGER, superliga VARCHAR, interliga VARCHAR, matches VARCHAR )
Name the least merconorte for interliga of 2 and matches more than 260 with superliga more than 7
SELECT MIN(merconorte) FROM table_name_92 WHERE interliga = 2 AND matches > 260 AND superliga > 7
sql_create_context
CREATE TABLE table_1140074_2 ( pole_position VARCHAR, location VARCHAR )
what's the pole position with location being hockenheimring
SELECT pole_position FROM table_1140074_2 WHERE location = "Hockenheimring"
sql_create_context
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_DIRE_CD text, MED_DIRE_NM text,...
自2014.9.1起,止2020.1.14止,自付比例低于0.41的药品一共给患者65887975开出了多少
SELECT COUNT(*) 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.PERSON_ID = '65887975' AND t_kc22.STA_DATE BETWEEN '2014-09-01' AND '2020-01-14' AND t_kc22.SELF_PAY_PRO < 0.41
css
CREATE TABLE table_name_49 ( decision VARCHAR, attendance INTEGER )
What is the decision of the game with an attendance greater than 19,883?
SELECT decision FROM table_name_49 WHERE attendance > 19 OFFSET 883
sql_create_context
CREATE TABLE table_name_59 ( winner VARCHAR, runner_up VARCHAR, country VARCHAR )
Who was the winner from the United States the year Kimberly Kim was runner-up?
SELECT winner FROM table_name_59 WHERE runner_up = "kimberly kim" AND country = "united states"
sql_create_context
CREATE TABLE table_23183195_2 ( team VARCHAR, overall_record VARCHAR )
What team's overal record is 22-11?
SELECT team FROM table_23183195_2 WHERE overall_record = "22-11"
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 of protestant quaker religion are procedured with int insert 1-cham, rate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND procedures.short_title = "Int insert 1-cham, rate"
mimicsql_data
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...
在2014-10-07到2015-04-15的这几年里,查一下医院8417883中所有郑姓患者的医疗就诊记录
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8417883' AND gwyjzb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND gwyjzb.PERSON_NM LIKE '郑%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8417883' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND fgwyjzb.PERSON_NM LIKE '郑%'
css
CREATE TABLE table_name_2 ( series VARCHAR, game INTEGER )
What was the series standing for games over 4?
SELECT series FROM table_name_2 WHERE game > 4
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 ) ...
calculate the total number of patients diagnosed with icd9 code 30390 who had their blood gas tested by 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 = "30390" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_type_description VARCHAR(255) )...
Plot date to by the number of date to as a trend line, and sort by the x-axis from high to low.
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to DESC
nvbench
CREATE TABLE table_29931 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the number of score for january 12
SELECT COUNT("Score") FROM table_29931 WHERE "Date" = 'January 12'
wikisql
CREATE TABLE table_40746 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
Which television service has italian for its language?
SELECT "Television service" FROM table_40746 WHERE "Language" = 'italian'
wikisql
CREATE TABLE table_name_69 ( discovery___publication_of_name VARCHAR, species VARCHAR )
Tell me the discovery/publication for red deer cave people
SELECT discovery___publication_of_name FROM table_name_69 WHERE species = "red deer cave people"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_4 ( crowd VARCHAR, venue VARCHAR )
How many people watch at Western Oval venue?
SELECT COUNT(crowd) FROM table_name_4 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_2603017_2 ( b___bishop VARCHAR, bc___beast_cadet VARCHAR )
what is b - bishop where bc - beast cadet is gr - great dove?
SELECT b___bishop FROM table_2603017_2 WHERE bc___beast_cadet = "GR - Great Dove"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many patients with st elevated myocardial infarction/cardiac catheterization primary disease were admitted to hospital before 2135?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2135"
mimicsql_data
CREATE TABLE table_29723 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who were the 76ers opponents on January 17?
SELECT "Team" FROM table_29723 WHERE "Date" = 'January 17'
wikisql
CREATE TABLE table_203_274 ( id number, "church name" text, "address" text, "community" text, "school" text )
is our lady of loretto listed above or below the holy spirit ?
SELECT (SELECT id FROM table_203_274 WHERE "church name" = 'our lady of loretto') < (SELECT id FROM table_203_274 WHERE "church name" = 'holy spirit')
squall
CREATE TABLE table_name_51 ( date VARCHAR, livery VARCHAR )
What is the date for the Operational Livery?
SELECT date FROM table_name_51 WHERE livery = "operational"
sql_create_context
CREATE TABLE table_28668784_1 ( city___town VARCHAR, stadium VARCHAR )
What town holds Stadion Zlatica?
SELECT city___town FROM table_28668784_1 WHERE stadium = "Stadion Zlatica"
sql_create_context
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, ...
列出患者43772576所有检验结果指标记录中的仪器编号以及名称在2005-02-16到2014-01-13内均为什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_23014685_1 ( area_damaged VARCHAR, target VARCHAR )
What area was damaged when King Khalid Military City was targeted?
SELECT area_damaged FROM table_23014685_1 WHERE target = "King Khalid Military City"
sql_create_context
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 patient ( uniquep...
in 01/last year what was the first value of a rdw lab test of patient 006-65715?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-65715')) AND lab.labname = 'rdw' AND DATETIME(lab.labresulttime, 'start of year') =...
eicu