context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_27000 (
"Name of Village" text,
"Name in Syriac" text,
"Number of Believers" real,
"Number of Priests" real,
"Number of Churches" real
) | Name the most number of believers for | SELECT MAX("Number of Believers") FROM table_27000 WHERE "Name in Syriac" = 'ܓܘܝܠܢ' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose language is ptun and year of birth is less than 2064? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PTUN" AND demographic.dob_year < "2064" | mimicsql_data |
CREATE TABLE table_name_71 (
date VARCHAR,
opponent VARCHAR
) | What is the Date with an Opponent that is indiana state college? | SELECT date FROM table_name_71 WHERE opponent = "indiana state college" | sql_create_context |
CREATE TABLE table_204_231 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many nations are ranked 9th ? | SELECT COUNT("nation") FROM table_204_231 WHERE "rank" = 9 | squall |
CREATE TABLE table_73845 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Who wrote the episode with e4515 as the production code? | SELECT "Written by" FROM table_73845 WHERE "Production code" = 'E4515' | wikisql |
CREATE TABLE table_name_7 (
name VARCHAR,
winning_driver VARCHAR
) | What race did eugenio silvani win? | SELECT name FROM table_name_7 WHERE winning_driver = "eugenio silvani" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | what is the number of patients in careunit ccu until 3 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-3 year')) | mimic_iii |
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 inputevents_cv (
row_id number,
subject_id number,
... | what is the dose of vitamin d, that patient 8324 was last prescribed in 08/last year? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8324) AND prescriptions.drug = 'vitamin d' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIM... | mimic_iii |
CREATE TABLE table_name_28 (
start_date VARCHAR,
party VARCHAR
) | Name the start date with party of pd | SELECT start_date FROM table_name_28 WHERE party = "pd" | sql_create_context |
CREATE TABLE table_name_95 (
location_attendance VARCHAR,
game VARCHAR
) | What is the location and attendance of game 1? | SELECT location_attendance FROM table_name_95 WHERE game = 1 | sql_create_context |
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 program (
program_id int,
name varchar,
college varchar... | Core requires what classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many bronze medals did russia earn ? | SELECT "bronze" FROM table_204_107 WHERE "nation" = 'russia' | squall |
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE savings (
custid number,
balance number
) | Find the total balance across checking accounts. | SELECT SUM(balance) FROM checking | spider |
CREATE TABLE table_25856 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Name the date for l 89 92 (ot) | SELECT "Date" FROM table_25856 WHERE "Score" = 'L 89–92 (OT)' | wikisql |
CREATE TABLE table_58766 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
) | What is the average money for a to par of 15, and is from the United States? | SELECT AVG("Money ( $ )") FROM table_58766 WHERE "To par" = '15' AND "Country" = 'united states' | wikisql |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
fi... | count the number of patients who are admitted to hospital until 2101. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) <= '2101' | mimic_iii |
CREATE TABLE table_21486890_1 (
matches INTEGER,
not_out VARCHAR
) | Name the least matches for not out being 44 | SELECT MIN(matches) FROM table_21486890_1 WHERE not_out = 44 | sql_create_context |
CREATE TABLE table_name_2 (
total INTEGER,
nation VARCHAR,
bronze VARCHAR
) | What's the total amount of Bulgaria that has more than 13 bronze? | SELECT SUM(total) FROM table_name_2 WHERE nation = "bulgaria" AND bronze > 13 | 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... | count the number of patients whose admission type is elective and primary disease is morbid obesity/sda. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "MORBID OBESITY/SDA" | mimicsql_data |
CREATE TABLE table_name_8 (
record VARCHAR,
home VARCHAR
) | What is the team's record when vancouver was at home? | SELECT record FROM table_name_8 WHERE home = "vancouver" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the last specimen test given to patient 51177 in 10/2105? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-10' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 jobs (
JOB_ID varchar(10),
JOB_... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_39647 (
"Outcome" text,
"Date" real,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Which Surface has a Partner of jim thomas, and a Date of 2007? | SELECT "Surface" FROM table_39647 WHERE "Partner" = 'jim thomas' AND "Date" = '2007' | wikisql |
CREATE TABLE table_name_97 (
tournaments_played VARCHAR,
money_list_rank VARCHAR,
cuts_made VARCHAR
) | how many times is the money list rank 221 and cuts more than 2? | SELECT COUNT(tournaments_played) FROM table_name_97 WHERE money_list_rank = "221" AND cuts_made > 2 | sql_create_context |
CREATE TABLE table_204_75 (
id number,
"year" number,
"place" text,
"gold" text,
"silver" text,
"bronze" text
) | which country has won more gold medals : china or mexico ? | SELECT "gold" FROM table_204_75 WHERE "gold" IN ('chn', 'mex') GROUP BY "gold" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGE... | Show the number of documents in each day for all documents on project with details 'Graph Database project' and bin document date by weekday and group by document name with a stacked bar chart, and order y-axis from low to high order please. | SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' GROUP BY Document_Name ORDER BY COUNT(Document_Date) | nvbench |
CREATE TABLE table_51260 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When melbourne played as the home team, who did they play? | SELECT "Away team" FROM table_51260 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_name_27 (
date VARCHAR,
week VARCHAR
) | What was the date of week 8? | SELECT date FROM table_name_27 WHERE week = 8 | sql_create_context |
CREATE TABLE table_42598 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director(s)" text,
"Result" text
) | What is the year of the ceremony with a not nominated result and ni iji sin as the original title? | SELECT "Year (Ceremony)" FROM table_42598 WHERE "Result" = 'not nominated' AND "Original title" = 'ničiji sin' | wikisql |
CREATE TABLE table_1153 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | Name the total number of game sites for chicago bears | SELECT COUNT("Game Site") FROM table_1153 WHERE "Opponent" = 'Chicago Bears' | wikisql |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Create a bar chart showing how many class across class, and list from high to low by the x-axis please. | SELECT Class, COUNT(Class) FROM race GROUP BY Class ORDER BY Class DESC | nvbench |
CREATE TABLE table_20366 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
) | What is the content of la7 television service? | SELECT "Content" FROM table_20366 WHERE "Television service" = 'LA7' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | i would like a flight from CINCINNATI to BURBANK on AA | 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 = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCI... | atis |
CREATE TABLE table_name_31 (
pick INTEGER,
player VARCHAR
) | What pick was play Jason Webb? | SELECT MAX(pick) FROM table_name_31 WHERE player = "jason webb" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | list all flights on CO leaving DENVER on sunday after 2134 | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 2134 AND flight.flight_days = days.days_code) AND city.city_code = airport_service... | atis |
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 patients are admitted in transfer within this facility and use the lab item id 51427? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "51427" | mimicsql_data |
CREATE TABLE table_37134 (
"Games" real,
"Drawn" real,
"Lost" real,
"Goal difference" text,
"Points" real
) | Name the least lost with points more than 6 and games less than 5 | SELECT MIN("Lost") FROM table_37134 WHERE "Points" > '6' AND "Games" < '5' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | Visualize a bar chart for simply show the department of the employee and the corresponding salary. | SELECT DEPARTMENT_NAME, SALARY FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_78781 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
) | Who reported the game played on 1 september? | SELECT "Report" FROM table_78781 WHERE "Date" = '1 september' | wikisql |
CREATE TABLE table_56653 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away team when the home team scored 14.14 (98)? | SELECT "Away team" FROM table_56653 WHERE "Home team score" = '14.14 (98)' | wikisql |
CREATE TABLE table_14469 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | On which date were the 2003 Toronto Blue Jays 54-55? | SELECT "Date" FROM table_14469 WHERE "Record" = '54-55' | wikisql |
CREATE TABLE table_36705 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who won Women's doubles when Raina Tzvetkova won women's singles before 2000? | SELECT "Women's doubles" FROM table_36705 WHERE "Year" < '2000' AND "Women's singles" = 'raina tzvetkova' | wikisql |
CREATE TABLE table_name_60 (
producer VARCHAR,
year VARCHAR
) | Who were the producers in 1961? | SELECT producer FROM table_name_60 WHERE year = 1961 | sql_create_context |
CREATE TABLE table_name_96 (
natural_change VARCHAR,
deaths VARCHAR,
crude_birth_rate__per_1000_ VARCHAR,
crude_death_rate__per_1000_ VARCHAR
) | What is the national change where crude birth rate is less than 11.4, crude death rate is more than 12.1 and deaths are 4 376? | SELECT natural_change FROM table_name_96 WHERE crude_birth_rate__per_1000_ < 11.4 AND crude_death_rate__per_1000_ > 12.1 AND deaths = "4 376" | sql_create_context |
CREATE TABLE table_24466 (
"School" text,
"Location" text,
"Catchment" text,
"Roll" real,
"Gender" text,
"External link" text
) | What school is in Brechin? | SELECT "External link" FROM table_24466 WHERE "Location" = 'Brechin' | wikisql |
CREATE TABLE table_19595 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" real,
"Scoring average" text,
"Scoring rank" text
) | What was the scoring rank for Angela Stanford in 2009? | SELECT "Scoring rank" FROM table_19595 WHERE "Year" = '2009' | wikisql |
CREATE TABLE table_1341604_26 (
first_elected INTEGER,
incumbent VARCHAR
) | What year was ike skelton first elected? | SELECT MIN(first_elected) FROM table_1341604_26 WHERE incumbent = "Ike Skelton" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | until 2104 how many patients have undergone infectious disease consultation within the same month after mechanical ventilation? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.un... | eicu |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 患者俞嘉平大腿的各项指标检验结果的详细情况怎么样 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_41470 (
"Season" text,
"PAT Pct." text,
"20-29" text,
"30-39" text,
"40-49" text,
"FG-FGA" text,
"FG Pct." text,
"Long" real,
"Points" real
) | What 20-29 was in season 2008? | SELECT "20-29" FROM table_41470 WHERE "Season" = '2008' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | until 1 year ago what were the five most commonly prescribed drugs for patients who had previously received oth perc proc bil trct within 2 months? | 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | tell me the monthly minimum amount of po in patient 027-22704's body until 37 months ago? | SELECT MIN(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 = '027-22704')) AND intakeoutput.celllabel = 'po' A... | eicu |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Of all the French Phonetics courses , show me those worth 12 credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%French Phonetics%' OR name LIKE '%French Phonetics%') AND credits = 12 | advising |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | when was patient 030-16826 prescribed a medication until 06/2105 for the first time via the per ng tube route? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-16826')) AND medication.routeadmin = 'per ng tube' AND STR... | eicu |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname va... | authors of ACL 2014 papers | SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_name_65 (
error VARCHAR,
size__steps_ VARCHAR,
just__cents_ VARCHAR
) | What is the error that has a size (steps) more than 5 and a just (cents) value 536.95 | SELECT error FROM table_name_65 WHERE size__steps_ > 5 AND just__cents_ = 536.95 | sql_create_context |
CREATE TABLE table_name_6 (
season VARCHAR,
big_ten VARCHAR
) | What is the Season with a Big Ten that is 2nd (386)? | SELECT season FROM table_name_6 WHERE big_ten = "2nd (386)" | sql_create_context |
CREATE TABLE table_8176 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is Score, when Game is less than 61, when February is less than 11, and when Opponent is '@ Buffalo Sabres'? | SELECT "Score" FROM table_8176 WHERE "Game" < '61' AND "February" < '11' AND "Opponent" = '@ buffalo sabres' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
r... | what date is patient 83038's birthday? | SELECT patients.dob FROM patients WHERE patients.subject_id = 83038 | mimic_iii |
CREATE TABLE table_42173 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Team Estudantes Paulista with a position less than 4 has what average against? | SELECT AVG("Against") FROM table_42173 WHERE "Team" = 'estudantes paulista' AND "Position" < '4' | wikisql |
CREATE TABLE table_name_88 (
label VARCHAR,
title VARCHAR,
year VARCHAR,
details VARCHAR
) | Which label has a year older than 2004 and a 2xcd detail as well as the sonic seducer cold hands seduction vol. 69 title? | SELECT label FROM table_name_88 WHERE year > 2004 AND details = "2xcd" AND title = "sonic seducer cold hands seduction vol. 69" | sql_create_context |
CREATE TABLE table_1868929_1 (
upper_index_kcal__nm_3 VARCHAR,
lower_index_mj__nm_3 VARCHAR
) | Name the upper index kcal/nm3 for 62.47 | SELECT upper_index_kcal__nm_3 FROM table_1868929_1 WHERE lower_index_mj__nm_3 = "62.47" | 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... | 78507360患者有过什么住院诊断呢? | SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC 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 = '78507360' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz... | css |
CREATE TABLE table_8875 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | what is the game when the opponent is @ chicago stags? | SELECT SUM("Game") FROM table_8875 WHERE "Opponent" = '@ chicago stags' | wikisql |
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text... | Show all game ids and the number of hours played. | SELECT gameid, SUM(hours_played) FROM plays_games GROUP BY gameid | spider |
CREATE TABLE table_79838 (
"Estimate" real,
"Name" text,
"Nat." text,
"Ship Type" text,
"Principal victims" text,
"Date" text
) | what is the name of the battleship with the battle listed on May 13, 1915? | SELECT "Name" FROM table_79838 WHERE "Ship Type" = 'battleship' AND "Date" = 'may 13, 1915' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | i would like a nonstop flight from PHILADELPHIA to PITTSBURGH | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_2781227_2 (
college_junior_club_team VARCHAR,
player VARCHAR
) | How many teams does Lee Sorochan play for? | SELECT COUNT(college_junior_club_team) FROM table_2781227_2 WHERE player = "Lee Sorochan" | sql_create_context |
CREATE TABLE table_8208 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Version" text
) | What is the Label of the Original CD release? | SELECT "Label" FROM table_8208 WHERE "Format" = 'cd' AND "Version" = 'original' | wikisql |
CREATE TABLE table_71625 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the fewest number of silver medals received by a nation who received 40 bronze medals and more than 42 gold medals? | SELECT MIN("Silver") FROM table_71625 WHERE "Bronze" = '40' AND "Gold" > '42' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 病人被门诊诊断为多动性障碍的的甲胎蛋白的参考值界限下限和上限分别是什么呢? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '多动性障碍' AND jyjgzbb.JCZBMC = '甲胎蛋白' | css |
CREATE TABLE table_56048 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team at Kardinia Park? | SELECT "Home team" FROM table_56048 WHERE "Venue" = 'kardinia park' | wikisql |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255... | Draw a scatter chart about the correlation between student_id and address_id , and group by attribute other_details. | SELECT student_id, address_id FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | 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... | 20027341的团伙成员最常开的药品的排序看一下 | 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_ID = '20027341' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC 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.ME... | css |
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, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter, rank total number from low to high order. | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Revenue) | nvbench |
CREATE TABLE table_3207 (
"Region" text,
"Median income ( Intl.$ )" real,
"Below 40% of median income" text,
"Below 50% of median income" text,
"Below 60% of median income" text
) | What is the median income for the region where 24.4% pf people make below 60% of the median income? | SELECT MIN("Median income ( Intl.$ )") FROM table_3207 WHERE "Below 60% of median income" = '24.4%' | wikisql |
CREATE TABLE table_32439 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
) | What is the Final Four with a win percentage of .750? | SELECT "Final Four" FROM table_32439 WHERE "Win %" = '.750' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
C... | Max reputation users of the same age as me. | SELECT DisplayName AS Name, Id AS "user_id", Reputation FROM Users WHERE Age = (SELECT Age FROM Users WHERE Id = @UserID) ORDER BY Reputation DESC | sede |
CREATE TABLE table_76172 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
) | Who was the finalist in Miami? | SELECT "Finalist" FROM table_76172 WHERE "Tournament" = 'miami' | wikisql |
CREATE TABLE table_name_60 (
tournament VARCHAR
) | What is Tournament, when 2000 is 'A'? | SELECT tournament FROM table_name_60 WHERE 2000 = "a" | sql_create_context |
CREATE TABLE table_name_77 (
name VARCHAR,
matches VARCHAR,
wins VARCHAR,
losses VARCHAR
) | Who has 1 win, 1 loss, and has played 2 matches? | SELECT name FROM table_name_77 WHERE wins = "1" AND losses = "1" AND matches = "2" | sql_create_context |
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... | 列出俞阳泽患者在编码0973581的医院中就诊科室名称不包含医学科的所有医疗就诊记录都有哪些? | SELECT * FROM qtb WHERE qtb.PERSON_NM = '俞阳泽' AND qtb.MED_SER_ORG_NO = '0973581' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%医学科%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '俞阳泽' AND gyb.MED_SER_ORG_NO = '0973581' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%医学科%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '俞阳泽' AND zyb.MED_SER_OR... | css |
CREATE TABLE table_15130 (
"Hindi" text,
"Romani" text,
"Domari" text,
"Lomavren" text,
"Persian" text
) | What word in Hindi has the same meaning as the Lomavren word saj? | SELECT "Hindi" FROM table_15130 WHERE "Lomavren" = 'saj' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | select all users from Sri Lanaka order by reputation. | SELECT * FROM Users ORDER BY Reputation DESC | sede |
CREATE TABLE table_41816 (
"Year" real,
"Tournament Name" text,
"Champions" text,
"Runners-up" text,
"Score" text
) | After 1989, what was the score of the Grand Prix Passing Shot where the Runners-up were Jeff Tarango? | SELECT "Score" FROM table_41816 WHERE "Year" > '1989' AND "Tournament Name" = 'grand prix passing shot' AND "Runners-up" = 'jeff tarango' | wikisql |
CREATE TABLE table_name_23 (
week VARCHAR,
attendance VARCHAR
) | What is the total number of Week(s), when Attendance is 61,603? | SELECT COUNT(week) FROM table_name_23 WHERE attendance = "61,603" | sql_create_context |
CREATE TABLE table_10622 (
"Episode #" real,
"Title" text,
"Airdate" text,
"Rating (Millions)" text,
"Rank" text
) | On what date did the episode 'Petra-Gate' air? | SELECT "Airdate" FROM table_10622 WHERE "Title" = 'petra-gate' | wikisql |
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... | 患者00569182肘部的各项指标检验结果的数据怎么样? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
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 demographic (... | provide the number of patients whose primary disease is bladder cancer/sda and admission year is less than 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND demographic.admityear < "2138" | mimicsql_data |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | show me the fares from WASHINGTON to OAKLAND | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | what were the top three most common diagnosis until 2104? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE ... | mimic_iii |
CREATE TABLE table_66109 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
) | What station has average ratings of 14.7%? | SELECT "TV Station" FROM table_66109 WHERE "Average Ratings" = '14.7%' | wikisql |
CREATE TABLE table_name_57 (
senior_british_open VARCHAR,
senior_pga_championship VARCHAR
) | Who won the Senior British Open when Hale Irwin (3/7) won the Senior PGA Championship? | SELECT senior_british_open FROM table_name_57 WHERE senior_pga_championship = "hale irwin (3/7)" | 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,... | how many patients whose death status is 1 and drug code is clin300l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "CLIN300L" | mimicsql_data |
CREATE TABLE table_train_189 (
"id" int,
"alt" float,
"hyperglycemia" bool,
"liver_disease" bool,
"smoking" bool,
"alcohol_abuse" bool,
"drug_abuse" bool,
"triglyceride_tg" float,
"NOUSE" float
) | triglycerides > 450 mg / dl | SELECT * FROM table_train_189 WHERE triglyceride_tg > 450 | criteria2sql |
CREATE TABLE table_63327 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What's the score when Orient was home? | SELECT "Score" FROM table_63327 WHERE "Home team" = 'orient' | wikisql |
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREAT... | How many books fall into each category, and rank y-axis in desc order. | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_63 (
builder VARCHAR,
pennant_number VARCHAR
) | Which Builder has a Pennant number of Q149? | SELECT builder FROM table_name_63 WHERE pennant_number = "q149" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | For the Winter , what type of Other classes are available ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
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... | 编号为5026399医疗机构目前在院多少人? | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5026399' AND qtb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5026399' AND gyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '5026399' AND zyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM mzb WHERE mzb.MED_SER_ORG_NO = '... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.