context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
i want to leave BOSTON at 838 and arrive in DENVER at 1110 in the morning
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 ((flight.arrival_time = 1110 AND flight.departure_time = 838) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_ai...
atis
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the sum of salary bin hire_date by weekday, list total number of salary from high to low order.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_name_11 ( result VARCHAR, venue VARCHAR )
Which result has adelaide oval as the venue?
SELECT result FROM table_name_11 WHERE venue = "adelaide oval"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在2001年6月25日到2009年3月18日这段时间医院编号为6114875的这个医院有多少科室在门诊就诊中给患者开出少于20张检验报告单啊?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_13749 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What lane did Bronte Barratt, who had a rank larger than 4, swim in?
SELECT AVG("Lane") FROM table_13749 WHERE "Name" = 'bronte barratt' AND "Rank" > '4'
wikisql
CREATE TABLE table_name_7 ( place VARCHAR, score VARCHAR )
Which Place has a Score of 71-70=141?
SELECT place FROM table_name_7 WHERE score = 71 - 70 = 141
sql_create_context
CREATE TABLE table_74893 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average gold medals for countries with more than 0 bronze, more than 0 silver, rank over 2 and total over 3?
SELECT AVG("Gold") FROM table_74893 WHERE "Bronze" > '0' AND "Silver" > '0' AND "Rank" > '2' AND "Total" > '3'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE class_of_service ( booking_...
i want to travel from PITTSBURGH to OAKLAND around midnight could you give me the flights
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 ((flight.departure_time >= 2330 OR flight.departure_time < 30) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_...
atis
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 are the four most frequently given tests for patients who were previously diagnosed with depressed level of consciousness during the same hospital encounter until 2100?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depressed level o...
eicu
CREATE TABLE table_38254 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What was the highest week when the record was 1-3?
SELECT MAX("Week") FROM table_38254 WHERE "Record" = '1-3'
wikisql
CREATE TABLE city ( city_id SMALLINT UNSIGNED, city VARCHAR(50), country_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE film ( film_id SMALLINT UNSIGNED, title VARCHAR(255), description TEXT, release_year YEAR, language_id TINYINT UNSIGNED, original_language_id TINYI...
List the genre name and genre id using a bar chart, list by the category_id in desc.
SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T1.category_id DESC
nvbench
CREATE TABLE table_18600760_19 ( geo_id VARCHAR, land___sqmi__ VARCHAR )
where the land is 35.990 what is the number of the geo id
SELECT geo_id FROM table_18600760_19 WHERE land___sqmi__ = "35.990"
sql_create_context
CREATE TABLE table_name_47 ( week_2 VARCHAR, week_4 VARCHAR )
Who was the girl of the week 2 weeks before terri lynn farrow in the same month?
SELECT week_2 FROM table_name_47 WHERE week_4 = "terri lynn farrow"
sql_create_context
CREATE TABLE table_name_88 ( stroke_count INTEGER, radical__variants_ VARCHAR, frequency VARCHAR )
WHAT IS THE STROKE COUNT WITH RADICAL FREQUENCY SMALLER THAN 129?
SELECT AVG(stroke_count) FROM table_name_88 WHERE radical__variants_ = "皿" AND frequency < 129
sql_create_context
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...
Do you know of any intelligent systems courses that are easier than RCNSCI 419 ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%intelligent systems%' AND program_course.workload < (SELECT MIN(PROGRAM_...
advising
CREATE TABLE table_66937 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
During the Formula One World Championships, which engine was used in 1965?
SELECT "Engine" FROM table_66937 WHERE "Year" = '1965'
wikisql
CREATE TABLE table_26750 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Medley" text, "Event 2 Truck Pull" text, "Event 3 Dead Lift" text, "Event 4 Fingals Fingers" text, "Event 5 Keg Toss" text, "Event 6 Atlas Stones" text )
What is the score in the 2 truck pull of the player who got 1 (5 in 33.84s) in the 4 fingals fingers?
SELECT "Event 2 Truck Pull" FROM table_26750 WHERE "Event 4 Fingals Fingers" = '1 (5 in 33.84s)'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
since 6 years ago how many patients were prescribed fentanyl in the same hospital visit after receiving therapeutic antibacterials - third generation cephalosporin treatment?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - third generation cephalosporin' AND DATETIME...
eicu
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, c...
Show the transaction type and the number of transactions by a pie chart.
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
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...
在2008年7月17日到2012年9月8日期间,参保人孙莉莉门诊西药一共是多少钱?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '孙莉莉' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-07-17' AND '2012-09-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
count the number of times patient 027-165214 has received a lab test with serum osmolality this month.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214')) AND lab.labname = 'serum osmolality' AND DATETIME(lab.labresulttime, 'start of...
eicu
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...
Let me know the type of admission and procedure ic9 code for the patient with patient id 2560.
SELECT demographic.admission_type, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_17344582_11 ( location_attendance VARCHAR, series VARCHAR )
List all location attendance for series 1-1.
SELECT location_attendance FROM table_17344582_11 WHERE series = "1-1"
sql_create_context
CREATE TABLE table_17433 ( "Model/Engine" text, "Capacity" text, "Cylinders/Valves" text, "Power/rpm" text, "Torque (Nm)/rpm" text )
What is the torque formula for the 1.6 Duratec ti-vct model/engine?
SELECT "Torque (Nm)/rpm" FROM table_17433 WHERE "Model/Engine" = '1.6 Duratec Ti-VCT'
wikisql
CREATE TABLE table_name_19 ( date VARCHAR, opponent VARCHAR, attendance VARCHAR )
when has an Opponent of @ philadelphia phillies and an Attendance of 20,072?
SELECT date FROM table_name_19 WHERE opponent = "@ philadelphia phillies" AND attendance = "20,072"
sql_create_context
CREATE TABLE table_38683 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is Mike Harris' lowest overall?
SELECT MIN("Overall") FROM table_38683 WHERE "Name" = 'mike harris'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
Comments left by a user on your posts.
SELECT c.CreationDate AS "comment_date", p.Id AS "post_link", c.Text AS Comment FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE c.UserId = 9003 ORDER BY c.CreationDate
sede
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
Max and average reputation per month 2019.
SELECT YEAR(p.CreationDate) AS y, MONTH(p.CreationDate) AS m, COUNT_BIG(1) AS num_answers, AVG(CAST(u.Reputation AS INT)) AS avg_rep, MAX(u.Reputation) AS max_rep FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND p.CreationDate >= '2019-01-01' GROUP BY YEAR(p.CreationDate), MONTH(p.Crea...
sede
CREATE TABLE table_name_53 ( country VARCHAR, winter_olympics VARCHAR )
With the Winter Olympics was 1960, what was the country?
SELECT country FROM table_name_53 WHERE winter_olympics = "1960"
sql_create_context
CREATE TABLE table_73052 ( "Name" text, "Nickname" text, "First season" text, "Location" text, "Home ground(s)" text, "Coach" text, "Captain" text )
What is the code nickname where Steve Mayne is the coach?
SELECT "Nickname" FROM table_73052 WHERE "Coach" = 'Steve Mayne'
wikisql
CREATE TABLE table_24006 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "MotoGP winner" text, "Moto2 winner" text, "125cc winner" text, "Report" text )
How many 125cc winners were in the same events as when the Moto2 winner was Shoya Tomizawa?
SELECT COUNT("125cc winner") FROM table_24006 WHERE "Moto2 winner" = 'Shoya Tomizawa'
wikisql
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
Report the distinct advisors who have more than 2 students.
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2
spider
CREATE TABLE table_name_97 ( last_yr INTEGER, yr_plyf INTEGER )
What is the earliest last year with a yr plyf less than 0?
SELECT MIN(last_yr) FROM table_name_97 WHERE yr_plyf < 0
sql_create_context
CREATE TABLE table_8343 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
Which Venue has a Round of gs, and a Result of 0 3?
SELECT "Venue" FROM table_8343 WHERE "Round" = 'gs' AND "Result" = '0–3'
wikisql
CREATE TABLE table_17869717_1 ( week VARCHAR, date VARCHAR )
In how many weeks was the game played on November 3 played?
SELECT COUNT(week) FROM table_17869717_1 WHERE date = "November 3"
sql_create_context
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 employees with first names that end with the letter m, give me a bar chart to show their average salary.
SELECT FIRST_NAME, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME
nvbench
CREATE TABLE table_64054 ( "Rank\u2003" real, "Largest U.S. City\u2003" text, "Total" real, "Partners\u2003" real, "Other" real )
What is the number of partners for the city ranked under 294, total over 264, largest city of Chicago, and other over 46?
SELECT "Partners\u2003" FROM table_64054 WHERE "Rank\u2003" < '294' AND "Total" > '264' AND "Largest U.S. City\u2003" = 'chicago' AND "Other" > '46'
wikisql
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, draw a bar chart about the distribution of name and the average of code , and group by attribute name, and show y axis in desc order.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_name_68 ( term_in_office VARCHAR, state VARCHAR, member VARCHAR )
What term did Stewart Mcarthur from Vic serve in office?
SELECT term_in_office FROM table_name_68 WHERE state = "vic" AND member = "stewart mcarthur"
sql_create_context
CREATE TABLE table_4596 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the lowest overall pick for a player from Washington?
SELECT MIN("Overall") FROM table_4596 WHERE "College" = 'washington'
wikisql
CREATE TABLE table_1571238_2 ( fourth_place VARCHAR, team VARCHAR )
When colgate is the team how many times did they place fourth?
SELECT COUNT(fourth_place) FROM table_1571238_2 WHERE team = "Colgate"
sql_create_context
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 was hired before 2002-06-21, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time by a bar chart.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_69538 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
On what date was the record 62 84?
SELECT "Date" FROM table_69538 WHERE "Record" = '62–84'
wikisql
CREATE TABLE table_2992 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Win/Lose" text, "Result" text )
When was the win/lose lose and the round a play-off?
SELECT "Date" FROM table_2992 WHERE "Win/Lose" = 'Lose' AND "Round" = 'Play-off'
wikisql
CREATE TABLE table_63324 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date was Newcastle United the away team?
SELECT "Date" FROM table_63324 WHERE "Away team" = 'newcastle united'
wikisql
CREATE TABLE table_1858574_2 ( yacht VARCHAR, sail_number VARCHAR )
When 6606 is the sail number what is the type of yacht?
SELECT yacht AS Type FROM table_1858574_2 WHERE sail_number = "6606"
sql_create_context
CREATE TABLE table_8009 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the game number when the game was against phoenix?
SELECT "Game" FROM table_8009 WHERE "Team" = 'phoenix'
wikisql
CREATE TABLE table_29757 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was the game against Detroit played?
SELECT "Location Attendance" FROM table_29757 WHERE "Team" = 'Detroit'
wikisql
CREATE TABLE table_58602 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score when the record became 25 14 9?
SELECT "Score" FROM table_58602 WHERE "Record" = '25–14–9'
wikisql
CREATE TABLE table_68342 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
what is the time when the event is bellator 89?
SELECT "Time" FROM table_68342 WHERE "Event" = 'bellator 89'
wikisql
CREATE TABLE table_51084 ( "American name" text, "British name" text, "Value" text, "Dotted Value" text, "Double Dotted Value" text, "Triple Dotted Value" text )
what is the double dotted value when the triple dotted value is 15/128?
SELECT "Double Dotted Value" FROM table_51084 WHERE "Triple Dotted Value" = '15/128'
wikisql
CREATE TABLE table_203_93 ( id number, "incumbent" text, "reason for vacancy" text, "appointed successor" text, "date of appointment" text, "elected successor" text, "date of election" text )
which elected successor took office the earliest ?
SELECT "appointed successor" FROM table_203_93 ORDER BY "date of appointment" LIMIT 1
squall
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int,...
a FIRST class flight on AA to SAN FRANCISCO on the coming tuesday
SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.month_number = 3 AND DATE_DAY_0.year = 1991 AND...
atis
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients are diagnosed for unspecified sinusitis (chronic) and tested with urine in lab?
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 = "Unspecified sinusitis (chronic)" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
I need to know AIDS and Other Health Crises courses with no prerequisites .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%AIDS and Other Health Crises%' OR course.description LIKE '%AIDS and Other Health Crises%' OR course.name LIKE '%AIDS and Other Health Crises%') AND course.enforced_requ...
advising
CREATE TABLE table_10441 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the lowest attendance at Glenferrie Oval?
SELECT MIN("Crowd") FROM table_10441 WHERE "Venue" = 'glenferrie oval'
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, ...
how many patients whose religion is catholic and item id is 50912?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.itemid = "50912"
mimicsql_data
CREATE TABLE table_1310 ( "Team" text, "Titles" real, "Runner-up" real, "Third place" real, "Fourth place" real, "Years participated" real )
How many years did notre dame participate?
SELECT MAX("Years participated") FROM table_1310 WHERE "Team" = 'Notre Dame'
wikisql
CREATE TABLE table_42882 ( "Name" text, "GP-GS" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
What is the lowest gain with an 18 long, and a loss less than 191?
SELECT MIN("Gain") FROM table_42882 WHERE "Long" = '18' AND "Loss" < '191'
wikisql
CREATE TABLE table_4928 ( "Player" text, "Span" text, "Lost" text, "Draw" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text )
How many tries does Fakahau Valu have?
SELECT "Tries" FROM table_4928 WHERE "Player" = 'fakahau valu'
wikisql
CREATE TABLE table_name_87 ( line VARCHAR, operator VARCHAR, destination VARCHAR )
Which line has an operator of the London Overground and ends at the Crystal Palace?
SELECT line FROM table_name_87 WHERE operator = "london overground" AND destination = "crystal palace"
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
How many widow patients have had other body fluid lab tests?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_74 ( Id VARCHAR )
What is 2004, when 2005 is '2R', and when 2006 is '1R
SELECT 2004 FROM table_name_74 WHERE 2005 = "2r" AND 2006 = "1r"
sql_create_context
CREATE TABLE table_19765685_2 ( country VARCHAR, also_currently_known_as VARCHAR )
How many tournaments are also currently known as the hp open?
SELECT COUNT(country) FROM table_19765685_2 WHERE also_currently_known_as = "HP Open"
sql_create_context
CREATE TABLE Projects ( project_details VARCHAR, project_id VARCHAR, role_code VARCHAR ) CREATE TABLE Project_Staff ( project_details VARCHAR, project_id VARCHAR, role_code VARCHAR )
List the project details of the projects which did not hire any staff for a researcher role.
SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')
sql_create_context
CREATE TABLE table_name_21 ( assists VARCHAR, minutes VARCHAR, player VARCHAR, position VARCHAR, goals VARCHAR )
What is the total number of assists when Edmundo Rodriguez is playing the position of striker, less than 4 goals were scored, and the minutes were less than 473?
SELECT COUNT(assists) FROM table_name_21 WHERE position = "striker" AND goals < 4 AND player = "edmundo rodriguez" AND minutes < 473
sql_create_context
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE studen...
How many faculty do we have?
SELECT COUNT(*) FROM faculty
spider
CREATE TABLE table_79826 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Transfer fee" text )
What is the nationality of the player with a transfer fee of 400k?
SELECT "Nat." FROM table_79826 WHERE "Transfer fee" = '£400k'
wikisql
CREATE TABLE table_name_46 ( Id VARCHAR )
Which 2008 Tournament has a 2007 of a and a 2010 of qf?
SELECT 2008 FROM table_name_46 WHERE 2007 = "a" AND 2010 = "qf"
sql_create_context
CREATE TABLE table_name_55 ( city VARCHAR, venue VARCHAR )
In which city is the San Lorenzo Centenario venue located?
SELECT city FROM table_name_55 WHERE venue = "san lorenzo centenario"
sql_create_context
CREATE TABLE table_47319 ( "Title" text, "Parent magazine" text, "Magazine type" text, "Frequency" text, "First published" text )
What was the parent magazine of the magazine that was first published on december 16, 2004?
SELECT "Parent magazine" FROM table_47319 WHERE "First published" = 'december 16, 2004'
wikisql
CREATE TABLE table_name_53 ( away_team VARCHAR, home_team VARCHAR )
Who was the away team when the home team was Lincoln City?
SELECT away_team FROM table_name_53 WHERE home_team = "lincoln city"
sql_create_context
CREATE TABLE table_2145 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the result when John Barrow was the incumbent first elected in 2004?
SELECT "Result" FROM table_2145 WHERE "First elected" = '2004' AND "Incumbent" = 'John Barrow'
wikisql
CREATE TABLE table_10335_1 ( camp VARCHAR, estimated_deaths VARCHAR )
what's the camp with estimated deaths of 600,000
SELECT camp FROM table_10335_1 WHERE estimated_deaths = "600,000"
sql_create_context
CREATE TABLE table_name_56 ( leading_scorer VARCHAR, visitor VARCHAR )
Who is the leading scorer of the Villa De Los Barrios visitor?
SELECT leading_scorer FROM table_name_56 WHERE visitor = "villa de los barrios"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients whose procedure icd9 code is 3891.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3891"
mimicsql_data
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname ...
Is there any lab for 533 ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 533
advising
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
No reppers: Lowest 256 Reputation / (Answer + Question) Count ratios.
SELECT Users.Id AS "user_link", Users.Reputation, COUNT(*) AS PostCount, Users.Reputation / CAST(COUNT(*) AS FLOAT) AS Ratio FROM Users INNER JOIN Posts ON Users.Id = Posts.OwnerUserId AND Posts.PostTypeId IN (1, 2) GROUP BY Users.Id, Users.Reputation ORDER BY Ratio LIMIT 256
sede
CREATE TABLE table_21202 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many scores are listed for game 37?
SELECT COUNT("Score") FROM table_21202 WHERE "Game" = '37'
wikisql
CREATE TABLE table_10848177_1 ( track__number INTEGER )
What is the highest track number?
SELECT MAX(track__number) FROM table_10848177_1
sql_create_context
CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE project_outcomes ( project_id number, outcome_code text, outcome_details text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE T...
List the project details of the projects with the research outcome described with the substring 'Published'.
SELECT T1.project_details FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'
spider
CREATE TABLE table_52795 ( "Area name" text, "Area headquarters" text, "Area president (Quorum)" text, "First counselor (Quorum)" text, "Second counselor (Quorum)" text )
Name the area president when the area name is south america south
SELECT "Area president (Quorum)" FROM table_52795 WHERE "Area name" = 'south america south'
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...
provide the number of black/african ethnic background patients who were born before the year 2071.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_46581 ( "Builder" text, "Works no." real, "Built" real, "Wheels" text, "Notes" text )
Which wheels were built 1920?
SELECT "Wheels" FROM table_46581 WHERE "Built" = '1920'
wikisql
CREATE TABLE table_11656578_2 ( population__1980_ VARCHAR, capital VARCHAR )
How many people lived in the voivodenship whose capital is Siedlce in the year of 1980?
SELECT population__1980_ FROM table_11656578_2 WHERE capital = "Siedlce"
sql_create_context
CREATE TABLE table_name_38 ( country VARCHAR, place VARCHAR, score VARCHAR )
Which country had a place of t1, as well as a score of 72-68-70-73=283?
SELECT country FROM table_name_38 WHERE place = "t1" AND score = 72 - 68 - 70 - 73 = 283
sql_create_context
CREATE TABLE table_38175 ( "Tournament" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which tournament had a result in 2010 and 2012 of a?
SELECT "Tournament" FROM table_38175 WHERE "2012" = 'a' AND "2010" = 'a'
wikisql
CREATE TABLE table_79414 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Series" text, "Arena" text )
Which Attendance has an Arena of arrowhead pond of anaheim, and a Loss of giguere (3 3)?
SELECT MAX("Attendance") FROM table_79414 WHERE "Arena" = 'arrowhead pond of anaheim' AND "Loss" = 'giguere (3–3)'
wikisql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, ...
Show the number of start dates of all the apartment bookings for each year with a bar chart, and order by the total number in desc please.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE table_59033 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Country of the Player with a Score of 71-73-71=215?
SELECT "Country" FROM table_59033 WHERE "Score" = '71-73-71=215'
wikisql
CREATE TABLE table_32541 ( "Rank" real, "Player" text, "Years" text, "Games" real, "PPG Avg." real, "Total Points" real )
How many players played over 125 games and were named david gonzalvez?
SELECT COUNT("Rank") FROM table_32541 WHERE "Games" > '125' AND "Player" = 'david gonzalvez'
wikisql
CREATE TABLE table_24589 ( "Year" text, "MAAC" text, "Overall" text, "Regular Season Results" text, "MAAC Tournament Result" text, "NCAA Seed" text, "NCAA Round" text )
In which year is the overall 29-4?
SELECT "Year" FROM table_24589 WHERE "Overall" = '29-4'
wikisql
CREATE TABLE table_78279 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
What is the record of the game on December 5, 2007?
SELECT "Record" FROM table_78279 WHERE "Date" = 'december 5, 2007'
wikisql
CREATE TABLE table_78173 ( "Season" real, "Belonging league" text, "Matches" real, "league point" real, "Draw" real, "Lose" real, "Goal difference" real, "Point" real, "Lost point" real, "Final rank" real )
I want the total number of matches for draw less than 7 and lost point of 16 with lose more than 4
SELECT COUNT("Matches") FROM table_78173 WHERE "Draw" < '7' AND "Lost point" = '16' AND "Lose" > '4'
wikisql
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
did italy or spain receive a greater number of silver medals ?
SELECT "nation" FROM table_203_374 WHERE "nation" IN ('italy', 'spain') ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE table_27756014_1 ( high_points VARCHAR, date VARCHAR )
How many games were played on october 16?
SELECT COUNT(high_points) FROM table_27756014_1 WHERE date = "October 16"
sql_create_context
CREATE TABLE table_name_83 ( title VARCHAR, track VARCHAR )
What is the title of track 7?
SELECT title FROM table_name_83 WHERE track = 7
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, ...
Highest scoring unanswered questions in the last two weeks.
SELECT P.Id AS "post_link", Score, AnswerCount, ViewCount, CreationDate FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.Id INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName = '##Tag:string##' AND P.AcceptedAnswerId IS NULL AND P.CreationDate >= CURRENT_TIMESTAMP() - 14 ORDER BY Score DESC, AnswerCount,...
sede
CREATE TABLE table_name_40 ( format VARCHAR, date VARCHAR, label VARCHAR )
Which Format has a Date of 14 october 2008, and a Label of eagle eye media?
SELECT format FROM table_name_40 WHERE date = "14 october 2008" AND label = "eagle eye media"
sql_create_context
CREATE TABLE table_name_33 ( record VARCHAR, loss VARCHAR )
What was the record of the game that had a loss of Stottlemyre (10-12)?
SELECT record FROM table_name_33 WHERE loss = "stottlemyre (10-12)"
sql_create_context