context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, val...
Show names of technicians and the number of machines they are assigned to repair Visualize by bar chart, and I want to display in desc by the Y.
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
医生排序在团伙成员曹子平最常去的中,有哪些?
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '曹子平' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_16292 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
Who directed the episode with production code 7aff03?
SELECT "Directed by" FROM table_16292 WHERE "Production code" = '7AFF03'
wikisql
CREATE TABLE table_2562572_5 ( population__2002_ INTEGER, population__2011_ VARCHAR )
Name the least population for 2002 for 2011 being 9564
SELECT MIN(population__2002_) FROM table_2562572_5 WHERE population__2011_ = 9564
sql_create_context
CREATE TABLE table_79183 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
The golfer in place 1 if from what country?
SELECT "Country" FROM table_79183 WHERE "Place" = '1'
wikisql
CREATE TABLE table_name_76 ( name VARCHAR, club VARCHAR, pos VARCHAR )
What is the Name of the D Player from the Dinamo Moscow Club?
SELECT name FROM table_name_76 WHERE club = "dinamo moscow" AND pos = "d"
sql_create_context
CREATE TABLE table_50175 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Nolan Henke's To par when he placed in t3?
SELECT "To par" FROM table_50175 WHERE "Place" = 't3' AND "Player" = 'nolan henke'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose admission year is less than 2162 and diagnoses icd9 code is 56722?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2162" AND diagnoses.icd9_code = "56722"
mimicsql_data
CREATE TABLE table_name_98 ( location VARCHAR, odds VARCHAR, score VARCHAR )
Where was the match located when the odds were p + 1 and the score was 1/3?
SELECT location FROM table_name_98 WHERE odds = "p + 1" AND score = "1/3"
sql_create_context
CREATE TABLE table_name_71 ( location VARCHAR, host VARCHAR, national_champion VARCHAR )
At what Location did Robert Morris University (Illinois) Host the Lindenwood National Chamption?
SELECT location FROM table_name_71 WHERE host = "robert morris university (illinois)" AND national_champion = "lindenwood"
sql_create_context
CREATE TABLE table_name_55 ( position VARCHAR, nationality VARCHAR, round VARCHAR )
What position is Sweden in round 2?
SELECT position FROM table_name_55 WHERE nationality = "sweden" AND round = "2"
sql_create_context
CREATE TABLE table_24477075_1 ( position VARCHAR, minutes VARCHAR )
Name the position for 132 minutes
SELECT position FROM table_24477075_1 WHERE minutes = 132
sql_create_context
CREATE TABLE player ( player_id number, sponsor_name text, player_name text, gender text, residence text, occupation text, votes number, rank text ) CREATE TABLE coach ( coach_id number, coach_name text, gender text, club_id number, rank number ) CREATE TABLE club (...
What are the gender and occupation of players?
SELECT gender, occupation FROM player
spider
CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percen...
Count the number of programs broadcast for each time section of a day in a bar chart, order y axis in asc order.
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*)
nvbench
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
what were the four most frequent diagnosis until 2101?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE STRFTIME('%y', diagnoses_icd.charttime) <= '2101' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE ...
mimic_iii
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What Ug Surgery Research classes have 5 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Ug Surgery Research%' OR name LIKE '%Ug Surgery Research%') AND credits = 5
advising
CREATE TABLE table_26213 ( "World record" text, "Paula Radcliffe ( GBR )" text, "2:15:25" text, "London , Great Britain" text, "13 April 2003" text )
Name the london great britain for championship record
SELECT "London , Great Britain" FROM table_26213 WHERE "World record" = 'Championship record'
wikisql
CREATE TABLE table_33798 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
Which game is named tsegay kebede category:articles with hcards?
SELECT "Games" FROM table_33798 WHERE "Name" = 'tsegay kebede category:articles with hcards'
wikisql
CREATE TABLE table_45505 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Can you tell me the Opponent that has the Round of 3?
SELECT "Opponent" FROM table_45505 WHERE "Round" = '3'
wikisql
CREATE TABLE customers ( customer_id number, customer_name text ) CREATE TABLE services ( service_id number, service_name text ) CREATE TABLE available_policies ( policy_id number, policy_type_code text, customer_phone text ) CREATE TABLE claims ( claim_id number, fnol_id number, ...
What are the phone numbers of customers using the policy with the code 'Life Insurance'?
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
spider
CREATE TABLE table_27700530_5 ( high_points VARCHAR, date VARCHAR )
Who had the high point total on october 20?
SELECT high_points FROM table_27700530_5 WHERE date = "October 20"
sql_create_context
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Find Nationality and the average of ID , and group by attribute Nationality, and visualize them by a bar chart, display by the y-axis in desc please.
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) DESC
nvbench
CREATE TABLE table_name_58 ( date VARCHAR, score VARCHAR )
Which Date has a Score of 106 112?
SELECT date FROM table_name_58 WHERE score = "106–112"
sql_create_context
CREATE TABLE table_20609 ( "Year" text, "Stamp duty reserve tax" text, "Standard Stamp Duty" text, "Standard Duties Total Revenue (in \u20acmillion)" real, "over Total Tax Revenue (in %)" text, "over GDP (in %)" text )
What is the stamp duty reserve tax when the percentage over total tax revenue is 0.79?
SELECT "Stamp duty reserve tax" FROM table_20609 WHERE "over Total Tax Revenue (in %)" = '0.79'
wikisql
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 all employees who have the letters D or S in their first name, find job_id and the sum of salary , and group by attribute job_id, and visualize them by a bar chart, and could you list in ascending by the Y?
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)
nvbench
CREATE TABLE table_name_76 ( emissions_co2 VARCHAR, max_speed VARCHAR, car_model VARCHAR )
What is the emissions CO2 with a max speed of km/h (mph) of the car model Panamera 4s?
SELECT emissions_co2 FROM table_name_76 WHERE max_speed = "km/h (mph)" AND car_model = "panamera 4s"
sql_create_context
CREATE TABLE table_name_35 ( date VARCHAR, record VARCHAR )
What was the date the record became 26 14 9?
SELECT date FROM table_name_35 WHERE record = "26–14–9"
sql_create_context
CREATE TABLE table_75233 ( "Season" text, "Oberliga Bayern" text, "Oberliga Hessen" text, "Oberliga Baden-W\u00fcrttemberg" text, "Oberliga S\u00fcdwest" text )
which Oberliga Baden-W rttemberg has a Season of 1991-92?
SELECT "Oberliga Baden-W\u00fcrttemberg" FROM table_75233 WHERE "Season" = '1991-92'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
疾病S14.067的病号郑思源在门诊诊断时的氨基末端B型利钠肽的结果定量及其单位分别是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descrip...
Finding most high-rep users among multiple SE sites. Parametrisation is comma-separated list of database names. The DB names are coming as ou can see it from SELECT * FROM sysdatabases;
SELECT * FROM sysdatabases
sede
CREATE TABLE table_2182562_2 ( winnings VARCHAR, starts VARCHAR )
How high was the amount of winnings (in $) in the year with 15 starts?
SELECT winnings FROM table_2182562_2 WHERE starts = 15
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what is the FIRST class fare from BALTIMORE to DALLAS
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name t...
Return the color description that is most common across all products.
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_77466 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What is the Date of the game in Vancouver?
SELECT "Date" FROM table_77466 WHERE "Home" = 'vancouver'
wikisql
CREATE TABLE table_5267 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which venue hosts the Olympic Games for DNQ position?
SELECT "Venue" FROM table_5267 WHERE "Competition" = 'olympic games' AND "Position" = 'dnq'
wikisql
CREATE TABLE Assets ( asset_make VARCHAR, asset_model VARCHAR, asset_details VARCHAR, asset_disposed_date VARCHAR )
List the all the assets make, model, details by the disposed date ascendingly.
SELECT asset_make, asset_model, asset_details FROM Assets ORDER BY asset_disposed_date
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
show me the first ward identification of patient 1205 the previous year?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_47386 ( "Poll Source" text, "Dates administered" text, "Democrat: Brian Schweitzer" text, "Republican: Roy Brown" text, "Libertarian: Stan Jones" text, "Lead Margin" real )
What is the percentage for Schweitzer when the lead margin is 29?
SELECT "Democrat: Brian Schweitzer" FROM table_47386 WHERE "Lead Margin" = '29'
wikisql
CREATE TABLE table_201_13 ( id number, "city" text, "county(ies)" text, "population\n(2000 census)" number, "population\n(2010 census)" number, "class" text, "incorporation\ndate" number )
how many cities have 1926 as their incorporation date ?
SELECT COUNT("city") FROM table_201_13 WHERE "incorporation\ndate" = 1926
squall
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
how many times did patient 016-35802 go into icu?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35802')
eicu
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, ...
how many patients whose year of birth is less than 2180 and drug route is ivpca?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2180" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_59477 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the attendance at the Billericay Town home game?
SELECT "Attendance" FROM table_59477 WHERE "Home team" = 'billericay town'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Find Obsolete comments on Islam.SE (Newest first).
SELECT Id, Text, Id AS "comment_link" FROM Comments WHERE LENGTH(Text) < 20 AND Text LIKE '%##phrase##%' ORDER BY Id DESC LIMIT 10000
sede
CREATE TABLE table_75644 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which Record has an Opponent of twins, and a Date of july 25?
SELECT "Record" FROM table_75644 WHERE "Opponent" = 'twins' AND "Date" = 'july 25'
wikisql
CREATE TABLE table_27905 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type / Location" text, "Settlement destiny" text, "Largest ethnic group (year)" text )
What is the settlement destiny in Aleksandrovo?
SELECT "Settlement destiny" FROM table_27905 WHERE "Settlement" = 'Aleksandrovo'
wikisql
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 number of patients speaking port had discharge location as short term hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.discharge_location = "SHORT TERM HOSPITAL"
mimicsql_data
CREATE TABLE table_name_57 ( quantity_preserved VARCHAR, fleet_number_s_ VARCHAR )
What's the quantity preserved when the fleet number was 700?
SELECT quantity_preserved FROM table_name_57 WHERE fleet_number_s_ = "700"
sql_create_context
CREATE TABLE table_name_30 ( points VARCHAR, games VARCHAR )
How many points were scored by the player who played 348 games?
SELECT points FROM table_name_30 WHERE games = "348"
sql_create_context
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_i...
What are the dates of transactions with at least 100 share count or amount bigger than 100, and count them by a line chart
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100
nvbench
CREATE TABLE table_27755784_8 ( record VARCHAR, date VARCHAR )
What is the record when the date is January 7?
SELECT record FROM table_27755784_8 WHERE date = "January 7"
sql_create_context
CREATE TABLE table_name_61 ( time_retired VARCHAR, grid VARCHAR )
What time is grid 7 in?
SELECT time_retired FROM table_name_61 WHERE grid = 7
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
What is the number of hispanic or latino-puerto rican patients who have been admitted in hospital for more than 20 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE table_8537 ( "Discipline" text, "Championship" text, "Circuit" text, "Event" text, "Session" text, "Cause" text )
The Milwaukee Mile circuit has what type of session?
SELECT "Session" FROM table_8537 WHERE "Circuit" = 'milwaukee mile'
wikisql
CREATE TABLE table_name_92 ( points INTEGER, rank VARCHAR )
What is the sum of the points for the player who was a rank of 61t?
SELECT SUM(points) FROM table_name_92 WHERE rank = "61t"
sql_create_context
CREATE TABLE table_6565 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest number of silver medals of the team with less than 0 bronzes?
SELECT MAX("Silver") FROM table_6565 WHERE "Bronze" < '0'
wikisql
CREATE TABLE table_16007 ( "Nomination" text, "Actors Name" text, "Film Name" text, "Director" text, "Country" text )
Srdjan Dragojevic worked on a film which earned what nomination?
SELECT "Nomination" FROM table_16007 WHERE "Director" = 'Srdjan Dragojevic'
wikisql
CREATE TABLE table_name_5 ( rider VARCHAR, manufacturer VARCHAR, grid VARCHAR )
Who is the driver of the car manufactured by ktm, who started in grid 1.
SELECT rider FROM table_name_5 WHERE manufacturer = "ktm" AND grid = "1"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose admission year is less than 2133 and procedure icd9 code is 4513?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2133" AND procedures.icd9_code = "4513"
mimicsql_data
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...
二零零七年十一月二十日到二零一七年十一月八日,查一下在这段时间患者40200914买西药的次数
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '40200914' AND t_kc22.STA_DATE BETWEEN '2007-11-20' AND '2017-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
叫王红豆的病人的上臂的各项指标检验的结果如何?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_25553 ( "Date" text, "Location" text, "Opponent" text, "Sooners Points" real, "Opp. Points" real, "Record" text )
How many points did the opponents score on the game where Sooners' record was 16-5?
SELECT MAX("Opp. Points") FROM table_25553 WHERE "Record" = '16-5'
wikisql
CREATE TABLE table_name_80 ( area__km_2__ INTEGER, code VARCHAR, population VARCHAR )
What is the average area for code 98030 with population over 312?
SELECT AVG(area__km_2__) FROM table_name_80 WHERE code = 98030 AND population > 312
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...
what is minimum age of patients whose marital status is divorced and primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement ?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_name_34 ( margin_of_victory VARCHAR, date VARCHAR )
What is the margin of victory of the tournament on 15 Jul 2007?
SELECT margin_of_victory FROM table_name_34 WHERE date = "15 jul 2007"
sql_create_context
CREATE TABLE table_59160 ( "Year" real, "Team/Chassis" text, "Engine" text, "Tyres" text, "Pts." real )
How many points have an Engine of ferrari tipo 033 v6 tc, and a Year smaller than 1987?
SELECT MAX("Pts.") FROM table_59160 WHERE "Engine" = 'ferrari tipo 033 v6 tc' AND "Year" < '1987'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, E...
App Engine questions by month.
SELECT PostMonth, COUNT(DISTINCT PostNumber) FROM (SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS PostMonth, Posts.Id AS PostNumber FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'google-chrome' AND Posts.ParentId IS NULL) AS ...
sede
CREATE TABLE table_55170 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How much did the away team St Kilda score?
SELECT "Away team score" FROM table_55170 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_69821 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real )
What is the nation of the person who was from the CSC team?
SELECT "Nation" FROM table_69821 WHERE "Team" = 'csc'
wikisql
CREATE TABLE table_name_25 ( finish VARCHAR, player VARCHAR )
What is the finish of player Hale Irwin?
SELECT finish FROM table_name_25 WHERE player = "hale irwin"
sql_create_context
CREATE TABLE table_29418619_1 ( _number VARCHAR, hometown VARCHAR )
What number is the player whose hometown is Tampa, FL?
SELECT _number FROM table_29418619_1 WHERE hometown = "Tampa, FL"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what is the number of days that have elapsed since the first time patient 027-120575 received a total bilirubin lab test on this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120575' AND patient.hosp...
eicu
CREATE TABLE table_name_20 ( city_of_license VARCHAR, erp_w VARCHAR, frequency_mhz VARCHAR )
Which city has ERP W under 14 and a frequency over 93.7MHz?
SELECT city_of_license FROM table_name_20 WHERE erp_w < 14 AND frequency_mhz > 93.7
sql_create_context
CREATE TABLE table_name_35 ( bello VARCHAR, liscumb VARCHAR, libweshya VARCHAR )
What Bello has a 27 Liscumb and 6539 Libweshya?
SELECT bello FROM table_name_35 WHERE liscumb = "27" AND libweshya = "6539"
sql_create_context
CREATE TABLE table_1855342_5 ( experts_view INTEGER, willing_to_take_risks VARCHAR )
When 25 are willing to take risks, what is the experts view?
SELECT MIN(experts_view) FROM table_1855342_5 WHERE willing_to_take_risks = 25
sql_create_context
CREATE TABLE table_13134 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
Which Year(s) won has a Total larger than 295?
SELECT "Year(s) won" FROM table_13134 WHERE "Total" > '295'
wikisql
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 cost ( row_id...
tell me the time of hospital admission of patient 8005 since 4 years ago?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 8005 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_203_324 ( id number, "chord" text, "root" text, "major third" text, "perfect fifth" text, "minor seventh" text )
what 's the total number of thirds you can make on a 7th form chord ?
SELECT COUNT(*) FROM table_203_324
squall
CREATE TABLE table_name_87 ( cross_code_debut VARCHAR, year VARCHAR, player VARCHAR )
What is the cross-code debut later than 1958 for Dick Thornett?
SELECT cross_code_debut FROM table_name_87 WHERE year > 1958 AND player = "dick thornett"
sql_create_context
CREATE TABLE Student ( StuID VARCHAR, sex VARCHAR, sportname VARCHAR ) CREATE TABLE Sportsinfo ( StuID VARCHAR, sex VARCHAR, sportname VARCHAR )
Show all male student ids who don't play football.
SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football"
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 me the number of patients whose admission year is less than 2124 and diagnoses icd9 code is 29634?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2124" AND diagnoses.icd9_code = "29634"
mimicsql_data
CREATE TABLE table_78627 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What player had a To par smaller than 9 and won in 1985?
SELECT "Player" FROM table_78627 WHERE "To par" < '9' AND "Year(s) won" = '1985'
wikisql
CREATE TABLE table_47324 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
WHAT POSITION IS 273?
SELECT "Position" FROM table_47324 WHERE "Overall" = '273'
wikisql
CREATE TABLE table_67860 ( "Player" text, "Rank" real, "Event" text, "Surface" text, "Score" text )
What's the lowest rank of a player who played in 2012?
SELECT MIN("Rank") FROM table_67860 WHERE "Event" = '2012'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
what is the number of patients who had been diagnosed with nb transitory tachypnea in 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nb transitory tachypnea') AND STRFTIME('%y', diagnoses_icd...
mimic_iii
CREATE TABLE table_1346118_5 ( result VARCHAR, incumbent VARCHAR )
What was the result of the election when Clarence F. Lea was the incumbent?
SELECT result FROM table_1346118_5 WHERE incumbent = "Clarence F. Lea"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在整个医疗记录中医院编号3850390的住院诊断为躁狂抑郁性精神病当前为抑郁相的人花的最低和最高医疗费总额是多少元?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3850390' AND t_kc21.IN_DIAG_DIS_NM = '躁狂抑郁性精神病当前为抑郁相')
css
CREATE TABLE table_dev_43 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "hemoglobin_a1c_hba1c" float, "point_of_care_blood_glucose_poc" int, "diabetic" string, "temperature" float, "creatinine_clearance_cl" float...
male and female , age: > 18 to 70 years at the time of screening visit.
SELECT * FROM table_dev_43 WHERE (gender = 'male' OR gender = 'female') AND (age > 18 AND age <= 70)
criteria2sql
CREATE TABLE table_name_2 ( status VARCHAR, opposing_team VARCHAR )
What status has gauteng falcons as the opposing team?
SELECT status FROM table_name_2 WHERE opposing_team = "gauteng falcons"
sql_create_context
CREATE TABLE church ( church_id number, name text, organized_by text, open_date number, continuation_of text ) CREATE TABLE people ( people_id number, name text, country text, is_male text, age number ) CREATE TABLE wedding ( church_id number, male_id number, female...
Show the minimum, maximum, and average age for all people.
SELECT MIN(age), MAX(age), AVG(age) FROM people
spider
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of first_name and commission_pct , I want to show total number in ascending order.
SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT
nvbench
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...
what is the date of birth and language of subject id 2560?
SELECT demographic.dob, demographic.language FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_66671 ( "Name" text, "Employed" text, "Position held" text, "Honour" text, "Citation" text )
What citation is shown for the employed years of 1970 1996?
SELECT "Citation" FROM table_66671 WHERE "Employed" = '1970–1996'
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...
count the number of patients whose insurance is medicare and procedure short title is iv infusion clofarabine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine"
mimicsql_data
CREATE TABLE table_name_79 ( school VARCHAR, location VARCHAR )
What school is located in rossville?
SELECT school FROM table_name_79 WHERE location = "rossville"
sql_create_context
CREATE TABLE table_15183 ( "Year" real, "\u00c1lbum" text, "Charts" text, "Sales" real, "Certification" text )
What were the number of sales before 1991?
SELECT "Sales" FROM table_15183 WHERE "Year" < '1991'
wikisql
CREATE TABLE table_name_98 ( test_career VARCHAR, player VARCHAR )
When was Mushfiqur Rahim's test career?
SELECT test_career FROM table_name_98 WHERE player = "mushfiqur rahim"
sql_create_context
CREATE TABLE table_47204 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
In what region and year was Jacob the number 2 name and Ryan the number 10 name?
SELECT "Region (year)" FROM table_47204 WHERE "No. 2" = 'jacob' AND "No. 10" = 'ryan'
wikisql
CREATE TABLE table_1137703_2 ( round VARCHAR, grand_prix VARCHAR )
Which round was the Spanish Grand Prix?
SELECT round FROM table_1137703_2 WHERE grand_prix = "Spanish grand_prix"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( 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 ...
在患者32284795的医疗记录中,他的药品消费金额在1441.3元以上的医疗就诊有哪几次?编号是什么
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '32284795' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1441.3)
css
CREATE TABLE table_name_88 ( points INTEGER, extra_points VARCHAR, touchdowns VARCHAR )
What is the highest number of points for players with less than 2 touchdowns and 0 extra points?
SELECT MAX(points) FROM table_name_88 WHERE extra_points = 0 AND touchdowns < 2
sql_create_context