context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_23225 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What was the number of races in the season in which the team placed on the 14th position?
SELECT MIN("Races") FROM table_23225 WHERE "Position" = '14th'
wikisql
CREATE TABLE table_20302 ( "#" real, "Advocate # 1" text, "Advocate # 2" text, "Root of All Evil" text, "Poll winner" text, "Original air date" text )
What are the original air dates when scientology isthe poll winner?
SELECT "Original air date" FROM table_20302 WHERE "Poll winner" = 'Scientology'
wikisql
CREATE TABLE table_16950 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
How many tournaments ended with a score of 204 (-12)?
SELECT COUNT("Tournament") FROM table_16950 WHERE "Score" = '204 (-12)'
wikisql
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 )
What are the number of the names of all products?, rank x-axis from low to high order.
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE catalog_contents ( catalog_entry_name VARCHAR, LENGTH VARCHAR, width VARCHAR )
Find the names of the products with length smaller than 3 or height greater than 5.
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
sql_create_context
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,...
列出患者69380544就诊科室名称不包含眼外伤的全部医疗在医院2426455中就诊记录都是哪些啊?
SELECT * FROM t_kc21 WHERE PERSON_ID = '69380544' AND MED_SER_ORG_NO = '2426455' AND NOT MED_ORG_DEPT_NM LIKE '%眼外伤%'
css
CREATE TABLE table_name_52 ( captain VARCHAR, manager VARCHAR )
Which captain has howard wilkinson as the manager?
SELECT captain FROM table_name_52 WHERE manager = "howard wilkinson"
sql_create_context
CREATE TABLE table_33844 ( "Kanji" text, "Name (Translation)" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
Which builder has the the kanji of ?
SELECT "Builder" FROM table_33844 WHERE "Kanji" = '曙'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose ethnicity is hispanic or latino and days of hospital stay is greater than 23?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE table_51177 ( "Name of ground" text, "Location" text, "Year" text, "FC matches" text, "LA matches" text, "T20 matches" text, "Total" text )
Which FC match has a total of 24?
SELECT "FC matches" FROM table_51177 WHERE "Total" = '24'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
what patient 035-4312's age is on this hospital encounter?
SELECT patient.age FROM patient WHERE patient.uniquepid = '035-4312' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_name_55 ( country VARCHAR, player VARCHAR )
What country is Steve Jones from?
SELECT country FROM table_name_55 WHERE player = "steve jones"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
how many days has it elapsed since patient 9964 was admitted to the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 9964 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_name_53 ( game INTEGER, attendance VARCHAR )
What's the game with an attendance of 71,962?
SELECT MIN(game) FROM table_name_53 WHERE attendance = 71 OFFSET 962
sql_create_context
CREATE TABLE table_14945881_1 ( week INTEGER, date VARCHAR )
Name the least week for september 19, 1976
SELECT MIN(week) FROM table_14945881_1 WHERE date = "September 19, 1976"
sql_create_context
CREATE TABLE table_name_77 ( white__both_hispanic_and_non_hispanic_ VARCHAR, black__both_hispanic_and_non_hispanic_ VARCHAR, hispanic__of_any_race_ VARCHAR )
What is the total number of white (Hispanic/Non-Hispanic) having a black (Hispanic/Non-Hispanic) of 9.9 and Hispanic under 99.5?
SELECT COUNT(white__both_hispanic_and_non_hispanic_) FROM table_name_77 WHERE black__both_hispanic_and_non_hispanic_ = 9.9 AND hispanic__of_any_race_ < 99.5
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
has patient 015-33415 been admitted into the hospital until 1 year ago?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-33415' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year')
eicu
CREATE TABLE table_11677100_16 ( position VARCHAR, hometown VARCHAR )
What positions were drafted from Las Vegas, NV?
SELECT position FROM table_11677100_16 WHERE hometown = "Las Vegas, NV"
sql_create_context
CREATE TABLE table_50762 ( "Rank" real, "City" text, "Population" text, "Definition" text, "Country" text )
What's the rank of the Province-Level Municipality?
SELECT "Rank" FROM table_50762 WHERE "Definition" = 'province-level municipality'
wikisql
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE advisor ( s_ID v...
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, show by the Y-axis from low to high.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary)
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
how many hours have passed since last time that patient 15986 stayed in careunit micu during their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15986 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_26609958_1 ( rainfall_totals__million_m_3__ INTEGER )
What is the lowest overall amount of rainfall totals (million m 3)?
SELECT MIN(rainfall_totals__million_m_3__) FROM table_26609958_1
sql_create_context
CREATE TABLE table_name_94 ( producer_s_ VARCHAR, writer_s_ VARCHAR )
Which producer worked with Robert Sproul-cran as writer?
SELECT producer_s_ FROM table_name_94 WHERE writer_s_ = "robert sproul-cran"
sql_create_context
CREATE TABLE table_47694 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
Which Rider has a Grid larger than 6, and has Laps of 28, and a Time of +39.476?
SELECT "Rider" FROM table_47694 WHERE "Grid" > '6' AND "Laps" = '28' AND "Time" = '+39.476'
wikisql
CREATE TABLE market ( market_id number, district text, num_of_employees number, num_of_shops number, ranking number ) CREATE TABLE phone ( name text, phone_id number, memory_in_g number, carrier text, price number ) CREATE TABLE phone_market ( market_id number, phone_id...
What is the carrier of the most expensive phone?
SELECT carrier FROM phone ORDER BY price DESC LIMIT 1
spider
CREATE TABLE table_name_9 ( team__number1 VARCHAR )
Tell me the 1st leg for asfa rabat
SELECT 1 AS st_leg FROM table_name_9 WHERE team__number1 = "asfa rabat"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
病号卫谷雪在2004年8月7日到2004年8月8日内的住院次数总共有多少次?
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '卫谷雪' AND zyb.IN_HOSP_DAYS BETWEEN '2004-08-07' AND '2004-08-08'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many female patients remained admitted in the hospital for more than 23 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
68211216患者的身高与体重分别多少?
SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '68211216' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzj...
css
CREATE TABLE table_66481 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is Denmark's rank?
SELECT "Rank" FROM table_66481 WHERE "Nation" = 'denmark'
wikisql
CREATE TABLE table_21258_1 ( infant_mortality_rate INTEGER, period VARCHAR )
period between 1985 - 1990 have minimum infant mortality rate of what.
SELECT MIN(infant_mortality_rate) FROM table_21258_1 WHERE period = "1985 - 1990"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutput...
what was the name of the first intake of patient 011-35642 that they had until 1726 days ago?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-35642')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_64646 ( "Year" real, "Title" text, "From album" text, "Label" text, "Label-Nr" text )
How many years have a Form album of the thing?
SELECT SUM("Year") FROM table_64646 WHERE "From album" = 'the thing'
wikisql
CREATE TABLE table_15739098_2 ( airdate VARCHAR, story VARCHAR )
What is the airdate when the story is listed as hugh leonard?
SELECT airdate FROM table_15739098_2 WHERE story = "Hugh Leonard"
sql_create_context
CREATE TABLE table_name_52 ( week VARCHAR, date VARCHAR )
What week did they have a bye?
SELECT week FROM table_name_52 WHERE date = "bye"
sql_create_context
CREATE TABLE table_name_99 ( avg_g INTEGER, long INTEGER )
What is the lowest Avg/G with a Long less than 0?
SELECT MIN(avg_g) FROM table_name_99 WHERE long < 0
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
查查检测指标643141数值的平均值以及最值,是针对门诊诊断为疾病I65.176的患者的
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE table_26017 ( "#" real, "Title" text, "Original airdate" text, "Timeslot" text, "Viewers (millions)" text, "Nightly rank" real, "Weekly rank" real )
What episode premier received 0.680 million viewers?
SELECT "Original airdate" FROM table_26017 WHERE "Viewers (millions)" = '0.680'
wikisql
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept...
A scatter chart shows the correlation between ID and salary .
SELECT ID, salary FROM instructor ORDER BY salary
nvbench
CREATE TABLE table_15386 ( "Name" text, "League" real, "Play-offs" real, "FA Cup" real, "League Cup" real, "Total" real )
Name the lowest league for play-offs more than 0 and total of 25
SELECT MIN("League") FROM table_15386 WHERE "Play-offs" > '0' AND "Total" = '25'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
how many patients with diagnoses of other alteration of consciousness were admitted before the year 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2180" AND diagnoses.long_title = "Other alteration of consciousness"
mimicsql_data
CREATE TABLE procedures ( 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 ) ...
how many patients whose primary disease is liver transplant and age is less than 85?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.age < "85"
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, find name and code , and group by attribute headquarter, and visualize them by a bar chart, order x axis from high to low order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_61026 ( "Year" real, "Award" text, "Category" text, "Role" text, "Result" text )
Which Result has a Category of outstanding actor (drama)?
SELECT "Result" FROM table_61026 WHERE "Category" = 'outstanding actor (drama)'
wikisql
CREATE TABLE table_46036 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
What is the lowest game number when the record was 26-24-9?
SELECT MIN("Game") FROM table_46036 WHERE "Record" = '26-24-9'
wikisql
CREATE TABLE table_23184448_3 ( opp_points INTEGER, record VARCHAR )
How many points did the opposing team get in the game with 6-2 record?
SELECT MIN(opp_points) FROM table_23184448_3 WHERE record = "6-2"
sql_create_context
CREATE TABLE table_train_55 ( "id" int, "ejection_fraction_ef" int, "systolic_dysfunction" bool, "language" string, "valvular_dysfunction" bool, "consent" bool, "heart_disease" bool, "left_bundle_branch_block" bool, "trauma" bool, "pericardial_disease" bool, "complete_fluid_c...
history of significant trauma
SELECT * FROM table_train_55 WHERE trauma = 1
criteria2sql
CREATE TABLE table_19658 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How may draws did libertad have?
SELECT COUNT("Draws") FROM table_19658 WHERE "Team" = 'Libertad'
wikisql
CREATE TABLE table_name_20 ( record VARCHAR, game VARCHAR, december VARCHAR )
Game larger than 34, and a December smaller than 23 had what record?
SELECT record FROM table_name_20 WHERE game > 34 AND december < 23
sql_create_context
CREATE TABLE table_27352 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What team got a draft pick player from McGill?
SELECT "CFL Team" FROM table_27352 WHERE "College" = 'McGill'
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, ...
what is age and discharge location of subject name jerry deberry?
SELECT demographic.age, demographic.discharge_location FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_test_31 ( "id" int, "ejection_fraction_ef" int, "macular_disease" bool, "systemic" bool, "alt" float, "iud" bool, "condom_with_spermicide" bool, "gender" string, "meropenem" bool, "non_q_wave_myocardial_infarction" bool, "hbcab" bool, "unstable_angina" ...
the presence of any of the following diseases: asthma if treated with systemic or inhaled corticosteroids in the last 6 months ; cystic fibrosis ; angina ( recurrent heart pain )
SELECT * FROM table_test_31 WHERE (asthma = 1 AND (systemic = 1 OR inhaled_corticosteroids = 1)) OR cystic_fibrosis = 1 OR angina = 1 OR recurrent_heart_pain = 1
criteria2sql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildin...
Show the number of apartment bookings for each weekday and bin booking start date by weekday interval in a bar chart, and sort y axis in desc order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE employees ( department_id VARCHAR )
Return all the information for all employees without any department number.
SELECT * FROM employees WHERE department_id = "null"
sql_create_context
CREATE TABLE table_name_40 ( position VARCHAR, pick__number VARCHAR, college VARCHAR )
What is Position, when Pick # is less than 40, and when College is Western?
SELECT position FROM table_name_40 WHERE pick__number < 40 AND college = "western"
sql_create_context
CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE course ( cid text, cname text, credits number, instructor number, days tex...
Find the names of courses that have either 3 credits or 1 credit but 4 hours.
SELECT cname FROM course WHERE credits = 3 UNION SELECT cname FROM course WHERE credits = 1 AND hours = 4
spider
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
Which upper level electives are offered before noon ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
advising
CREATE TABLE table_3243 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text )
On the Circuit Zolder who was the winning team?
SELECT "Winning Team" FROM table_3243 WHERE "Circuit" = 'Circuit Zolder'
wikisql
CREATE TABLE table_60313 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the record on October 30?
SELECT "Record" FROM table_60313 WHERE "Date" = 'october 30'
wikisql
CREATE TABLE table_67836 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
yes or no for the melbourne with yes for gold coast, yes for adelaide, no for auckland?
SELECT "Melbourne" FROM table_67836 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'no' AND "Auckland" = 'no'
wikisql
CREATE TABLE table_name_54 ( year INTEGER, venue VARCHAR )
What is the highest Year, when the Venue is Beijing, PR China?
SELECT MAX(year) FROM table_name_54 WHERE venue = "beijing, pr china"
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...
Show me about the correlation between School_ID and All_Games_Percent , and group by attribute ACC_Regular_Season in a scatter chart.
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_25518 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
The episode which originally aired on December 17, 2004 was written by whom?
SELECT "Written by" FROM table_25518 WHERE "Original air date" = 'December 17, 2004'
wikisql
CREATE TABLE table_78631 ( "Year" real, "Winner" text, "Sport" text, "Hometown" text, "College" text )
What is the total number of Year, when Winner is 'Johnathan Gray'?
SELECT COUNT("Year") FROM table_78631 WHERE "Winner" = 'johnathan gray'
wikisql
CREATE TABLE table_30603 ( "Year" real, "Austria" text, "Belgium" text, "England" text, "Germany" text, "Italy" text, "Netherlands" text, "Saudi Arabia" text, "Spain" text, "United Arab Emirates" text )
What was the team from Austria when the Netherlands sent Brunssum/Schinnen LL Brunssum and Belgium sent Shape and Waterloo LL Brussels?
SELECT "Austria" FROM table_30603 WHERE "Netherlands" = 'Brunssum/Schinnen LL Brunssum' AND "Belgium" = 'SHAPE and Waterloo LL Brussels'
wikisql
CREATE TABLE table_19381 ( "Country" text, "Local Name" text, "Host" text, "Channel" text, "Year Aired" text, "Top Prize" text )
Which Country is the show aired on Fox?
SELECT "Country" FROM table_19381 WHERE "Channel" = 'Fox'
wikisql
CREATE TABLE table_204_583 ( id number, "capacitor type" text, "capacity" text, "volts" text, "temp." text, "energy-to-weight ratio" text, "power-to-weight ratio" text )
which capacitor has the top voltage rating ?
SELECT "capacitor type" FROM table_204_583 ORDER BY "volts" DESC LIMIT 1
squall
CREATE TABLE table_204_296 ( id number, "rank" number, "athlete" text, "qual" number, "final" number, "total" number, "notes" text )
who scored higher in total score of the two athletes from the soviet union -lrb- urs -rrb- ?
SELECT "athlete" FROM table_204_296 WHERE "athlete" = 'urs' ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_46922 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which country scored 69-67-69-70=275?
SELECT "Country" FROM table_46922 WHERE "Score" = '69-67-69-70=275'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the average age of male patients who died before the year 2165?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2165.0"
mimicsql_data
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...
get the number of patients with cardiac arrest diagnoses who are widowed.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Cardiac arrest"
mimicsql_data
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
number of hospital visits of patient 65401 in this year.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 65401 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_47172 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which Year(s) won has a Total smaller than 292, and a Player of hale irwin?
SELECT "Year(s) won" FROM table_47172 WHERE "Total" < '292' AND "Player" = 'hale irwin'
wikisql
CREATE TABLE table_name_59 ( rank INTEGER, country VARCHAR )
What is the sum of the ranks for india?
SELECT SUM(rank) FROM table_name_59 WHERE country = "india"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
For class RCIDIV 390 , how often does it meet ?
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE table_4433 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
Tell me the lowest pick number for columbus crew
SELECT MIN("Pick #") FROM table_4433 WHERE "MLS team" = 'columbus crew'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is admission location and diagnoses long title of subject id 9271?
SELECT demographic.admission_location, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "9271"
mimicsql_data
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在零七年三月二十五号到一七年八月八号内医疗机构9399151开出的检验报告单一共是多少?
SELECT COUNT(*) FROM jybgb WHERE YLJGDM = '9399151' AND BGRQ BETWEEN '2007-03-25' AND '2017-08-08'
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE aircraft ( ...
do you have a flight from SALT LAKE CITY to ST. PETERSBURG
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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
在2012年8月24日到2020年5月4日内病人尤云霞被开出的所有检验报告单的检验报告单号都有哪些?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number...
what does patient 021-102856 have to pay for their stay in hospital in 2104?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-102856') AND STRFTIME('%y', cost.chargetime) = '2104'
eicu
CREATE TABLE table_name_32 ( year INTEGER, charts VARCHAR )
What year was the No. 7 charts?
SELECT AVG(year) FROM table_name_32 WHERE charts = "no. 7"
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...
查一下哪些检验指标记录满足这个条件:检测指标名称、结果定量单位跟检验指标记录50359097599一致,且检测指标结果定量不一致
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50359097599') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50359097599') AND jyjgzbb.JCZBJGDL <> (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50359097599')
css
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, ...
how many papers appeared at nips last year
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'nips'
scholar
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 ( ...
how many patients whose procedure icd9 code is 5771?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5771"
mimicsql_data
CREATE TABLE table_name_92 ( player VARCHAR, place VARCHAR, score VARCHAR )
What T9 Place Player had a Score of 73-67-74-71=285?
SELECT player FROM table_name_92 WHERE place = "t9" AND score = 73 - 67 - 74 - 71 = 285
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
Count the number of questions.
SELECT COUNT(Id) FROM Posts WHERE PostTypeId = 2 AND (Body LIKE '%<pre>%')
sede
CREATE TABLE table_name_48 ( open_source VARCHAR, editor VARCHAR, cost___us$__ VARCHAR, activity VARCHAR )
Which source has a Cost free, and an Activity of some, and an Editor of markitup?
SELECT open_source FROM table_name_48 WHERE cost___us$__ = "free" AND activity = "some" AND editor = "markitup"
sql_create_context
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, show me about the distribution of headquarter and the average of revenue , and group by attribute headquarter in a bar chart, and I want to show by the Y from low to high.
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue)
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose diagnoses short title is hy kid nos w cr kid i-iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Hy kid NOS w cr kid I-IV"
mimicsql_data
CREATE TABLE table_54753 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Date has a Home team of st kilda?
SELECT "Date" FROM table_54753 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_name_95 ( res VARCHAR, event VARCHAR )
What is the result of the UFC 87?
SELECT res FROM table_name_95 WHERE event = "ufc 87"
sql_create_context
CREATE TABLE table_203_780 ( id number, "rank" number, "diver" text, "preliminary\npoints" number, "preliminary\nrank" number, "final\npoints" number, "final\nrank" number, "final\ntotal" number )
what is the difference in the total score between first and second place ?
SELECT ABS((SELECT "final\ntotal" FROM table_203_780 WHERE "rank" = 1) - (SELECT "final\ntotal" FROM table_203_780 WHERE "rank" = 2))
squall
CREATE TABLE table_171236_1 ( census_ranking VARCHAR, official_name VARCHAR )
With the official name Quispamsis, what is the census ranking?
SELECT census_ranking FROM table_171236_1 WHERE official_name = "Quispamsis"
sql_create_context
CREATE TABLE table_1302886_1 ( others_number INTEGER, bush_percentage VARCHAR )
What is the others# when bush% is 57.0%?
SELECT MAX(others_number) FROM table_1302886_1 WHERE bush_percentage = "57.0%"
sql_create_context
CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number, unsure_rate number ) CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height nu...
Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates?
SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate
spider
CREATE TABLE table_train_195 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "allergy_to_perflutren" bool, "heart_disease" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
bmi > 35
SELECT * FROM table_train_195 WHERE body_mass_index_bmi >= 35
criteria2sql
CREATE TABLE table_2516 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
what is the district where the vacator is vacant?
SELECT "District" FROM table_2516 WHERE "Vacator" = 'Vacant'
wikisql
CREATE TABLE table_26240046_1 ( season_3 INTEGER, played_by VARCHAR )
How many season 3 appearances by Morgan the Dog?
SELECT MAX(season_3) FROM table_26240046_1 WHERE played_by = "Morgan the Dog"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For all employees in the Finance department, compare the total number of different job id using a bar chart.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID
nvbench