context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_74 (
venue VARCHAR,
goals VARCHAR,
assists VARCHAR
) | Where were less than 72 goals made and more than 40 assists made? | SELECT venue FROM table_name_74 WHERE goals < 72 AND assists > 40 | sql_create_context |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
... | How many employees have salary between 100000 and 200000? | SELECT COUNT(*) FROM employee WHERE salary BETWEEN 100000 AND 200000 | spider |
CREATE TABLE table_name_96 (
nationality VARCHAR,
position VARCHAR,
school_club_team VARCHAR
) | What is the nationality of the guard who plays at Utah? | SELECT nationality FROM table_name_96 WHERE position = "guard" AND school_club_team = "utah" | sql_create_context |
CREATE TABLE table_32731 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team's venue is Windy Hill? | SELECT "Home team" FROM table_32731 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_55342 (
"Finish Position" text,
"Lengths Behind" text,
"Post Position" real,
"Horse name" text,
"Trainer" text,
"Jockey" text,
"Owner" text,
"Post Time Odds" text
) | Who the Owner that has a Lengths Behind of 5 ? | SELECT "Owner" FROM table_55342 WHERE "Lengths Behind" = '5½' | wikisql |
CREATE TABLE roles (
role_code text,
role_description text
)
CREATE TABLE documents (
document_id number,
document_status_code text,
document_type_code text,
shipping_agent_code text,
receipt_date time,
receipt_number text,
other_details text
)
CREATE TABLE documents_mailed (
d... | What are the shipping agent names? | SELECT shipping_agent_name FROM ref_shipping_agents | spider |
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... | count the number of patients whose year of birth is less than 2170 and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,... | Give me line charts of worldwide gross how many date account opened over year date account opened by major genres other_account_details | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details | nvbench |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | provide the number of patients whose year of death is less than or equal to 2111 and procedure long title is exteriorization of small intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2111.0" AND procedures.long_title = "Exteriorization of small intestine" | mimicsql_data |
CREATE TABLE table_name_40 (
height VARCHAR,
school VARCHAR
) | Which height is associated with Franklin High School? | SELECT height FROM table_name_40 WHERE school = "franklin high school" | sql_create_context |
CREATE TABLE Tasks (
task_id INTEGER,
project_id INTEGER,
task_details VARCHAR(255),
"eg Agree Objectives" VARCHAR(1)
)
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
... | Display a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars?, and I want to display by the X-axis in ascending. | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | nvbench |
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... | what is the name of the drug that patient 016-14220 was prescribed within the same day after it had been diagnosed with sepsis? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-14220') AND diagnosis.diagnos... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients born before the year 2110 were diagnosed with dehydration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2110" AND diagnoses.short_title = "Dehydration" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a scatter chart about the correlation between manager_id and department_id . | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_204_681 (
id number,
"2011 rank" number,
"2010 rank" number,
"2009 rank" number,
"2008 rank" number,
"2007 rank" number,
"company (country)" text,
"2011 arms sales (us$ m.)" number,
"2010 arms sales (us$ m.)" number,
"2009 arms sales (us$ m.)" number,
"2008... | which company had the highest 2009 arms sales ? | SELECT "company (country)" FROM table_204_681 ORDER BY "2009 arms sales (us$ m.)" DESC LIMIT 1 | squall |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | what is the minimum number of daily diagnosed cases of hepatorenal syndrome during the last year? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'hepatorenal syndrome' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS ... | eicu |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | how much is the difference between the total output and the total input of patient 3929 on this month/24? | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT... | mimic_iii |
CREATE TABLE table_65889 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Wins" real
) | How many total points were in 1992? | SELECT COUNT("Points") FROM table_65889 WHERE "Year" = '1992' | wikisql |
CREATE TABLE table_name_92 (
position VARCHAR,
pick VARCHAR,
round VARCHAR
) | Which Position has a Pick smaller than 152, and a Round smaller than 3? | SELECT position FROM table_name_92 WHERE pick < 152 AND round < 3 | sql_create_context |
CREATE TABLE table_name_35 (
incumbent VARCHAR,
result VARCHAR
) | Which Incumbent has a Result of retired democratic gain? | SELECT incumbent FROM table_name_35 WHERE result = "retired democratic gain" | sql_create_context |
CREATE TABLE table_1341568_44 (
status VARCHAR,
incumbent VARCHAR
) | What is the status of incumbent Charles Stenholm? | SELECT status FROM table_1341568_44 WHERE incumbent = "Charles Stenholm" | sql_create_context |
CREATE TABLE table_name_26 (
date VARCHAR,
opponent VARCHAR
) | On what day did the team play the Indianapolis Colts? | SELECT date FROM table_name_26 WHERE opponent = "indianapolis colts" | sql_create_context |
CREATE TABLE table_name_61 (
name VARCHAR,
roll VARCHAR,
area VARCHAR
) | What school in Dalefield has a roll less than 81? | SELECT name FROM table_name_61 WHERE roll < 81 AND area = "dalefield" | sql_create_context |
CREATE TABLE table_56595 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what's the average grid that has a time/retired piston and laps smaller than 15? | SELECT AVG("Grid") FROM table_56595 WHERE "Time/Retired" = 'piston' AND "Laps" < '15' | wikisql |
CREATE TABLE table_name_29 (
franchise VARCHAR,
finish VARCHAR,
percentage VARCHAR,
year VARCHAR
) | Which Franchise has a Percentage under 0.707, a Year larger than 1931, and the Finish was won 1998 World Series? | SELECT franchise FROM table_name_29 WHERE percentage < 0.707 AND year > 1931 AND finish = "won 1998 world series" | sql_create_context |
CREATE TABLE table_name_27 (
position VARCHAR,
pick VARCHAR,
school_club_team VARCHAR
) | Which position at UCLA has a lower than 92 pick number? | SELECT position FROM table_name_27 WHERE pick < 92 AND school_club_team = "ucla" | sql_create_context |
CREATE TABLE table_name_68 (
position VARCHAR,
years_in_orlando VARCHAR
) | Which Position has a Years in Orlando of 1997 1998? | SELECT position FROM table_name_68 WHERE years_in_orlando = "1997–1998" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | Show posts about Jon Skeet. | SELECT Title, ViewCount, Id FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%Jon Skeet%' OR Title LIKE '%Jon-Skeet%' | sede |
CREATE TABLE table_name_31 (
date VARCHAR,
winning_score VARCHAR
) | Which Date has a Winning score of 69-68-68-70=275? | SELECT date FROM table_name_31 WHERE winning_score = 69 - 68 - 68 - 70 = 275 | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | tuesday morning flights between CHARLOTTE and 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 22 AND date_day.month_number = 3 AN... | atis |
CREATE TABLE table_name_47 (
game INTEGER,
time VARCHAR,
attendance VARCHAR
) | Which week was the first game played that had a time of 2:06 and less than 27,374 attendees? | SELECT MIN(game) FROM table_name_47 WHERE time = "2:06" AND attendance < 27 OFFSET 374 | 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 are treated for contrast arteriogram-leg and have their discharge location as home? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.short_title = "Contrast arteriogram-leg" | mimicsql_data |
CREATE TABLE table_name_1 (
date VARCHAR,
source VARCHAR,
murray VARCHAR
) | What is the date of the poll where Murray had 11% from the Suffolk University source? | SELECT date FROM table_name_1 WHERE source = "suffolk university" AND murray = "11%" | sql_create_context |
CREATE TABLE table_name_86 (
drawn INTEGER,
games INTEGER
) | What is the highest number of games drawn, where the games played was less than 7? | SELECT MAX(drawn) FROM table_name_86 WHERE games < 7 | 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... | Who was GEOG 795 taught by in the past ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
CREATE TABLE table_204_665 (
id number,
"rank" number,
"name" text,
"notability" text,
"birthplace" text,
"advocate" text
) | who is ranked after wayne gretzky ? | SELECT "name" FROM table_204_665 WHERE id = (SELECT id FROM table_204_665 WHERE "name" = 'wayne gretzky') + 1 | squall |
CREATE TABLE table_2641 (
"Party Name" text,
"States contested" real,
"Seats contested" real,
"Seats won" real,
"No. of Votes" real,
"% of Votes" text,
"% in Seats contested" text,
"Forfeited in seats" real
) | Where 19 seats were won, what was the minimum number of forfeited seats? | SELECT MIN("Forfeited in seats") FROM table_2641 WHERE "Seats won" = '19' | wikisql |
CREATE TABLE table_name_46 (
replaced_by VARCHAR,
team VARCHAR,
date_of_vacancy VARCHAR
) | Who was the replacement for the Brussels team with a date of vacancy of 22 December 2007? | SELECT replaced_by FROM table_name_46 WHERE team = "brussels" AND date_of_vacancy = "22 december 2007" | sql_create_context |
CREATE TABLE table_51989 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average total medals of the team with 2 gold and less than 1 silver? | SELECT AVG("Total") FROM table_51989 WHERE "Gold" = '2' AND "Silver" < '1' | 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 Apartment_Bookings (
apt_bookin... | Show the number of apartment bookings in each year and bin booking start date by year with a bar chart, could you sort from low to high by the y axis? | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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_care... | how many hours has elapsed since patient 83062 was admitted into the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062) AND icustays.outtime IS NULL | mimic_iii |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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... | 在2007-10-12到2017-03-18内患者范华池曾在医院有多少次就诊? | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '范华池' AND mzjzjlb.JZKSRQ BETWEEN '2007-10-12' AND '2017-03-18') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_26212 (
"World record" text,
"Paula Radcliffe ( GBR )" text,
"2:15:25" text,
"London , Great Britain" text,
"13 April 2003" text
) | Name the world record for 26 april 2009 | SELECT "World record" FROM table_26212 WHERE "13 April 2003" = '26 April 2009' | wikisql |
CREATE TABLE table_name_84 (
state VARCHAR,
interview VARCHAR,
evening_gown VARCHAR,
swimsuit VARCHAR
) | Name the state with an evening gown more than 8.86 and interview less than 8.7 and swimsuit less than 8.96 | SELECT state FROM table_name_84 WHERE evening_gown > 8.86 AND swimsuit < 8.96 AND interview < 8.7 | sql_create_context |
CREATE TABLE table_name_36 (
crew_chief VARCHAR,
team VARCHAR,
driver_s_ VARCHAR
) | Who is Eric McClure's and Tristar Motorsports' crew chief? | SELECT crew_chief FROM table_name_36 WHERE team = "tristar motorsports" AND driver_s_ = "eric mcclure" | sql_create_context |
CREATE TABLE table_78265 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
) | Tell me the 2.4km run for points less than 2 | SELECT "2.4km Run (min:sec)" FROM table_78265 WHERE "Points" < '2' | wikisql |
CREATE TABLE table_16849531_2 (
protein_identity VARCHAR,
length__bp_aa_ VARCHAR
) | What is the protein identity with a length of 5304bp/377aa? | SELECT protein_identity FROM table_16849531_2 WHERE length__bp_aa_ = "5304bp/377aa" | sql_create_context |
CREATE TABLE table_204_726 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"behind" number,
"points" number
) | what is the number of 1500 meter runners that came from italy ? | SELECT COUNT("athlete") FROM table_204_726 WHERE "country" = 'italy' | squall |
CREATE TABLE table_22058547_1 (
type VARCHAR,
mascot VARCHAR
) | What school classifications have trappers as mascot? | SELECT type FROM table_22058547_1 WHERE mascot = "Trappers" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | what is the unabbreviated version of the malig neopl pleura nos? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malig neopl pleura nos' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'malig neopl pleura nos' | mimic_iii |
CREATE TABLE table_name_36 (
example VARCHAR,
formula VARCHAR
) | Which example has rx as the formula? | SELECT example FROM table_name_36 WHERE formula = "rx" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | How many patients with secondary neuroendocrine tumor of bone had a blood gas test? | 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 = "Secondary neuroendocrine tumor of bone" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_27721131_6 (
score VARCHAR,
high_points VARCHAR
) | What was the score when andray blatche , al thornton (20) had the high points? | SELECT score FROM table_27721131_6 WHERE high_points = "Andray Blatche , Al Thornton (20)" | sql_create_context |
CREATE TABLE table_54115 (
"Gymnast" text,
"Floor Exercise" real,
"Pommel Horse" real,
"Rings" real,
"Vault" real,
"Parallel Bars" real,
"Horizontal Bar" real,
"Total" real
) | what was the score of the parallel bars with a floor exercise score more than 9.137, vault more than 9.5 and horizontal bar of 9.225? | SELECT SUM("Parallel Bars") FROM table_54115 WHERE "Floor Exercise" > '9.137' AND "Horizontal Bar" = '9.225' AND "Vault" > '9.5' | wikisql |
CREATE TABLE table_25346 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
) | What is the original air date of the episode titled 'Mom at the Bar/Train Buddy' that was written b Adrienne Carter? | SELECT "Original air date" FROM table_25346 WHERE "Written by" = 'Adrienne Carter' AND "Title" = 'Mom at the Bar/Train Buddy' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 患者64170409以前有某些异常情况她还记得么? | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_name_96 (
time VARCHAR,
grid VARCHAR,
rider VARCHAR
) | What is the time of Troy Bayliss with less than 8 grids? | SELECT time FROM table_name_96 WHERE grid < 8 AND rider = "troy bayliss" | sql_create_context |
CREATE TABLE table_20466963_4 (
guest_2 VARCHAR,
guest_4 VARCHAR,
guest_3 VARCHAR
) | Who is the guest 2 in the episode where guest 4 is Iyare Igiehon and guest 3 is John Oliver? | SELECT guest_2 FROM table_20466963_4 WHERE guest_4 = "Iyare Igiehon" AND guest_3 = "John Oliver" | sql_create_context |
CREATE TABLE table_1638437_2 (
english_name VARCHAR,
simplified VARCHAR
) | Name the english name for | SELECT english_name FROM table_1638437_2 WHERE simplified = "崖城镇" | sql_create_context |
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 time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | what are the five most common medications that followed within the same month for patients who received sm bowel endoscopy nec until 2102? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_17840 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | Name the barrel twist for colt model mt6400 | SELECT "Barrel twist" FROM table_17840 WHERE "Colt model no." = 'MT6400' | wikisql |
CREATE TABLE table_13709 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the Week of the game with an Attendance of 64,900 and a Result of L 34-13? | SELECT MAX("Week") FROM table_13709 WHERE "Attendance" = '64,900' AND "Result" = 'l 34-13' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | what is the minimum total hospital cost which involves c1-c4 fx-cl/cord inj nos since 2105? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'c1-c4 fx-cl/cord inj nos')) AND STRFTIME('%y', cost.chargetime)... | mimic_iii |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | Find the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties, and count them by a bar chart, sort in descending by the y-axis. | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) DESC | nvbench |
CREATE TABLE table_12261926_2 (
general_classification VARCHAR,
winner VARCHAR
) | What is the general classification with the winner being evgeni berzin? | SELECT COUNT(general_classification) FROM table_12261926_2 WHERE winner = "Evgeni Berzin" | sql_create_context |
CREATE TABLE table_name_13 (
team VARCHAR
) | What is 2006, when Team is 'Tacuary'? | SELECT 2006 FROM table_name_13 WHERE team = "tacuary" | sql_create_context |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | A bar chart for finding the number of the name of all students who were in the tryout sorted in alphabetic order. | SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName | nvbench |
CREATE TABLE qtb (
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... | 这个赵伟博的患者以往做了哪些检查还知道么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '赵伟博' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P... | css |
CREATE TABLE table_name_54 (
score VARCHAR,
january VARCHAR,
record VARCHAR
) | What is the score of the game before January 22 with a 30-7-7 record? | SELECT score FROM table_name_54 WHERE january < 22 AND record = "30-7-7" | sql_create_context |
CREATE TABLE table_name_16 (
opponent VARCHAR,
location VARCHAR
) | Which Opponent has Location Wonju Chiak Indoor Gym, South Korea? | SELECT opponent FROM table_name_16 WHERE location = "wonju chiak indoor gym, south korea" | sql_create_context |
CREATE TABLE table_1245 (
"No. in season" real,
"No. disc" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the original air date for episode 17 in the season? | SELECT "Original air date" FROM table_1245 WHERE "No. in season" = '17' | wikisql |
CREATE TABLE table_6410 (
"Feature" text,
"GT Force" text,
"Driving Force EX" text,
"Driving Force Pro" text,
"Driving Force GT" text,
"G25 Racing Wheel" text,
"G27 Racing Wheel" text
) | Driving Force EX of no, and a Driving Force GT of yes, and a Driving Force Pro of yes has what feature? | SELECT "Feature" FROM table_6410 WHERE "Driving Force EX" = 'no' AND "Driving Force GT" = 'yes' AND "Driving Force Pro" = 'yes' | wikisql |
CREATE TABLE table_name_46 (
country VARCHAR,
place VARCHAR
) | What is the Country, when Place is '1'? | SELECT country FROM table_name_46 WHERE place = "1" | sql_create_context |
CREATE TABLE table_23157 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Left" real,
"Current Conference" text
) | When was the school whose students are nicknamed Rams founded? | SELECT MAX("Founded") FROM table_23157 WHERE "Nickname" = 'Rams' | wikisql |
CREATE TABLE Visits_Restaurant (
Id VARCHAR
)
CREATE TABLE Student (
Id VARCHAR
) | Which student visited restaurant most often? List student's first name and last name. | SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_30370 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | When did the episode titled 'Bad dreams' air for the first time? | SELECT "Original air date" FROM table_30370 WHERE "Title" = 'Bad Dreams' | wikisql |
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
country text,
active varchar(2)
)
CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varc... | A bar chart for finding the number of the country of the airlines whose name starts with 'Orbit', display y-axis in asc order please. | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) | nvbench |
CREATE TABLE table_26880 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall FHT Points" text,
"Overall WC points (Rank)" text
) | Name the points for thomas morgenstern | SELECT "Points" FROM table_26880 WHERE "Name" = 'Thomas Morgenstern' | wikisql |
CREATE TABLE table_260938_1 (
si_prefix VARCHAR,
chuquet VARCHAR
) | Name the si prefix for thousand chuquet | SELECT si_prefix FROM table_260938_1 WHERE chuquet = "thousand" | sql_create_context |
CREATE TABLE table_2555 (
"Number in map" text,
"Prefecture" text,
"Area (km\u00b2)" text,
"Population (2001)" real,
"Pop. density (/km\u00b2)" text
) | How many prefectures have an area of 361.719 kilometers squared? | SELECT COUNT("Prefecture") FROM table_2555 WHERE "Area (km\u00b2)" = '361.719' | wikisql |
CREATE TABLE table_79656 (
"Match" real,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attnd." real,
"Report" text
) | Which match did FCR 2001 Duisburg participate as the opponent? | SELECT SUM("Match") FROM table_79656 WHERE "Opponent" = 'fcr 2001 duisburg' | wikisql |
CREATE TABLE table_13474 (
"Event" text,
"Record" text,
"Nationality" text,
"Date" text,
"Games" text
) | Which games saw a record set in the long jump event? | SELECT "Games" FROM table_13474 WHERE "Event" = 'long jump' | wikisql |
CREATE TABLE table_204_595 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total number of gold medals won by jamaica ? | SELECT "gold" FROM table_204_595 WHERE "nation" = 'jamaica' | squall |
CREATE TABLE table_17125 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | How many manners of departure did peter voets have? | SELECT COUNT("Manner of departure") FROM table_17125 WHERE "Outgoing manager" = 'Peter Voets' | wikisql |
CREATE TABLE table_name_5 (
date VARCHAR,
round VARCHAR
) | What was the date for Round 2r? | SELECT date FROM table_name_5 WHERE round = "2r" | sql_create_context |
CREATE TABLE table_name_4 (
date INTEGER,
description VARCHAR
) | What is the latest death with a description of BR-Built inspection saloon? | SELECT MAX(date) FROM table_name_4 WHERE description = "br-built inspection saloon" | sql_create_context |
CREATE TABLE people (
weight VARCHAR,
people_id VARCHAR,
height VARCHAR
)
CREATE TABLE body_builder (
people_id VARCHAR,
snatch VARCHAR
) | List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. | SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | calculate the total amount of input of patient 007-4371 on 01/30/2105. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4371')) AND intakeoutput.cellpath LIKE '%int... | eicu |
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,... | provide the number of patients whose days of hospital stay is greater than 20 and diagnoses short title is critical illness myopthy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "20" AND diagnoses.short_title = "Critical illness myopthy" | mimicsql_data |
CREATE TABLE table_name_96 (
visitor VARCHAR,
leading_scorer VARCHAR
) | What is the visitor team of the game with Rudy Gay (18) as the leading scorer? | SELECT visitor FROM table_name_96 WHERE leading_scorer = "rudy gay (18)" | 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 minimum age of patients of asian ethnicity who stayed in hospital for 29 days? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "29" | mimicsql_data |
CREATE TABLE table_26996293_1 (
cfl_team VARCHAR,
player VARCHAR
) | What CFL Team was Barry Jamieson a part of? | SELECT cfl_team FROM table_26996293_1 WHERE player = "Barry Jamieson" | sql_create_context |
CREATE TABLE table_48595 (
"Election" real,
"Leader" text,
"# of seats won" real,
"# of National votes" real,
"% of National vote" text,
"# of Prefectural votes" real,
"% of Prefectural vote" text
) | What is the total number of # Of Prefectural Votes, when % Of Prefectural Vote is 48.4%, and when # Of Seats Won is greater than 61? | SELECT COUNT("# of Prefectural votes") FROM table_48595 WHERE "% of Prefectural vote" = '48.4%' AND "# of seats won" > '61' | wikisql |
CREATE TABLE table_47109 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | What is the drawn when there are 402 points? | SELECT "Drawn" FROM table_47109 WHERE "Points for" = '402' | wikisql |
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,... | 计算一下37191004580的医疗费用明细里药品的总额 | SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '37191004580' | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location te... | tell me patient 17694's average value of heart rate since 1708 days ago? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17694)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... | mimic_iii |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE status (
station_id numb... | Find all the zip codes in which the max dew point have never reached 70. | SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70 | spider |
CREATE TABLE table_name_58 (
nba_draft VARCHAR,
college VARCHAR
) | What is the NBA draft for ohio state? | SELECT nba_draft FROM table_name_58 WHERE college = "ohio state" | sql_create_context |
CREATE TABLE table_name_9 (
name VARCHAR,
function VARCHAR
) | Who had a function of explorator? | SELECT name FROM table_name_9 WHERE function = "explorator" | sql_create_context |
CREATE TABLE table_name_84 (
name VARCHAR,
result VARCHAR,
heat VARCHAR,
rank VARCHAR
) | What is the Name of the Player with a Rank of 23 or less, Heat of 4 and Result of 55.91? | SELECT name FROM table_name_84 WHERE heat = 4 AND rank < 23 AND result = "55.91" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.