context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_36 ( school_club_team VARCHAR, round VARCHAR, position VARCHAR )
What school did the linebacker who was drafted after round 8 come from?
SELECT school_club_team FROM table_name_36 WHERE round > 8 AND position = "linebacker"
sql_create_context
CREATE TABLE table_17299 ( "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 was the game 39?
SELECT COUNT("Record") FROM table_17299 WHERE "Game" = '39'
wikisql
CREATE TABLE table_14170 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Release price ( USD )" tex...
What turbo has a L2 cache of 4 256 kb, a release date of June 2013, and a Model number of core i7-4770s?
SELECT "Turbo" FROM table_14170 WHERE "L2 cache" = '4 × 256 kb' AND "Release date" = 'june 2013' AND "Model number" = 'core i7-4770s'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
calculate the probability of survival for four year among the patients diagnosed with upper respiratory obstruction - due to tumor.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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...
Return a bar chart about the distribution of All_Games and School_ID , list by the School_ID in descending.
SELECT All_Games, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
what is the one year survival rate for a patient with facial bone fracture - maxillary fracture?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number,...
what were the top five diagnoses that had the highest one year mortality rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_12962773_12 ( player VARCHAR, height VARCHAR )
WHat is the number for the player whose height is 2.01?
SELECT COUNT(player) FROM table_12962773_12 WHERE height = "2.01"
sql_create_context
CREATE TABLE table_56308 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What is the tournament surface at Aptos?
SELECT "Surface" FROM table_56308 WHERE "Tournament" = 'aptos'
wikisql
CREATE TABLE table_43173 ( "Name" text, "Position" text, "Number" text, "School/Club Team" text, "Season" text, "Acquisition via" text )
What season did School/Club Team, East have an Acquisition via of trade?
SELECT "Season" FROM table_43173 WHERE "Acquisition via" = 'trade' AND "School/Club Team" = 'east'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医院4072141中给患者74583279开出的单价最高的药品编号都是?药品名称都叫什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '74583279' AND gwyjzb.MED_SER_ORG_NO = '4072141' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '74583279' AND fg...
css
CREATE TABLE table_name_3 ( position VARCHAR, hometown VARCHAR )
What is the position of the player from Fort Lauderdale, Florida?
SELECT position FROM table_name_3 WHERE hometown = "fort lauderdale, florida"
sql_create_context
CREATE TABLE table_22285 ( "No. overall" real, "No. in series" real, "Title" text, "Director" text, "Writer" text, "Original air date" text, "Production code" real )
Who wrote 'episode 10'?
SELECT "Writer" FROM table_22285 WHERE "Title" = 'Episode 10'
wikisql
CREATE TABLE table_name_65 ( call_sign VARCHAR, city_of_license VARCHAR )
What call sign is licensed in soledad, california?
SELECT call_sign FROM table_name_65 WHERE city_of_license = "soledad, california"
sql_create_context
CREATE TABLE table_848 ( "Rnd" real, "Circuit" text, "GTO Winning Team" text, "GTU Winning Team" text, "TO Winning Team" text, "TU Winning Team" text, "Results" text )
On what circuit was the GTU winning team #59 Brumos Porsche - Audi in round 5?
SELECT "Circuit" FROM table_848 WHERE "Rnd" = '5' AND "GTU Winning Team" = '#59 Brumos Porsche - Audi'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, J...
看看病患33309508颅部各项指标的检验结果怎么样
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
css
CREATE TABLE table_33089 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the attendance on the bye week?
SELECT "Attendance" FROM table_33089 WHERE "Date" = 'bye'
wikisql
CREATE TABLE faculty ( lname VARCHAR, rank VARCHAR ) CREATE TABLE Faculty ( lname VARCHAR, facID VARCHAR ) CREATE TABLE activity ( activity_name VARCHAR ) CREATE TABLE Faculty_participates_in ( facID VARCHAR, actid VARCHAR )
Find the first names of professors who are not playing Canoeing or Kayaking.
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
sql_create_context
CREATE TABLE table_name_49 ( seasons VARCHAR, total_seasons VARCHAR, city VARCHAR )
What is the season that has fewer than 5 total seasons and is in Ottawa, Ontario?
SELECT seasons FROM table_name_49 WHERE total_seasons < 5 AND city = "ottawa, ontario"
sql_create_context
CREATE TABLE table_41567 ( "Year" real, "January" real, "February" real, "March" real, "April" real, "June" real, "July" real, "August" real, "September" real, "October" real, "November" real, "December" real, "Annual Additions(in millions)" real, "Average Monthly...
What is the total number for November, larger than 8.53 in February, 20.21 in March, and less than 7.9 in September?
SELECT COUNT("November") FROM table_41567 WHERE "February" > '8.53' AND "March" = '20.21' AND "September" < '7.9'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter, list in desc by the Y.
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer) DESC
nvbench
CREATE TABLE table_15887683_5 ( language VARCHAR, television_service VARCHAR, n° VARCHAR )
What language is Sky Cinema Passion television service n. 308?
SELECT language FROM table_15887683_5 WHERE television_service = "Sky Cinema Passion" AND n° = "308"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Road.
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
nvbench
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
For those employees who was hired before 2002-06-21, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, and sort y-axis from high to low order please.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
I want to take a 16 -credit course on Cinema and the Francophone World .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Cinema and the Francophone World%' OR name LIKE '%Cinema and the Francophone World%') AND credits = 16
advising
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
审核检验报告单19700369409的人姓名以及工号都是什么?
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.BGDH = '19700369409' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.BGDH = '19700369409'
css
CREATE TABLE table_15568886_14 ( proto_austronesian VARCHAR, proto_oceanic VARCHAR )
Name the proto-austrronesian for *pine, *papine
SELECT proto_austronesian FROM table_15568886_14 WHERE proto_oceanic = "*pine, *papine"
sql_create_context
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE ...
Which countries has the most number of airlines whose active status is 'Y'?
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_20922 ( "Country" text, "Region" text, "Joined OPEC" real, "Population (July 2012)" real, "Area (km\u00b2)" real, "Production ( bbl /day)" text )
What was the minimum area in square kilometers that produced 3,200,000 (12th) bbl/day?
SELECT MIN("Area (km\u00b2)") FROM table_20922 WHERE "Production ( bbl /day)" = '3,200,000 (12th)'
wikisql
CREATE TABLE table_35179 ( "Year" real, "Title" text, "Director" text, "Writer" text, "Notes" text )
What notes did the creature comforts film have?
SELECT "Notes" FROM table_35179 WHERE "Title" = 'creature comforts'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents...
calculate five year survival probability of patients who were prescribed lactulose after having been diagnosed with digestive neoplasm nos?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Desc...
How many documents are created in each day? Bin the document date by year interval with a line chart, and show by the x axis in descending please.
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC
nvbench
CREATE TABLE table_name_54 ( name VARCHAR, length_meters VARCHAR, km_from_kingston VARCHAR )
What is Name, when Length Meters is greater than 66.4, and when Km From Kingston is 138.8?
SELECT name FROM table_name_54 WHERE length_meters > 66.4 AND km_from_kingston = 138.8
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
when was the last time that patient 003-7849 was prescribed dextrose 50% abboject and glucose-vitamin c 4-0.006 g po chew until 34 months ago at the same time?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'glucose-vitamin c 4-0.006 g po chew' AND patient.uniquepid = '003-7849' AND DATETIME(medication.drugstarttime) <= DATETIM...
eicu
CREATE TABLE table_25689740_2 ( Ends VARCHAR, pa VARCHAR )
What is shown for ends lost when pa is 44?
SELECT Ends AS lost FROM table_25689740_2 WHERE pa = 44
sql_create_context
CREATE TABLE albums ( id INTEGER, title VARCHAR(160), artist_id INTEGER ) CREATE TABLE genres ( id INTEGER, name VARCHAR(120) ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, ...
Visualize a bar chart for how many tracks does each genre have and what are the names of the top 5?
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5
nvbench
CREATE TABLE table_name_42 ( points INTEGER, entrant VARCHAR, chassis VARCHAR )
What is the total number of Points that Peter Whitehead earned in a Ferrari 125?
SELECT SUM(points) FROM table_name_42 WHERE entrant = "peter whitehead" AND chassis = "ferrari 125"
sql_create_context
CREATE TABLE table_name_89 ( us_dance VARCHAR, year INTEGER )
Name the US dance when the year is more than 1985
SELECT us_dance FROM table_name_89 WHERE year > 1985
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Top User Of a Peticular Tag in Iran.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", TagName, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ...
sede
CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Ag...
Show the comparison of the total number of the home city of all drivers with a bar chart, I want to rank in descending by the bars.
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY Home_city DESC
nvbench
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...
Which tests have 'Pass' results? Return the dates when the tests were taken, and count them by a bar chart, order by the Y in asc.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken)
nvbench
CREATE TABLE table_47860 ( "Date" text, "Time" text, "Opponent" text, "Site" text, "City" text )
What is the site where the game was held in the city of Delaware?
SELECT "Site" FROM table_47860 WHERE "City" = 'delaware'
wikisql
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) 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 section ( course...
Find the number of courses provided in each year with a group line chart that groups by semester, and I want to show in desc by the X.
SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year DESC
nvbench
CREATE TABLE table_45573 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
What is the sum of To Par, when Player is 'Bob Rosburg'?
SELECT SUM("To par") FROM table_45573 WHERE "Player" = 'bob rosburg'
wikisql
CREATE TABLE table_74389 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the title of episode 10?
SELECT "Title" FROM table_74389 WHERE "No. in season" = '10'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
Find questions only tagged with one thing, that isn't also in the title.
SELECT Id AS "post_link", Tags FROM Posts WHERE Tags LIKE '<gimp>' AND NOT Title LIKE '%gimp%'
sede
CREATE TABLE table_62056 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What week were there 56,023 people in attendance?
SELECT COUNT("Week") FROM table_62056 WHERE "Attendance" = '56,023'
wikisql
CREATE TABLE table_204_609 ( id number, "year" number, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
tell me the number of times he finished above 10th place .
SELECT COUNT(*) FROM table_204_609 WHERE "finish" < 10
squall
CREATE TABLE table_1805191_36 ( candidates VARCHAR, incumbent VARCHAR )
Who were all the candidates in elections in which Steve Chabot was a candidate?
SELECT candidates FROM table_1805191_36 WHERE incumbent = "Steve Chabot"
sql_create_context
CREATE TABLE table_name_58 ( bronze INTEGER, gold VARCHAR, silver VARCHAR, total VARCHAR )
What is the lowest bronze a team with 9 silvers, a total larger than 13, and more than 13 gold medals has?
SELECT MIN(bronze) FROM table_name_58 WHERE silver = 9 AND total > 13 AND gold > 13
sql_create_context
CREATE TABLE table_48309 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Silver has a Rank of 1, and a Total smaller than 11?
SELECT SUM("Silver") FROM table_48309 WHERE "Rank" = '1' AND "Total" < '11'
wikisql
CREATE TABLE procedures ( 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, ...
count the number of patients whose drug route is both eyes.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE table_name_5 ( crowd INTEGER, home_team VARCHAR )
What is the highest crowd number for the home team Richmond?
SELECT MAX(crowd) FROM table_name_5 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE table_203_212 ( id number, "#" number, "district" text, "land area (km2)" number, "population\n(2010 census)" number, "density (persons/km2)" number )
how many more people live in dennery than the forest reserve ?
SELECT (SELECT "population\n(2010 census)" FROM table_203_212 WHERE "district" = 'dennery') - (SELECT "population\n(2010 census)" FROM table_203_212 WHERE "district" = 'forest reserve')
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what are the top four prescribed drugs among patients with age 60 or above since 2101?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', medication.drugstarttime) >= '2101' GROUP BY medication.drugname) AS t1 W...
eicu
CREATE TABLE table_name_81 ( digital_psip INTEGER, call_sign VARCHAR, broadcast_channel VARCHAR )
What is the lowest Digital PSIP for channels over 29 with callsign CFTU-DT?
SELECT MIN(digital_psip) FROM table_name_81 WHERE call_sign = "cftu-dt" AND broadcast_channel > 29
sql_create_context
CREATE TABLE table_68894 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Name the opponent with record of 12-18
SELECT "Opponent" FROM table_68894 WHERE "Record" = '12-18'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
Can SAC 440 be taken by me in Spring-Summer 2001 ?
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
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...
在78308838010住院就诊中,出院的病区是哪个?编码是什么?床位号呢
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '78308838010'
css
CREATE TABLE table_name_59 ( points INTEGER, entrant VARCHAR, year VARCHAR )
What is the total amount of points that Christy has in the years before 1954?
SELECT SUM(points) FROM table_name_59 WHERE entrant = "christy" AND year < 1954
sql_create_context
CREATE TABLE table_63508 ( "Total fat" text, "Saturated fat" text, "Monounsaturated fat" text, "Polyunsaturated fat" text, "Smoke point" text )
What is the saturated fat with 28g of polyunsaturated fat?
SELECT "Saturated fat" FROM table_63508 WHERE "Polyunsaturated fat" = '28g'
wikisql
CREATE TABLE table_23906 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Accreditation" text, "Founded" text, "Enrollment" text )
What is the control type which was founded in 1818?
SELECT "Control" FROM table_23906 WHERE "Founded" = '1818'
wikisql
CREATE TABLE table_name_51 ( round VARCHAR, position VARCHAR, college VARCHAR )
Name the total number of round for wide receiver for kent state
SELECT COUNT(round) FROM table_name_51 WHERE position = "wide receiver" AND college = "kent state"
sql_create_context
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...
Bring the list of patients younger than 41 years of age who had a blood lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
What are all the different zip codes that have a maximum dew point that was always below 70?
SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70
spider
CREATE TABLE table_15852257_1 ( podiums VARCHAR, final_placing VARCHAR )
Which podiums have a final placing of 10th?
SELECT podiums FROM table_15852257_1 WHERE final_placing = "10th"
sql_create_context
CREATE TABLE table_16901 ( "number" real, "date of debut" text, "name" text, "date of birth" text, "number of caps" real, "number of goals" real, "date of death\u2020" text )
What is the name of person that scored 10 goals?
SELECT "name" FROM table_16901 WHERE "number of goals" = '10'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId numb...
All swift-related questions in 2015.
SELECT Id, PostTypeId, Body, ParentId, CreationDate, Score FROM Posts AS p WHERE p.ParentId IN (SELECT Id FROM Posts AS q WHERE (q.Tags LIKE '%<swift>%' OR q.Tags LIKE '%<swift2>%' OR q.Tags LIKE '%<swift-playground>%' OR q.Tags LIKE '%<swift-json>%' OR q.Tags LIKE '%<swift-generics>%' OR q.Tags LIKE '%<swift-extension...
sede
CREATE TABLE table_name_27 ( fourth_quarter VARCHAR, rank VARCHAR, second_quarter VARCHAR )
When the rank is less than 4, and has a second quarter of exxon mobil 341,140.3, what is the fourth quarter?
SELECT fourth_quarter FROM table_name_27 WHERE rank < 4 AND second_quarter = "exxon mobil 341,140.3"
sql_create_context
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 cost ( row_id number, subject_id number, hadm_id nu...
how much dose of lactated ringers did patient 24894 receive on 11/29/2100?
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 = 24894)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), Company varchar(80), Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), Phone varchar(24), Fax varchar(24), Email varchar(60), ...
What are the titles and ids for albums containing tracks with unit price greater than 1, could you order by the y axis in asc?
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId
nvbench
CREATE TABLE table_name_59 ( rank INTEGER, annual_change VARCHAR )
What is the average rank of the airport with a 9.3% annual change?
SELECT AVG(rank) FROM table_name_59 WHERE annual_change = "9.3%"
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 prescriptions...
count the number of patients whose admission year is less than 2154 and diagnoses long title is congestive heart failure, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.long_title = "Congestive heart failure, unspecified"
mimicsql_data
CREATE TABLE procedures ( 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 ) ...
count the number of patients whose age is less than 81 and drug code is metd10?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "METD10"
mimicsql_data
CREATE TABLE table_9220 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
what is the week when the finalist is marcelo r os?
SELECT "Week" FROM table_9220 WHERE "Finalist" = 'marcelo ríos'
wikisql
CREATE TABLE table_204_261 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many medals did france get in total ?
SELECT "total" FROM table_204_261 WHERE "nation" = 'france'
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
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, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_75839 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average Total with a Nation of ethiopia (eth) and a Rank that is larger than 9?
SELECT AVG("Total") FROM table_75839 WHERE "Nation" = 'ethiopia (eth)' AND "Rank" > '9'
wikisql
CREATE TABLE table_3618 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
When was William Kennedy first elected?
SELECT "First elected" FROM table_3618 WHERE "Incumbent" = 'William Kennedy'
wikisql
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.decision = 'yes'
spider
CREATE TABLE table_202_75 ( id number, "award" text, "category" text, "recipients and nominees" text, "result" text )
which category did both warren beatty and jeremy pikser each won together ?
SELECT "category" FROM table_202_75 WHERE "recipients and nominees" = 'warren beatty' AND "result" = 'won' INTERSECT SELECT "category" FROM table_202_75 WHERE "recipients and nominees" = 'jeremy pikser' AND "result" = 'won'
squall
CREATE TABLE table_name_71 ( record VARCHAR, opponent VARCHAR )
Name the record with opponent of christian nielson
SELECT record FROM table_name_71 WHERE opponent = "christian nielson"
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 prescriptions...
how many patients whose ethnicity is white and drug route is replace?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name varcha...
Find all Bars in Dallas
SELECT business.name FROM business, category WHERE business.city = 'Dallas' AND category.business_id = business.business_id AND category.category_name = 'Bars'
yelp
CREATE TABLE table_38761 ( "The Kennel Club (UK) Toy Group" text, "Canadian Kennel Club Toy Dogs Group" text, "American Kennel Club Toy Group" text, "Australian National Kennel Council Toy Dogs Group" text, "New Zealand Kennel Club Toy Group" text )
What is the New Zealand Kennel Club Toy Group with papillon as the Australian National Kennel Council Toy Dogs Group breed?
SELECT "New Zealand Kennel Club Toy Group" FROM table_38761 WHERE "Australian National Kennel Council Toy Dogs Group" = 'papillon'
wikisql
CREATE TABLE table_name_20 ( sales_area__m²_ INTEGER, sales_per_area VARCHAR, no_of_stores VARCHAR )
What is the smallest sales area (m ) that has 4,094/m and more than 2 stores?
SELECT MIN(sales_area__m²_) FROM table_name_20 WHERE sales_per_area = "€4,094/m²" AND no_of_stores > 2
sql_create_context
CREATE TABLE table_12896884_1 ( city VARCHAR, enrollment VARCHAR )
How many cities have an enrollment of 19082?
SELECT COUNT(city) FROM table_12896884_1 WHERE enrollment = 19082
sql_create_context
CREATE TABLE table_name_27 ( competition VARCHAR, score VARCHAR )
What Competition had a Score of 3 3?
SELECT competition FROM table_name_27 WHERE score = "3–3"
sql_create_context
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 ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
has any organism been observed in the first microbiological examination of patient 31325's bone marrow in their first hospital visit?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31325 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'bone marrow' AND NOT microbiologyevents.org_...
mimic_iii
CREATE TABLE table_14549 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "NFL Recap" text, "Record" text, "Attendance" text )
What was the NFL Recap of the game held on December 24, 2005?
SELECT "NFL Recap" FROM table_14549 WHERE "Date" = 'december 24, 2005'
wikisql
CREATE TABLE table_26449 ( "Song title" text, "Artist" text, "Year" real, "Genre" text, "Single / Pack name" text, "Release date" text, "Family Friendly" text, "Additional Rock Band 3 Features" text )
What is the year for the genre of emo and artist is all-american rejects and song title is ' move along '?
SELECT MAX("Year") FROM table_26449 WHERE "Genre" = 'Emo' AND "Artist" = 'All-American Rejects' AND "Song title" = ' Move Along '
wikisql
CREATE TABLE table_65988 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Bronze has a Nation of austria, and a Total larger than 6?
SELECT MAX("Bronze") FROM table_65988 WHERE "Nation" = 'austria' AND "Total" > '6'
wikisql
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...
查查编号为59839403的病患被开出过药品金额超过2930.76元的医疗记录,看看这些医疗就诊的编码
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '59839403' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2930.76) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '59839403' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOU...
css
CREATE TABLE table_43011 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
Which Team has a Score of 89-123?
SELECT "Team" FROM table_43011 WHERE "Score" = '89-123'
wikisql
CREATE TABLE table_name_2 ( region VARCHAR, date VARCHAR )
What is the Region of the release on December 22, 2008?
SELECT region FROM table_name_2 WHERE date = "december 22, 2008"
sql_create_context
CREATE TABLE table_name_40 ( prize_money VARCHAR, matches VARCHAR, new_entries_this_round VARCHAR )
What is the prize money amount after match 1, with 102 new entries to the round?
SELECT prize_money FROM table_name_40 WHERE matches > 1 AND new_entries_this_round = "102"
sql_create_context
CREATE TABLE table_1388 ( "Frequency" text, "Station" text, "Operator" text, "Language" text, "Genre" text, "Coverage Area" text )
What is the name of the station where the language is tamil malay?
SELECT "Station" FROM table_1388 WHERE "Language" = 'Tamil Malay'
wikisql
CREATE TABLE table_80318 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
Which venue had an extra of Junior Race?
SELECT "Venue" FROM table_80318 WHERE "Extra" = 'junior race'
wikisql
CREATE TABLE table_61236 ( "Position" text, "Driver" text, "Entrant" text, "Class" text, "Laps" real )
Can you tell me the Position that has the Entrant of j ampt?
SELECT "Position" FROM table_61236 WHERE "Entrant" = 'j ampt'
wikisql
CREATE TABLE table_27950 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
Was the constitution amended when the percentage of yes votes was 69.82%?
SELECT "Const. Amd.?" FROM table_27950 WHERE "% YES" = '69.82%'
wikisql