context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_22577693_1 ( host_nation_s_ VARCHAR, winner VARCHAR )
What is the name of the host nations if the winner was Hong Kong 207/6 (47.1 overs)?
SELECT host_nation_s_ FROM table_22577693_1 WHERE winner = "Hong Kong 207/6 (47.1 overs)"
sql_create_context
CREATE TABLE table_name_64 ( rowers VARCHAR, time VARCHAR )
What rowers have a 6:29.56 time?
SELECT rowers FROM table_name_64 WHERE time = "6:29.56"
sql_create_context
CREATE TABLE table_59148 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What is the Surface of the match with a Score in the final of 5 7, 6 7 (2 7)?
SELECT "Surface" FROM table_59148 WHERE "Score in the final" = '5–7, 6–7 (2–7)'
wikisql
CREATE TABLE table_17224 ( "No. in series" real, "No. in 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 that was viewed by 2.50 million people in the U.S.?
SELECT "Directed by" FROM table_17224 WHERE "U.S. viewers (millions)" = '2.50'
wikisql
CREATE TABLE table_21114 ( "Company" text, "ICB Sector" text, "Ticker symbol" text, "Index weighting (%) at 17 January 2013" text, "Market cap. at April 2013 (\u20ac)" text )
Name the total number of index weighting % at 17 january 2013 for bouygues
SELECT COUNT("Index weighting (%) at 17 January 2013") FROM table_21114 WHERE "Company" = 'Bouygues'
wikisql
CREATE TABLE table_55278 ( "Province" text, "Comune" text, "Population (inh.)" real, "Area (km\u00b2)" real, "Total (km\u00b2)" real )
What is the Piano di Sorrento, Napoli lowest km2 with a total smaller than 121.14 km2?
SELECT MIN("Area (km\u00b2)") FROM table_55278 WHERE "Province" = 'napoli' AND "Comune" = 'piano di sorrento' AND "Total (km\u00b2)" < '121.14'
wikisql
CREATE TABLE table_19746 ( "Team" text, "Copa Libertadores 1998" text, "Copa Mercosur 1998" text, "Copa CONMEBOL 1998" text, "Copa Interamericana 1998" text, "Recopa Sudamericana 1998" text, "Intercontinental Cup 1998" text )
Did Flamengo play in the Recopa Sudamericana in 1998
SELECT "Recopa Sudamericana 1998" FROM table_19746 WHERE "Team" = 'Flamengo'
wikisql
CREATE TABLE table_71176 ( "Year" real, "Class" text, "Tyres" text, "Team" text, "Co-Drivers" text, "Laps" real, "Pos." text, "Class Pos." text )
Which class more recent than 1988 has G tyres?
SELECT "Class" FROM table_71176 WHERE "Tyres" = 'g' AND "Year" > '1988'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, ...
tell me the number of patients admitted to the hospital?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions
mimic_iii
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
how many are current patients of the age 40s?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 40 AND 49
mimic_iii
CREATE TABLE table_27155990_1 ( category VARCHAR, project_name VARCHAR )
What was the category of the project name Mighty No. 9?
SELECT category FROM table_27155990_1 WHERE project_name = "Mighty No. 9"
sql_create_context
CREATE TABLE table_51406 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
what is the current version with license gpl v3?
SELECT "Current version" FROM table_51406 WHERE "License" = 'gpl v3'
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, ...
从2012年10月17日到2017年12月25日之间名叫张静雅的患者就诊过多少个医生?
SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '张静雅' AND zzmzjzjlb.JZKSRQ BETWEEN '2012-10-17' AND '2017-12-25' UNION SELECT COUNT(fz...
css
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...
how many patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_20284 ( "Episode" real, "Title" text, "Story" text, "Adapted by" text, "Director" text, "Airdate" text, "Exists?" text )
What is the airdate when the story is listed as hugh leonard?
SELECT "Airdate" FROM table_20284 WHERE "Story" = 'Hugh Leonard'
wikisql
CREATE TABLE table_68697 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Which surface was played during Curitiba tournament?
SELECT "Surface" FROM table_68697 WHERE "Tournament" = 'curitiba'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
what flights are there from NEWARK to SEATTLE on saturday
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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND d...
atis
CREATE TABLE table_64846 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total Goals" real )
What is the Total Apps listing for Paul Wilson?
SELECT "Total Apps" FROM table_64846 WHERE "Name" = 'paul wilson'
wikisql
CREATE TABLE table_204_260 ( id number, "date" text, "venue" text, "opponent" text, "result" text, "tournament" text, "scored" number )
what is the number of games played against the wakefield trinity wildcats ?
SELECT COUNT(*) FROM table_204_260 WHERE "opponent" = 'wakefield trinity wildcats'
squall
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗就诊78665747040期间这个病人的个人账户支出在医疗总费用中占比达到多少?
SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '78665747040') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '78665747040')
css
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
Posts with a single accepted answer that is upvoted at the same time.
SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.AcceptedAnswerId = v.PostId INNER JOIN Votes AS upv ON upv.PostId = v.PostId AND upv.VoteTypeId = 2 AND v.CreationDate = upv.CreationDate WHERE v.VoteTypeId = 1 AND p.AnswerCount = 1
sede
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
Which parts have more than 2 faults? Show the part name and id in a bar chart, and show x axis in asc order.
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_name
nvbench
CREATE TABLE table_name_93 ( opponent_number VARCHAR, attendance VARCHAR )
Who was the opponent in the game that was attended by 48,000 people?
SELECT opponent_number FROM table_name_93 WHERE attendance = "48,000"
sql_create_context
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 Team_ID over the All_Home , and group by attribute ACC_Road, rank in asc by the names please.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_68095 ( "Year" real, "Group" text, "Award" text, "Film/Show" text, "Result" text )
What is the average Year that has the Group, Logie Award, the Award, Most Outstanding Actor, and the Result, nominated?
SELECT AVG("Year") FROM table_68095 WHERE "Group" = 'logie award' AND "Award" = 'most outstanding actor' AND "Result" = 'nominated'
wikisql
CREATE TABLE table_name_65 ( laps INTEGER, grid VARCHAR, time_retired VARCHAR )
What is the lap total for the grid under 15 that retired due to transmission?
SELECT SUM(laps) FROM table_name_65 WHERE grid < 15 AND time_retired = "transmission"
sql_create_context
CREATE TABLE table_name_2 ( crowd VARCHAR, venue VARCHAR )
How many people were in the crowd at Lake Oval?
SELECT crowd FROM table_name_2 WHERE venue = "lake oval"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
Calculate the number of patients less than 82 years with a bactss drug code.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "82" AND prescriptions.formulary_drug_cd = "BACTSS"
mimicsql_data
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 prescriptions ( subject_id text, hadm_id...
what is the number of patients whose year of death is less than or equal to 2155 and drug code is osel75?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2155.0" AND prescriptions.formulary_drug_cd = "OSEL75"
mimicsql_data
CREATE TABLE table_47743 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What home has 46 points?
SELECT "Home" FROM table_47743 WHERE "Points" = '46'
wikisql
CREATE TABLE table_name_65 ( number_of_fixtures INTEGER, round VARCHAR )
What is the sum of Number of fixtures when the rounds shows quarter-finals?
SELECT SUM(number_of_fixtures) FROM table_name_65 WHERE round = "quarter-finals"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
show me all the flights from INDIANAPOLIS to SAN DIEGO on US
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'IND...
atis
CREATE TABLE table_name_56 ( date VARCHAR, high_points VARCHAR )
What is Date, when High Points is 'Danny Granger (32)'?
SELECT date FROM table_name_56 WHERE high_points = "danny granger (32)"
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...
How many of the patients with psychogenic paranoid psychosis died in or before 2179?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2179.0" AND diagnoses.long_title = "Psychogenic paranoid psychosis"
mimicsql_data
CREATE TABLE table_train_67 ( "id" int, "corticosteroid_therapy" bool, "viral_infection" bool, "active_infection" bool, "hiv_infection" bool, "neutropenia" int, "receiving_prednisolone" int, "age" float, "NOUSE" float )
clinical diagnosis of a bacterial or viral infection
SELECT * FROM table_train_67 WHERE active_infection = 1 OR viral_infection = 1
criteria2sql
CREATE TABLE table_12224 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is Score, when Record is '4-1'?
SELECT "Score" FROM table_12224 WHERE "Record" = '4-1'
wikisql
CREATE TABLE problem_category_codes ( problem_category_code text, problem_category_description text ) CREATE TABLE staff ( staff_id number, staff_first_name text, staff_last_name text, other_staff_details text ) CREATE TABLE problem_status_codes ( problem_status_code text, problem_stat...
Which staff members are assigned to the problem with id 1? Give me their first and last names.
SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
spider
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Most gold, silver, bronze badges.
SELECT RANK() OVER (ORDER BY SUM(CASE WHEN Class = 1 THEN 1 ELSE 0 END) DESC, SUM(CASE WHEN Class = 2 THEN 1 ELSE 0 END) DESC, SUM(CASE WHEN Class = 3 THEN 1 ELSE 0 END) DESC, COUNT(Id) DESC), UserId AS "user_link", SUM(CASE WHEN Class = 1 THEN 1 ELSE 0 END) AS gold, SUM(CASE WHEN Class = 2 THEN 1 ELSE 0 END) AS silver...
sede
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 number of patients whose diagnoses icd9 code is 0417 and lab test abnormal status is abnormal?
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 = "0417" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_63 ( attendance VARCHAR, week VARCHAR )
Overall attendance for week 4?
SELECT attendance FROM table_name_63 WHERE week = 4
sql_create_context
CREATE TABLE table_24811 ( "Tournament" real, "Conference" text, "Championship Game Opponent" text, "Score" text, "Location" text, "Head Coach" text )
What is the conference when Ferris State is the championship game opponent?
SELECT "Conference" FROM table_24811 WHERE "Championship Game Opponent" = 'Ferris State'
wikisql
CREATE TABLE table_2666 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Name the total number of replaced by for 13 june 2009
SELECT COUNT("Replaced by") FROM table_2666 WHERE "Date of appointment" = '13 June 2009'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, ...
Suggested edits on my posts.
SELECT s.Id AS "suggested_edit_link", s.PostId AS "post_link", s.OwnerUserId AS "user_link", s.CreationDate, s.ApprovalDate, s.RejectionDate FROM SuggestedEdits AS s INNER JOIN Posts AS p ON s.PostId = p.Id WHERE p.OwnerUserId = '##UserId##' ORDER BY s.CreationDate DESC
sede
CREATE TABLE table_62841 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What's the 2010 when they had a Q2 in 2009?
SELECT "2010" FROM table_62841 WHERE "2009" = 'q2'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Descr...
Users whose questions you have answered.
SELECT u.Id AS "user_link", u.Id AS Id, COUNT(q.Id) AS AnsweredByYou, u.Reputation, u.LastAccessDate FROM Users AS u INNER JOIN Posts AS q ON q.OwnerUserId = u.Id INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.OwnerUserId = '##UserId##' GROUP BY u.Id, u.Reputation, u.LastAccessDate ORDER BY AnsweredByYou DESC
sede
CREATE TABLE table_203_267 ( id number, "no." number, "song" text, "singers" text, "length (m:ss)" text )
other than the first track , what track was less than 2 minutes in length ?
SELECT "song" FROM table_203_267 WHERE id <> 1 AND "length (m:ss)" < 2
squall
CREATE TABLE table_41480 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What time has humber college north as the ground, and toronto downtown dingos as the home?
SELECT "Time" FROM table_41480 WHERE "Ground" = 'humber college north' AND "Home" = 'toronto downtown dingos'
wikisql
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 TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, and sort in ascending by the X please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what is the minimum cost of the hospital which involves hepatic failure during this year?
SELECT MIN(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 diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'hepatic failure')) AND DATETIME(cost.charget...
eicu
CREATE TABLE table_203_430 ( id number, "draw" number, "artist" text, "song" text, "jury" number, "televote" number, "total" number, "place" number )
how many songs were juried about eight ?
SELECT COUNT("song") FROM table_203_430 WHERE "televote" = 8
squall
CREATE TABLE table_66116 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Enrollment" real, "IHSAA Class / Football/Soccer" text, "Year Joined" real, "Previous Conference" text )
Which #/ County has an Enrollment larger than 1,108, and a School of anderson?
SELECT "# / County" FROM table_66116 WHERE "Enrollment" > '1,108' AND "School" = 'anderson'
wikisql
CREATE TABLE table_56501 ( "Wind farm" text, "Capacity (MW)" real, "Country" text, "State/Province" text, "Notes" text )
What special notes are included for the windfarm with a capacity (MW) of 343?
SELECT "Notes" FROM table_56501 WHERE "Capacity (MW)" = '343'
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...
Specify the language that patient Stephanie Suchan speaks along with the gender
SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
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 )
For those records from the products and each product's manufacturer, draw a scatter chart about the correlation between code and manufacturer .
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE table_name_23 ( date INTEGER, region VARCHAR, format VARCHAR )
WHAT IS THE LOWEST DATE FOR KOREA, IN CD FORMAT?
SELECT MIN(date) FROM table_name_23 WHERE region = "korea" AND format = "cd"
sql_create_context
CREATE TABLE table_20502 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text )
What city in the Citrus Bowl aired on ABC?
SELECT "City" FROM table_20502 WHERE "Stadium" = 'Citrus Bowl' AND "Television" = 'ABC'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_...
what was the name of the first medication that was prescribed to patient 27451 until 63 months ago?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27451) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-63 month') ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE Staff ( Staff_ID INTEGER, Staff_Details VARCHAR(255) ) CREATE TABLE Claim_Headers ( Claim_Header_ID INTEGER, Claim_Status_Code CHAR(15), Claim_Type_Code CHAR(15), Policy_ID INTEGER, Date_of_Claim DATETIME, Date_of_Settlement DATETIME, Amount_Claimed DECIMAL(20,4), A...
For each policy type, return its type code and its count in the record. Visualize by pie chart.
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the average of manufacturer over the name , and group by attribute name by a bar chart, could you rank Y in desc order?
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
has patient 54894 received any diagnoses since 1 year ago?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54894) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_76 ( name VARCHAR, role VARCHAR, period VARCHAR )
What name has the role of midfielder for 1999-2003?
SELECT name FROM table_name_76 WHERE role = "midfielder" AND period = "1999-2003"
sql_create_context
CREATE TABLE table_67154 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
When were the Brewers 27-31?
SELECT "Date" FROM table_67154 WHERE "Record" = '27-31'
wikisql
CREATE TABLE table_name_5 ( team VARCHAR, county VARCHAR )
Which team is in Sussex county?
SELECT team FROM table_name_5 WHERE county = "sussex"
sql_create_context
CREATE TABLE zyb ( 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...
医疗机构9229187一一年的十一月十一号直到一四年一月五号未就业人员在就诊方面的花费医疗费总额达到3685.16元以上的就诊记录数量
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9229187' AND qtb.IN_HOSP_DATE BETWEEN '2011-11-11' AND '2014-01-05' AND qtb.INSURED_STS = '未就业' AND qtb.MED_AMOUT >= 3685.16 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9229187' AND gyb.IN_HOSP_DATE BETWEEN '2011-11-11' AND '2014-01-05' AND gyb.INSURED...
css
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, ...
列出病人出院的病区名称和代码还有出院床位号,主要针对住院就诊84889733276的病患
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '84889733276'
css
CREATE TABLE table_30133_1 ( current_account_balance__percent_of_gdp_ VARCHAR, gdp_at_constant_prices_growth_rate__percent_change_ VARCHAR )
How many current account balances are associated with GDP at constant prices growth rates of 4.6?
SELECT COUNT(current_account_balance__percent_of_gdp_) FROM table_30133_1 WHERE gdp_at_constant_prices_growth_rate__percent_change_ = "4.6"
sql_create_context
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
A stacked bar chart shows the total number of ships with different nationalities and split by ship type.
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality
nvbench
CREATE TABLE table_name_22 ( try_bonus VARCHAR, club VARCHAR )
What is the try bonus that has llangefni rfc as the club?
SELECT try_bonus FROM table_name_22 WHERE club = "llangefni rfc"
sql_create_context
CREATE TABLE table_59097 ( "Clubs" text, "Position 2010-11" text, "Region" text, "Stadium" text, "Capacity" real )
What is the highest capacity of the tsentral stadium (batumi)?
SELECT MAX("Capacity") FROM table_59097 WHERE "Stadium" = 'tsentral stadium (batumi)'
wikisql
CREATE TABLE table_32126 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the sum of Top-5 values with events values less than 2?
SELECT SUM("Top-5") FROM table_32126 WHERE "Events" < '2'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
Give me the title and highest price for each film in a bar chart.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
CREATE TABLE table_19643 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
When the elapsed time is 2:14:12:49, what are all yachts associated with this value?
SELECT "Yacht" FROM table_19643 WHERE "Elapsed time d:hh:mm:ss" = '2:14:12:49'
wikisql
CREATE TABLE table_14291 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
Which player went to college at Up-Diliman and plays on PBA team of the Alaska Milkmen?
SELECT "Player" FROM table_14291 WHERE "PBA team" = 'alaska milkmen' AND "College" = 'up-diliman'
wikisql
CREATE TABLE table_name_31 ( details VARCHAR, points VARCHAR )
During which competition were a total of 36 points scored?
SELECT details FROM table_name_31 WHERE points = 36
sql_create_context
CREATE TABLE table_41105 ( "Rank" real, "City 1" text, "City 2" text, "2012 Passengers (in millions)" real, "2011 Passengers (in millions)" text, "Distance" text )
What is the number of 2011 passengers in millions that have traveled a distance of 1271km?
SELECT "2011 Passengers (in millions)" FROM table_41105 WHERE "Distance" = '1271km'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
What RCARTS classes are counted as ULCS ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%RCARTS%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_name_13 ( surface VARCHAR, opponent VARCHAR )
WHich Surface has an Opponent of gustavo kuerten?
SELECT surface FROM table_name_13 WHERE opponent = "gustavo kuerten"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id n...
when did patient 25050 last receive spinal tap since 1 year ago?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal tap') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25050) AND DATETIME(proc...
mimic_iii
CREATE TABLE table_284 ( "Stage (Winner)" text, "General classification" text, "Mountains classification" text, "Points classification" text, "Combination classification" text, "Team Classification" text )
WHAT TEAM CLASSIFIED IN THE STAGE WHERE BRADLEY WIGGINS WON THE POINTS CLASSIFICATION ?
SELECT "Team Classification" FROM table_284 WHERE "Points classification" = 'Bradley Wiggins'
wikisql
CREATE TABLE table_name_50 ( school VARCHAR, round VARCHAR, position VARCHAR, pick VARCHAR )
From what school was the linebacker that had a pick less than 245 and was drafted in round 6?
SELECT school FROM table_name_50 WHERE position = "linebacker" AND pick < 245 AND round = 6
sql_create_context
CREATE TABLE table_name_42 ( visitor VARCHAR, time VARCHAR )
Who was the visitor at 5:00 pm?
SELECT visitor FROM table_name_42 WHERE time = "5:00 pm"
sql_create_context
CREATE TABLE table_77637 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was Alexander Wurz's highest grid with laps of less than 25?
SELECT MAX("Grid") FROM table_77637 WHERE "Driver" = 'alexander wurz' AND "Laps" < '25'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
when did patient 18866 first have a minimum value of arterial bp [systolic] on this month/23?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
Visualize a bar chart for what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there, and list from low to high by the Y-axis.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_document_types ( docume...
Return the ids and details corresponding to projects for which there are more than two documents.
SELECT T1.project_id, T1.project_details FROM projects AS T1 JOIN documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2
spider
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a bar chart on what is the average age for a male in each job?, I want to rank by the X from high to low please.
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE table_69675 ( "Order" text, "Minister" text, "Party" text, "Prime Minister" text, "Title" text, "Term start" text, "Term end" text, "Term in office" text )
What was the starting date for the Minister for agriculture, fisheries and forestry that is in order number 25??
SELECT "Term start" FROM table_69675 WHERE "Title" = 'minister for agriculture, fisheries and forestry' AND "Order" = '25'
wikisql
CREATE TABLE table_17104539_10 ( high_rebounds VARCHAR, record VARCHAR )
Who had a high rebound where the associated record is 11-13?
SELECT high_rebounds FROM table_17104539_10 WHERE record = "11-13"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what are the top five most common diagnoses that patients were diagnosed with within 2 months after the diagnosis of meningitis - chronic?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'meningitis - chronic') AS t1 JOIN (SELEC...
eicu
CREATE TABLE table_65518 ( "Shirt No" real, "Nationality" text, "Player" text, "Birth Date" text, "Height" real, "Position" text )
What player that has a position of middle blocker, a Nationality of Turkey, and shirt no is 8?
SELECT "Player" FROM table_65518 WHERE "Position" = 'middle blocker' AND "Nationality" = 'turkey' AND "Shirt No" = '8'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subje...
during this month patient 15794 had been prescribed d5w?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND prescriptions.drug = 'd5w' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose year of death is less than or equal to 2158 and procedure icd9 code is 3324?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2158.0" AND procedures.icd9_code = "3324"
mimicsql_data
CREATE TABLE table_203_595 ( id number, "year" number, "division" number, "league" text, "reg. season" text, "playoffs" text, "open cup" text )
what is the last year the last usl second division is listed ?
SELECT MAX("year") FROM table_203_595 WHERE "league" = 'usl second division'
squall
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, ...
report the long title of procedure and procedure ic9 code for patient with patient id 26746.
SELECT procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "26746"
mimicsql_data
CREATE TABLE table_name_40 ( attendance INTEGER, date VARCHAR )
on april 9 what was the attendance?
SELECT AVG(attendance) FROM table_name_40 WHERE date = "april 9"
sql_create_context
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, ...
calculate the number of patients discharged from the hospital.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_name_84 ( points VARCHAR, year VARCHAR, entrant VARCHAR )
After 1972, how many points did Marlboro Team Alfa Romeo have?
SELECT points FROM table_name_84 WHERE year > 1972 AND entrant = "marlboro team alfa romeo"
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...
among patients admitted to emergency, how many of them had coronar arteriogr-1 cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE table_41986 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What score has ipswich town as the home team, and replay as the tie no.?
SELECT "Score" FROM table_41986 WHERE "Home team" = 'ipswich town' AND "Tie no" = 'replay'
wikisql
CREATE TABLE table_55350 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text )
How much cash was on hand when the money spent in the 2Q was $16,042,388?
SELECT "Cash On Hand" FROM table_55350 WHERE "Money Spent, 2Q" = '$16,042,388'
wikisql