context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_75836 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest Bronze with a Nation of egypt (egy) and with a Gold that is smaller than 2? | SELECT MIN("Bronze") FROM table_75836 WHERE "Nation" = 'egypt (egy)' AND "Gold" < '2' | wikisql |
CREATE TABLE table_22426 (
"Candidate" text,
"Office running for" text,
"Running with (in team)" text,
"Won or lost" text,
"Votes given" text
) | Name the officing running for for carol marsh | SELECT "Office running for" FROM table_22426 WHERE "Candidate" = 'Carol Marsh' | wikisql |
CREATE TABLE table_77303 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Who was the opponent on October 14, 1984? | SELECT "Opponent" FROM table_77303 WHERE "Date" = 'october 14, 1984' | wikisql |
CREATE TABLE table_47546 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | Who was the opponent for a game over 31 and a date over 30? | SELECT "Opponent" FROM table_47546 WHERE "Game" > '31' AND "Date" > '30' | wikisql |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank i... | show me all the flights from PHILADELPHIA to NEWARK | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'N... | atis |
CREATE TABLE table_9588 (
"School" text,
"Base" text,
"Bask" text,
"Golf" text,
"Soccer" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text
) | Which school has yes for soccer, tennis and indoor track. | SELECT "School" FROM table_9588 WHERE "Soccer" = 'yes' AND "Tennis" = 'yes' AND "Indoor track" = 'yes' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | what is five year survival rate of patients diagnosed with pleural effusion? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE classification (
id int,
msid int,
gid int
)
CREATE TABLE directed_by (
id int,
msid int,
did int
)
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year in... | Find all movies about Persians | SELECT movie.title FROM keyword, movie, tags WHERE keyword.keyword = 'Persians' AND tags.kid = keyword.id AND tags.msid = movie.mid | imdb |
CREATE TABLE table_1884 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
) | How many different reasons are there for the change in Connecticut (3)? | SELECT COUNT("Reason for change") FROM table_1884 WHERE "State (class)" = 'Connecticut (3)' | wikisql |
CREATE TABLE table_name_93 (
date VARCHAR,
tie_no VARCHAR
) | On what date was Tie #13 played? | SELECT date FROM table_name_93 WHERE tie_no = "13" | sql_create_context |
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varchar(4),
alid bigint,
airline varchar(4),
codeshare text
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
country... | A bar chart for finding the number of the country of the airlines whose name starts with 'Orbit', show by the the number of country in desc. | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) DESC | nvbench |
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 admitted to emergency had radical neck dissection (unilateral)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Radical neck dissection, unilateral" | mimicsql_data |
CREATE TABLE table_52224 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | I want the average events for top 10 less than 4 | SELECT AVG("Events") FROM table_52224 WHERE "Top-10" < '4' | wikisql |
CREATE TABLE table_name_64 (
away_team VARCHAR,
venue VARCHAR
) | Who was the opposing team at the match played at the Arden Street Oval? | SELECT away_team FROM table_name_64 WHERE venue = "arden street oval" | 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
)
... | how many patients whose primary disease is hyperglycemia and drug name is albuterol 0.083% neb soln? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND prescriptions.drug = "Albuterol 0.083% Neb Soln" | 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... | what is the number of patients whose ethnicity is white - russian and drug name is metoprolol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Metoprolol" | mimicsql_data |
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... | 咱们医院的在00年4月27日到2000年12月12日内病人65980310的所有检验结果指标记录的检测人为韩乐音的检验指标流水号是多少号? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Users with most unique badges. Most decorated users | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS rank, UserId AS "user_link", COUNT(DISTINCT Name) AS badges FROM Badges WHERE TagBased != 0 GROUP BY UserId ORDER BY Badges DESC LIMIT 500 | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 哪些是俞以轩患者的检验报告单对应的检验结果指标均正常以及列出检验报告单号是多少? | SELECT jybgb.BGDH 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 NOT ... | css |
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 demographic (... | What is the admission location and discharge location of Thomas Jeanbaptiste? | SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Thomas Jeanbaptiste" | mimicsql_data |
CREATE TABLE table_59409 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
) | Who won Silver in 2000? | SELECT "Silver" FROM table_59409 WHERE "Year" = '2000' | wikisql |
CREATE TABLE table_75600 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | Which Points is the lowest one that has a Year larger than 1974, and a Rank of 15th? | SELECT MIN("Points") FROM table_75600 WHERE "Year" > '1974' AND "Rank" = '15th' | wikisql |
CREATE TABLE table_33383 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"2012 club" text
) | What is the Weight for the Name Billy Miller Category:Articles with hcards? | SELECT "Weight" FROM table_33383 WHERE "Name" = 'billy miller category:articles with hcards' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | calculate the number of patients who had stayed in ward 27 since 2103. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 27 AND STRFTIME('%y', transfers.intime) >= '2103') | mimic_iii |
CREATE TABLE table_name_31 (
date VARCHAR,
record VARCHAR
) | When was the record 17-17? | SELECT date FROM table_name_31 WHERE record = "17-17" | sql_create_context |
CREATE TABLE table_51906 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | Name the sum of Long for yards less than 197 and players of matt nagy | SELECT SUM("Long") FROM table_51906 WHERE "Yards" < '197' AND "Player" = 'matt nagy' | wikisql |
CREATE TABLE table_42205 (
"Name" text,
"Innings" real,
"Runs Scored" real,
"Balls Faced" real,
"Average" real,
"S.R." real
) | What is the number of averages having a balls faced over 297 and more than 7 innings? | SELECT COUNT("Average") FROM table_42205 WHERE "Balls Faced" > '297' AND "Innings" > '7' | wikisql |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_as... | Return the average price for each product type by a bar chart, and rank bars from low to high order. | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code | nvbench |
CREATE TABLE table_76086 (
"Code" text,
"District" text,
"Headquarters" text,
"Population (2011)" real,
"Area (km\u00b2)" real,
"Density (/km\u00b2)" real,
"Official website" text
) | What is the sum of the area values for districts having density over 462 and websites of http://krishna.nic.in/? | SELECT SUM("Area (km\u00b2)") FROM table_76086 WHERE "Density (/km\u00b2)" > '462' AND "Official website" = 'http://krishna.nic.in/' | wikisql |
CREATE TABLE film_category (
film_id SMALLINT UNSIGNED,
category_id TINYINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE address (
address_id SMALLINT UNSIGNED,
address VARCHAR(50),
address2 VARCHAR(50),
district VARCHAR(20),
city_id SMALLINT UNSIGNED,
postal_code VARCHAR(10),
... | What are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?, I want to display by the Y in descending. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC | nvbench |
CREATE TABLE table_61237 (
"Position" text,
"Driver" text,
"Entrant" text,
"Class" text,
"Laps" real
) | Can you tell me the Entrant that has the Laps of 17? | SELECT "Entrant" FROM table_61237 WHERE "Laps" = '17' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | give me the number of patients whose year of birth is less than 1837 and drug name is piperacillin-tazobactam na? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1837" AND prescriptions.drug = "Piperacillin-Tazobactam Na" | mimicsql_data |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
res... | what is the fare code Y and what is the fare code H | SELECT DISTINCT fare_airline, fare_basis_code, fare_id, from_airport, one_direction_cost, restriction_code, round_trip_cost, round_trip_required, to_airport FROM fare WHERE fare_basis_code = 'H' OR fare_basis_code = 'Y' | atis |
CREATE TABLE Player_Attributes (
id INTEGER,
player_fifa_api_id INTEGER,
player_api_id INTEGER,
date TEXT,
overall_rating INTEGER,
potential INTEGER,
preferred_foot TEXT,
attacking_work_rate TEXT,
defensive_work_rate TEXT,
crossing INTEGER,
finishing INTEGER,
heading_accu... | Find the top five players in terms of potential, bin the birthday into YEAR interval, and count the birthday grouping by player's name. | SELECT birthday, COUNT(birthday) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id GROUP BY player_name ORDER BY potential DESC LIMIT 5 | nvbench |
CREATE TABLE table_17863 (
"Constituency" text,
"Electorate" real,
"s Spoilt vote" real,
"Total poll (%)" text,
"For (%)" text,
"Against (%)" text
) | How many for percentages are there when the against percentage is 35,782 (69)? | SELECT "For (%)" FROM table_17863 WHERE "Against (%)" = '35,782 (69)' | wikisql |
CREATE TABLE table_name_64 (
attendance VARCHAR,
record VARCHAR
) | What was the attendance at the ballpark during the game where the Blue Jays had a record of 26-35 during the 1996 season? | SELECT COUNT(attendance) FROM table_name_64 WHERE record = "26-35" | sql_create_context |
CREATE TABLE table_name_3 (
result VARCHAR,
opponent VARCHAR
) | Which Result has an Opponent of washington redskins? | SELECT result FROM table_name_3 WHERE opponent = "washington redskins" | sql_create_context |
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value_billion text
)
CREATE TABLE building... | Return a bar chart showing the number of companies in each building, show in descending by the y-axis please. | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY COUNT(T2.name) DESC | nvbench |
CREATE TABLE table_35229 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Location/attendance" text,
"Record" text
) | What was the average date with a record of 30-31-9 in a game over 70? | SELECT AVG("Date") FROM table_35229 WHERE "Record" = '30-31-9' AND "Game" > '70' | wikisql |
CREATE TABLE table_9814 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Place is 'T5', and when Player is 'George Archer'? | SELECT "Score" FROM table_9814 WHERE "Place" = 't5' AND "Player" = 'george archer' | wikisql |
CREATE TABLE table_60887 (
"Team" text,
"Club home city" text,
"2006\u201307 Season" text,
"Stadium" text,
"Stadium capacity" text
) | What is 2006-07 Season, when Stadium Capacity is '0 2,500'? | SELECT "2006\u201307 Season" FROM table_60887 WHERE "Stadium capacity" = '0 2,500' | wikisql |
CREATE TABLE table_train_254 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"hgba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"hypertension" bool,
"fasting_glucose... | any diabetic subject with a hgba1c level of < 7 % or > 11 % | SELECT * FROM table_train_254 WHERE diabetes = 1 AND (hgba1c < 7 OR hgba1c > 11) | criteria2sql |
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
)
... | How many patients are admitted as new born and discharged to disc-tran cancer/chldrn h? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE table_name_68 (
championship INTEGER,
league_cup VARCHAR,
fa_cup VARCHAR
) | Which Championship has a League Cup larger than 0, and a FA Cup larger than 0? | SELECT MIN(championship) FROM table_name_68 WHERE league_cup > 0 AND fa_cup > 0 | sql_create_context |
CREATE TABLE table_42285 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was 2009, when 2012 was A, when 2003 was A, and then the Tournament was the Madrid Masters? | SELECT "2009" FROM table_42285 WHERE "2012" = 'a' AND "2003" = 'a' AND "Tournament" = 'madrid masters' | wikisql |
CREATE TABLE table_56652 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team score when South Melbourne was the away team? | SELECT "Home team score" FROM table_56652 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Best commenters by average comment score. Users ranked by average comment score. | SELECT UserId AS "user_link", SUM(Score) AS Score, COUNT(Score) AS Comments, ROUND(AVG(CAST(Score AS FLOAT)), 3) AS AvgScore, ROUND(STDEV(Score), 3) AS StdDev, MAX(Score) AS TopScore, ROUND((SUM(Score) - MAX(Score)) / (COUNT(Score) - 1.0), 3) AS AvgScoreWOTop FROM Comments INNER JOIN Users ON Users.Id = UserId WHERE Us... | sede |
CREATE TABLE table_1638437_2 (
traditional VARCHAR,
population VARCHAR
) | Name the traditional for population 74779 | SELECT traditional FROM table_1638437_2 WHERE population = 74779 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | count the number of patients whose diagnoses icd9 code is 49320 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "49320" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_31941 (
"Year" real,
"Host" text,
"Winners" text,
"Runners-up" text,
"Third Place" text,
"Fourth Place" text
) | Tell me fourth place for year of 2010 | SELECT "Fourth Place" FROM table_31941 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_name_52 (
time VARCHAR,
round VARCHAR,
record VARCHAR
) | What is the time of the match with 3 rounds and a 9-3 record? | SELECT time FROM table_name_52 WHERE round = 3 AND record = "9-3" | sql_create_context |
CREATE TABLE table_10114 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Which game site has a Week bigger than 13, and a Result of l 20 0? | SELECT "Game site" FROM table_10114 WHERE "Week" > '13' AND "Result" = 'l 20–0' | wikisql |
CREATE TABLE table_14975 (
"Rank" text,
"Event" text,
"Place" text,
"Name" text,
"Prize" text
) | Who won the event with a top prize of $2,434,061? | SELECT "Name" FROM table_14975 WHERE "Prize" = '$2,434,061' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varc... | show me the airlines that fly between TORONTO and DENVER | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... | atis |
CREATE TABLE table_name_11 (
year INTEGER,
event VARCHAR,
venue VARCHAR
) | What is the earliest year that a team event was included at Vilamoura, Portugal? | SELECT MIN(year) FROM table_name_11 WHERE event = "team" AND venue = "vilamoura, portugal" | sql_create_context |
CREATE TABLE table_76871 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
) | What is Points Against, when Drawn is '2', and when Points Of is '32'? | SELECT "Points against" FROM table_76871 WHERE "Drawn" = '2' AND "Points" = '32' | wikisql |
CREATE TABLE customer_addresses (
customer_id VARCHAR,
address_id VARCHAR
)
CREATE TABLE customers (
customer_id VARCHAR
)
CREATE TABLE addresses (
city VARCHAR,
address_id VARCHAR
) | Which city has the most customers living in? | SELECT t3.city 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 GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 92929768721的出院日期在医疗就诊里是几号? | SELECT gwyjzb.OUT_HOSP_DATE FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '92929768721' UNION SELECT fgwyjzb.OUT_HOSP_DATE FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '92929768721' | css |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | this year, what are the top three most frequently prescribed drugs to patients during the same month after they are diagnosed with mitr/aortic mult involv? | 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_name_66 (
tournament VARCHAR
) | What is the Tournament, when 2012 is 3R? | SELECT tournament FROM table_name_66 WHERE 2012 = "3r" | sql_create_context |
CREATE TABLE table_203_240 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
) | what team did the phillies play after august 7 ? | SELECT "opponent" FROM table_203_240 WHERE id = (SELECT id FROM table_203_240 WHERE "date" = 'august 7') + 1 | squall |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | what was the organism found in patient 3125's last swab test in 12/this year? | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125) AND microbiologyevents.spec_type_desc = 'swab' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of ye... | mimic_iii |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | What are the classes Prof. Gerald Carr teaches Fall 2007 ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Gerald Carr%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE table_name_58 (
games VARCHAR,
wins VARCHAR,
losses VARCHAR,
club VARCHAR
) | What is the total number of Games, when Losses is greater than 6, when Club is 'Club Sportif Sfaxien', and when Wins is less than 3? | SELECT COUNT(games) FROM table_name_58 WHERE losses > 6 AND club = "club sportif sfaxien" AND wins < 3 | sql_create_context |
CREATE TABLE table_68663 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | Name the most laps for corvette racing in 2004 | SELECT MAX("Laps") FROM table_68663 WHERE "Team" = 'corvette racing' AND "Year" = '2004' | wikisql |
CREATE TABLE table_19417 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | Name the school year for class a for sterling city and little elm | SELECT "School Year" FROM table_19417 WHERE "Class A" = 'Sterling City' AND "Class AA" = 'Little Elm' | wikisql |
CREATE TABLE table_10053 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What country is player jay haas, who is in t10 place, from? | SELECT "Country" FROM table_10053 WHERE "Place" = 't10' AND "Player" = 'jay haas' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | how many times has patient 030-42006 been administered d5ns ivf on the last intensive care unit visit? | 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 = '030-42006') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.uni... | eicu |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date ... | How many customers do not have an account? | SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM accounts) | spider |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | Return the countries of the mountains that have a height larger than 5000. | SELECT country FROM mountain WHERE height > 5000 | spider |
CREATE TABLE table_70243 (
"Strong's #" text,
"Hebrew word" text,
"Strong's Transliteration" text,
"Strong's Words Compounded" text,
"English Spelling" text
) | What is the Words with a Strong's # of 5418? | SELECT "Strong's Words Compounded" FROM table_70243 WHERE "Strong's #" = '5418' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Ln... | Show all the buildings along with the number of faculty members the buildings have. Show the proportion. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | just count the number of patients who had been prescribed neo*po*mct oil in the last year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'neo*po*mct oil' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | mimic_iii |
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Video_Games (
Ga... | Bar chart x axis sportname y axis the total number, list in desc by the Y. | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_37 (
date VARCHAR,
city VARCHAR
) | What is the Date of the Event in Panama City? | SELECT date FROM table_name_37 WHERE city = "panama city" | sql_create_context |
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
regional_population number,
gdp number
)
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar number,
apr number,
jun number,
jul number,
aug number,
sep number,
... | Find the number of matches in different competitions. | SELECT COUNT(*), competition FROM match GROUP BY competition | spider |
CREATE TABLE table_12198 (
"Preferences" text,
"1. vs 2." real,
"1. vs 3." real,
"2. vs 3." real,
"Total" real
) | What is the 1 vs 2 when 2 vs 3 is less than 15 and total is less than 30? | SELECT COUNT("1. vs 2.") FROM table_12198 WHERE "2. vs 3." < '15' AND "Total" < '30' | wikisql |
CREATE TABLE table_2115 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real
) | What location contains a school that has an enrollment of 2686? | SELECT "Location" FROM table_2115 WHERE "Enrollment" = '2686' | wikisql |
CREATE TABLE table_name_53 (
team VARCHAR,
high_rebounds VARCHAR
) | What is the Team when antonio davis (8) had the high rebounds? | SELECT team FROM table_name_53 WHERE high_rebounds = "antonio davis (8)" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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 time
)
CREATE TABLE microb... | what were the three most frequent lab tests those patients had within 2 months after having had a inject ca chemother nec procedure until 2103? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE table_12206918_2 (
date VARCHAR,
opponent VARCHAR
) | How many times was pernell whitaker an opponent? | SELECT COUNT(date) FROM table_12206918_2 WHERE opponent = "Pernell Whitaker" | sql_create_context |
CREATE TABLE table_name_51 (
liberal_ticket VARCHAR,
free_libertarian_ticket VARCHAR
) | Robert S. Flanzer was the Free Libertarian ticket with who listed as the Liberal Ticket? | SELECT liberal_ticket FROM table_name_51 WHERE free_libertarian_ticket = "robert s. flanzer" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is primary disease and procedure short title of subject id 17570? | SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "17570" | mimicsql_data |
CREATE TABLE table_25085059_3 (
pick__number VARCHAR,
position VARCHAR
) | What draft pick number was the player with the position DL? | SELECT pick__number FROM table_25085059_3 WHERE position = "DL" | sql_create_context |
CREATE TABLE table_27308 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the party for pennsylvania 10 | SELECT "Party" FROM table_27308 WHERE "District" = 'Pennsylvania 10' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 能知道医疗机构3414056在10年04月1日到19年7月1日内入院诊断疾病结果与出院诊断疾病结果不同的次数吗 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3414056' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-04-01' AND '2019-07-01' AND gwyjzb.IN_DIAG_DIS_CD <> gwyjzb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3414056' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-04-01' AND '2019-07-01'... | css |
CREATE TABLE table_14058433_3 (
points VARCHAR,
tries_for VARCHAR
) | How many points were made when the tries for was 83? | SELECT points FROM table_14058433_3 WHERE tries_for = "83" | sql_create_context |
CREATE TABLE table_71192 (
"Player" text,
"Position" text,
"Previous Club" text,
"Apps" real,
"Tries" real,
"Goals" text,
"Points" real
) | What Full Back Player has 0 Apps? | SELECT "Player" FROM table_71192 WHERE "Position" = 'full back' AND "Apps" = '0' | wikisql |
CREATE TABLE table_14755 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
) | Who is the director of the film in Italian? | SELECT "Director" FROM table_14755 WHERE "Language" = 'italian' | wikisql |
CREATE TABLE table_204_828 (
id number,
"whitworth size (in)" number,
"core diameter (in)" number,
"threads per inch" number,
"pitch (in)" number,
"tapping drill size" text
) | what is the core diameter of the last whitworth thread size ? | SELECT "core diameter (in)" FROM table_204_828 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_34041 (
"Game #" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | Visitor of calgary has what record? | SELECT "Record" FROM table_34041 WHERE "Visitor" = 'calgary' | wikisql |
CREATE TABLE table_41180 (
"Team" text,
"Match" text,
"Points" text,
"Draw" text,
"Lost" text
) | What is the Draw for the team of tramwajarz d ? | SELECT "Draw" FROM table_41180 WHERE "Team" = 'tramwajarz łódź' | wikisql |
CREATE TABLE table_name_66 (
surface VARCHAR,
score_in_the_final VARCHAR,
outcome VARCHAR,
partner VARCHAR
) | On what surface was Ivan Lendl a partner with a runner-up outcome and final score of 2 6, 6 7? | SELECT surface FROM table_name_66 WHERE outcome = "runner-up" AND partner = "ivan lendl" AND score_in_the_final = "2–6, 6–7" | sql_create_context |
CREATE TABLE table_18600760_4 (
land___sqmi__ VARCHAR,
geo_id VARCHAR
) | Name the land where geo id is 3807717980 | SELECT land___sqmi__ FROM table_18600760_4 WHERE geo_id = 3807717980 | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 从0二年十一月十二日到一二年八月九日,患者戚鸿振的医保个人账户总共被刷了多少金额 | SELECT SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '戚鸿振' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-11-12' AND '2012-08-09' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE table_13495 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | what is the township when the land (sqmi) is more than 36.112, the geo id is higher than 3801985060 and the latitude is 46.062384? | SELECT "Township" FROM table_13495 WHERE "Land ( sqmi )" > '36.112' AND "GEO ID" > '3801985060' AND "Latitude" = '46.062384' | wikisql |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DAT... | On which days more than one revisions were made on catalogs, bin the date into weekday interval and count them to show the trend, and sort by the date_of_latest_revision in descending. | SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs ORDER BY date_of_latest_revision DESC | nvbench |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Po... | Average upvotes over time for a post. | SELECT SUM('count') AS "upvotes", COUNT(*) AS "months", AVG('count') AS "upvotes/month" FROM (SELECT TIME_TO_STR(CreationDate, '%Y') AS "year", TIME_TO_STR(CreationDate, '%m') AS "month", COUNT(*) AS "count" FROM Votes WHERE PostId = '##PostId:int##' AND VoteTypeId = 2 GROUP BY TIME_TO_STR(CreationDate, '%m'), TIME_TO_... | sede |
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... | 从2000年9月28日到2007年1月25日这段时间内患者奚霞辉所有检验结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_name_98 (
episodes VARCHAR,
first_airdate VARCHAR
) | How many episodes were in the season that first aired on September 22, 1989? | SELECT episodes FROM table_name_98 WHERE first_airdate = "september 22, 1989" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.