context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose age is less than 48 and procedure icd9 code is 5011?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "48" AND procedures.icd9_code = "5011"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
Get all community wiki posts.
SELECT * FROM Posts WHERE OwnerUserId = -1 AND PostTypeId = 3 ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE table_name_71 ( notes VARCHAR, rank VARCHAR, athlete VARCHAR )
Ioannis Christou with a rank smaller than 6 has what notes?
SELECT notes FROM table_name_71 WHERE rank < 6 AND athlete = "ioannis christou"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
Line chart, the X is the hire date of employees and the Y-axis is the corresponding salary, and order x axis in asc order please.
SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_12 ( best VARCHAR, name VARCHAR )
Name the the Best of rodolfo lav n
SELECT best FROM table_name_12 WHERE name = "rodolfo lavín"
sql_create_context
CREATE TABLE table_820 ( "Year" real, "Winner" text, "Language" text, "Artist" text, "Song" text, "Points" real, "Margin" real, "Second place" text, "Date" text, "Venue" text, "Location" text, "Participants" real )
how many locations has spain as the winner?
SELECT COUNT("Location") FROM table_820 WHERE "Winner" = 'Spain'
wikisql
CREATE TABLE table_53422 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the home team that played against Collingwood?
SELECT "Home team" FROM table_53422 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
Who instructs BCS 532 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BCS' AND course.number = 532 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of...
advising
CREATE TABLE table_78029 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the score of the away team that played home team Geelong?
SELECT "Away team score" FROM table_78029 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_name_9 ( losing_bonus VARCHAR, played VARCHAR, points_against VARCHAR )
What is the losing bonus of the team with 22 pays and 428 points against?
SELECT losing_bonus FROM table_name_9 WHERE played = "22" AND points_against = "428"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give the number of patients who have stayed in the hospital for more than one day and the diagnosis long title is end stage renal disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.long_title = "End stage renal disease"
mimicsql_data
CREATE TABLE table_name_54 ( world_ranking__1_ VARCHAR, ranking_la__2_ VARCHAR, year_of_publication VARCHAR )
In 2008, what was the world ranking that ranked 5th in L.A.?
SELECT world_ranking__1_ FROM table_name_54 WHERE ranking_la__2_ = "5th" AND year_of_publication = "2008"
sql_create_context
CREATE TABLE table_name_83 ( played INTEGER, city VARCHAR, average_attendance VARCHAR )
What is the average played value in Belgrade with attendance greater than 26,222?
SELECT AVG(played) FROM table_name_83 WHERE city = "belgrade" AND average_attendance > 26 OFFSET 222
sql_create_context
CREATE TABLE table_51633 ( "Date" text, "Three" text, "Four" text, "Five" text, "Seven" text )
Name the three for william prewett for four and five being richard ellis with seven being nicholas king on 5 november 1693
SELECT "Three" FROM table_51633 WHERE "Four" = 'william prewett' AND "Five" = 'richard ellis' AND "Seven" = 'nicholas king' AND "Date" = '5 november 1693'
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...
find the number of patients with diagnoses icd9 code 34291 for whom ascitic fluid lab test order was placed.
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 = "34291" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_68292 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What was the 2012 finish in the US Open?
SELECT "2012" FROM table_68292 WHERE "Tournament" = 'us open'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what specimen was patient 27465 tested for the last time in 06/this year?
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', micro...
mimic_iii
CREATE TABLE table_1342233_17 ( party VARCHAR, incumbent VARCHAR )
What party is incumbent virgil chapman from?
SELECT party FROM table_1342233_17 WHERE incumbent = "Virgil Chapman"
sql_create_context
CREATE TABLE mzb ( 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...
医院6703357的8237科室在一零年九月十一日到一八年七月二十五日的这段时间里涉及到多少医疗费
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '6703357' AND qtb.MED_ORG_DEPT_CD = '8237' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '6703357' AND gyb.MED_ORG_DEPT_CD = '8237' UNION SELECT zyb.MED_CLINIC_ID FRO...
css
CREATE TABLE table_14875671_1 ( opponent VARCHAR, week VARCHAR )
Who was the opponent in week 4?
SELECT opponent FROM table_14875671_1 WHERE week = 4
sql_create_context
CREATE TABLE table_52588 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text )
On what circuit is there a class gts-2 race that takes place on May 27?
SELECT "Circuit" FROM table_52588 WHERE "Date" = 'may 27' AND "Class" = 'gts-2'
wikisql
CREATE TABLE table_22962745_35 ( season VARCHAR, batsmen VARCHAR )
What season was herschelle gibbs andrew symonds venugopal rao batsmen?
SELECT season FROM table_22962745_35 WHERE batsmen = "Herschelle Gibbs Andrew Symonds Venugopal Rao"
sql_create_context
CREATE TABLE table_19529639_3 ( second_national_tour_year_2 VARCHAR, original_west_end_cast VARCHAR )
How many different actors from the Second national tour year 2 played the character played by Oliver Tompsett from the original West End cast?
SELECT COUNT(second_national_tour_year_2) FROM table_19529639_3 WHERE original_west_end_cast = "Oliver Tompsett"
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_CLINIC_ID text, MED_DIRE_CD tex...
从2013年1月5日到2017年2月8日,患者35826599的住院次数总共多少次?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '35826599' AND t_kc21.IN_HOSP_DATE BETWEEN '2013-01-05' AND '2017-02-08' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_187239_1 ( minor_sponsors VARCHAR, kit_manufacturer VARCHAR, main_sponsor VARCHAR )
When batavo is the main sponsor and olympikus is the kit manufacturer who are the minor sponsors?
SELECT minor_sponsors FROM table_187239_1 WHERE kit_manufacturer = "Olympikus" AND main_sponsor = "Batavo"
sql_create_context
CREATE TABLE table_70100 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
Name the tournament of beijing
SELECT "2011" FROM table_70100 WHERE "Tournament" = 'beijing'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
provide the number of patients whose procedure icd9 code is 4576 and drug route is iv bolus
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4576" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_5879 ( "Rank" text, "Quarterback" text, "Streak start" text, "Streak end" text, "Teams" text, "Regular season" real, "Playoffs" real, "Total" real )
What streak start has a total less than 79, 22t as the rank, and tampa bay as the teams?
SELECT "Streak start" FROM table_5879 WHERE "Total" < '79' AND "Rank" = '22t' AND "Teams" = 'tampa bay'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
药品奥美拉唑镁肠溶片在医疗就诊99828917080中的剂型和规格分别多少?
SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '99828917080' AND t_kc22.SOC_SRT_DIRE_NM = '奥美拉唑镁肠溶片'
css
CREATE TABLE table_10738 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What is the Visitor with a Leading scorer with rudy gay (24)?
SELECT "Visitor" FROM table_10738 WHERE "Leading scorer" = 'rudy gay (24)'
wikisql
CREATE TABLE table_2112260_1 ( website VARCHAR, specialization VARCHAR, division VARCHAR )
What is every website with specialization of engineering and division of dhaka division?
SELECT website FROM table_2112260_1 WHERE specialization = "Engineering" AND division = "Dhaka division"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
what was the name of the medicine that was prescribed to patient 14467 for the first time during this month?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_22035 ( "Romanised name" text, "Chinese name" text, "age at appointment" real, "Foreign nationality" text, "Portfolio attachment" text, "Prior occupation" text, "Govt salary" text )
For the chinese name how many in total is the govt salary?
SELECT COUNT("Govt salary") FROM table_22035 WHERE "Chinese name" = '盧奕基'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
count the number of patients whose marital status is divorced and procedure icd9 code is 8968?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.icd9_code = "8968"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
What is on Dr. Andrew Cadotte 's roster for the next term ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Andrew Cadotte%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE table_72929 ( "DSL Type" text, "Provider" text, "Resale" text, "Down (up to kbit/s)" real, "Up (up to kbit/s)" real )
What is download bandwith where the provider is deutsche telekom ag?
SELECT MAX("Down (up to kbit/s)") FROM table_72929 WHERE "Provider" = 'Deutsche Telekom AG'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Top 100 users by average score.
SELECT Users.Id AS "user_link", Users.Reputation, COUNT(Posts.Id) AS Questions, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 GROUP BY Users.Id, DisplayName, Users.Reputation HAVING COUNT(Posts.Id) > 1 ORDER BY 'average_score...
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
All answers by a user, with questions.
SELECT a.CreationDate, a.Id, b.Id AS "post_link", b.Title, b.Body AS Question, a.Body AS Answer FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.Id WHERE a.OwnerUserId = '##UserId##' ORDER BY a.CreationDate
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
what is subject name of subject id 2560?
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, ...
How many faculty members participate in each activity? Return the activity names and the number of faculty members Show bar chart, list in ascending by the x-axis.
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name
nvbench
CREATE TABLE table_203_83 ( id number, "ranking" number, "company" text, "industry" text, "revenue (usd billions)" text, "fy" text, "capitalization (usd billions)" text, "employees" number, "listing" text, "headquarters" text, "ceo" text )
what is the company with the highest revenue in the automotive industry ?
SELECT "company" FROM table_203_83 WHERE "industry" = 'automotive' ORDER BY "revenue (usd billions)" DESC LIMIT 1
squall
CREATE TABLE table_name_58 ( attendance INTEGER, game VARCHAR, score VARCHAR )
Which Attendance has a Game score less than 3, and a Score of 2 5?
SELECT AVG(attendance) FROM table_name_58 WHERE game < 3 AND score = "2 – 5"
sql_create_context
CREATE TABLE table_204_513 ( id number, "date" text, "time" text, "opponent#" text, "site" text, "tv" text, "result" text, "attendance" number )
was duke at 2:00 pm or 1:00 pm ?
SELECT "time" FROM table_204_513 WHERE "opponent#" = 'duke'
squall
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
have any prescriptions been given since 5 years ago to patient 25951?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25951) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year')
mimic_iii
CREATE TABLE table_18602 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who are the contenders In the New York 19 polling area race?
SELECT "Candidates" FROM table_18602 WHERE "District" = 'New York 19'
wikisql
CREATE TABLE table_name_1 ( date VARCHAR, score VARCHAR )
On what date was the score 6 4?
SELECT date FROM table_name_1 WHERE score = "6–4"
sql_create_context
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(...
Show me a bar chart for what are the different transaction types, and how many transactions of each have taken place?
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_13752 ( "Round" real, "Opposition Team" text, "Venue" text, "Result" text, "Report" text )
What is the result of round 4?
SELECT "Result" FROM table_13752 WHERE "Round" = '4'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the cost for diagnosis of caesarian section?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'caesarian section')
eicu
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, ...
Can you list the classes that Dr. Ashley David has taught ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_6081 ( "Image" text, "Father" text, "Birth" text, "Ceased to be Duchess" text, "Death" text, "Husband" text )
Who is the husband of the image of renata of lorraine?
SELECT "Husband" FROM table_6081 WHERE "Image" = 'renata of lorraine'
wikisql
CREATE TABLE table_name_12 ( pat_robertson VARCHAR, bob_dole VARCHAR, george_hw_bush VARCHAR )
When Bob Dole had 26%, and George H.W. Bush had 47%, what did Pat Robertson have?
SELECT pat_robertson FROM table_name_12 WHERE bob_dole = "26%" AND george_hw_bush = "47%"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
give the discharge location of subject id 6983.
SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_name_16 ( Id VARCHAR )
What is the 2012 value with 1r in 2011, 2007 of A, 2010 of 1r, and 2009 of A?
SELECT 2012 FROM table_name_16 WHERE 2011 = "1r" AND 2007 = "a" AND 2010 = "1r" AND 2009 = "a"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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, ...
which airline is the cheapest to fly from DALLAS to BALTIMORE on 12 24
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 24 ...
atis
CREATE TABLE skills_required_to_fix ( part_fault_id number, skill_id number ) CREATE TABLE maintenance_contracts ( maintenance_contract_id number, maintenance_contract_company_id number, contract_start_date time, contract_end_date time, other_contract_details text ) CREATE TABLE parts ( ...
What is the description of the type of the company who concluded its contracts most recently?
SELECT T1.company_name FROM third_party_companies AS T1 JOIN maintenance_contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1
spider
CREATE TABLE table_name_85 ( bronze VARCHAR, nation VARCHAR )
Which bronze has a Nation of poland?
SELECT bronze FROM table_name_85 WHERE nation = "poland"
sql_create_context
CREATE TABLE table_11225 ( "Name" text, "Area (km 2 )" real, "Population Estimate 2005" real, "Population Census 2010" real, "Capital" text )
how many times was the population estimate 2005 have an area (km2) more than 8,023.74?
SELECT COUNT("Population Estimate 2005") FROM table_11225 WHERE "Area (km 2 )" > '8,023.74'
wikisql
CREATE TABLE table_77683 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text )
What L2 cache had a release date of august 26, 2007?
SELECT "L2 cache" FROM table_77683 WHERE "Release date" = 'august 26, 2007'
wikisql
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number )
is german above or below russia in the number of people who speak that language ?
SELECT (SELECT "number" FROM table_203_88 WHERE "language" = 'german') > (SELECT "number" FROM table_203_88 WHERE "language" = 'russian')
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
what are the three intakes that are the most frequent until 2101?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2101' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status_code text, order_date time ) CREATE TABLE product_suppliers ( product_id number, supplier_id number, date_supplied_from time, date_supplied_to time, total_amount_purchased text, total_value_purchase...
What are the names of staff who have been assigned multiple jobs?
SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1
spider
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Highest rated users who have never voted.
SELECT u.Id AS "user_link", u.DisplayName, u.Reputation FROM Users AS u WHERE u.UpVotes = 0 ORDER BY u.Reputation DESC LIMIT 100
sede
CREATE TABLE table_11107 ( "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text )
Which game site Kickoff [a] of 1:00, and an Attendance of 63,251?
SELECT "Game site" FROM table_11107 WHERE "Kickoff [a ]" = '1:00' AND "Attendance" = '63,251'
wikisql
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE ...
Find date_address_from and the average of monthly_rental bin date_address_from by weekday, and visualize them by a bar chart.
SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
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 who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and commission_pct in a bar chart.
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_12914 ( "Club" text, "City" text, "Founded" real, "Stadium" text, "Capacity" real )
How many foundeds have sousse as the city, with a capacity greater than 25,000?
SELECT COUNT("Founded") FROM table_12914 WHERE "City" = 'sousse' AND "Capacity" > '25,000'
wikisql
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
Show different teams in eliminations and the number of eliminations from each team by a bar chart, and list from high to low by the Y-axis.
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_780 ( id number, "rank" number, "diver" text, "preliminary\npoints" number, "preliminary\nrank" number, "final\npoints" number, "final\nrank" number, "final\ntotal" number )
which diver is listed before ninel krutova ?
SELECT "diver" FROM table_203_780 WHERE id = (SELECT id FROM table_203_780 WHERE "diver" = 'ninel krutova') - 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 is subject name and admission type of subject id 2560?
SELECT demographic.name, demographic.admission_type FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_27 ( commercial_operation VARCHAR, construction_start VARCHAR )
When was commercial operation where construction started June 10, 1971?
SELECT commercial_operation FROM table_name_27 WHERE construction_start = "june 10, 1971"
sql_create_context
CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE product ( pr...
Find the name and population of districts with population between 200000 and 200000 Show a bar chart, I want to rank in asc by the y axis please.
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population
nvbench
CREATE TABLE table_780 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the the candidates with incumbent being james o'connor
SELECT "Candidates" FROM table_780 WHERE "Incumbent" = 'James O''Connor'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在医院2848267中韦乐和患者门诊诊断名称包含妊娠的门诊有哪几条就诊记录?
SELECT * 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 = '韦乐和' AND hz_info.YLJGDM = '2848267' AND mzjzjlb.JZZDSM LIKE '%妊娠%'
css
CREATE TABLE table_48624 ( "Team" text, "Head coach" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text )
Who is the kitmaker for Fc Augsburg?
SELECT "Kitmaker" FROM table_48624 WHERE "Team" = 'fc augsburg'
wikisql
CREATE TABLE table_name_41 ( week INTEGER, opponent VARCHAR, attendance VARCHAR )
What is the sum on week against the Tampa Bay Buccaneers with less than 60,320 in attendance?
SELECT SUM(week) FROM table_name_41 WHERE opponent = "tampa bay buccaneers" AND attendance < 60 OFFSET 320
sql_create_context
CREATE TABLE table_9513 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the average goals against for teams with more than 56 goals for and exactly 50 points?
SELECT AVG("Goals Against") FROM table_9513 WHERE "Points 1" = '50' AND "Goals For" > '56'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
View statistics for your questions. Number of views per day for your questions, and their total views, sorted highest view rate to lowest
SELECT ViewCount, ROUND(CAST(ViewCount AS FLOAT) / DATEDIFF(dd, CreationDate, GETDATE()), 1) AS ViewsPerDay, Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND OwnerUserId = '##UserId##' ORDER BY ViewCount DESC
sede
CREATE TABLE table_name_56 ( country VARCHAR, athlete VARCHAR )
what is the country for fabiana beltrame?
SELECT country FROM table_name_56 WHERE athlete = "fabiana beltrame"
sql_create_context
CREATE TABLE table_1130632_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
Who wrote all the shows with 18.73 u.s. viewers?
SELECT written_by FROM table_1130632_1 WHERE us_viewers__million_ = "18.73"
sql_create_context
CREATE TABLE table_15402 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
What is the overall record of the Ravens?
SELECT "Overall Record" FROM table_15402 WHERE "Team" = 'ravens'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从00年2月1日开始06年5月3日结束患者89244700所有检验结果指标记录中的仪器编号以及名称都是啥吗?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM ...
css
CREATE TABLE table_11793221_2 ( complement VARCHAR, commander VARCHAR )
What are the complements when the commander is Major William Lloyd?
SELECT complement FROM table_11793221_2 WHERE commander = "Major William Lloyd"
sql_create_context
CREATE TABLE table_80053 ( "Matches" real, "Wickets" real, "Runs" real, "Average" real, "10WM" real, "Best in Innings" text, "Best in Match" text )
What is the total number of wickets that have runs under 4600 and matches under 44?
SELECT SUM("Wickets") FROM table_80053 WHERE "Runs" < '4600' AND "Matches" < '44'
wikisql
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
tell me the number of patients on base type of drug prescription who have diagnoses icd9 code 1120.
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.icd9_code = "1120" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
门诊诊断患者吕华美患有复发性抑郁障碍,548921检测指标的结果定量是什么?对应的单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
Show the hours of the day a user is most active. Gets the hours in which a user has been active (enables you to see when a user sleeps!)
WITH hours AS (SELECT TIME_TO_STR(CreationDate, '%I') AS HoursSeen FROM Posts WHERE OwnerUserId = '##UserId##' UNION ALL SELECT TIME_TO_STR(CreationDate, '%I') AS HoursSeen FROM Comments WHERE UserId = '##UserId##') SELECT HoursSeen AS Hour, COUNT(*) AS Count, '|' + REPEAT('*', COUNT(*)) AS Graph FROM hours GROUP BY Ho...
sede
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...
在哪几次医疗记录中患者00352468所开的药品价格均低于6550.61元?这些就诊时的编号是多少?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '00352468' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6550.61)
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
SELECT DATEFROMPARTS ( DATEPART(yyyy, GETDATE()) -1, 1, 1 ).
SELECT DATEFROMPARTS(TIME_TO_STR(CURRENT_TIMESTAMP(), '%Y'), 1, 1)
sede
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...
how many patients died of septic shock?
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.short_title = "Septic shock"
mimicsql_data
CREATE TABLE table_name_31 ( to_par VARCHAR, score VARCHAR )
When the score was 76-73-67-69=285 what was the To par?
SELECT to_par FROM table_name_31 WHERE score = 76 - 73 - 67 - 69 = 285
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
Display a bar chart for what is the total revenue of companies started by founder?
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
how many days have elapsed since patient 97395 was admitted to the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 97395 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
list of ids of patients diagnosed with leukocytosis - neutrophilia until 3 years ago.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'leukocytosis - neutrophilia' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE table_32172 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
What label has RTRADLP 346 as catalogue?
SELECT "Label" FROM table_32172 WHERE "Catalogue" = 'rtradlp 346'
wikisql
CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0...
Find the number of rooms with more than 50 capacity for each building. Show bar chart.
SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 varc...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and rank total number in desc order.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_4513 ( "Rank" text, "Name and flag" text, "Water area (km 2 )" real, "Water area as percentage of total area" text, "Percentage of national freshwater area" text )
Which province and flag which has a water area (km 2) smaller than 176,928 has a total water area percentage of 0.0%?
SELECT "Name and flag" FROM table_4513 WHERE "Water area (km 2 )" < '176,928' AND "Water area as percentage of total area" = '0.0%'
wikisql
CREATE TABLE table_74091 ( "Episode" text, "Date" text, "Official ITV1 rating (millions)" text, "Weekly rank" real, "Share (%)" text, "Official ITV1 HD rating (millions)" text, "Total ITV1 viewers (millions)" text )
What was the share (%) for the Semi-Final 2 episode?
SELECT "Share (%)" FROM table_74091 WHERE "Episode" = 'Semi-final 2'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of newborn admitted patients who have lab test item id 51274?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51274"
mimicsql_data