context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABL... | what is the fare on 11 7 going one way from DALLAS to SAN FRANCISCO | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_name_35 (
finish INTEGER,
year VARCHAR
) | What was Jeff's finish in 2011? | SELECT SUM(finish) FROM table_name_35 WHERE year = 2011 | sql_create_context |
CREATE TABLE t_kc21 (
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,
... | 看看编号为5878641的医院在零八年十月十四日到一五年十一月十五日的这段时间里,有多少医疗费总额不少于1815.95元的科室 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '5878641' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-10-14' AND '2015-11-15' GROUP B... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients are admitted before the year 2190 and tested in lab for abnormal status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2190" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_23 (
lost INTEGER,
games INTEGER
) | What's the total Lost with Games that's less than 4? | SELECT SUM(lost) FROM table_name_23 WHERE games < 4 | sql_create_context |
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... | what were the top three most common diagnoses for patients of the 30s since 2100? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100' GROUP BY diagnosis.... | eicu |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | how many patients have expired after they have been diagnosed with crnry athrscl natve vssl within the same hospital visit since 2103? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... | mimic_iii |
CREATE TABLE table_24938621_3 (
production_code VARCHAR,
written_by VARCHAR
) | What is the production code of the episode written by Cathryn Humphris? | SELECT production_code FROM table_24938621_3 WHERE written_by = "Cathryn Humphris" | sql_create_context |
CREATE TABLE table_5674 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many points have @ new york islanders as the opponent, with a game greater than 35? | SELECT COUNT("Points") FROM table_5674 WHERE "Opponent" = '@ new york islanders' AND "Game" > '35' | wikisql |
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 hz_info (
KH text,
KLX number... | 2008年5月16日-2018年8月8日期间,苏幼安这名患者的428058这个指标的所有记录 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '苏幼安'... | css |
CREATE TABLE table_name_71 (
part_number_s_ VARCHAR,
l3_cache VARCHAR,
sspec_number VARCHAR
) | Which Part number(s) has a L3 cache of 8 mb and a sSpec number of sr0pl(e1)? | SELECT part_number_s_ FROM table_name_71 WHERE l3_cache = "8 mb" AND sspec_number = "sr0pl(e1)" | sql_create_context |
CREATE TABLE table_22368 (
"Voting order" real,
"Country" text,
"Spokespersons" text,
"Commentator" text,
"Broadcaster" text
) | who was the commentator when spokesperson was claude darget | SELECT "Commentator" FROM table_22368 WHERE "Spokespersons" = 'Claude Darget' | wikisql |
CREATE TABLE table_204_32 (
id number,
"season" number,
"division" text,
"w-l" text,
"finish" text,
"home" text,
"road" text,
"gf" number,
"ga" number,
"coach" text,
"playoffs" text,
"avg attendance" number
) | amount of seasons with a winning record | SELECT COUNT("season") FROM table_204_32 WHERE "w-l" > "w-l" | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | How many of the male patients are less than 74 years old? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "74" | mimicsql_data |
CREATE TABLE table_204_696 (
id number,
"issue" number,
"volume" number,
"title" text,
"main feature story" text,
"first/early appearance story/stories" text,
"release date" text
) | what other publication was released in the same month as jean gray ? | SELECT "title" FROM table_204_696 WHERE "title" <> 'jean grey' AND "release date" = (SELECT "release date" FROM table_204_696 WHERE "title" = 'jean grey') | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is maximum days of hospital stay of patients whose primary disease is squamous cell carcinoma oral tongue/sda? | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" | mimicsql_data |
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 information information on flights from SAN FRANCISCO to DENVER on thursday morning | 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 = 'DENVER' AND date_day.day_number = 24 AND date_day.month_number = 5 AND d... | atis |
CREATE TABLE table_21713 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | What is the 3rd participle of the verb whose 2nd participle is band? | SELECT "Part 3" FROM table_21713 WHERE "Part 2" = 'band' | wikisql |
CREATE TABLE table_28393 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" text,
"Primary Conference" text,
"Colors" text
) | What is the enrollment for the colors green & black? | SELECT "Enrollment" FROM table_28393 WHERE "Colors" = 'Green & Black' | wikisql |
CREATE TABLE table_806 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" text
) | The minimum average number of dancers is 34.1 how many times | SELECT MIN("Number of dances") FROM table_806 WHERE "Average" = '34.1' | wikisql |
CREATE TABLE table_48337 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which player(s) is from South Africa? | SELECT "Player" FROM table_48337 WHERE "Country" = 'south africa' | 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... | give me the number of patients whose age is less than 41 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart, I want to rank in ascending by the y-axis. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_33806 (
"Year" real,
"Name" text,
"Nationality" text,
"Time" text,
"Age category" text
) | In which Age Category is Marco Manenti? | SELECT "Age category" FROM table_33806 WHERE "Name" = 'marco manenti' | wikisql |
CREATE TABLE table_name_98 (
result VARCHAR,
attendance VARCHAR
) | What is the result of the game with 68,436 attending? | SELECT result FROM table_name_98 WHERE attendance = "68,436" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
User... | My score and number of non-CW answers per tag. | SELECT t.TagName, SUM(a.Score) AS "total_score", COUNT(a.Id) AS "answer_count" FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE (a.OwnerUserId = '##userid##') AND (a.CommunityOwnedDate IS NULL) GROUP BY t.TagName ORDER... | sede |
CREATE TABLE table_64883 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What GEO ID has a longitude of -102.693028? | SELECT "GEO ID" FROM table_64883 WHERE "Longitude" = '-102.693028' | wikisql |
CREATE TABLE table_name_64 (
attendance INTEGER,
result VARCHAR
) | What was the highest attendance of games that resulted in L 23-20? | SELECT MAX(attendance) FROM table_name_64 WHERE result = "l 23-20" | sql_create_context |
CREATE TABLE table_name_99 (
nominated_by_the_taoiseach INTEGER,
total VARCHAR,
cultural_and_educational_panel VARCHAR,
industrial_and_commercial_panel VARCHAR,
administrative_panel VARCHAR
) | What is the average nominated of the composition nominated by Taioseach with an Industrial and Commercial panel less than 9, an administrative panel greater than 0, a cultural and educational panel greater than 2, and a total less than 29? | SELECT AVG(nominated_by_the_taoiseach) FROM table_name_99 WHERE industrial_and_commercial_panel < 9 AND administrative_panel > 0 AND cultural_and_educational_panel > 2 AND total < 29 | sql_create_context |
CREATE TABLE table_name_61 (
total_matches INTEGER,
year VARCHAR,
points_won VARCHAR
) | How many Total matches have a Year of career, and a Points won larger than 25? | SELECT SUM(total_matches) FROM table_name_61 WHERE year = "career" AND points_won > 25 | sql_create_context |
CREATE TABLE table_25363 (
"R" real,
"Player" text,
"Scottish Premier League" real,
"Scottish Cup" real,
"Scottish League Cup" real,
"Champions League (qualifying)" real,
"Europa League" real,
"Total" real
) | Name the scottish premier league georgios samaras | SELECT "Scottish Premier League" FROM table_25363 WHERE "Player" = 'Georgios Samaras' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,... | sql php injection query (phpsqlquery1). | SELECT Body FROM Posts WHERE Posts.Body LIKE '%sql%' AND Posts.Body LIKE '%php%' AND Posts.Body LIKE '%<code>%' AND (Posts.Body LIKE '%sql injectable%' OR Posts.Body LIKE '%inject%' OR Posts.Body LIKE '%injectable%') LIMIT 100 | sede |
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 instructor (
... | Just how big do you think 579 is ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 579 | advising |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number... | what was patient 22245's daily average value of body weight this year? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22245)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi... | mimic_iii |
CREATE TABLE table_23195_5 (
present_share VARCHAR,
producing_nation VARCHAR
) | Name the present share for australia | SELECT present_share FROM table_23195_5 WHERE producing_nation = "Australia" | sql_create_context |
CREATE TABLE table_name_79 (
year VARCHAR,
make_ VARCHAR,
_model VARCHAR
) | What year has a make & model of mci d4000n? | SELECT year FROM table_name_79 WHERE make_ & _model = "mci d4000n" | sql_create_context |
CREATE TABLE table_train_7 (
"id" int,
"bleeding" int,
"hypotension" bool,
"burn_injury" int,
"hypoperfusion" bool,
"hypertension" bool,
"age" float,
"lactate" int,
"NOUSE" float
) | intracranial bleed or intracranial hypertension during this hospital admission | SELECT * FROM table_train_7 WHERE bleeding = 1 OR hypertension = 1 | criteria2sql |
CREATE TABLE table_8484 (
"School" text,
"Locality" text,
"Ages" text,
"Capacity" real,
"Ofsted" real
) | Which Capacity has a School of windlehurst school, and an Ofsted smaller than 131889? | SELECT SUM("Capacity") FROM table_8484 WHERE "School" = 'windlehurst school' AND "Ofsted" < '131889' | wikisql |
CREATE TABLE table_name_63 (
moving_from VARCHAR,
country VARCHAR
) | What moving has fra as the country? | SELECT moving_from FROM table_name_63 WHERE country = "fra" | sql_create_context |
CREATE TABLE table_1470 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" real... | What is the minimum if 40 to 44? | SELECT MIN("40 to 44") FROM table_1470 | wikisql |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses... | A bar chart shows the distribution of password and gender_mf . | SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_6 (
time VARCHAR,
opponent VARCHAR
) | What is shintaro ishiwatari's time? | SELECT time FROM table_name_6 WHERE opponent = "shintaro ishiwatari" | sql_create_context |
CREATE TABLE table_name_83 (
week INTEGER,
result VARCHAR
) | What was the latest week with a result of l 14-3? | SELECT MAX(week) FROM table_name_83 WHERE result = "l 14-3" | sql_create_context |
CREATE TABLE table_name_86 (
population_estimate_2005 VARCHAR,
capital VARCHAR
) | how many population estimate 2005 are for majene? | SELECT COUNT(population_estimate_2005) FROM table_name_86 WHERE capital = "majene" | sql_create_context |
CREATE TABLE table_22822559_4 (
date VARCHAR,
team VARCHAR
) | On what date did the Pistons play @ toronto? | SELECT date FROM table_22822559_4 WHERE team = "@ Toronto" | sql_create_context |
CREATE TABLE table_69970 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text
) | Where was match 8 played? | SELECT "Ground" FROM table_69970 WHERE "Match" = '8' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose primary disease is hyperglycemia;hyponatremia and age is less than 62? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.age < "62" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose admission type is emergency and diagnoses long title is chronic pulmonary heart disease, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic pulmonary heart disease, unspecified" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, find headquarter and the sum of code , and group by attribute headquarter, and visualize them by a bar chart, and I want to sort y axis from low to high order. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code | nvbench |
CREATE TABLE table_name_71 (
champion VARCHAR,
year VARCHAR,
finalist VARCHAR
) | What is Champion, when Year is greater than 2007, and when Finalist is 'Asvel'? | SELECT champion FROM table_name_71 WHERE year > 2007 AND finalist = "asvel" | sql_create_context |
CREATE TABLE table_9054 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the surface tye during the match with the opponent of richard fromberg? | SELECT "Surface" FROM table_9054 WHERE "Opponent" = 'richard fromberg' | wikisql |
CREATE TABLE table_73953 (
"Name" text,
"Turbines" text,
"Capacity (MW)" text,
"Power (MW\u00b7hr/yr)" text,
"Location (county)" text,
"Year Operational" real,
"Status" text
) | What all capacities have turbines between 50-60? | SELECT "Capacity (MW)" FROM table_73953 WHERE "Turbines" = '50-60' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
margin_of_victory VARCHAR
) | What is the date of the tournament with 5 strokes as the margin of victory? | SELECT date FROM table_name_62 WHERE margin_of_victory = "5 strokes" | sql_create_context |
CREATE TABLE table_name_64 (
to_par VARCHAR,
score VARCHAR
) | Name the to par for score of 74-74-74-71=293 | SELECT to_par FROM table_name_64 WHERE score = 74 - 74 - 74 - 71 = 293 | sql_create_context |
CREATE TABLE table_77857 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | When did tav rez lose? | SELECT "Date" FROM table_77857 WHERE "Loss" = 'tavárez' | wikisql |
CREATE TABLE table_71189 (
"Event" text,
"Time" text,
"Venue" text,
"Date" text,
"Notes" text
) | What were the notes for the time 45.74? | SELECT "Notes" FROM table_71189 WHERE "Time" = '45.74' | wikisql |
CREATE TABLE table_26407 (
"Season" text,
"Name" text,
"Teams" real,
"Relegated to league" text,
"Promoted to league" text,
"Promoted from league" text,
"Relegated from league" text
) | How many seasons did Barking Birmingham & Solihull Stourbridge were relegated from league? | SELECT COUNT("Season") FROM table_26407 WHERE "Relegated from league" = 'Barking Birmingham & Solihull Stourbridge' | wikisql |
CREATE TABLE table_5896 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which Opponent has a February larger than 7 and Record of 37-16-4? | SELECT "Opponent" FROM table_5896 WHERE "February" > '7' AND "Record" = '37-16-4' | wikisql |
CREATE TABLE table_78543 (
"Tujunga" text,
"La Crescenta- Montrose" text,
"Glendale" text,
"La Ca\u00f1ada Flintridge" text,
"Pasadena" text
) | What is the percentage of La Canada Flintridge when Tujunga is 7%? | SELECT "La Ca\u00f1ada Flintridge" FROM table_78543 WHERE "Tujunga" = '7%' | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | have patient 61527's been prescribed docusate sodium, potassium chloride, or spironolactone in the last year? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's... | mimic_iii |
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address ... | Just list the resident id and details in a bar chart. | SELECT other_details, resident_id FROM Residents | nvbench |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | What are the name of rooms that cost more than the average. | SELECT roomname FROM rooms WHERE baseprice > (SELECT AVG(baseprice) FROM rooms) | spider |
CREATE TABLE table_name_53 (
owner VARCHAR,
horse_name VARCHAR
) | Who is the owner of Icabad Crane? | SELECT owner FROM table_name_53 WHERE horse_name = "icabad crane" | sql_create_context |
CREATE TABLE table_204_795 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"location" text,
"attendance" number
) | how many total wins did the team have in 1949 ? | SELECT COUNT(*) FROM table_204_795 WHERE "result" = 'win' AND "date" = 1949 | squall |
CREATE TABLE table_name_93 (
player VARCHAR,
total VARCHAR,
country VARCHAR
) | Who is that player from South Africa who had a total score under 293? | SELECT player FROM table_name_93 WHERE total < 293 AND country = "south africa" | sql_create_context |
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,
... | 列出91413607292这个门诊就诊的首诊医生和其他接诊医生的工号 | SELECT zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '91413607292' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '91413607292' | css |
CREATE TABLE table_26493520_1 (
title VARCHAR,
written_by VARCHAR,
directed_by VARCHAR
) | How many episodes were written by Alexander Woo and directed by Scott Winant? | SELECT COUNT(title) FROM table_26493520_1 WHERE written_by = "Alexander Woo" AND directed_by = "Scott Winant" | sql_create_context |
CREATE TABLE table_50540 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Rebounds, when Date is 'March 12'? | SELECT "High rebounds" FROM table_50540 WHERE "Date" = 'march 12' | wikisql |
CREATE TABLE table_name_86 (
record VARCHAR,
date VARCHAR
) | What was the record after the January 18 game? | SELECT record FROM table_name_86 WHERE date = "january 18" | sql_create_context |
CREATE TABLE table_35305 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which Runner(s)-up has a Margin of victory of 1 stroke, and a Tournament of world seniors invitational? | SELECT "Runner(s)-up" FROM table_35305 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'world seniors invitational' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG... | css |
CREATE TABLE table_name_79 (
laps VARCHAR,
grid VARCHAR,
time VARCHAR
) | How many laps had a grid over 16 and a Time of +1:35.890? | SELECT laps FROM table_name_79 WHERE grid > 16 AND time = "+1:35.890" | sql_create_context |
CREATE TABLE table_30128 (
"Year(s)" real,
"Television commentator" text,
"Dual Television commentator" text,
"Radio commentator" text,
"Spokesperson" text
) | Who made the comments for radio broadcast when Jan Gabrielsson made them for television broadcast? | SELECT "Radio commentator" FROM table_30128 WHERE "Television commentator" = 'Jan Gabrielsson' | wikisql |
CREATE TABLE table_3557 (
"Pick #" real,
"Brand (to)" text,
"Employee (Real name)" text,
"Role(s)" text,
"Brand (from)" text
) | Name the brand for pick number 15 | SELECT "Brand (to)" FROM table_3557 WHERE "Pick #" = '15' | wikisql |
CREATE TABLE table_name_39 (
director VARCHAR,
film_title_used_in_nomination VARCHAR
) | What is the Director of Children of Sarajevo? | SELECT director FROM table_name_39 WHERE film_title_used_in_nomination = "children of sarajevo" | sql_create_context |
CREATE TABLE table_name_26 (
distance VARCHAR,
type VARCHAR
) | What is the distance for the team time trial? | SELECT distance FROM table_name_26 WHERE type = "team time trial" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 列举出从2000年6月13日到2019年11月17日这段时间,编号为64770032的病患所有检验报告单中的标本采集部位? | (SELECT jybgb.BBCJBW 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 = '64770032' AND jybgb.BGRQ BETWEEN '2000-06-13' AND '2019-11-17') U... | css |
CREATE TABLE table_75031 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
) | Virtual channel of 16.5 has what call sign? | SELECT "Call sign" FROM table_75031 WHERE "Virtual channel" = '16.5' | wikisql |
CREATE TABLE table_26847237_1 (
score VARCHAR,
opposition VARCHAR,
location VARCHAR
) | What was the score when the opposition was West Coast in Wanganui? | SELECT score FROM table_26847237_1 WHERE opposition = "West Coast" AND location = "Wanganui" | sql_create_context |
CREATE TABLE table_29083 (
"Round #" text,
"Home Team" text,
"Win/Loss" text,
"Score" text,
"Opposition" text,
"Location" text
) | what is the home team when the round # is round 1? | SELECT "Home Team" FROM table_29083 WHERE "Round #" = 'Round 1' | wikisql |
CREATE TABLE table_19296 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
) | What is the finished place where exited is day 11? | SELECT "Finished" FROM table_19296 WHERE "Exited" = 'Day 11' | wikisql |
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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | i need information for a flight from DENVER to ATLANTA | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA... | atis |
CREATE TABLE table_37965 (
"Callsign" text,
"Area served" text,
"Frequency" text,
"Band" text,
"On-air ID" text,
"Purpose" text
) | Name the purpose for on-air ID of 2xx | SELECT "Purpose" FROM table_37965 WHERE "On-air ID" = '2xx' | wikisql |
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real,
Total_Points real
)
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height ... | What are the hometowns of gymnasts and the corresponding number of gymnasts. Show a pie chart. | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown | nvbench |
CREATE TABLE table_38780 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | Highest smaller than 3,378, and a Stadium of cappielow has what average capacity? | SELECT AVG("Capacity") FROM table_38780 WHERE "Highest" < '3,378' AND "Stadium" = 'cappielow' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | please list the morning flights from PHILADELPHIA to TORONTO | 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_27734769_9 (
high_rebounds VARCHAR,
team VARCHAR
) | Who did the high rebounds for the team Minnesota? | SELECT high_rebounds FROM table_27734769_9 WHERE team = "Minnesota" | sql_create_context |
CREATE TABLE table_10026563_1 (
ended_time_as_senior_g8_leader VARCHAR,
person VARCHAR
) | When did Jacques Chirac stop being a G8 leader? | SELECT ended_time_as_senior_g8_leader FROM table_10026563_1 WHERE person = "Jacques Chirac" | sql_create_context |
CREATE TABLE table_21772 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text,
"Independent Green" text,
"Libertarian" text,
"Other Party" text
) | Who was the republican candidate in the race with incumbent thelma drake? | SELECT "Republican" FROM table_21772 WHERE "Incumbent" = 'Thelma Drake' | wikisql |
CREATE TABLE table_name_43 (
score VARCHAR,
championship VARCHAR,
surface VARCHAR,
outcome VARCHAR
) | what is the score when the surface is carpet (i) outcome is winner and the championship is rotterdam, netherlands? | SELECT score FROM table_name_43 WHERE surface = "carpet (i)" AND outcome = "winner" AND championship = "rotterdam, netherlands" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
Po... | Top 30 Users from Milan, Italy. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%toulouse%' ORDER BY Reputation DESC LIMIT 30 | sede |
CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
) | how many tracks are in the album ? | SELECT COUNT("title") FROM table_204_184 | squall |
CREATE TABLE table_6001 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) | Which Combination classification has a Stage of 14? | SELECT "Combination classification" FROM table_6001 WHERE "Stage" = '14' | wikisql |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | until 2104, patient 7073 underwent any procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' | mimic_iii |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE STUDENT (
STU_NUM int,
... | What is the number of professors for different school. | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE | nvbench |
CREATE TABLE table_38498 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Name the visitor for detroit on february 24 | SELECT "Visitor" FROM table_38498 WHERE "Home" = 'detroit' AND "Date" = 'february 24' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what is patient 016-34108's last ward id until 2104? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108') AND STRFTIME('%y', patient.unitadmittime) <= '2104' ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_35331 (
"Episode" text,
"Title" text,
"Writer(s)" text,
"Preservation" text,
"Original airdate" text
) | What is the original airdate for episode 7-17 (195) from writer Sidney Slon? | SELECT "Original airdate" FROM table_35331 WHERE "Writer(s)" = 'sidney slon' AND "Episode" = '7-17 (195)' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | In the afternoon of Fall 2006 , is 692 available ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 692 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2006 | advising |
CREATE TABLE table_name_18 (
days VARCHAR,
year VARCHAR,
constituency VARCHAR
) | What are the number of days in 1945 where the constituent was heywood and radcliffe? | SELECT days FROM table_name_18 WHERE year = "1945" AND constituency = "heywood and radcliffe" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.