context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_44 (
time_retired VARCHAR,
manufacturer VARCHAR,
grid VARCHAR
) | WHAT IS THE TIME/ RETIRED WITH A HONDA MANUFACTURER, GRID 8? | SELECT time_retired FROM table_name_44 WHERE manufacturer = "honda" AND grid = "8" | sql_create_context |
CREATE TABLE table_name_93 (
to_par VARCHAR,
country VARCHAR,
score VARCHAR
) | how many times is the country united states and the score 72-71-73-73=289? | SELECT COUNT(to_par) FROM table_name_93 WHERE country = "united states" AND score = 72 - 71 - 73 - 73 = 289 | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | patient 81223 has any disease diagnosed during the last year? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81223) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_44602 (
"Number" text,
"Builder" text,
"Type" text,
"Date" text,
"Works number" real
) | With a works number of 40864 for the builder of Baldwin Locomotive Works, the number listed is? | SELECT "Number" FROM table_44602 WHERE "Builder" = 'baldwin locomotive works' AND "Works number" = '40864' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 ... | show me flights from BOSTON to WASHINGTON leaving 7 15 | 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 = 15 AND date_day.month_number = 7 AN... | atis |
CREATE TABLE table_2233872_1 (
season VARCHAR,
gf VARCHAR
) | What was the season where the team reached a GP of 244? | SELECT season FROM table_2233872_1 WHERE gf = 244 | sql_create_context |
CREATE TABLE table_name_18 (
playoffs_2 VARCHAR,
season VARCHAR
) | What is the playoffs 2 result of season 2010-11? | SELECT playoffs_2 FROM table_name_18 WHERE season = "2010-11" | sql_create_context |
CREATE TABLE table_76908 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is the quantity made of the e-22 class, which has a quantity preserved of 0? | SELECT "Quantity made" FROM table_76908 WHERE "Quantity preserved" = '0' AND "Class" = 'e-22' | wikisql |
CREATE TABLE table_name_34 (
tie_no VARCHAR,
away_team VARCHAR
) | What is the Tie number of when Wigan Athletic was the away team? | SELECT tie_no FROM table_name_34 WHERE away_team = "wigan athletic" | sql_create_context |
CREATE TABLE table_2509202_2 (
combaya_municipality VARCHAR,
quiabaya_municipality VARCHAR
) | What is the number for combaya municipality when quiabaya municipality is 33? | SELECT combaya_municipality FROM table_2509202_2 WHERE quiabaya_municipality = "33" | sql_create_context |
CREATE TABLE table_204_98 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what is the first year ? | SELECT MIN("year") FROM table_204_98 | squall |
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... | how many times has remove skull tongs procedure been done until 2104? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove skull tongs') AND STRFTIME('%y', procedures_icd.charttime) <= '2104' | mimic_iii |
CREATE TABLE table_name_51 (
game VARCHAR,
points VARCHAR,
october VARCHAR
) | How many games have Points smaller than 4, and an October smaller than 5? | SELECT COUNT(game) FROM table_name_51 WHERE points < 4 AND october < 5 | sql_create_context |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARC... | Create a bar chart showing the total number across rank, display Y in descending order. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | when did patient 32163 get a microbiology test for the first time since 79 months ago. | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32163) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-79 month') ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_58381 (
"Season" text,
"Winners" text,
"Score" text,
"Runners-up" text,
"Venue" text
) | What is the Score of the Rangers' Runner-ups and Hibernian Winners in Hampden Park? | SELECT "Score" FROM table_58381 WHERE "Venue" = 'hampden park' AND "Runners-up" = 'rangers' AND "Winners" = 'hibernian' | wikisql |
CREATE TABLE table_20683381_2 (
date_of_opinion_poll VARCHAR,
undecided VARCHAR
) | How many polls taken on different dates show an undecided percentage of 25%? | SELECT COUNT(date_of_opinion_poll) FROM table_20683381_2 WHERE undecided = "25%" | sql_create_context |
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 diagnosis (
diagn... | what are patient 013-28507's changes in weight last measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (S... | eicu |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 TA... | what flights are available on sunday to PITTSBURGH from SAN FRANCISCO | 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 = 'PITTSBURGH' AND date_day.day_number = 27 AND date_day.month_number = 8 AN... | atis |
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 text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 编号为22165387的病患的检验报告单的报告日期在14年3月4日之后的是在哪些门诊就诊的?列出流水号 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | Of all the 400 -level courses , which ones do not include labs ? | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400 | advising |
CREATE TABLE table_203_266 (
id number,
"group" text,
"members" number,
"caucusing" number,
"total" number
) | which group had the most members ? | SELECT "group" FROM table_203_266 ORDER BY "members" DESC LIMIT 1 | squall |
CREATE TABLE table_25355501_2 (
june_10_11 VARCHAR,
november_3 VARCHAR
) | june 10-11 when november 3 is 133? | SELECT june_10_11 FROM table_25355501_2 WHERE november_3 = "133" | sql_create_context |
CREATE TABLE table_32963 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which airport has an ICAO of RCKH? | SELECT "Airport" FROM table_32963 WHERE "ICAO" = 'rckh' | wikisql |
CREATE TABLE table_15584067_7 (
written_by VARCHAR,
no_in_season VARCHAR
) | Name who wrote the 11 number in the season | SELECT written_by FROM table_15584067_7 WHERE no_in_season = "11" | sql_create_context |
CREATE TABLE table_54137 (
"Rank" real,
"Airline/Holding" text,
"Passenger Fleet" real,
"Current Destinations" real,
"Alliance/ Association" text
) | Which alliance has a rank of 40? | SELECT "Alliance/ Association" FROM table_54137 WHERE "Rank" = '40' | wikisql |
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Roles (
role_code VARCHAR(15),
role_description VARCHAR(80)
)
CREATE TABLE Document_Structures (
document_structure_code VARCHAR(15),
parent_document_struct... | what are the different role codes for users, and how many users have each?, show from low to high by the X-axis please. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY role_code | nvbench |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 在医疗机构6356555里面现在有多少在院的人? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6356555' AND gwyjzb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6356555' AND fgwyjzb.HOSP_STS > 0 | css |
CREATE TABLE table_6984 (
"Year" text,
"Film title used in nomination" text,
"Original title" text,
"Main Language(s)" text,
"Result" text
) | For the film made in 1964: (37th), what was the result? | SELECT "Result" FROM table_6984 WHERE "Year" = '1964: (37th)' | wikisql |
CREATE TABLE table_40715 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is Package/Option, when Television Service is Sky Inside? | SELECT "Package/Option" FROM table_40715 WHERE "Television service" = 'sky inside' | wikisql |
CREATE TABLE table_60963 (
"Class" text,
"Team" text,
"Drivers" text,
"Laps" real,
"Qual Pos" real
) | What are the most laps for the Qual position of 7 in the OC class? | SELECT MAX("Laps") FROM table_60963 WHERE "Class" = 'oc' AND "Qual Pos" = '7' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | Is there a Advanced Mathematical Methods for the Biological Sciences class ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Mathematical Methods for the Biological Sciences%' OR name LIKE '%Advanced Mathematical Methods for the Biological Sciences%') AND department = 'EECS' | advising |
CREATE TABLE table_name_23 (
copa_libertadores_1999 VARCHAR,
copa_conmebol_1999 VARCHAR,
team VARCHAR
) | What is the Copa Libertadores 1999 result for team gr mio, who did not qualify for Copa Conmebol 1999? | SELECT copa_libertadores_1999 FROM table_name_23 WHERE copa_conmebol_1999 = "did not qualify" AND team = "grêmio" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about School_ID over the All_Home , and group by attribute ACC_Road by a bar chart. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home | nvbench |
CREATE TABLE table_55933 (
"Club" text,
"Position in 2012" text,
"First season" text,
"Number of seasons" real,
"First season of current spell" real,
"Titles" real,
"Last title" text
) | what is the last title when the titles is more than 12 and the position in 2012 is 7th | SELECT "Last title" FROM table_55933 WHERE "Titles" > '12' AND "Position in 2012" = '7th' | wikisql |
CREATE TABLE table_204_726 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"behind" number,
"points" number
) | lavia is ranked 6 , but who is ranked above it ? | SELECT "country" FROM table_204_726 WHERE "rank" = 6 - 1 | squall |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 参保人水建茗10元以内小金额结算次数有多少,时间是在13年3月5日到16年1月7日内 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '水建茗' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-03-05' AND '2016-01-07' AND t_kc24.MED_AMOUT <= 10 | css |
CREATE TABLE table_18740 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result of the election when Clarence F. Lea was the incumbent? | SELECT "Result" FROM table_18740 WHERE "Incumbent" = 'Clarence F. Lea' | wikisql |
CREATE TABLE table_43640 (
"Year" real,
"U.S. Rank" real,
"Total s Ton" real,
"Domestic s Ton" real,
"Foreign Total s Ton" real,
"Foreign Imports s Ton" real,
"Foreign Exports s Ton" real
) | what is the average domestic s tone when the foreign imports s tone is less than 225,281 and the year is later than 2003? | SELECT AVG("Domestic s Ton") FROM table_43640 WHERE "Foreign Imports s Ton" < '225,281' AND "Year" > '2003' | wikisql |
CREATE TABLE table_13970 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | What is the total number of poles with less than 0 wins? | SELECT COUNT("Poles") FROM table_13970 WHERE "Wins" < '0' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE city (
city_code varchar,
... | flights from PITTSBURGH to NEWARK | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW... | atis |
CREATE TABLE table_57183 (
"Round" real,
"Pick" real,
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"School/club team" text
) | How many rounds have School/club team of pan american? | SELECT SUM("Round") FROM table_57183 WHERE "School/club team" = 'pan american' | wikisql |
CREATE TABLE on_call (
nurse number,
blockfloor number,
blockcode number,
oncallstart time,
oncallend time
)
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE affiliated_with (
physician number,
dep... | Find the physician who prescribed the highest dose. What is his or her name? | SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1 | spider |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the email by a bar chart, and sort by the EMAIL from high to low. | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | nvbench |
CREATE TABLE table_name_55 (
score VARCHAR,
tie_no VARCHAR
) | What score has a tie of 5? | SELECT score FROM table_name_55 WHERE tie_no = "5" | sql_create_context |
CREATE TABLE table_13184 (
"Rank" real,
"District" text,
"2010 Population" real,
"Area (km 2 )" real,
"State" text
) | What is the total population of the district of Klang, with an area larger than 636? | SELECT COUNT("2010 Population") FROM table_13184 WHERE "District" = 'klang' AND "Area (km 2 )" > '636' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Na... | Deleted users with large number of posts. | SELECT p.OwnerDisplayName, COUNT(p.Id) FROM Posts AS p WHERE NOT p.OwnerDisplayName IS NULL AND p.PostTypeId IN (1, 2) GROUP BY p.OwnerDisplayName ORDER BY COUNT(p.Id) DESC | sede |
CREATE TABLE table_17640 (
"Record" text,
"Date and Time" text,
"Competition" text,
"Home or Away" text,
"Opponent" text,
"Score" text
) | What records are hit where the opponent is Aylesbury United? | SELECT "Record" FROM table_17640 WHERE "Opponent" = 'Aylesbury United' | wikisql |
CREATE TABLE table_8952 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text,
"Independent Green" text,
"Libertarian" text,
"Other Party" text
) | What is the name of the incumbent for Glenn Nye? | SELECT "Incumbent" FROM table_8952 WHERE "Democratic" = 'glenn nye' | wikisql |
CREATE TABLE table_14506 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
) | What is the date of the Last Performance of Billy Elliot with a Cast Status of past replacement? | SELECT "Last Performance" FROM table_14506 WHERE "Status" = 'past replacement' | wikisql |
CREATE TABLE table_2102898_1 (
viewers__in_millions_ VARCHAR,
broadcast_date VARCHAR
) | On broadcast date is 25april1970, how many people tuned in? | SELECT viewers__in_millions_ FROM table_2102898_1 WHERE broadcast_date = "25April1970" | 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... | provide the number of patients whose days of hospital stay is greater than 34 and drug name is pancrelipase 5000? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.drug = "Pancrelipase 5000" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what did patient 004-65311 receive for his or her last procedure? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65311')) ORDER BY treatment.treatmenttime DESC LIMIT 1 | eicu |
CREATE TABLE table_11147852_1 (
city_of_license_market VARCHAR,
station VARCHAR
) | What market is KTFK-DT in? | SELECT city_of_license_market FROM table_11147852_1 WHERE station = "KTFK-DT" | sql_create_context |
CREATE TABLE table_name_72 (
jerseys INTEGER,
young_rider VARCHAR,
giro_wins VARCHAR,
points VARCHAR,
different_holders VARCHAR
) | what is the highest jersey when points is 0, different holders is less than 3, giro wins is less than 1 and young rider is more than 1? | SELECT MAX(jerseys) FROM table_name_72 WHERE points = 0 AND different_holders < 3 AND giro_wins < 1 AND young_rider > 1 | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | how many days has it elapsed since patient 30826 was admitted to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_name_85 (
chassis VARCHAR,
year VARCHAR
) | What is the chassis for the year of 1969? | SELECT chassis FROM table_name_85 WHERE year = 1969 | sql_create_context |
CREATE TABLE table_35590 (
"Year" text,
"Winners" text,
"Score" text,
"Runner-up" text,
"Venue" text
) | Which year had UTC as the runner-up and Saint-Gaudens Bears as the winners? | SELECT "Year" FROM table_35590 WHERE "Runner-up" = 'utc' AND "Winners" = 'saint-gaudens bears' | 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 personal history of malignant neoplasm of bladder and lab test abnormal status is abnormal? | 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 = "Personal history of malignant neoplasm of bladder" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_18836 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is the name of the column points against? | SELECT "Points against" FROM table_18836 WHERE "Points" = 'Points' | wikisql |
CREATE TABLE table_name_34 (
number_of_episodes INTEGER,
genre VARCHAR,
highest_average_point_ratings VARCHAR
) | What are the number of episodes when the genre is modern drama and the highest average ratings points are 28? | SELECT AVG(number_of_episodes) FROM table_name_34 WHERE genre = "modern drama" AND highest_average_point_ratings = 28 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | give me the top three most commonly prescribed drugs for patients of 30s until 2100? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', medication.drugstarttime) <= '2100' GROUP BY medication.drugn... | eicu |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE advisor (
s_id text,
i_id text
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE instructor (
id text,
... | List in alphabetic order the names of all distinct instructors. | SELECT DISTINCT name FROM instructor ORDER BY name | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | Calculate the average age of patients who were admitted in or after 2150 and are 41 years or older. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "41" AND demographic.admityear >= "2150" | mimicsql_data |
CREATE TABLE table_48937 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Which Date has an Against smaller than 21, and a Status of second test? | SELECT "Date" FROM table_48937 WHERE "Against" < '21' AND "Status" = 'second test' | wikisql |
CREATE TABLE table_66870 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text,
"Note" text
) | Name the catalog with cd format | SELECT "Catalog" FROM table_66870 WHERE "Format" = 'cd' | wikisql |
CREATE TABLE table_55394 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What driver has grid number 18? | SELECT "Driver" FROM table_55394 WHERE "Grid" = '18' | wikisql |
CREATE TABLE table_168274_1 (
company VARCHAR,
index_weighting___percentage__at_17_january_2013 VARCHAR
) | Name the company where index weighting % is 11.96 | SELECT company FROM table_168274_1 WHERE index_weighting___percentage__at_17_january_2013 = "11.96" | sql_create_context |
CREATE TABLE table_61642 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is Away Team, when Home Team is 'Boston United'? | SELECT "Away team" FROM table_61642 WHERE "Home team" = 'boston united' | wikisql |
CREATE TABLE table_name_87 (
record VARCHAR,
date VARCHAR
) | What is the record of the game on 5 February 2008? | SELECT record FROM table_name_87 WHERE date = "5 february 2008" | sql_create_context |
CREATE TABLE table_11585313_1 (
number_of_caps VARCHAR,
name VARCHAR
) | What is the toatl number of caps where the name is Hans Blume? | SELECT COUNT(number_of_caps) FROM table_11585313_1 WHERE name = "Hans Blume" | sql_create_context |
CREATE TABLE table_29381 (
"Season" real,
"Series" text,
"Team" text,
"Starts" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real,
"Points" text,
"Place" text
) | Name the most starts for 6 wins | SELECT MAX("Starts") FROM table_29381 WHERE "Wins" = '6' | wikisql |
CREATE TABLE WINE (
Price INTEGER,
Cases INTEGER,
YEAR VARCHAR,
Grape VARCHAR
) | What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape? | SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel" | sql_create_context |
CREATE TABLE table_77192 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | what is the date when the round is qf? | SELECT "Date" FROM table_77192 WHERE "Round" = 'qf' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_name text,
last_name text,
amount_outstanding number,
email_address text,
phone_number text,
cell_mobile_phone_number text
... | What is the country in which the customer Carole Bernhard lived? | SELECT T2.country FROM customers AS T1 JOIN addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | spider |
CREATE TABLE table_19778010_5 (
date VARCHAR,
opponent VARCHAR
) | On how many different dates was a game against Houston played? | SELECT COUNT(date) FROM table_19778010_5 WHERE opponent = "Houston" | sql_create_context |
CREATE TABLE table_12942 (
"Class" text,
"Number(s)" text,
"DRG Number(s)" text,
"Quantity" real,
"Year(s) of Manufacture" text,
"Type" text
) | What is the average quantity that has 1104 as the number(s)? | SELECT AVG("Quantity") FROM table_12942 WHERE "Number(s)" = '1104' | wikisql |
CREATE TABLE table_71712 (
"Model/Engine" text,
"Capacity" text,
"Cylinders/Valves" text,
"Power/rpm" text,
"Torque (Nm)/rpm" text
) | Name the capacity for the torque of n m (lb ft) @4150 | SELECT "Capacity" FROM table_71712 WHERE "Torque (Nm)/rpm" = 'n·m (lb·ft) @4150' | wikisql |
CREATE TABLE table_10768 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What is the attendance when oadby town is away? | SELECT "Attendance" FROM table_10768 WHERE "Away team" = 'oadby town' | wikisql |
CREATE TABLE table_name_96 (
active_pixels VARCHAR,
model VARCHAR
) | What are the active pixels of the c-most model camera? | SELECT active_pixels FROM table_name_96 WHERE model = "c-most" | sql_create_context |
CREATE TABLE table_name_82 (
country VARCHAR,
play VARCHAR
) | Which Country is the Play Electra and Orestes, The Trial from? | SELECT country FROM table_name_82 WHERE play = "electra and orestes, the trial" | sql_create_context |
CREATE TABLE table_name_74 (
original_airing VARCHAR,
rating VARCHAR,
episode_number_production_number VARCHAR
) | What was the date of airing for episodes with ratings under 10.1 and production number of 96 5-09? | SELECT original_airing FROM table_name_74 WHERE rating < 10.1 AND episode_number_production_number = "96 5-09" | sql_create_context |
CREATE TABLE table_name_85 (
block_a VARCHAR,
antonio_thomas VARCHAR
) | Tell me the block A for antonio thomas of kondo (13:24) | SELECT block_a FROM table_name_85 WHERE antonio_thomas = "kondo (13:24)" | sql_create_context |
CREATE TABLE table_17922 (
"Position" real,
"Club" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Pts For" real,
"Pts Agst" real,
"B.P." real,
"Points" real
) | Name the most points against when points for is 860 | SELECT MAX("Pts Agst") FROM table_17922 WHERE "Pts For" = '860' | wikisql |
CREATE TABLE table_1098 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | what country was the player drafted by the toronto maple leafs | SELECT "Nationality" FROM table_1098 WHERE "NHL team" = 'Toronto Maple Leafs' | wikisql |
CREATE TABLE table_name_84 (
place VARCHAR,
player VARCHAR
) | What place did Fred Couples finish in? | SELECT place FROM table_name_84 WHERE player = "fred couples" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | The lab-free classes are taught by which professors ? | SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr... | advising |
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 is the number of patients whose marital status is married and procedure icd9 code is 3972? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3972" | mimicsql_data |
CREATE TABLE table_name_39 (
rank INTEGER,
built VARCHAR,
building VARCHAR
) | What is the sum of Rank with a build year earlier than 2007 for the howard johnson hotel bucharest? | SELECT SUM(rank) FROM table_name_39 WHERE built < 2007 AND building = "howard johnson hotel bucharest" | sql_create_context |
CREATE TABLE Student_Course_Registrations (
student_id INTEGER,
course_id INTEGER,
registration_date DATETIME
)
CREATE TABLE People_Addresses (
person_address_id INTEGER,
person_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Candidates (
candida... | How many registed students do each course have? List course name and the number of their registered students, and could you display by the the total number in descending? | SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_83 (
wind VARCHAR,
time VARCHAR
) | What's the wind when the time was 19.32? | SELECT wind FROM table_name_83 WHERE time = "19.32" | sql_create_context |
CREATE TABLE table_22460085_1 (
original_manchester_performer VARCHAR,
original_west_end_performer VARCHAR
) | Who was the Manchester performer of Lisa Davina Phillip's character? | SELECT original_manchester_performer FROM table_22460085_1 WHERE original_west_end_performer = "Lisa Davina Phillip" | sql_create_context |
CREATE TABLE table_73720 (
"Year" text,
"Superintendent" text,
"Middlesex Principal" text,
"Gorham Principal" text,
"Middle School Principal" text,
"High School Principal" text
) | How many high school principals were there in 2000-2001? | SELECT "High School Principal" FROM table_73720 WHERE "Year" = '2000-2001' | wikisql |
CREATE TABLE table_46376 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | The Crvena Zvezda club has what aggregate? | SELECT "Aggregate" FROM table_46376 WHERE "Club" = 'crvena zvezda' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 看看医疗就诊04488736077的人员信息,需要包括姓名、性别、年龄和公民身份号码 | SELECT t_kc21.PERSON_NM, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE, t_kc21.IDENTITY_CARD FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '87710436501' | css |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | find travel arrangements for a round trip flight from BALTIMORE to PITTSBURGH after 2000 o'clock pm before 2200 o'clock pm | 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, fare, flight, flight_fare WHERE (((NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id = fare.fare_id AND flight.departure_time < 2200 AND flight.flight_id = flight_fare... | atis |
CREATE TABLE table_75660 (
"Rank" real,
"Municipality" text,
"Province" text,
"Status" text,
"Area (km 2 )" real
) | What is the total Rank that has a Municipality of Winnipeg, an Area (KM 2) that's larger than 464.01? | SELECT SUM("Rank") FROM table_75660 WHERE "Municipality" = 'winnipeg' AND "Area (km 2 )" > '464.01' | wikisql |
CREATE TABLE table_4083 (
"Player" text,
"Games" real,
"Field goals" real,
"Free throws" real,
"Points" real,
"Points per game" text
) | How many points per game did the person who played in 15 games and made 0 free throws score? | SELECT "Points per game" FROM table_4083 WHERE "Games" = '15' AND "Free throws" = '0' | wikisql |
CREATE TABLE table_21189 (
"Months in Malayalam Era" text,
"In Malayalam" text,
"Gregorian Calendar" text,
"Tamil calendar" text,
"Saka era" text,
"Sign of Zodiac" text
) | Name the saka era for malayalam | SELECT "Saka era" FROM table_21189 WHERE "In Malayalam" = 'മിഥുനം' | wikisql |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Give me a bar chart for the average of baseprice of each decor | SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.