context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_21 (
week_5 VARCHAR,
week_3 VARCHAR
) | Who was the girl on week 5 that came after week 3's Shelly Louise? | SELECT week_5 FROM table_name_21 WHERE week_3 = "shelly louise" | sql_create_context |
CREATE TABLE table_73175 (
"Conventional" text,
"Sarikoli (in IPA )" text,
"Uyghur ( K\u0322ona Yezik\u0322 )" text,
"Uyghur ( Yen\u0261i Yezik\u0322 )" text,
"Chinese" text,
"Pinyin" text
) | Name the pinyin for | SELECT "Pinyin" FROM table_73175 WHERE "Uyghur ( K\u0322ona Yezik\u0322 )" = 'تىزناپ' | wikisql |
CREATE TABLE table_name_86 (
episode_count VARCHAR,
viewers__in_millions_ VARCHAR
) | How many total episodes aired over all seasons with 7.79 million viewers? | SELECT COUNT(episode_count) FROM table_name_86 WHERE viewers__in_millions_ = 7.79 | sql_create_context |
CREATE TABLE table_55915 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Which date's visitor was jazz, when the leading scorer was Mehmet Okur (22)? | SELECT "Date" FROM table_55915 WHERE "Visitor" = 'jazz' AND "Leading scorer" = 'mehmet okur (22)' | wikisql |
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABL... | Can you draw a bar chart to show the number of items in each customer details category?, and list total number in desc order. | SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details ORDER BY COUNT(customer_details) DESC | nvbench |
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... | Does ENSCEN 172 have any prerequisites ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_name_15 (
visitor VARCHAR,
record VARCHAR
) | Who was the visitor that led to a 3-0-2 record? | SELECT visitor FROM table_name_15 WHERE record = "3-0-2" | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of salary over hire_date . | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
... | papers typically cited by parsing papers | SELECT DISTINCT cite.citedpaperid FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citingpaperid AND paper.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE table_name_80 (
tv_season VARCHAR,
households__in_millions_ VARCHAR
) | Which TV season has Households (in millions) of 30.503 (34.9 rating)? | SELECT tv_season FROM table_name_80 WHERE households__in_millions_ = "30.503 (34.9 rating)" | sql_create_context |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
ei... | Display a bar chart for what is the name of each aircraft and how many flights does each one complete?, and could you sort by the x axis in desc? | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name DESC | nvbench |
CREATE TABLE table_1400 (
"Headphone Model" text,
"Headphone Class" text,
"Sensitivity (dB)" text,
"Impedance (Ohms)" real,
"Driver-matched dB" text,
"Construction" text,
"Earpads" text,
"Termination" text,
"Succeeded by" text
) | Name the driver matched db for joseph grado signature | SELECT "Driver-matched dB" FROM table_1400 WHERE "Headphone Class" = 'Joseph Grado Signature' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what was the total amount of urine output patient 012-35970 had until 02/27/2104? | 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 = '012-35970')) AND intakeoutput.celllabel = 'urine... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | how many hours has elapsed since the last time patient 006-105495 received a enteral vital af 1.2 intake on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE cinema (
LOCATION VARCHAR,
openning_year VARCHAR
) | Show all the locations where some cinemas were opened in both year 2010 and year 2011. | SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011 | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Draw a bar chart about the distribution of meter_200 and the average of meter_100 , and group by attribute meter_200. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 | nvbench |
CREATE TABLE table_name_3 (
opponent VARCHAR,
date VARCHAR
) | Which opponent has a date 21 jul 2007? | SELECT opponent FROM table_name_3 WHERE date = "21 jul 2007" | sql_create_context |
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 (... | give the number of patients whose admission year is before 2166 and lab test name is lipase. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2166" AND lab.label = "Lipase" | mimicsql_data |
CREATE TABLE table_17355628_7 (
score VARCHAR,
date VARCHAR
) | What is the score when the game took place on January 18? | SELECT score FROM table_17355628_7 WHERE date = "January 18" | sql_create_context |
CREATE TABLE table_65754 (
"Competition" text,
"Played" real,
"Spartak" real,
"Draw" real,
"Dynamo" real
) | what is the highest spartak when played is less than 15 and dynamo is less than 3? | SELECT MAX("Spartak") FROM table_65754 WHERE "Played" < '15' AND "Dynamo" < '3' | wikisql |
CREATE TABLE table_name_31 (
record VARCHAR,
result VARCHAR
) | What is the record of the game that has a result of w 45 17? | SELECT record FROM table_name_31 WHERE result = "w 45–17" | sql_create_context |
CREATE TABLE table_name_93 (
english_title VARCHAR,
year VARCHAR,
country VARCHAR
) | What is the English title for years after 1981 originating from Argentina? | SELECT english_title FROM table_name_93 WHERE year > 1981 AND country = "argentina" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | count the number of patients whose gender is m and admission location is clinic referral/premature? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | all flights from BOSTON to WASHINGTON on 11 11 | 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 = 'WASHINGTON' AND date_day.day_number = 11 AND date_day.month_number = 11 A... | atis |
CREATE TABLE table_24915874_1 (
trainer VARCHAR,
jockey VARCHAR
) | Who was the trainer when the jockey was Luke Nolen? | SELECT trainer FROM table_24915874_1 WHERE jockey = "Luke Nolen" | sql_create_context |
CREATE TABLE table_13619135_5 (
high_points VARCHAR,
team VARCHAR
) | Which players scored the most points when the opposing team was Seattle and how many points did they score? | SELECT high_points FROM table_13619135_5 WHERE team = "Seattle" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 患者昌娜兰在2007年3月16日到2020年1月1日间有过多少次住院经历? | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '昌娜兰' AND IN_HOSP_DATE BETWEEN '2007-03-16' AND '2020-01-01' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_28700 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What is the title of the episode with production code 305? | SELECT "Title" FROM table_28700 WHERE "Production code" = '305' | wikisql |
CREATE TABLE table_17417383_6 (
round_of_16 VARCHAR,
quarterfinals VARCHAR,
event VARCHAR
) | Name the round 16 for did not advance and light flyweight | SELECT round_of_16 FROM table_17417383_6 WHERE quarterfinals = "Did not advance" AND event = "Light flyweight" | sql_create_context |
CREATE TABLE table_19465 (
"Rnd" real,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | who is the the pole position with rnd being 16 | SELECT "Pole position" FROM table_19465 WHERE "Rnd" = '16' | 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,
... | provide the number of patients whose diagnoses long title is seroma complicating a procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Seroma complicating a procedure" | mimicsql_data |
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,
... | Calculate the number of patients with item id 51098 who died in or before the year 2165. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "51098" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | count the numbers of patients who died after having been diagnosed with hypoxemia within the same month in 2104. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoxemia') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosist... | eicu |
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 (... | what number of patients with diagnoses icd9 code 7069 had admission location as clinic referral/premature? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "7069" | mimicsql_data |
CREATE TABLE table_name_14 (
entrant VARCHAR,
year VARCHAR,
chassis VARCHAR
) | Who is entered earlier than 1975 and has a Lotus 20 chassis? | SELECT entrant FROM table_name_14 WHERE year < 1975 AND chassis = "lotus 20" | sql_create_context |
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10),
date_from DATETIME,
date_to DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Research_Staff (
staff_id INTEGER,
employer_organisation_id INTEGER,
staff_details VARCHAR(255)
)
CREATE TABLE Pr... | Find the organisation ids and details of the organisations which are involved i Visualize by bar chart, and I want to rank total number from high to low order please. | 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 T1.organisation_id DESC | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在7379867号医院的医疗记录中记录的入院确诊是患有T83.572的病人的最低和最高医疗费统共多少? | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '7379867' AND IN_DIAG_DIS_CD = 'T83.572') | css |
CREATE TABLE table_59823 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What Date has a Label of grilled cheese? | SELECT "Date" FROM table_59823 WHERE "Label" = 'grilled cheese' | wikisql |
CREATE TABLE table_76252 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the number of the round in which Ron Hansen was drafted and the overall is greater than 332? | SELECT COUNT("Round") FROM table_76252 WHERE "Name" = 'ron hansen' AND "Overall" > '332' | wikisql |
CREATE TABLE table_46655 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" text
) | What is Total, when Player is 'Hale Irwin'? | SELECT "Total" FROM table_46655 WHERE "Player" = 'hale irwin' | wikisql |
CREATE TABLE table_68996 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
) | Of those with a height of 7-0, who weighs the most? | SELECT MAX("Weight") FROM table_68996 WHERE "Height" = '7-0' | wikisql |
CREATE TABLE table_name_30 (
engine VARCHAR,
points VARCHAR
) | Which Engine has Points of 3? | SELECT engine FROM table_name_30 WHERE points = 3 | sql_create_context |
CREATE TABLE table_name_48 (
county VARCHAR,
grantee VARCHAR
) | Tell me the county for mariano castro | SELECT county FROM table_name_48 WHERE grantee = "mariano castro" | sql_create_context |
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
... | A bar chart for what are the number of the names of races held between 2009 and 2011?, and order by the how many name in ascending. | SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE table_name_18 (
val_de_marne VARCHAR,
seine_saint_denis VARCHAR
) | WHAT IS THE VAL-DE-MARNE WITH A Seine-Saint-Denis of 2.7%? | SELECT val_de_marne FROM table_name_18 WHERE seine_saint_denis = "2.7%" | sql_create_context |
CREATE TABLE table_name_37 (
date VARCHAR,
competition VARCHAR
) | When was the friendship cup? | SELECT date FROM table_name_37 WHERE competition = "friendship cup" | sql_create_context |
CREATE TABLE table_name_6 (
away_team VARCHAR,
home_team VARCHAR
) | What was the away team that faced Carlton? | SELECT away_team FROM table_name_6 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | give me the difference between the total of the input and the output of patient 027-144847 on last month/27. | SELECT (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 = '027-144847')) AND intakeoutput.cellpath ... | eicu |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_cod... | i would like an evening flight from PITTSBURGH to LOS ANGELES on 6 3 | 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 = 'LOS ANGELES' AND date_day.day_number = 3 AND date_day.month_number = 6 A... | atis |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW t... | 柳芳林患者以前有都有哪个门诊诊断的结果? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '柳芳林' | css |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, and could you order in ascending by the Y? | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_36 (
gold_coast VARCHAR,
sydney VARCHAR,
auckland VARCHAR,
melbourne VARCHAR,
perth VARCHAR
) | Which gold Coast has a Melbourne of yes, a Perth of yes, an Auckland of no, and a Sydney of no? | SELECT gold_coast FROM table_name_36 WHERE melbourne = "yes" AND perth = "yes" AND auckland = "no" AND sydney = "no" | sql_create_context |
CREATE TABLE table_name_59 (
year INTEGER,
chassis VARCHAR,
start VARCHAR
) | What is the lowest year that has lola t93/00 as the chassis with a start leas than 14? | SELECT MIN(year) FROM table_name_59 WHERE chassis = "lola t93/00" AND start < 14 | sql_create_context |
CREATE TABLE table_7449 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Which Nationality has a School/Club Team of louisiana state? | SELECT "Nationality" FROM table_7449 WHERE "School/Club Team" = 'louisiana state' | wikisql |
CREATE TABLE table_71157 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
) | Name the venue for margin less than 66 and opponent of north queensland cowboys | SELECT "Venue" FROM table_71157 WHERE "Margin" < '66' AND "Opponent" = 'north queensland cowboys' | wikisql |
CREATE TABLE table_2747 (
"Season" real,
"Winner" text,
"Captain" text,
"Coach" text,
"League finish" text,
"Mat" real,
"W" real,
"L" real,
"Win %" text,
"Runner-up" text
) | Name the win% for chennai super kings for 2010 | SELECT "Win %" FROM table_2747 WHERE "Winner" = 'Chennai Super Kings' AND "Season" = '2010' | wikisql |
CREATE TABLE table_16432543_3 (
location VARCHAR,
enrollment VARCHAR
) | What school location had an enrollment of 12400? | SELECT location FROM table_16432543_3 WHERE enrollment = 12400 | sql_create_context |
CREATE TABLE table_20084 (
"First District" text,
"Second District" text,
"Third District" text,
"Fourth District" text,
"Fifth District" text
) | Name the fourth district for joan runnels | SELECT "Fourth District" FROM table_20084 WHERE "Second District" = 'Joan Runnels' | wikisql |
CREATE TABLE table_204_180 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | what was the top attendance of the 1981 's games ? | SELECT MAX("attendance") FROM table_204_180 | squall |
CREATE TABLE table_74649 (
"Rank" text,
"County" text,
"Population (1960)" real,
"Population (2000)" real,
"Population (2040)" real
) | What was the population of a county in 2040 that had a population less than 108,172 in 2000 and less than 107,589 in 1960? | SELECT COUNT("Population (2040)") FROM table_74649 WHERE "Population (1960)" < '108,172' AND "Population (2000)" < '107,589' | wikisql |
CREATE TABLE table_29099 (
"Series #" real,
"Episode #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | The episode with the original airdate December22,1996 has what title? | SELECT "Title" FROM table_29099 WHERE "Original Airdate" = 'December22,1996' | 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 of the female patients had icd9 code 4610? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "4610" | mimicsql_data |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | how many actors have appeared in each musical?, could you rank in descending by the Y? | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_... | in Spring and Summer term , how many 300 -level classes are being offered ? | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.se... | advising |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is the number of patients whose marital status is married and lab test name is urine volume? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Urine Volume" | mimicsql_data |
CREATE TABLE table_name_68 (
song VARCHAR,
index VARCHAR
) | What song had an index of m6? | SELECT song FROM table_name_68 WHERE index = "m6" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_39 (
home_team VARCHAR,
venue VARCHAR
) | What's the home team for the western oval venue? | SELECT home_team FROM table_name_39 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE table_name_72 (
spike INTEGER,
weight VARCHAR,
block VARCHAR
) | What is the sum of Spike when the Weight was more than 84, and Block was less than 315? | SELECT SUM(spike) FROM table_name_72 WHERE weight > 84 AND block < 315 | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | Posts tagged with [viewpager] but NOT [android]. | SELECT Posts.Id, Posts.Id AS "post_link", Posts.Tags FROM Posts WHERE Posts.Tags LIKE 'fragment' AND NOT Posts.Tags LIKE 'android' | sede |
CREATE TABLE table_30468 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Team classification" text
) | When hayden roulston is the winner what is the stage? | SELECT "Stage" FROM table_30468 WHERE "Winner" = 'Hayden Roulston' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | tell me the number of patients hospitalized in 2102? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) = '2102' | mimic_iii |
CREATE TABLE table_19643196_1 (
fleet__number VARCHAR,
length__ft_ VARCHAR
) | What is the fleet number when the length (ft) is 30? | SELECT fleet__number FROM table_19643196_1 WHERE length__ft_ = 30 | sql_create_context |
CREATE TABLE table_18270 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who is the candidate in election where the incumbent was first elected in 1980? | SELECT "Candidates" FROM table_18270 WHERE "First elected" = '1980' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE... | what's the name of the drug that patient 7698 was last prescribed via po route during a month before? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698) AND prescriptions.route = 'po' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescription... | mimic_iii |
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
)
... | what is the number of patients whose primary disease is guillain barre syndrome and procedure short title is int insert 1-cham, rate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND procedures.short_title = "Int insert 1-cham, rate" | mimicsql_data |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Show names and seatings for all tracks opened after 2000. | SELECT Name, Seating FROM track WHERE Year_Opened > 2000 | nvbench |
CREATE TABLE table_203_237 (
id number,
"n" number,
"p" text,
"nat." text,
"name" text,
"age" number,
"moving from" text,
"type" text,
"transfer\nwindow" text,
"ends" number,
"transfer\nfee" text
) | what is the difference in age between palo vanoli and marc kalenga ? | SELECT (SELECT "age" FROM table_203_237 WHERE "name" = 'paolo vanoli') - (SELECT "age" FROM table_203_237 WHERE "name" = 'marc kalenga') | squall |
CREATE TABLE table_8427 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | What is the transfer window for the player whose status was loan ended? | SELECT "Transfer window" FROM table_8427 WHERE "Status" = 'loan ended' | wikisql |
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... | Find Team_Name and Team_ID , and visualize them by a bar chart, list X-axis in descending order. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name DESC | nvbench |
CREATE TABLE table_202_50 (
id number,
"no." number,
"ritu" text,
"season" text,
"hindu lunar months" text,
"gregorian month" text,
"characteristics" text,
"seasonal festivals" text
) | which ritu has the most seasonal festivals ? | SELECT "ritu" FROM table_202_50 ORDER BY "seasonal festivals" DESC LIMIT 1 | squall |
CREATE TABLE table_name_96 (
evening_gown INTEGER,
state VARCHAR,
interview VARCHAR
) | What is the number for evening gown in kansas with less than 9.357 interviews? | SELECT SUM(evening_gown) FROM table_name_96 WHERE state = "kansas" AND interview < 9.357 | sql_create_context |
CREATE TABLE table_11960407_4 (
date VARCHAR,
high_rebounds VARCHAR
) | When did Chris Bosh (14) have the high rebounds? | SELECT date FROM table_11960407_4 WHERE high_rebounds = "Chris Bosh (14)" | sql_create_context |
CREATE TABLE table_44043 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | What is the home team with an 8.7 (55) away team score? | SELECT "Home team" FROM table_44043 WHERE "Away team score" = '8.7 (55)' | wikisql |
CREATE TABLE table_13726 (
"Protocol" text,
"Power Line" text,
"Radio-Frequency" text,
"Open Source?" text,
"Needs Neutral Wire?" text
) | Does Zigbee need neutral wire when the open source is yes? | SELECT "Needs Neutral Wire?" FROM table_13726 WHERE "Open Source?" = 'yes' AND "Protocol" = 'zigbee' | wikisql |
CREATE TABLE table_name_52 (
visitor VARCHAR,
date VARCHAR
) | Name the visitor for october 19 | SELECT visitor FROM table_name_52 WHERE date = "october 19" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when was the first time that patient 007-2001 had the blood loss output since 2035 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2001')) AND intakeoutput.cellpath LIKE '%output%'... | eicu |
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... | what is the number of patients whose year of birth is less than 2041 and procedure icd9 code is 3761? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2041" AND procedures.icd9_code = "3761" | mimicsql_data |
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,
... | show the language and admission time of subject id 42067. | SELECT demographic.language, demographic.admittime FROM demographic WHERE demographic.subject_id = "42067" | mimicsql_data |
CREATE TABLE table_50558 (
"Administrating agencies by NIP funds ONLY" text,
"Management and support" real,
"Data collection" text,
"Data processing and exploitation" text,
"Total" real
) | What is the lowest total data processing and exploitation of 00 0,228, and a management and support larger than 1,7? | SELECT MIN("Total") FROM table_50558 WHERE "Data processing and exploitation" = '00 0,228' AND "Management and support" > '1,7' | wikisql |
CREATE TABLE table_dev_50 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"hba1c" float,
"age" float,
"NOUSE" float
) | adult patients, > / = 18 years of age | SELECT * FROM table_dev_50 WHERE age >= 18 | criteria2sql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | N mero de usuarios registrados por a o. | SELECT COUNT(u.Id) FROM Users AS u | sede |
CREATE TABLE procedures_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,
... | what was the last value of an chloride lab test in patient 84346 until 51 months ago? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84346) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-51 mo... | mimic_iii |
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 ... | 在2003年9月3日到2003年10月12日间患者53577732全部检验报告单的审核日期都是几月几号? | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '53577732' AND jybgb.BGRQ BETWEEN '2003-09-03' AND '2003-10-12' UNION... | css |
CREATE TABLE table_78586 (
"Rank" real,
"Name" text,
"Season" text,
"Club" text,
"minutes" real
) | What are the minutes of the Player from Real Madrid Club with a Rank of 7 or larger? | SELECT SUM("minutes") FROM table_78586 WHERE "Rank" > '7' AND "Club" = 'real madrid' | wikisql |
CREATE TABLE table_63907 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." real,
"Release date" text
) | What's the title of the film directed by Friz Freleng with an MM Series, production number greater than 6209 and a release date of 1934-11-03? | SELECT "Title" FROM table_63907 WHERE "Production Num." > '6209' AND "Series" = 'mm' AND "Director" = 'friz freleng' AND "Release date" = '1934-11-03' | wikisql |
CREATE TABLE table_204_340 (
id number,
"name" text,
"year inducted" number,
"position" text,
"apps" number,
"goals" number
) | what player has the most number of goals ? | SELECT "name" FROM table_204_340 ORDER BY "goals" DESC LIMIT 1 | squall |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | 列出病人王阳焱从0七年八月二十一日起,至0九年一月二日止的所有检验结果指标记录中的检测方法 | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | when has patient 035-24054 last had a enteral nepro intake yesterday? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_51840 (
"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 for the game played at Victoria Park? | SELECT "Home team" FROM table_51840 WHERE "Venue" = 'victoria park' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.