context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_22 (
bronze INTEGER,
gold VARCHAR,
silver VARCHAR,
edition VARCHAR
) | What is the highest Edition I Bronze with a Gold higher than 9 and a Silver higher than 10? | SELECT MAX(bronze) FROM table_name_22 WHERE silver > 10 AND edition = "i" AND gold > 9 | sql_create_context |
CREATE TABLE table_name_68 (
record VARCHAR,
location_attendance VARCHAR,
opponent VARCHAR
) | What Record has a Location Attendance of delta center, and an Opponent of vs vancouver grizzlies? | SELECT record FROM table_name_68 WHERE location_attendance = "delta center" AND opponent = "vs vancouver grizzlies" | sql_create_context |
CREATE TABLE table_1706 (
"Episode #" real,
"Title" text,
"Director" text,
"Screenwriter" text,
"Original airdate" text,
"English airdate" text
) | Which are dates of transmission in English of the title 'takeback' 't kubakku' ( ) | SELECT "English airdate" FROM table_1706 WHERE "Title" = 'Takeback" "Tēkubakku" (テークバック)' | wikisql |
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
Service_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
... | What are the descriptions of the service types with product price above 100, and count them by a pie chart | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description | nvbench |
CREATE TABLE table_31149 (
"Name/ designation" text,
"Year of intro" real,
"Country of origin" text,
"Primary cartridge" text,
"Major users" text
) | Who are all the major users of the Gordon Close-Support Weapon System? | SELECT "Major users" FROM table_31149 WHERE "Name/ designation" = 'Gordon Close-Support Weapon System' | wikisql |
CREATE TABLE table_75779 (
"Year" real,
"Film" text,
"Awards" text,
"Category" text,
"Result" text
) | Which awards happened more recently than 2005? | SELECT "Awards" FROM table_75779 WHERE "Year" > '2005' | wikisql |
CREATE TABLE table_203_306 (
id number,
"no." number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
) | what is the name of the last title listed in this chart ? | SELECT "title" FROM table_203_306 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_21260421_1 (
score VARCHAR,
location VARCHAR
) | How many tournaments were held at Alabama? | SELECT COUNT(score) FROM table_21260421_1 WHERE location = "Alabama" | sql_create_context |
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE keyword (
keyword varchar,
... | return me the total citations of the papers in ' University of Michigan ' . | SELECT SUM(publication.citation_num) FROM author, organization, publication, writes WHERE organization.name = 'University of Michigan' AND organization.oid = author.oid AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
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... | how many patients on urgent admission had other lysis of peritoneal adhesions? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Other lysis of peritoneal adhesions" | mimicsql_data |
CREATE TABLE table_14958620_1 (
week INTEGER,
attendance VARCHAR
) | On which week was the attendance 74303? | SELECT MAX(week) FROM table_14958620_1 WHERE attendance = 74303 | sql_create_context |
CREATE TABLE table_name_70 (
notes VARCHAR,
bronze VARCHAR,
gold VARCHAR,
year VARCHAR
) | What is Notes, when Gold is 'Thierry Gueorgiou', when Year is before 2008, and when Bronze is 'Valentin Novikov'? | SELECT notes FROM table_name_70 WHERE gold = "thierry gueorgiou" AND year < 2008 AND bronze = "valentin novikov" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | did patient 32486 take a lactate test until 2 years ago? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32486) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose age is less than 71 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_76 (
player VARCHAR,
pick__number VARCHAR,
college VARCHAR
) | Who is the player that attended Notre Dame with a pick smaller than 304? | SELECT player FROM table_name_76 WHERE pick__number < 304 AND college = "notre dame" | sql_create_context |
CREATE TABLE table_name_16 (
byes INTEGER,
against VARCHAR,
wins VARCHAR
) | How many Byes have Against of 1076 and Wins smaller than 13? | SELECT AVG(byes) FROM table_name_16 WHERE against = 1076 AND wins < 13 | sql_create_context |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date D... | How many accounts are opened in each day? Bin the account open day by weekday in a bar chart, I want to rank by the y axis in desc. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY COUNT(date_account_opened) DESC | nvbench |
CREATE TABLE table_70463 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the total decile with an Area of whitianga, and a Roll smaller than 835? | SELECT SUM("Decile") FROM table_70463 WHERE "Area" = 'whitianga' AND "Roll" < '835' | wikisql |
CREATE TABLE table_13635 (
"Millewa" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many byes were there with an Against of 1655 and more than 10 wins? | SELECT MIN("Byes") FROM table_13635 WHERE "Against" = '1655' AND "Wins" > '10' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a scatter chart about the correlation between commission_pct and department_id . | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_18379 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who is the incumbent in district Texas 15? | SELECT "Incumbent" FROM table_18379 WHERE "District" = 'Texas 15' | wikisql |
CREATE TABLE table_30653 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. air date" text,
"Production code" real,
"U.S. viewers (million)" text
) | who are the writers of the episode whose production code is 176206? | SELECT "Written by" FROM table_30653 WHERE "Production code" = '176206' | wikisql |
CREATE TABLE table_29329432_1 (
no VARCHAR,
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Name the number of episodes that jim barnes wrote for 1.82 million viewers | SELECT COUNT(no) FROM table_29329432_1 WHERE written_by = "Jim Barnes" AND us_viewers__million_ = "1.82" | sql_create_context |
CREATE TABLE table_17803 (
"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 third entry in the row with a first entry of 'club'? | SELECT "Won" FROM table_17803 WHERE "Club" = 'Club' | 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,... | 已经被门诊诊断出患有疾病E00.628的患者体内的免疫球蛋白A(标准)的参考值范围下限和上限具体是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'E00.628' AND jyjgzbb.JCZBMC = '免疫球蛋白A(标准)' UNION SELECT jyjgzbb.CK... | css |
CREATE TABLE table_203_504 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many times was the competition friendly ? | SELECT COUNT(*) FROM table_203_504 WHERE "competition" = 'friendly' | squall |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | 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, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, list Y-axis from high to low order. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_17124 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | What is the date of vacancy for 10 december 2007 when quit? | SELECT "Date of vacancy" FROM table_17124 WHERE "Date of appointment" = '10 December 2007' AND "Manner of departure" = 'Quit' | wikisql |
CREATE TABLE table_19138 (
"EDO Flight" real,
"Shuttle" text,
"Mission" text,
"Launch Date" text,
"Duration" text,
"Primary Payload(s)" text
) | what's the duration with mission being sts-87 | SELECT "Duration" FROM table_19138 WHERE "Mission" = 'STS-87' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | Bin the hire date into Month interval, and then calculate the total salary of employees in each month for a bar chart, note that just select those employees without the letter M in their first name, and display by the y-axis from low to high please. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_74 (
cpu_speed VARCHAR,
type VARCHAR
) | What is the CPU speed(s) of the New Plus type hardware? | SELECT cpu_speed FROM table_name_74 WHERE type = "new plus" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | how did patient 021-155303 last visit the hospital? | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-155303' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
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... | list flights from PITTSBURGH to LOS ANGELES which leave on thursday after 1700 | 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 ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
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 PendingFlags (
Id number,
FlagTypeId ... | My posts sorted by length. | SELECT Id AS "post_link", Score, Body, CreationDate, LENGTH(Body) FROM Posts WHERE OwnerUserId = '810077' AND YEAR(CreationDate) >= 2008 ORDER BY LENGTH(Body) DESC | sede |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose primary disease was syncope;telemetry died in or before year 2179? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.dod_year <= "2179.0" | mimicsql_data |
CREATE TABLE table_1838 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What's the series number for the episode titled 'Hunted'? | SELECT MIN("No. in series") FROM table_1838 WHERE "Title" = 'Hunted' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | Posts closed since 01/2012 by month. | SELECT CAST(YEAR(p.CreationDate) AS TEXT(10)) + '/' + CAST(MONTH(p.CreationDate) AS TEXT(19)) AS dt, COUNT(p.Id) AS pcount FROM Posts AS p WHERE p.CreationDate > '2012-01-01' GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate) | sede |
CREATE TABLE table_name_47 (
play VARCHAR,
company VARCHAR
) | Which play was done by the Radu Stanca National Theatre company? | SELECT play FROM table_name_47 WHERE company = "radu stanca national theatre" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | until 2102 what were the top three most common specimen tests? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2102' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3 | mimic_iii |
CREATE TABLE table_name_13 (
player VARCHAR,
years_for_grizzlies VARCHAR
) | Which player played for the Grizzlies from 1997-1998? | SELECT player FROM table_name_13 WHERE years_for_grizzlies = "1997-1998" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how many times gabapentin 100 mg po caps has been prescribed to patient 016-13544 since 2104? | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-13544')) AND medication.drugname = 'gabapentin 100 mg po caps' AND STRFTIM... | eicu |
CREATE TABLE table_27139 (
"Round" real,
"Circuit" text,
"Date" text,
"Class A Winner" text,
"Class B Winner" text,
"Class C Winner" text,
"Class D Winner" text
) | When did Alan Hutcheson won Class B on round 1? | SELECT "Date" FROM table_27139 WHERE "Class B Winner" = 'Alan Hutcheson' AND "Round" = '1' | wikisql |
CREATE TABLE table_45431 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is H/A/N, when Date is October 31? | SELECT "H/A/N" FROM table_45431 WHERE "Date" = 'october 31' | 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... | To how many patients was nifedipine cr administered of prescribed? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NIFEdipine CR" | mimicsql_data |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Show me 9 -credit The History of Disaster courses . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%The History of Disaster%' OR name LIKE '%The History of Disaster%') AND credits = 9 | advising |
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 admission time of subject name paul edwards? | SELECT demographic.admittime FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_name_75 (
crowd INTEGER,
away_team VARCHAR
) | What was the top crowd when essendon played away? | SELECT MAX(crowd) FROM table_name_75 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id int,
... | show me round trip fares from NEW YORK to MIAMI | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... | atis |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | Draw a bar chart of main industry versus total number of market value | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
CREATE TABLE Claims_Processing (
Claim_Processing_ID INTEGER,
Claim_ID INTEGER,
Claim_Outcome_Code CHAR(15),
Claim_Stage_ID INTEGER,
Staff_ID INTEGER
)
CREATE TABLE Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATETIME,
End_Date DATETI... | For each policy type, return its type code and its count in the record Visualize by bar chart, and rank the total number from low to high order please. | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_80376 (
"2002/ 03" text,
"2004/ 05" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | Name the 2009/10 with 2011/12 of a | SELECT "2009/ 10" FROM table_80376 WHERE "2011/ 12" = 'a' | wikisql |
CREATE TABLE table_name_34 (
series VARCHAR,
production_number VARCHAR
) | What is the Series number of the episode with a production number of 1547? | SELECT series FROM table_name_34 WHERE production_number = 1547 | 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,
... | 找出医院8754336全部医疗就诊的记录里不一样的科室接诊的患者和不同疾病编号的患者平均的年纪有多大 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8754336' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 in... | show me all the flights between PHILADELPHIA and DENVER | 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 = 'D... | atis |
CREATE TABLE table_46624 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What are the years when the grizzles had a player who attended Villanova? | SELECT "Years for Grizzlies" FROM table_46624 WHERE "School/Club Team" = 'villanova' | wikisql |
CREATE TABLE table_40199 (
"Round" text,
"Date" text,
"Matches" real,
"Clubs" text,
"Prize money" text
) | What is Prize Money, when Matches is less than 73, and when Round is Third Round Proper? | SELECT "Prize money" FROM table_40199 WHERE "Matches" < '73' AND "Round" = 'third round proper' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many time did patient 022-3289 produce a urinary catheter output: urethral output in their first hospital encounter? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-3289' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.h... | eicu |
CREATE TABLE table_45267 (
"Railway" text,
"Built" real,
"Wheels" text,
"Location" text,
"ObjectNumber" text
) | What is the UK Railway with an ObjectNumber of 1975-7023? | SELECT "Railway" FROM table_45267 WHERE "ObjectNumber" = '1975-7023' | wikisql |
CREATE TABLE table_dev_7 (
"id" int,
"active_infection" bool,
"macroalbuminuria" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_b" bool,
"fasting_blood_glucose_fbg" float,
"creatinine_clearance_cl" float,
"triglyceride_tg" float,
"NOUSE" float
) | triglycerides > 450 mg / dl | SELECT * FROM table_dev_7 WHERE triglyceride_tg > 450 | criteria2sql |
CREATE TABLE table_name_74 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
) | What To par has a Place of t10, and a Score of 67-73=140? | SELECT to_par FROM table_name_74 WHERE place = "t10" AND score = 67 - 73 = 140 | sql_create_context |
CREATE TABLE table_22935 (
"Tie no" real,
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the tie when team 2 is koper? | SELECT MIN("Tie no") FROM table_22935 WHERE "Team 2" = 'Koper' | wikisql |
CREATE TABLE table_name_57 (
nationality VARCHAR,
ranking VARCHAR
) | What is the Nationality that shows 4 as the ranking? | SELECT nationality FROM table_name_57 WHERE ranking = 4 | sql_create_context |
CREATE TABLE table_3126 (
"Episode Number" real,
"Location" text,
"Original Airdate" text,
"Challenge Winner" text,
"Challenge" text
) | What is the original airdate of the episode where the challenge is 'Southwestern Exposure', a twelve-egg omelette'? | SELECT "Original Airdate" FROM table_3126 WHERE "Challenge" = 'Southwestern Exposure", a twelve-egg omelette' | wikisql |
CREATE TABLE table_name_65 (
goals VARCHAR,
games VARCHAR
) | Name the goals with games of 6 | SELECT goals FROM table_name_65 WHERE games = "6" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients were diagnosed with acute diastolic heart failure and their drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ac diastolic hrt failure" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id n... | how many people have been discharged from hospital in 2104? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2104' | mimic_iii |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients who had phosphate lab test were discharged to home health care? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Phosphate" | mimicsql_data |
CREATE TABLE table_1686313_1 (
pop_density__per_km²_ VARCHAR,
barangay VARCHAR
) | Name the population density when barangay is tiptip | SELECT pop_density__per_km²_ FROM table_1686313_1 WHERE barangay = "Tiptip" | sql_create_context |
CREATE TABLE table_2562572_44 (
dominant_religion__2002_ VARCHAR,
settlement VARCHAR
) | What was the dominant religion in 2002 in lokve? | SELECT dominant_religion__2002_ FROM table_2562572_44 WHERE settlement = "Lokve" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | select * from Posts where Id=311703. | SELECT * FROM Posts WHERE ParentId = 311703 | sede |
CREATE TABLE table_77754 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real
) | What is the total Avg when TDs are 0 and Dawan Moss is a player? | SELECT COUNT("Avg.") FROM table_77754 WHERE "Player" = 'dawan moss' AND "TD's" < '0' | wikisql |
CREATE TABLE table_28846752_5 (
innings VARCHAR,
bbi VARCHAR
) | how many innings had bbi 4/26? | SELECT innings FROM table_28846752_5 WHERE bbi = "4/26" | sql_create_context |
CREATE TABLE Has_allergy (
StuID VARCHAR
) | Show all student IDs who have at least two allergies. | SELECT StuID FROM Has_allergy GROUP BY StuID HAVING COUNT(*) >= 2 | sql_create_context |
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 swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Visualize a bar chart about the distribution of name and ID , and display from low to high by the x axis. | SELECT name, ID FROM swimmer ORDER BY name | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients whose diagnoses icd9 code is 7291 and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "7291" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | Show me a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available? | SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 | nvbench |
CREATE TABLE order_items (
order_id VARCHAR,
product_id VARCHAR
)
CREATE TABLE customer_orders (
order_id VARCHAR,
customer_id VARCHAR
)
CREATE TABLE products (
product_name VARCHAR,
product_id VARCHAR
) | Find the names of products that were bought by at least two distinct customers. | SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2 | sql_create_context |
CREATE TABLE table_41431 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1986\u20131987 Team" text
) | On what date was the player from Melrose, Massachusetts born? | SELECT "Birthdate" FROM table_41431 WHERE "Birthplace" = 'melrose, massachusetts' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | Return a histogram on what are the different transaction types, and how many transactions of each have taken place? | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type | nvbench |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
) | lorant olah scored the same number of goals in the uefa cup as what other player ? | SELECT "name" FROM table_204_978 WHERE "name" <> 'lorant olah' AND "uefa cup" = (SELECT "uefa cup" FROM table_204_978 WHERE "name" = 'lorant olah') | squall |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 在门诊诊断为疾病X60.562的患者身上其抗凝血酶III的参考值范围下限和上限具体为多少数值? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'X60.562' AND jyjgzbb.JCZBMC = '抗凝血酶III' UNION SELECT jyjgzbb.CKZFW... | css |
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... | 把2005年6月12日到2021年6月4日期间患者章安澜总共花了多少医保个人账户金额查看一下 | SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2005-06-12' AND '2021-06-04' | css |
CREATE TABLE table_58633 (
"Result" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text,
"Location" text
) | What is the date of the match located in Madrid, Esp? | SELECT "Date" FROM table_58633 WHERE "Location" = 'madrid, esp' | wikisql |
CREATE TABLE table_43928 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average number of golds in athletics associated with over 42 silvers? | SELECT AVG("Gold") FROM table_43928 WHERE "Sport" = 'athletics' AND "Silver" > '42' | wikisql |
CREATE TABLE table_name_1 (
place VARCHAR,
money___$__ VARCHAR,
score VARCHAR
) | What is the Place of the Player with Money greater than 300 and a Score of 71-69-70-70=280? | SELECT place FROM table_name_1 WHERE money___$__ > 300 AND score = 71 - 69 - 70 - 70 = 280 | 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,
... | what are the five most frequently given diagnoses for patients who had previously had antibacterials - cephalosporin within the same hospital visit, since 2101? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antib... | eicu |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | Show the company of the tallest entrepreneur. | SELECT T1.company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T2.height DESC LIMIT 1 | spider |
CREATE TABLE table_17108 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Where is lincoln high school located? | SELECT "Hometown" FROM table_17108 WHERE "School" = 'Lincoln High School' | wikisql |
CREATE TABLE table_name_49 (
constructor VARCHAR,
circuit VARCHAR
) | Which Constructor has Pergusa in the Circuit? | SELECT constructor FROM table_name_49 WHERE circuit = "pergusa" | sql_create_context |
CREATE TABLE table_name_34 (
time VARCHAR,
event VARCHAR
) | What is the time for the 50m breaststroke? | SELECT time FROM table_name_34 WHERE event = "50m breaststroke" | sql_create_context |
CREATE TABLE table_72280 (
"Name" text,
"Location" text,
"Light vehicle" text,
"Heavy vehicle (2 axles)" text,
"Heavy vehicle (3/4 axles)" text,
"Heavy vehicle (5+ axles)" text
) | What is the toll for light vehicles at the plaza between bela bela and modimolle? | SELECT "Light vehicle" FROM table_72280 WHERE "Location" = 'between Bela Bela and Modimolle' | wikisql |
CREATE TABLE table_name_65 (
date VARCHAR,
result VARCHAR
) | What is the Date when the result is *non-conference game. #rankings from ap poll .? | SELECT date FROM table_name_65 WHERE result = "*non-conference game. #rankings from ap poll ." | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | what does fare code BH mean | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'BH' | atis |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time... | Is there one class that 's harder than the rest ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH... | advising |
CREATE TABLE table_76848 (
"Club" text,
"Played" 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 lost when the club was Barry RFC? | SELECT "Lost" FROM table_76848 WHERE "Club" = 'barry rfc' | wikisql |
CREATE TABLE table_name_12 (
opponent VARCHAR,
round VARCHAR,
event VARCHAR
) | Who was the opponent in the WMMA 1: McCorkle vs. Heden event that went more than 1 round? | SELECT opponent FROM table_name_12 WHERE round > 1 AND event = "wmma 1: mccorkle vs. heden" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Questions that received a lot of bounty. Shows all questions that received more than one bounty | SELECT PostId AS "post_link", bounties, amount FROM (SELECT PostId, COUNT(BountyAmount) AS bounties, SUM(BountyAmount) AS amount FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8 GROUP BY PostId) AS B WHERE bounties > 1 ORDER BY amount DESC | sede |
CREATE TABLE table_name_6 (
builder VARCHAR,
date_ordered VARCHAR,
tc VARCHAR,
stl_no__1883_84_ VARCHAR
) | Who built the order on November 1881 of more than 54 TC&StL no. (1883 84)? | SELECT builder FROM table_name_6 WHERE tc & stl_no__1883_84_ > 54 AND date_ordered = "november 1881" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate ti... | , 2020. | SELECT p.OwnerUserId FROM (SELECT OwnerUserId, MIN(p.Id) AS firstpost FROM Posts AS p WHERE OwnerUserId IN (SELECT DISTINCT p1.OwnerUserId FROM Posts AS p1 WHERE p1.OwnerUserId > 0 GROUP BY p1.OwnerUserId HAVING YEAR(MIN(p1.CreationDate)) = 2020) GROUP BY OwnerUserId) AS f, Posts AS p WHERE p.Id = f.firstpost AND Tags ... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
... | what is the last time that patient 035-4312 was prescribed lactated ringers injection 1,000 ml since 180 months ago? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312')) AND medication.drugname = 'lactated ringers inject... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.