context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_48 ( attendance VARCHAR, week VARCHAR )
What was the attendance for Week 1?
SELECT attendance FROM table_name_48 WHERE week = 1
sql_create_context
CREATE TABLE table_20678 ( "Dates (MDY)" text, "Position" real, "Gross sales" text, "Tickets sold / available" text, "Sellout (%)" text )
What is the sellout % when the gross sales is $1,727,400?
SELECT "Sellout (%)" FROM table_20678 WHERE "Gross sales" = '$1,727,400'
wikisql
CREATE TABLE table_27844 ( "Institution" text, "Location" text, "Type" text, "Joined" real, "Enrollment" real, "Nickname" text )
What is the enrollment for the institution that joined in 1987?
SELECT MIN("Enrollment") FROM table_27844 WHERE "Joined" = '1987'
wikisql
CREATE TABLE table_26168687_5 ( vessel_type VARCHAR, vessel_operator VARCHAR )
Name the vessel type for dof subsea
SELECT vessel_type FROM table_26168687_5 WHERE vessel_operator = "DOF Subsea"
sql_create_context
CREATE TABLE table_name_96 ( class VARCHAR, quantity VARCHAR )
what is the class when the quantity is 4?
SELECT class FROM table_name_96 WHERE quantity = 4
sql_create_context
CREATE TABLE table_76242 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
When the player gained below 1,405 yards and lost over 390 yards, what's the sum of the long yards?
SELECT SUM("Long") FROM table_76242 WHERE "Loss" > '390' AND "Gain" < '1,405'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Annual comparison: all questions vs specified tag (with Graph). Specify a complete tag, and run the query. Click the GRAPH tab to view chart.
SELECT YEAR(CreationDate) AS "year", COUNT(*) AS "cnt" FROM Posts WHERE Title LIKE '%fax%' AND PostTypeId = 1 AND ClosedDate IS NULL GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate)
sede
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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, JO...
For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and department_id , and visualize them by a bar chart, I want to list from low to high by the DEPARTMENT_ID.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_204_101 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "sample(s)" text, "length" text )
how many songs have more than one sample ?
SELECT COUNT("title") FROM table_204_101 WHERE "sample(s)" > 1
squall
CREATE TABLE table_name_25 ( away_team VARCHAR )
What was the score when the away team was Footscray?
SELECT away_team AS score FROM table_name_25 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_76471 ( "Round" real, "Selection" real, "Player" text, "Position" text, "College" text )
Which Selection has a Player of jamaar taylor, and a Round larger than 6?
SELECT MIN("Selection") FROM table_76471 WHERE "Player" = 'jamaar taylor' AND "Round" > '6'
wikisql
CREATE TABLE table_name_73 ( losses INTEGER, position VARCHAR, goals_for VARCHAR )
What is the highest number of loss with a 7 position and more than 45 goals?
SELECT MAX(losses) FROM table_name_73 WHERE position = 7 AND goals_for > 45
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者陶乐贤来之前哪些检查项目已经做过了
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '陶乐贤' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE table_name_38 ( occupation VARCHAR, residence VARCHAR )
What is the occupation of the candidate that resides in Windsor Junction?
SELECT occupation FROM table_name_38 WHERE residence = "windsor junction"
sql_create_context
CREATE TABLE table_23456 ( "Number" real, "Registration" text, "First flew" text, "Last flew" text, "Flying hours" real, "Location" text )
what is the registration located on 31 january 1975 where first flew?
SELECT "Registration" FROM table_23456 WHERE "First flew" = '31 January 1975'
wikisql
CREATE TABLE table_30352 ( "Late Old English (Anglian)" text, "Early Middle English" text, "Late Middle English" text, "Early Modern English" text, "Modern English" text, "Example" text )
What is the Anglian phonology used in the example d g > 'day'; gr g > 'gray'?
SELECT "Late Old English (Anglian)" FROM table_30352 WHERE "Example" = 'dæg > "day"; grǣg > "gray'
wikisql
CREATE TABLE staff ( staff_id number, staff_first_name text, staff_last_name text, other_staff_details text ) CREATE TABLE problem_category_codes ( problem_category_code text, problem_category_description text ) CREATE TABLE problems ( problem_id number, product_id number, closure_...
Which problem id and log id are assigned to the staff named Rylan Homenick?
SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
spider
CREATE TABLE table_60431 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Report" text )
What is the Date of the Competition with a Score of 2 0?
SELECT "Date" FROM table_60431 WHERE "Score" = '2–0'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, ...
show me flights from ATLANTA to BALTIMORE
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
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...
年龄低于12岁病人的医疗记录的医疗费总额的平均值是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE < 12)
css
CREATE TABLE table_28498999_4 ( before INTEGER, score VARCHAR )
What is the before for the score of 63-67-66-71=267?
SELECT MIN(before) FROM table_28498999_4 WHERE score = 63 - 67 - 66 - 71 = 267
sql_create_context
CREATE TABLE table_1140085_2 ( rnd VARCHAR, pole_position VARCHAR, race VARCHAR )
how many times is the pole position niki lauda and the race is monaco grand prix?
SELECT COUNT(rnd) FROM table_1140085_2 WHERE pole_position = "Niki Lauda" AND race = "Monaco Grand Prix"
sql_create_context
CREATE TABLE table_203_782 ( id number, "year" number, "actor" text, "award" text, "category" text, "role" text, "episode" text, "result" text )
what year scored the most nominations ?
SELECT "year" FROM table_203_782 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_18635 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
how many dbeingtrict with candidates being william b. bankhead (d) 71.3% e. m. reed (r) 28.7%
SELECT COUNT("District") FROM table_18635 WHERE "Candidates" = 'William B. Bankhead (D) 71.3% E. M. Reed (R) 28.7%'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
i need information for ground transportation DENVER colorado
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_57150 ( "Rank" real, "List" text, "Candidate name" text, "Gender" text, "Religion" text, "Votes" real )
What rank is aliyya qadi with less than 1421 votes?
SELECT MIN("Rank") FROM table_57150 WHERE "Candidate name" = 'aliyya qadi' AND "Votes" < '1421'
wikisql
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...
列出37304370这名患者从零一年三月十一开始到二一年六月二十七这段时间在医院8586775被开的所有的药名还有药物的编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '37304370' AND t_kc22.t_kc21_MED_SER_ORG_NO = '8586775' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2001-03-11' AND '2021-06-27')
css
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country...
Find the number of the country of the airlines whose name starts with 'Orbit'.
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country
nvbench
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 drug is added to patient 007-16517 today compared to yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-16517') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_19628 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
What is the highest win for the team Nacional?
SELECT MAX("Wins") FROM table_19628 WHERE "Team" = 'Nacional'
wikisql
CREATE TABLE table_name_84 ( session VARCHAR, event VARCHAR )
The Fall Nationals has what sessions?
SELECT session FROM table_name_84 WHERE event = "fall nationals"
sql_create_context
CREATE TABLE table_name_42 ( tournament VARCHAR )
Which one of the tournaments had a QF in 1996?
SELECT tournament FROM table_name_42 WHERE 1996 = "qf"
sql_create_context
CREATE TABLE table_18717 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who won in the race in the section georgia 5
SELECT "Incumbent" FROM table_18717 WHERE "District" = 'Georgia 5'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what is the drug that patient 30789 was prescribed two times in 01/2104?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30789) AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-01' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1...
mimic_iii
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Besides general elective , what requirements does GEOSCI 205 fulfill ?
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'GEOSCI' AND course.number = 205 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_55970 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Gold has a Nation of united states, and a Total larger than 5?
SELECT MIN("Gold") FROM table_55970 WHERE "Nation" = 'united states' AND "Total" > '5'
wikisql
CREATE TABLE table_62216 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many bronzes were won by the country with a total higher than 5?
SELECT SUM("Bronze") FROM table_62216 WHERE "Total" > '5'
wikisql
CREATE TABLE table_47931 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What was the opponent in the final when the score was 6 3, 2 6, 7 5?
SELECT "Opponent in the final" FROM table_47931 WHERE "Score" = '6–3, 2–6, 7–5'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
what was the last time that patient 90663 went to the hospital via an clinic referral/premature?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 90663 AND admissions.admission_location = 'clinic referral/premature' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_28333 ( "Frequency (Hz)" text, "R (\u03a9/km)" text, "L (mH/km)" text, "G (\u03bcS/km)" text, "C (nF/km)" text )
what is the frequency (hz) when the g ( s/km) is 53.205?
SELECT "Frequency (Hz)" FROM table_28333 WHERE "G (\u03bcS/km)" = '53.205'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
provide the age and admission time of subject id 2560.
SELECT demographic.age, demographic.admittime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose ethnicity is black/haitian and year of birth is less than 2085?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2085"
mimicsql_data
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
Give me a histogram for what are the memories and carriers of phones?
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE table_6496 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Which Away team has a Tie # of replay, and an Attendance of 24 november 1998, and a Home team of rotherham united?
SELECT "Away team" FROM table_6496 WHERE "Tie no" = 'replay' AND "Attendance" = '24 november 1998' AND "Home team" = 'rotherham united'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
盐酸帕罗西汀片在医疗就诊14864928570中,他的收费项目分多少等级?
SELECT t_kc22.CHA_ITEM_LEV 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 = '14864928570' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片'
css
CREATE TABLE table_46458 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Ends" real, "Transfer fee" text )
What is the nationality for the player with over 64 goals?
SELECT "Nat." FROM table_46458 WHERE "Goals" > '64'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_ti...
For ELI 512 , is it always taught by either Prof. William Gehring or Prof. Peter Yaman ?
SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%William Gehring%' AND NOT instructor.name LIKE '%Peter Yaman%') AND course.course_id = course_offering.course_id AND course.department = 'ELI' AND course.number = 512 AND offering_instructor.instructor_id...
advising
CREATE TABLE table_2602958_5 ( writer_s_ VARCHAR, _number VARCHAR )
Who wrote the movie positioned at 8 on the list?
SELECT writer_s_ FROM table_2602958_5 WHERE _number = 8
sql_create_context
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...
User X's comments on User Y's posts.
SELECT C.CreationDate, C.Text, P.Id AS "post_link" FROM Comments AS C INNER JOIN Posts AS P ON C.PostId = P.Id WHERE C.UserId = '##UserIdX##' AND P.OwnerUserId = '##UserIDY##' ORDER BY C.CreationDate
sede
CREATE TABLE table_59820 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text )
What is the Score at Jobing.com Arena?
SELECT "Score" FROM table_59820 WHERE "Arena" = 'jobing.com arena'
wikisql
CREATE TABLE table_64442 ( "Date(s)" text, "Venue" text, "City" text, "Ticket price(s)" text, "Ticket sold / available" text, "Ticket grossing" text )
What was the ticket price at Red Rocks Amphitheatre?
SELECT "Ticket price(s)" FROM table_64442 WHERE "Venue" = 'red rocks amphitheatre'
wikisql
CREATE TABLE table_name_57 ( finalist VARCHAR, host_city VARCHAR, season VARCHAR )
Who was the finalist in the 2010 season in the host city tartu?
SELECT finalist FROM table_name_57 WHERE host_city = "tartu" AND season = 2010
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...
在2004年3月4日到2017年4月15日内总共有多少科室在医院0147642内,涉及医疗费总额低于7310.98元?
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0147642' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-03-04' AND '2017-04-15' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7310.98 UNION SELECT gyb.MED_ORG_DEPT_CD FRO...
css
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 ( ...
give the number of patients whose admission type is urgent and drug code is inte75i.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.formulary_drug_cd = "INTE75I"
mimicsql_data
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE restriction ( ...
what is the latest flight from SAN FRANCISCO to BOSTON
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 FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_name_52 ( value VARCHAR, composition VARCHAR, weight VARCHAR )
What is the value of the coin weighing 10.5 g and made of cupronickel?
SELECT value FROM table_name_52 WHERE composition = "cupronickel" AND weight = "10.5 g"
sql_create_context
CREATE TABLE table_name_92 ( report VARCHAR, status VARCHAR, against VARCHAR )
What report has tour match as the status, with an against less than 22?
SELECT report FROM table_name_92 WHERE status = "tour match" AND against < 22
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and days of hospital stay is greater than 26?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.days_stay > "26"
mimicsql_data
CREATE TABLE table_5776 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score in the final" text )
Which Opponent in the final has a Partner of dustin brown?
SELECT "Opponent in the final" FROM table_5776 WHERE "Partner" = 'dustin brown'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, pat...
for the last time during the first hospital encounter, what specimen test did patient 031-16123 get?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pati...
eicu
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...
给患有结膜炎的那些病患们给其开的药物的编号和名称分别是什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '结膜炎' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is primary disease and drug name of subject id 85673?
SELECT demographic.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "85673"
mimicsql_data
CREATE TABLE table_name_65 ( price VARCHAR, sampling_rate VARCHAR )
How much is a product with a Sampling Rate of 12-bit 40khz?
SELECT price FROM table_name_65 WHERE sampling_rate = "12-bit 40khz"
sql_create_context
CREATE TABLE table_name_66 ( record VARCHAR, opponent VARCHAR, week VARCHAR )
What was the record the the match against vs. calgary stampeders before week 15?
SELECT record FROM table_name_66 WHERE opponent = "vs. calgary stampeders" AND week < 15
sql_create_context
CREATE TABLE table_10021158_3 ( scoring_average VARCHAR, money_list_rank VARCHAR )
When the money list rank was n/a, what was the scoring average?
SELECT scoring_average FROM table_10021158_3 WHERE money_list_rank = "n/a"
sql_create_context
CREATE TABLE table_21091145_1 ( result VARCHAR, black_knights_points VARCHAR )
Name the result for 19 black knights points
SELECT result FROM table_21091145_1 WHERE black_knights_points = 19
sql_create_context
CREATE TABLE table_31306 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What is the most stolen ends?
SELECT MAX("Stolen Ends") FROM table_31306
wikisql
CREATE TABLE table_27712 ( "User" text, "Unit (kWh)/Time range" text, "Tariff ( Rs. /kWh)" text, "Fixed Charge ( Rs. /kWh)" text, "Fuel Adjustment Charge (% of Total Energy Charge)" text, "Max. Demand Charge ( Rs. /kVA)" text )
What user had a max demand charge of 1,100 and a unit/time range of h-2: off-peak (22:30-05:30)?
SELECT "User" FROM table_27712 WHERE "Max. Demand Charge ( Rs. /kVA)" = '1,100' AND "Unit (kWh)/Time range" = 'H-2: Off-peak (22:30-05:30)'
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...
Out of total number of white russian patients, calculate the minimum age of male patients
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE - RUSSIAN"
mimicsql_data
CREATE TABLE table_name_78 ( voter_registration VARCHAR, byut VARCHAR )
What is the voter registration that has a BYut of 48.2?
SELECT COUNT(voter_registration) FROM table_name_78 WHERE byut = 48.2
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients were born before the year 2031?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2031"
mimicsql_data
CREATE TABLE table_67418 ( "Name" text, "First captaincy" text, "Games as captain" real, "Wins" real, "Draws" real, "Losses" real )
How many losses does Alex Wilkinson have?
SELECT COUNT("Losses") FROM table_67418 WHERE "Name" = 'alex wilkinson'
wikisql
CREATE TABLE table_name_64 ( martyred INTEGER, canonised VARCHAR, beatified VARCHAR, name VARCHAR )
When was John Hoan Trinh Doan / St. John Hoan, who was beatified in 1909 and canonised after 1988, martyred?
SELECT MAX(martyred) FROM table_name_64 WHERE beatified = 1909 AND name = "john hoan trinh doan / st. john hoan" AND canonised > 1988
sql_create_context
CREATE TABLE table_name_27 ( roman VARCHAR, proto_germanic_origin VARCHAR )
The Proto-Germanic origin of /w/ is associated with what Roman entry?
SELECT roman FROM table_name_27 WHERE proto_germanic_origin = "/w/"
sql_create_context
CREATE TABLE table_name_4 ( april INTEGER, score VARCHAR, game VARCHAR )
Which April is the smallest one that has a Score of 2 4, and a Game smaller than 76?
SELECT MAX(april) FROM table_name_4 WHERE score = "2–4" AND game < 76
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 diagnosis is chr syst/diastl hrt fail and drug route is iv bolus?
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.short_title = "Chr syst/diastl hrt fail" AND prescriptions.route = "IV BOLUS"
mimicsql_data
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
what is the yearly minimum amount of lactate patient 2957 has since 4 years ago?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-4 ...
mimic_iii
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Documen...
Give me a group line chart showing the number of documents in different ending date. The x-axis is ending date and group by location code.
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To
nvbench
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, Cr...
Top 200 Users from France.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%france%' ORDER BY Reputation DESC LIMIT 20000
sede
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
Required courses for BE 619 are ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'BE' AND COURSE_0.number = ...
advising
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Show the director and their lowest rating among all movies in a bar chart, and sort total number from high to low order.
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director ORDER BY MIN(T1.stars) DESC
nvbench
CREATE TABLE table_1805191_2 ( first_elected VARCHAR, incumbent VARCHAR )
During what year was Representative Spencer Bachus first elected?
SELECT COUNT(first_elected) FROM table_1805191_2 WHERE incumbent = "Spencer Bachus"
sql_create_context
CREATE TABLE table_22355_23 ( total_min_2_medals_ INTEGER )
What is the least amount of total medals won?
SELECT MIN(total_min_2_medals_) FROM table_22355_23
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients diagnosed with transient neonatal thrombocytopenia had delta abnormal lab test status?
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.long_title = "Transient neonatal thrombocytopenia" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_49110 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
what is the average crowd when the away team is new zealand breakers and the venue is cairns convention centre?
SELECT AVG("Crowd") FROM table_49110 WHERE "Away team" = 'new zealand breakers' AND "Venue" = 'cairns convention centre'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose admission type is elective and year of birth is less than 1821?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "1821"
mimicsql_data
CREATE TABLE table_204_78 ( id number, "no." number, "train no." text, "origin" text, "destination" text, "train name" text )
what is the name of the train listed before bangalore express ?
SELECT "train name" FROM table_204_78 WHERE id = (SELECT id FROM table_204_78 WHERE "train name" = 'bangalore express') - 1
squall
CREATE TABLE club ( clubid VARCHAR, clubname VARCHAR ) CREATE TABLE member_of_club ( position VARCHAR, clubid VARCHAR )
How many different roles are there in the club 'Bootup Baltimore'?
SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
sql_create_context
CREATE TABLE table_13908 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
What time has a Set 3 of 25 16?
SELECT "Time" FROM table_13908 WHERE "Set 3" = '25–16'
wikisql
CREATE TABLE table_name_72 ( position VARCHAR, nationality VARCHAR, goals VARCHAR )
What is the position of the player from England with 62 goals?
SELECT position FROM table_name_72 WHERE nationality = "england" AND goals = "62"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, and list in desc by the Y please.
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
nvbench
CREATE TABLE table_42178 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
When was the winning score 6 (69-69-73-71=282)?
SELECT "Date" FROM table_42178 WHERE "Winning score" = '−6 (69-69-73-71=282)'
wikisql
CREATE TABLE t ( Id VARCHAR )
In the Class T, what is the total of the 1958 UTA?
SELECT COUNT(1958 AS _uta) FROM t AS able_name_49 WHERE class = "t"
sql_create_context
CREATE TABLE table_name_15 ( league_cup_apps VARCHAR, league_goals INTEGER )
What's the total number of league cup apps when the league goals were less than 0?
SELECT COUNT(league_cup_apps) FROM table_name_15 WHERE league_goals < 0
sql_create_context
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...
从2007年8月3日开始,截止到2009年8月24日,请把81818459的病人总共被开出的所有检验报告单中的标本采集部位给列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON 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.JZLSH_MZJZJLB WHERE hz_info.RYBH = '81818459' AND jybgb.BGRQ BETWEEN '2007-08-03' AND '200...
css
CREATE TABLE table_name_48 ( time VARCHAR, winner VARCHAR )
What was the time for Screen Your Friend?
SELECT time FROM table_name_48 WHERE winner = "screen your friend"
sql_create_context
CREATE TABLE table_9474 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
What is the Lead in the 2004-05 Season?
SELECT "Lead" FROM table_9474 WHERE "Season" = '2004-05'
wikisql
CREATE TABLE table_name_48 ( previous_club VARCHAR, date_of_birth VARCHAR )
What previous club was born on October 22, 1993?
SELECT previous_club FROM table_name_48 WHERE date_of_birth = "october 22, 1993"
sql_create_context
CREATE TABLE table_79874 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which NHL team has a Player of steve durbano?
SELECT "NHL team" FROM table_79874 WHERE "Player" = 'steve durbano'
wikisql
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges Show bar chart, I want to order Y-axis from low to high order.
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr
nvbench