context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_97 ( engine VARCHAR, year VARCHAR, entrant VARCHAR )
What engine was used by Ram Penthouse Rizla Racing in 1978?
SELECT engine FROM table_name_97 WHERE year > 1978 AND entrant = "ram penthouse rizla racing"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
find all flights from PHILADELPHIA to DALLAS stopping in ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit...
atis
CREATE TABLE table_name_62 ( position VARCHAR, goals_for VARCHAR, played VARCHAR )
How many positions have goals of fewer than 40 and more than 38 played?
SELECT COUNT(position) FROM table_name_62 WHERE goals_for < 40 AND played > 38
sql_create_context
CREATE TABLE table_203_595 ( id number, "year" number, "division" number, "league" text, "reg. season" text, "playoffs" text, "open cup" text )
how many times did they not qualify for both playoffs and open cup ?
SELECT COUNT(*) FROM table_203_595 WHERE "playoffs" = 'did not qualify' AND "open cup" = 'did not qualify'
squall
CREATE TABLE table_204_363 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text )
which event comes before dynamite !! usa ?
SELECT "event" FROM table_204_363 WHERE id = (SELECT id FROM table_204_363 WHERE "event" = 'dynamite!! usa') - 1
squall
CREATE TABLE table_71845 ( "Year" text, "Team" text, "Attempts" text, "Completions" text, "Completion %" text, "Yards" text )
Which team has a 59.8% completion rate?
SELECT "Team" FROM table_71845 WHERE "Completion %" = '59.8%'
wikisql
CREATE TABLE table_2889300_6 ( drumset_name VARCHAR, drumstand__oftenoptional_ VARCHAR, tom_tom_pads VARCHAR )
how many drumsets of drumstand (oftenoptional) with hd-1/3stand and tom-tom pads is 3xcloth-head are
SELECT COUNT(drumset_name) FROM table_2889300_6 WHERE drumstand__oftenoptional_ = "HD-1/3Stand" AND tom_tom_pads = "3xCloth-Head"
sql_create_context
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 ) ...
what is marital status and death status of subject id 98220?
SELECT demographic.marital_status, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "98220"
mimicsql_data
CREATE TABLE table_59811 ( "Rank" real, "Show" text, "Number of Viewers" text, "Date" text, "Network" text )
Which Rank has a Network of bbc one, and a Number of Viewers of 30.15million? Question 2
SELECT SUM("Rank") FROM table_59811 WHERE "Network" = 'bbc one' AND "Number of Viewers" = '30.15million'
wikisql
CREATE TABLE table_47802 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the maximum pick when WR was the position and Michigan the college, and the overall greater than 255?
SELECT MAX("Pick") FROM table_47802 WHERE "Position" = 'wr' AND "College" = 'michigan' AND "Overall" > '255'
wikisql
CREATE TABLE table_22669 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
Name the high rebounds for record 7-1
SELECT "High rebounds" FROM table_22669 WHERE "Record" = '7-1'
wikisql
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision Plot them as bar chart, order X-axis in asc order.
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state
nvbench
CREATE TABLE table_21796261_4 ( record VARCHAR, location VARCHAR )
What's the record achieved in the gamed played at BC Place Stadium?
SELECT record FROM table_21796261_4 WHERE location = "BC Place Stadium"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flig...
i'd like to go from ST. PAUL to KANSAS CITY on friday with a meal
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, food_service WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight....
atis
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, sort by the X in ascending.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_name_40 ( date_of_issue VARCHAR, place_of_issue VARCHAR )
On what date were sheets issued in Tallahassee, Florida?
SELECT date_of_issue FROM table_name_40 WHERE place_of_issue = "tallahassee, florida"
sql_create_context
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
which team took first place ?
SELECT "club" FROM table_204_135 WHERE "position" = 1
squall
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For all employees who have the letters D or S in their first name, find hire_date and the average of manager_id bin hire_date by time, and visualize them by a bar chart.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_203_609 ( id number, "#" number, "matters" text, "sections of the constitution allowing their institution" text, "eligible petitioners" text, "type" text )
how many matters have political party as their type ?
SELECT COUNT("matters") FROM table_203_609 WHERE "type" = 'political party'
squall
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 ) ...
how many patients admitted via office referral are less than 49 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.age < "49"
mimicsql_data
CREATE TABLE table_name_61 ( named VARCHAR, latitude VARCHAR )
Tell me the named for latitude of 6.4
SELECT named AS after FROM table_name_61 WHERE latitude = 6.4
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE tr...
i would like to get the top five diagnosis that has the highest three 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_34156 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real )
What number is Tony Dixon?
SELECT "Number" FROM table_34156 WHERE "Name" = 'tony dixon'
wikisql
CREATE TABLE table_name_11 ( method VARCHAR, event VARCHAR )
What was the method for the UFC Fight Night 10 event?
SELECT method FROM table_name_11 WHERE event = "ufc fight night 10"
sql_create_context
CREATE TABLE table_36201 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Points have a Game larger than 25, and an Opponent of dallas stars?
SELECT AVG("Points") FROM table_36201 WHERE "Game" > '25' AND "Opponent" = 'dallas stars'
wikisql
CREATE TABLE table_52129 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
What is the Label for Date of 14 November 2003, and Catalogue tojp 60121-22?
SELECT "Label" FROM table_52129 WHERE "Date" = '14 november 2003' AND "Catalogue" = 'tojp 60121-22'
wikisql
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_stat...
What zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature?
SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80
spider
CREATE TABLE table_21372 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
What is the population that has an area of 715.58?
SELECT "Population" FROM table_21372 WHERE "Area km 2" = '715.58'
wikisql
CREATE TABLE table_20799 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real )
What is the location of the school established in 1923
SELECT "Location" FROM table_20799 WHERE "Established" = '1923'
wikisql
CREATE TABLE table_name_17 ( county VARCHAR, school VARCHAR )
In what county is the school of Merrillville?
SELECT county FROM table_name_17 WHERE school = "merrillville"
sql_create_context
CREATE TABLE table_35851 ( "Name" text, "Hanzi" text, "Hanyu Pinyin" text, "Population (2010-11-01)" text, "Area (km\u00b2)" text, "Density (/km\u00b2)" text )
What is the population for the area that has a Hanzi of ?
SELECT "Population (2010-11-01)" FROM table_35851 WHERE "Hanzi" = '延寿县'
wikisql
CREATE TABLE table_name_28 ( losses INTEGER, draws INTEGER )
Which Losses have Draws larger than 0?
SELECT MAX(losses) FROM table_name_28 WHERE draws > 0
sql_create_context
CREATE TABLE table_33692 ( "Name" text, "Bullet" text, "Length" text, "Base" text, "Shoulder" text, "Neck" text )
What bullet does the gun with a shoulder measurement of 12.5 (.491)?
SELECT "Bullet" FROM table_33692 WHERE "Shoulder" = '12.5 (.491)'
wikisql
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 intakeoutput ( in...
for patients who were prescribed with aspirin 325 mg ec tab since 6 years ago, what are the top five most common drugs that followed within the same month?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'aspirin 325 mg ec tab' AND DATETIME(medication.drug...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose death status is 0 and procedure short title is venous cath nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Venous cath NEC"
mimicsql_data
CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, ...
What conferences does Yejin Kim submit to ?
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Yejin Kim' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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, ...
specify the religion of patient josette orr
SELECT demographic.religion FROM demographic WHERE demographic.name = "Josette Orr"
mimicsql_data
CREATE TABLE table_62778 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text )
Who is the director of the production number 9368?
SELECT "Director" FROM table_62778 WHERE "Production Number" = '9368'
wikisql
CREATE TABLE table_61335 ( "Name" text, "Serie A" real, "Champions League" real, "Coppa Italia" real, "Total" real )
What's the Serie A when the coppa italia was 5?
SELECT AVG("Serie A") FROM table_61335 WHERE "Coppa Italia" = '5'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is maximum age of patients whose marital status is single and ethnicity is unknown/not specified?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "UNKNOWN/NOT SPECIFIED"
mimicsql_data
CREATE TABLE table_203_784 ( id number, "no. in\nseries" number, "no. in\nseason" number, "performer" text, "appearance" text, "air date" text )
which month had the most performers ?
SELECT "air date" FROM table_203_784 GROUP BY "air date" ORDER BY COUNT("performer") DESC LIMIT 1
squall
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what number of patients with primary disease as overdose had procedure called contr cerebr arteriogram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND procedures.short_title = "Contr cerebr arteriogram"
mimicsql_data
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
show me all flights from DENVER to PHILADELPHIA which leave next saturday afternoon
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 = 'PHILADELPHIA' AND date_day.day_number = 26 AND date_day.month_number = 7...
atis
CREATE TABLE table_66482 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What country did ekaterina karsten row for with fa listed under notes?
SELECT "Country" FROM table_66482 WHERE "Notes" = 'fa' AND "Athlete" = 'ekaterina karsten'
wikisql
CREATE TABLE table_25107064_2 ( Ends VARCHAR, blank_ends VARCHAR )
Name the ends won for blank ends for 0
SELECT Ends AS won FROM table_25107064_2 WHERE blank_ends = 0
sql_create_context
CREATE TABLE table_name_62 ( normal_total VARCHAR, que VARCHAR )
Name the normal with que of 24
SELECT normal_total FROM table_name_62 WHERE que = "24"
sql_create_context
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), buildi...
Bar graph to show minimal room count from different apt type code, and order in ascending by the Y-axis.
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count)
nvbench
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 diagnosis ( diagn...
what is the average total hospital cost, that includes diagnostic ultrasound of heart - transthoracic echocardiography in 2105?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'diagnostic ultrasound of heart - transthorac...
eicu
CREATE TABLE table_name_38 ( volume VARCHAR, isbn VARCHAR )
What volume number has the ISBN of 978-1-59582-712-8 (hc) 978-1-59582-713-5 (tpb)?
SELECT volume FROM table_name_38 WHERE isbn = "978-1-59582-712-8 (hc) 978-1-59582-713-5 (tpb)"
sql_create_context
CREATE TABLE table_name_81 ( revenues VARCHAR, courtesy_title VARCHAR )
What is the Revenues of Ukyo-Daiyu?
SELECT revenues FROM table_name_81 WHERE courtesy_title = "ukyo-daiyu"
sql_create_context
CREATE TABLE table_66821 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "FCC info" text )
Name the total number of ERP W when the call sign is w217bf
SELECT COUNT("ERP W") FROM table_66821 WHERE "Call sign" = 'w217bf'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
give me the number of patients whose year of death is less than or equal to 2133 and procedure icd9 code is 3142?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2133.0" AND procedures.icd9_code = "3142"
mimicsql_data
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients less than 79 years who are suffering from posterior communicating aneurysm/sda primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" AND demographic.age < "79"
mimicsql_data
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
Accept rate of answers vs total answers written.
SELECT 10 * (answer_count / 10) AS answer_count, 100 * SUM(accepted_answer_count) / SUM(answer_count) AS accepted_percent FROM (SELECT Users.Id, COUNT(*) AS answer_count, SUM(CASE WHEN questions.AcceptedAnswerId = answers.Id THEN 1 ELSE 0 END) AS accepted_answer_count FROM Posts AS answers INNER JOIN Users AS users ON ...
sede
CREATE TABLE table_1163 ( "Rnd" real, "Pick" real, "Player name" text, "Position" text, "College" text, "Height" text, "Weight" text )
How many colleges did the player picked 57 attend?
SELECT COUNT("College") FROM table_1163 WHERE "Pick" = '57'
wikisql
CREATE TABLE table_2316 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment" real, "Founded" real )
How much would you expect the enrollment to be in Springfield?
SELECT MIN("Enrollment") FROM table_2316 WHERE "Location(s)" = 'Springfield'
wikisql
CREATE TABLE table_62156 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the To par of the Place 1 Player?
SELECT "To par" FROM table_62156 WHERE "Place" = '1'
wikisql
CREATE TABLE table_name_87 ( date VARCHAR, city VARCHAR )
What is Date, when City is 'Punta Del Este'?
SELECT date FROM table_name_87 WHERE city = "punta del este"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TAB...
What are the best NLP conferences ?
SELECT DISTINCT COUNT(DISTINCT cite.citingpaperid), paper.venueid FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'NLP' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.venueid ORDER BY COUN...
scholar
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For those employees who was hired before 2002-06-21, find hire_date and the average of department_id bin hire_date by time, and visualize them by a bar chart, and could you show by the Y-axis from low to high please?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_dev_53 ( "id" int, "anemia" bool, "gender" string, "hemoglobin_a1c_hba1c" float, "dyslipidemia" bool, "hct" int, "hematocrit_hct" float, "persistent_macroalbuminuria" bool, "urine_albumin" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "coagulopathy...
clinically significant anemia ( hct < 36 % in male , < 33 % in female )
SELECT * FROM table_dev_53 WHERE anemia = 1 OR (hct < 36 AND gender = 'male') OR (hct < 33 AND gender = 'female')
criteria2sql
CREATE TABLE table_name_93 ( top_25 VARCHAR, events INTEGER )
What is the total number of top-25 a tournament with less than 2 events has?
SELECT COUNT(top_25) FROM table_name_93 WHERE events < 2
sql_create_context
CREATE TABLE table_name_91 ( venue VARCHAR, competition VARCHAR )
What is the Venue with the Friendly Competition?
SELECT venue FROM table_name_91 WHERE competition = "friendly"
sql_create_context
CREATE TABLE table_10157 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is Richmond's away team score versus Geelong?
SELECT "Away team score" FROM table_10157 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_36527 ( "District" real, "Congress" text, "Date" text, "Predecessor" text, "Winner" text )
What predecessor has a district less than 11, 68th as the Congress, and may 1, 1923 as the date?
SELECT "Predecessor" FROM table_36527 WHERE "District" < '11' AND "Congress" = '68th' AND "Date" = 'may 1, 1923'
wikisql
CREATE TABLE table_1662 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the location attendance for 20
SELECT "Location Attendance" FROM table_1662 WHERE "Game" = '20'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
give me the total quantity of enteral impact peptide 1.5 that patient 015-23047 has taken today.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.celllabel = 'enter...
eicu
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...
what are the drugs that are added to patient 3125 today in comparison to yesterday?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ...
mimic_iii
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
Find the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties, and count them by a bar chart, and rank in asc by the x axis.
SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY Comptroller
nvbench
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, ...
papers on semantic parsing appeared at acl in 2016
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
scholar
CREATE TABLE table_55664 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Tell me the 2008 for when 2001 of wta premier 5 tournaments
SELECT "2008" FROM table_55664 WHERE "2001" = 'wta premier 5 tournaments'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id 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, JCZBJGDW t...
病患22945235在2001-12-09以前做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css
CREATE TABLE table_14904221_1 ( mens_singles VARCHAR, year VARCHAR )
WHo won men's singles in 1994?
SELECT mens_singles FROM table_14904221_1 WHERE year = 1994
sql_create_context
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...
从2007年8月3日开始,截止到2009年8月24日,请把81818459的病人总共被开出的所有检验报告单中的标本采集部位给列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '81818459' AND jybgb.BGRQ BETWEEN '2007-08-03' AND '200...
css
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...
列出医疗记录中对于10674984患者医疗费总额不少于3779.26元的出院诊断疾病编码和名称分别是什么?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '10674984' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3779.26) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '10674984' AND gyb.MED_CLINIC_ID IN (SELECT ...
css
CREATE TABLE table_1140076_2 ( report VARCHAR, race VARCHAR )
What is the report listed for the race in San Marino Grand Prix?
SELECT report FROM table_1140076_2 WHERE race = "San Marino Grand Prix"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
what was the lisinopril dose that was prescribed to patient 26995 in 11/last year for the first time?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995) AND prescriptions.drug = 'lisinopril' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFT...
mimic_iii
CREATE TABLE table_name_48 ( player VARCHAR, years_for_grizzlies VARCHAR )
Which Player has Years for Grizzlies of 2002-2003?
SELECT player FROM table_name_48 WHERE years_for_grizzlies = "2002-2003"
sql_create_context
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 ) ...
how many dead patients had ulcer of other part of foot diagnoses?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Ulcer of other part of foot"
mimicsql_data
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
Create a pie chart showing how many nationality across nationality.
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_name_81 ( position VARCHAR, round VARCHAR, overall VARCHAR )
What is the position of the player with a round less than 8 and an overall of 48?
SELECT position FROM table_name_81 WHERE round < 8 AND overall = 48
sql_create_context
CREATE TABLE table_74705 ( "Name" text, "Case type" text, "Bullet diameter" text, "Neck diameter" text, "Base diameter" text, "Rim diameter" text, "Case length" text, "Cartridge length" text )
Which Rim diameter has a Neck diameter of 11.84 (.466)?
SELECT "Rim diameter" FROM table_74705 WHERE "Neck diameter" = '11.84 (.466)'
wikisql
CREATE TABLE table_name_14 ( date VARCHAR, fastest_lap VARCHAR, race VARCHAR )
Tell me the date for jody scheckter being the fastest lap at the french grand prix
SELECT date FROM table_name_14 WHERE fastest_lap = "jody scheckter" AND race = "french grand prix"
sql_create_context
CREATE TABLE table_name_53 ( tournament VARCHAR, opponents_in_the_final VARCHAR )
Tell me the tournament for opponents of andrei pavel rogier wassen
SELECT tournament FROM table_name_53 WHERE opponents_in_the_final = "andrei pavel rogier wassen"
sql_create_context
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 diagnoses short title is ac infect polyneuritis and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Ac infect polyneuritis" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_70 ( record VARCHAR, game VARCHAR )
What was the record after game 37?
SELECT record FROM table_name_70 WHERE game = 37
sql_create_context
CREATE TABLE table_name_27 ( played INTEGER, against VARCHAR, lost VARCHAR )
What was the highest number of games played when they had over 14 against and 3 losses?
SELECT MAX(played) FROM table_name_27 WHERE against > 14 AND lost = 3
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate...
what was the number of times the adefovir dipivoxil was prescribed until 2104?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'adefovir dipivoxil' AND STRFTIME('%y', prescriptions.startdate) <= '2104'
mimic_iii
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, ...
what is the maximum age of married patients whose admission year is in or after 2184?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2184"
mimicsql_data
CREATE TABLE table_76437 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is Country, when Total is less than 290, and when Year(s) Won is 1960?
SELECT "Country" FROM table_76437 WHERE "Total" < '290' AND "Year(s) won" = '1960'
wikisql
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
For each director, how many reviews have they received?
SELECT COUNT(*), T1.director FROM movie AS T1 JOIN rating AS T2 ON T1.mid = T2.mid GROUP BY T1.director
spider
CREATE TABLE table_name_34 ( opponent VARCHAR, location VARCHAR, record VARCHAR )
Location of boston garden, and a Record of 58-23 involved what opponent?
SELECT opponent FROM table_name_34 WHERE location = "boston garden" AND record = "58-23"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
Top 50 Users from Hyderabad.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%hyderabad%' OR UPPER(Location) LIKE '%HYDERABAD' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
among patients who had a hospital stay for more than 14 days, how many of them were discharged to home?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "14"
mimicsql_data
CREATE TABLE fgwyjzb ( 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, ...
章浩然患者入院诊断疾病名称不包含癫痫在医院4333598的医疗就诊记录编号是什么号?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '章浩然' AND gwyjzb.MED_SER_ORG_NO = '4333598' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '章浩然' AND fgwyjzb.MED_SER_ORG_NO = '4333598' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%癫痫%'
css
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
List the name for storms and the number of affected regions for each storm. Plot them as pie chart.
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
nvbench
CREATE TABLE table_18645 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the party that was frist elected in 1919?
SELECT "Party" FROM table_18645 WHERE "First elected" = '1919'
wikisql
CREATE TABLE table_23575917_4 ( lees_team VARCHAR, episode VARCHAR )
Who is the Lees Team for episode 4x04?
SELECT lees_team FROM table_23575917_4 WHERE episode = "4x04"
sql_create_context
CREATE TABLE attribute_definitions ( attribute_id number, attribute_name text, attribute_data_type text ) CREATE TABLE catalog_contents_additional_attributes ( catalog_entry_id number, catalog_level_number number, attribute_id number, attribute_value text ) CREATE TABLE catalogs ( cata...
What are all the catalog entry names?
SELECT DISTINCT (catalog_entry_name) FROM catalog_contents
spider
CREATE TABLE table_name_25 ( money___ INTEGER, score VARCHAR )
Which Money has a Score of 70-68-73-68=279?
SELECT MIN(money___) AS $__ FROM table_name_25 WHERE score = 70 - 68 - 73 - 68 = 279
sql_create_context