context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_31017 (
"Team" text,
"Contest and round" text,
"Opponent" text,
"1st leg score*" text,
"2nd leg score**" text,
"Aggregate score" text
) | what is the name of the team which aggregate score is l 1 2 | SELECT "Team" FROM table_31017 WHERE "Aggregate score" = 'L 1–2' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | count the number of people who were discharged during the last year from the hospital. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_67115 (
"Rank" real,
"Airport" text,
"City" text,
"Code (IATA/ICAO)" text,
"2008" real,
"2009" real,
"2010" real
) | What is the average for the year 2008 of the team that in 2010 had an average of 240,735 with rank lower than 5? | SELECT AVG("2008") FROM table_67115 WHERE "2010" = '240,735' AND "Rank" < '5' | wikisql |
CREATE TABLE table_10935548_1 (
production_code VARCHAR,
written_by VARCHAR,
original_air_date VARCHAR
) | What is the production code of the episode written by Jos Molina that aired on October 12, 2004? | SELECT production_code FROM table_10935548_1 WHERE written_by = "José Molina" AND original_air_date = "October 12, 2004" | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_fare ... | i would like to fly from DENVER to BOSTON | 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 = 'BOSTON'... | atis |
CREATE TABLE table_name_9 (
time___et__ VARCHAR,
week VARCHAR
) | What time did the game start during week 1? | SELECT time___et__ FROM table_name_9 WHERE week = 1 | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | 患者吕博涉的胸腹水白蛋白(白蛋白)什么情况在14年9月30日到20年8月11日期间 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_204_982 (
id number,
"party/electoral alliance" text,
"seats" number,
"change" number,
"votes" number,
"%" text
) | which one has the most vote | SELECT "party/electoral alliance" FROM table_204_982 ORDER BY "votes" DESC LIMIT 1 | squall |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the correlation between manufacturer and code in a scatter chart. | SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_27259 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Podiums" real,
"Points" text,
"Position" text
) | In what series did he have the 7th position? | SELECT "Series" FROM table_27259 WHERE "Position" = '7th' | wikisql |
CREATE TABLE table_62620 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | In what year did the team of aston martin racing have a position of 6th? | SELECT COUNT("Year") FROM table_62620 WHERE "Team" = 'aston martin racing' AND "Pos." = '6th' | wikisql |
CREATE TABLE table_72815 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | What is the origin of the name of Keller Patera? | SELECT "Name origin" FROM table_72815 WHERE "Name" = 'Keller Patera' | wikisql |
CREATE TABLE table_24334 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | Name the team for june 20 | SELECT "Team" FROM table_24334 WHERE "Date" = 'June 20' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | provide the number of patients whose primary disease is bladder cancer/sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" | mimicsql_data |
CREATE TABLE table_name_18 (
league VARCHAR,
away VARCHAR
) | What league has 2-3 as the away? | SELECT league FROM table_name_18 WHERE away = "2-3" | sql_create_context |
CREATE TABLE table_25800134_19 (
director VARCHAR,
series__number VARCHAR
) | Who directed episode number 626 in the series? | SELECT director FROM table_25800134_19 WHERE series__number = 626 | sql_create_context |
CREATE TABLE table_53618 (
"Year of award" real,
"Athlete" text,
"Nation of citizenship" text,
"Team" text,
"Competition , governing body , or league" text,
"Sport" text
) | Which tennis team is from the United States? | SELECT "Team" FROM table_53618 WHERE "Sport" = 'tennis' AND "Nation of citizenship" = 'united states' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | provide the number of patients whose days of hospital stay is greater than 15 and item id is 50904? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.itemid = "50904" | mimicsql_data |
CREATE TABLE table_14102379_4 (
attendance INTEGER,
record VARCHAR
) | what is the minimum attendance with record being 4 6 | SELECT MIN(attendance) FROM table_14102379_4 WHERE record = "4–6" | sql_create_context |
CREATE TABLE table_41252 (
"Class" text,
"Quantity" real,
"Manufacturer" text,
"Motor" text,
"Seats" real
) | Which motor's quantity was more than 8, and a class of bs 1915? | SELECT "Motor" FROM table_41252 WHERE "Quantity" > '8' AND "Class" = 'bs 1915' | wikisql |
CREATE TABLE table_name_98 (
hazmat VARCHAR,
type VARCHAR,
tankers VARCHAR
) | What is the Hazmat, when the Type is Rural, and when the number of Tankers is 1? | SELECT hazmat FROM table_name_98 WHERE type = "rural" AND tankers = 1 | sql_create_context |
CREATE TABLE table_60617 (
"English translation" text,
"Original album" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Time" text
) | What is Original Album, when Time is '3:39'? | SELECT "Original album" FROM table_60617 WHERE "Time" = '3:39' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
... | View Questions from Tag in Last 2 Weeks. | SELECT CONCAT('http://stackoverflow.com/q/', Posts.Id) AS "Question ID", Posts.Title AS "Post Title", Posts.Body AS "Question Text", Posts.CreationDate AS "Post Date", Posts.Tags AS "Tags" FROM Posts JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = 'office-2013' AND... | sede |
CREATE TABLE table_name_10 (
tournament VARCHAR,
date VARCHAR
) | Which Tournament has a Date of january 10, 1994? | SELECT tournament FROM table_name_10 WHERE date = "january 10, 1994" | sql_create_context |
CREATE TABLE table_name_61 (
region VARCHAR,
catalog VARCHAR
) | Tell me the region for catalog of 576 096-2 | SELECT region FROM table_name_61 WHERE catalog = "576 096-2" | sql_create_context |
CREATE TABLE table_name_51 (
real_name VARCHAR,
primary_military_speciality VARCHAR
) | What is the real name of the person whose primary military specialty is shock paratrooper? | SELECT real_name FROM table_name_51 WHERE primary_military_speciality = "shock paratrooper" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | provide the number of patients whose year of birth is less than 2168 and procedure long title is continuous invasive mechanical ventilation for 96 consecutive hours or more? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2168" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more" | mimicsql_data |
CREATE TABLE table_73125 (
"Number One(s)" real,
"Artist(s)" text,
"Song(s) \u2014 Weeks" text,
"Issue Years" real,
"Whole Weeks" real
) | What is the title of every song, and how many weeks was each song at #1 for Rihanna in 2012? | SELECT "Song(s) \u2014 Weeks" FROM table_73125 WHERE "Issue Years" = '2012' AND "Artist(s)" = 'Rihanna' | wikisql |
CREATE TABLE table_56650 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the away team score when Carlton was the home team? | SELECT "Away team score" FROM table_56650 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE table_name_22 (
music VARCHAR,
score VARCHAR,
style VARCHAR
) | Which Music has a Score of 30 (10, 10, 10), and a Style of cha-cha-cha? | SELECT music FROM table_name_22 WHERE score = "30 (10, 10, 10)" AND style = "cha-cha-cha" | sql_create_context |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id number,
ticket_price number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_j... | Count the number of exhibitions that happened in or after 2005. | SELECT COUNT(*) FROM exhibition WHERE year >= 2005 | spider |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | count the number of patients whose admission type is elective and procedure long title is other endoscopy of small intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other endoscopy of small intestine" | mimicsql_data |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number ... | how can i go from the SAN FRANCISCO airport to downtown SAN FRANCISCO | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 哪位患者在门诊就诊中开出编码为04680290185检验报告单? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE zyjybgb.BGDH = '04680... | css |
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
)
... | what is marital status and procedure short title of subject id 74032? | SELECT demographic.marital_status, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_203_753 (
id number,
"rank" number,
"name" text,
"caps" number,
"goals" number,
"years" text
) | tommy taylor had the same number of goals as which other player -lrb- s -rrb- ? | SELECT "name" FROM table_203_753 WHERE "name" <> 'tommy taylor' AND "goals" = (SELECT "goals" FROM table_203_753 WHERE "name" = 'tommy taylor') | squall |
CREATE TABLE table_66322 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" real
) | What's the product that has less than 98.6 melamine content, more than 1 sample failed and took less than 3 samples? | SELECT "Product" FROM table_66322 WHERE "Melamine content(mg/kg)" < '98.6' AND "Samples failed" > '1' AND "Samples taken" < '3' | 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 ... | i'm looking for a flight that goes from ONTARIO to WESTCHESTER COUNTY and stops in CHICAGO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WESTCHESTER COUNTY' AN... | atis |
CREATE TABLE addresses (
address_id VARCHAR,
state_province_county VARCHAR
)
CREATE TABLE customer_addresses (
customer_id VARCHAR,
address_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
) | Find the names of customers who are not living in the state of California. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' | sql_create_context |
CREATE TABLE table_14976504_2 (
new_conference VARCHAR,
team_nickname VARCHAR
) | Which new conference is the Toreros Western Collegiate Lacrosse team playing in? | SELECT new_conference FROM table_14976504_2 WHERE team_nickname = "Toreros" | sql_create_context |
CREATE TABLE table_name_60 (
team VARCHAR
) | What is the 2013-2014 division for the Wolverhampton Wildcats? | SELECT 2013 AS _14_division FROM table_name_60 WHERE team = "wolverhampton wildcats" | sql_create_context |
CREATE TABLE table_name_96 (
nominated_work VARCHAR,
year VARCHAR
) | Which Nominated work has a Year of 1997? | SELECT nominated_work FROM table_name_96 WHERE year = 1997 | sql_create_context |
CREATE TABLE table_26842217_18 (
date VARCHAR,
broadcast VARCHAR
) | Name the date for espn | SELECT date FROM table_26842217_18 WHERE broadcast = "ESPN" | sql_create_context |
CREATE TABLE table_63618 (
"School" text,
"Location" text,
"Mascot" text,
"# / County" text,
"Year Joined" real,
"Previous Conference" text,
"Year Left" real,
"Conference Joined" text
) | Which Location has a Year Joined of 1966, and a Previous Conference of noble county, and a School of wawaka? | SELECT "Location" FROM table_63618 WHERE "Year Joined" = '1966' AND "Previous Conference" = 'noble county' AND "School" = 'wawaka' | wikisql |
CREATE TABLE table_203_151 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin of\nvictory" text,
"runner(s)-up" text
) | how many tournaments has he won by 3 or more strokes ? | SELECT COUNT("tournament") FROM table_203_151 WHERE "margin of\nvictory" >= 3 | squall |
CREATE TABLE table_train_19 (
"id" int,
"white_blood_cell_count_wbc" int,
"active_infection" bool,
"heart_disease" bool,
"temperature" float,
"skin_lesion" bool,
"heart_rate" int,
"paco2" float,
"immature_form" int,
"respiratory_rate" int,
"age" float,
"NOUSE" float
) | 2 or more among 1 ) 4 ) 1 ) body temperature > 38 c or < 36 c 2 ) heart rate > 90 / min 3 ) respiratory rate > 20 / min or paco2 < 32 mmhg 4 ) wbc > 12000 / mm3, < 4000 / mm3, or band forms > 10 % ; | SELECT * FROM table_train_19 WHERE (CASE WHEN temperature > 38 OR temperature < 36 THEN 1 ELSE 0 END + CASE WHEN heart_rate > 90 THEN 1 ELSE 0 END + CASE WHEN respiratory_rate > 20 OR paco2 < 32 THEN 1 ELSE 0 END + CASE WHEN white_blood_cell_count_wbc > 12000 OR white_blood_cell_count_wbc < 4000 OR immature_form > 10 T... | criteria2sql |
CREATE TABLE table_40440 (
"Year" real,
"Series" text,
"Winning team" text,
"Losing team" text,
"Score" text,
"Site" text
) | What was the latest year that the Atlanta Braves won and the St. Louis Cardinals lost? | SELECT MAX("Year") FROM table_40440 WHERE "Winning team" = 'atlanta braves' AND "Losing team" = 'st. louis cardinals' | wikisql |
CREATE TABLE table_name_47 (
score VARCHAR,
tie_no VARCHAR
) | What is the score when the tie number is 4? | SELECT score FROM table_name_47 WHERE tie_no = "4" | sql_create_context |
CREATE TABLE table_name_12 (
total INTEGER,
nation VARCHAR
) | What was the lowest total of medals won by Croatia? | SELECT MIN(total) FROM table_name_12 WHERE nation = "croatia" | sql_create_context |
CREATE TABLE table_79193 (
"Rank" text,
"Capacity" real,
"City" text,
"State" text,
"Year opened" text
) | What is the city in Alabama that opened in 1996? | SELECT "City" FROM table_79193 WHERE "Year opened" = '1996' AND "State" = 'alabama' | wikisql |
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE a... | Return the famous titles of the artist called 'Triumfall'. | SELECT famous_title FROM artist WHERE artist = "Triumfall" | spider |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | has albuterol concentrated 0.5%, acetaminophen 325 mg po tabs, or insulin lispro, recombinant been ordered for patient 021-25705 during this year? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND medication.drugname IN ('albuterol concentrated 0.5%', 'a... | eicu |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | what is the daily average dose of volume (ml)-antithrombin iii (human) (thrombate iii) 1,208 units in sterile iv diluent 22 ml infusion syringe given to patient 015-7988 until 1592 days ago? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND intakeoutput.celllabel = 'volume... | eicu |
CREATE TABLE match_season (
College VARCHAR
) | Show the name of colleges that have at least two players in descending alphabetical order. | SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC | sql_create_context |
CREATE TABLE table_56565 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date did the away team Melbourne play? | SELECT "Date" FROM table_56565 WHERE "Away team" = 'melbourne' | wikisql |
CREATE TABLE table_name_40 (
away VARCHAR,
round VARCHAR
) | What is the away where the round is the second round? | SELECT away FROM table_name_40 WHERE round = "second round" | sql_create_context |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Departments (
department_id INTEGER,
dept_store_id INTEGER,
department_name VARCHA... | Show the price of each product supplied by supplier id 3 in a bar chart. | SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 | nvbench |
CREATE TABLE table_name_74 (
boiling_point VARCHAR,
solvent VARCHAR
) | what's the boiling point of diethyl ether? | SELECT boiling_point FROM table_name_74 WHERE solvent = "diethyl ether" | sql_create_context |
CREATE TABLE table_29788320_2 (
number_of_editions VARCHAR,
concept VARCHAR
) | How many editions did Club Q-base concept have ? | SELECT COUNT(number_of_editions) FROM table_29788320_2 WHERE concept = "Club Q-BASE" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | what is the five most frequent drugs prescribed within the same month to the female patient with age 20s after they have been diagnosed with aortic valve disorder? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_11432 (
"Average population (x 1000)" real,
"Live births" real,
"Deaths" text,
"Natural change" real,
"Crude birth rate (per 1000)" real,
"Crude death rate (per 1000)" real,
"Natural change (per 1000)" real
) | what is the crude birth rate (per 1000) when the crude death rate (per 1000) is less than 6.2, the average population (x1000) is larger than 2,770 and the natural change (per 1000) is 17.2? | SELECT SUM("Crude birth rate (per 1000)") FROM table_11432 WHERE "Crude death rate (per 1000)" < '6.2' AND "Average population (x 1000)" > '2,770' AND "Natural change (per 1000)" = '17.2' | wikisql |
CREATE TABLE table_7062 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | What is the Enrollment for the Pilots? | SELECT MIN("Enrollment") FROM table_7062 WHERE "Team Nickname" = 'pilots' | wikisql |
CREATE TABLE table_20318 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by:" text,
"Written by:" text,
"Original air date" text
) | What is the title of the episode that aired on december 12, 1953? | SELECT "Title" FROM table_20318 WHERE "Original air date" = 'December 12, 1953' | wikisql |
CREATE TABLE table_24336 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | How many seasons have a premier date of January 6, 2005? | SELECT COUNT("Season") FROM table_24336 WHERE "Premier date" = 'January 6, 2005' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what are the top four most frequent diagnoses among patients of age 20s until 4 years ago? | 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 20 AND 29) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 yea... | eicu |
CREATE TABLE table_60157 (
"Team" text,
"Opponent" text,
"Score" text,
"Venue" text,
"Round" text
) | What is the venue of the match with the cronulla sharks as the opponent? | SELECT "Venue" FROM table_60157 WHERE "Opponent" = 'cronulla sharks' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose marital status is divorced and diagnoses icd9 code is 2764? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.icd9_code = "2764" | mimicsql_data |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fn... | What are the number of the last names for all scholarship students? | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName | nvbench |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major... | Is BIOPHYS 417 available to take in Spring 2013 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIOPHYS' AND course.number = 417 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2013 | advising |
CREATE TABLE table_13754 (
"Round" real,
"Opposition Team" text,
"Venue" text,
"Result" text,
"Report" text
) | What is the report for round 9? | SELECT "Report" FROM table_13754 WHERE "Round" = '9' | wikisql |
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... | find out the average age of newborn patients with self pay insurance. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Self Pay" | mimicsql_data |
CREATE TABLE table_49314 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the Opponent on August 31, 1997? | SELECT "Opponent" FROM table_49314 WHERE "Date" = 'august 31, 1997' | 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... | What is the average age of patients whose marital status is married and are aged 44 years or older? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "44" | mimicsql_data |
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number... | What are the first name, last name, and phone number of all the female faculty members? | SELECT fname, lname, phone FROM faculty WHERE sex = 'F' | spider |
CREATE TABLE table_204_712 (
id number,
"rank" number,
"athlete" text,
"nationality" text,
"time" text,
"notes" text
) | how many russians finished at least 3rd in the 20km walk ? | SELECT COUNT(*) FROM table_204_712 WHERE "nationality" = 'russia' AND id <= 3 | squall |
CREATE TABLE table_name_73 (
lane INTEGER,
time VARCHAR,
heat VARCHAR
) | What lane has a time of 24.83 and a heat less than 11? | SELECT SUM(lane) FROM table_name_73 WHERE time = "24.83" AND heat < 11 | sql_create_context |
CREATE TABLE table_name_41 (
total VARCHAR,
set_1 VARCHAR
) | What is the Total of the 24:26 Set 1? | SELECT total FROM table_name_41 WHERE set_1 = "24:26" | sql_create_context |
CREATE TABLE table_77552 (
"Party" text,
"Constituency Seats" real,
"Regional Seats" real,
"Total Seats" real,
"Seat Change" text
) | What is the full number of Total Seats with a constituency seat number bigger than 0 with the Liberal Democrat party, and the Regional seat number is smaller than 6? | SELECT SUM("Total Seats") FROM table_77552 WHERE "Constituency Seats" > '0' AND "Party" = 'liberal democrat' AND "Regional Seats" < '6' | wikisql |
CREATE TABLE table_24331 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | Name the number of episode summary for jesse csincsak | SELECT COUNT("Episode Summary") FROM table_24331 WHERE "Coach" = 'Jesse Csincsak' | wikisql |
CREATE TABLE table_204_58 (
id number,
"year" number,
"position" text
) | what was the last year they did not qualify ? | SELECT MAX("year") FROM table_204_58 WHERE "position" = 'did not qualify' | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name te... | Kendo React UI Top 100. | SELECT Posts.Id FROM Posts WHERE Posts.Tags LIKE '%kendo-react-ui%' LIMIT 1000 | sede |
CREATE TABLE table_25569 (
"R" real,
"Player" text,
"Position" text,
"League" real,
"Champions League" real,
"Copa del Rey" real,
"Total" real
) | If the player is Marcelo, what is the position? | SELECT "Position" FROM table_25569 WHERE "Player" = 'Marcelo' | wikisql |
CREATE TABLE table_name_9 (
to_par VARCHAR,
player VARCHAR,
total VARCHAR
) | What is total number of the to par of player john mahaffey, who has a total less than 298? | SELECT COUNT(to_par) FROM table_name_9 WHERE player = "john mahaffey" AND total < 298 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | get me the number of patients with *lit language who had creatine kinase, mb isoenzyme lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme" | mimicsql_data |
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,
... | 编号45775351的患者之前患过什么病 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '45775351' | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | count of popular questions with an accepted answer which is outvoted and not authored by the OP. | SELECT COUNT(q.Id) FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.PostTypeId = 1 AND q.ViewCount > 100000 AND (SELECT MAX(Score) FROM Posts AS q2 WHERE q.Id = q2.ParentId) > a.Score AND q.OwnerUserId != a.OwnerUserId | sede |
CREATE TABLE table_14659 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | What is the total number of laps that were completed in 1949? | SELECT COUNT("Laps") FROM table_14659 WHERE "Year" = '1949' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 列出患者俞夏岚所有检验报告单的审核日期时间在什么时候,在2002-05-16到2003-11-27范围内? | (SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞夏岚' AND jyb... | css |
CREATE TABLE table_27752 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the league for conference finals | SELECT "League" FROM table_27752 WHERE "Playoffs" = 'Conference Finals' | wikisql |
CREATE TABLE d_icd_diagnoses (
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
)... | what is the average number of monthly diagnosed cases of spleen disruption-clos this year? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'spleen disruption-clos') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIM... | mimic_iii |
CREATE TABLE table_14333 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which nation has a gold less than 2 and a bronze less than 5? | SELECT "Nation" FROM table_14333 WHERE "Gold" < '2' AND "Bronze" < '5' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | how many hours has passed since the first time patient 95892 got a base excess lab test in their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admiss... | mimic_iii |
CREATE TABLE Ref_locations (
location_code VARCHAR,
location_name VARCHAR
) | What is the location code for the country 'Canada'? | SELECT location_code FROM Ref_locations WHERE location_name = "Canada" | sql_create_context |
CREATE TABLE table_12629 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Notes" text
) | What was the result against opponent Amanda Lucas? | SELECT "Result" FROM table_12629 WHERE "Opponent" = 'amanda lucas' | 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,... | what is admission location and discharge location of subject name marilyn norvell? | SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Marilyn Norvell" | mimicsql_data |
CREATE TABLE table_79242 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
) | Which gymnast had a b score of 8.95 and an a score less than 6.9 | SELECT "Gymnast" FROM table_79242 WHERE "B Score" = '8.95' AND "A Score" < '6.9' | wikisql |
CREATE TABLE table_56016 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Away team was hawthorn, what's the Home team? | SELECT "Home team" FROM table_56016 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_72 (
ofsted_number INTEGER,
dcsf_number VARCHAR,
intake VARCHAR,
type VARCHAR,
faith VARCHAR
) | What is the lowest Ofsted number for a primary with a CE faith, intake of 30 and a DCSF number lower than 3349? | SELECT MIN(ofsted_number) FROM table_name_72 WHERE type = "primary" AND faith = "ce" AND intake = 30 AND dcsf_number < 3349 | sql_create_context |
CREATE TABLE table_2941848_10 (
network VARCHAR,
year VARCHAR
) | How many networks are listed when the year is 2008? | SELECT COUNT(network) FROM table_2941848_10 WHERE year = 2008 | sql_create_context |
CREATE TABLE table_66348 (
"Model" text,
"Year Introduced" real,
"Number of CPUs" text,
"Performance (MIPS)" text,
"Memory (GB)" text
) | Which Memory (GB) has a Number of CPUs of 1 6? | SELECT "Memory (GB)" FROM table_66348 WHERE "Number of CPUs" = '1–6' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.