context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_da... | i'd like a flight leaving ATLANTA 8 7 and arriving in DENVER colorado 8 7 leaving in the afternoon | 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 = 7 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = ... | atis |
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... | From whom I got downvotes. | SELECT u.UpVotes + u.DownVotes FROM Users AS u WHERE u.Id = '566193' | sede |
CREATE TABLE table_name_39 (
round VARCHAR,
opponent VARCHAR
) | Which round has an opponent of Freiburg? | SELECT round FROM table_name_39 WHERE opponent = "freiburg" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 编码为18795530病人在医院0561875入院诊断疾病名称不包含分裂的医疗就诊记录号码是多少? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '18795530' AND MED_SER_ORG_NO = '0561875' AND NOT IN_DIAG_DIS_NM LIKE '%分裂%' | css |
CREATE TABLE table_69876 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the final score for the game on May 4? | SELECT "Score" FROM table_69876 WHERE "Date" = 'may 4' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
c... | what is the price for orthopedics consultation? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'orthopedics consultation') | eicu |
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... | Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary. | SELECT EMAIL, SALARY FROM employees | nvbench |
CREATE TABLE table_203_191 (
id number,
"year" number,
"group" text,
"award" text,
"result" text,
"notes" text
) | what was the only award in 1994 ? | SELECT "award" FROM table_203_191 WHERE "year" = 1994 | squall |
CREATE TABLE table_78837 (
"Class" text,
"Number(s)" text,
"Quantity" real,
"Year(s) of Manufacture" text,
"Type" text
) | Which Year(s) of Manufacture has a Quantity larger than 60, and a Number(s) of 7001 7165? | SELECT "Year(s) of Manufacture" FROM table_78837 WHERE "Quantity" > '60' AND "Number(s)" = '7001–7165' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | Display all comments of a given user. | SELECT Comments.Text FROM Comments WHERE Comments.UserId = @UserId | sede |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | Return a bar chart on how many students participated in tryouts for each college by descennding count? | SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
) | Show the name, location, open year for all tracks with a seating higher than the average. | SELECT name, location, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track) | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is gender and admission time of subject id 84129? | SELECT demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "84129" | mimicsql_data |
CREATE TABLE table_22720 (
"interval name" text,
"size (steps)" real,
"size (cents)" real,
"just ratio" text,
"just (cents)" text,
"error" text,
"audio" text
) | If the just cents is 701.96, what is the interval name? | SELECT "interval name" FROM table_22720 WHERE "just (cents)" = '701.96' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 94947569717住院就诊中,出院科室的代码和名称分别是什么 | SELECT wdmzjzjlb.CYKSDM, wdmzjzjlb.CYKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '94947569717' UNION SELECT bdmzjzjlb.CYKSDM, bdmzjzjlb.CYKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '94947569717' | css |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWit... | SELECT TOP 100 DisplayName FROM Users WHERE Location='Russia' and Reputation=(select max(Reputation. | SELECT DisplayName, LastAccessDate, WebsiteUrl, AboutMe FROM Users WHERE Location = 'Russia' ORDER BY Reputation LIMIT 100 | sede |
CREATE TABLE table_36513 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What score was on July 25? | SELECT "Score" FROM table_36513 WHERE "Date" = 'july 25' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 那个11103457号的病患在看病过程中被开出的药品都少于9690.79元的医疗就诊编号是多少? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '11103457' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9690.79) | css |
CREATE TABLE Flight (
departure_date VARCHAR,
arrival_date VARCHAR,
origin VARCHAR,
destination VARCHAR
) | Show me the departure date and arrival date for all flights from Los Angeles to Honolulu. | SELECT departure_date, arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | 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, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, order in desc by the y axis. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE medication (
code number,
name text,
brand text,
description text
)
CREATE TABLE on_call (
nurse number,
blockfloor number,
blockcode number,
oncallstart time,
oncallend time
)
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffil... | What are the distinct names of nurses on call? | SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.employeeid = T2.nurse | spider |
CREATE TABLE table_11781 (
"Number" text,
"Type" text,
"Seating" text,
"Diagram no" real,
"Lot no." real,
"Weight" text
) | Which vehicle has a Diagram of 516 or smaller, and a driving motor brake second (dmbs) type. | SELECT "Seating" FROM table_11781 WHERE "Diagram no" > '516' AND "Type" = 'driving motor brake second (dmbs)' | wikisql |
CREATE TABLE table_30121075_1 (
area__acres__ VARCHAR,
poor_law_union VARCHAR,
townland VARCHAR
) | What is the area when the poor law union is skibbereen and the townland is knockmore? | SELECT area__acres__ FROM table_30121075_1 WHERE poor_law_union = "Skibbereen" AND townland = "Knockmore" | sql_create_context |
CREATE TABLE table_name_64 (
Id VARCHAR
) | What's the 2005 result when 2001 is sf? | SELECT 2005 FROM table_name_64 WHERE 2001 = "sf" | sql_create_context |
CREATE TABLE table_63213 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | How many cores does the processor released in April 2012 with a price of $393 and part number av8063801117503 have? | SELECT "Cores" FROM table_63213 WHERE "Release date" = 'april 2012' AND "Release price ( USD )" = '$393' AND "Part number(s)" = 'av8063801117503' | wikisql |
CREATE TABLE table_16243 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
) | What is the highest no. in season? | SELECT MAX("No. in season") FROM table_16243 | wikisql |
CREATE TABLE table_name_87 (
total INTEGER,
bronze VARCHAR,
silver VARCHAR,
nation VARCHAR
) | What is the smallest number of total medals for Georgia with 0 silver and 1 bronze? | SELECT MIN(total) FROM table_name_87 WHERE silver > 0 AND nation = "georgia" AND bronze < 1 | sql_create_context |
CREATE TABLE table_10359 (
"Catalogue Number" text,
"Artist" text,
"Tracks" text,
"Type" text,
"Year" real
) | What is the type of disc by Logistics after 2004? | SELECT "Type" FROM table_10359 WHERE "Year" > '2004' AND "Artist" = 'logistics' | wikisql |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Behavior_Incident (
i... | Give me the comparison about the sum of monthly_rental over the date_address_to bin date_address_to by weekday. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_23105 (
"Season #" real,
"Episode #" real,
"Title" text,
"Director(s)" text,
"Writer(s)" text,
"Original Air Date" text
) | What was the highest season number? | SELECT MAX("Season #") FROM table_23105 | wikisql |
CREATE TABLE table_19242 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
) | Who played Richmond at home? | SELECT "Home team" FROM table_19242 WHERE "Away team" = 'Richmond' | wikisql |
CREATE TABLE table_178399_1 (
parish__prestegjeld_ VARCHAR,
year_built VARCHAR
) | Name the parish for 1908 | SELECT parish__prestegjeld_ FROM table_178399_1 WHERE year_built = 1908 | sql_create_context |
CREATE TABLE table_24280 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which player plays for the Winnipeg Blue Bombers? | SELECT "Player" FROM table_24280 WHERE "CFL Team" = 'Winnipeg Blue Bombers' | wikisql |
CREATE TABLE table_16039 (
"Character" text,
"1954 Broadway" text,
"1955 broadcast" text,
"1960 broadcast" text,
"1979 Broadway" text,
"1990 Broadway" text,
"1991 Broadway" text,
"1998 Broadway" text,
"1999 Broadway" text
) | Who played in the 1991 Broadway before Barbara McCulloh played the part in the 1999 Broadway? | SELECT "1991 Broadway" FROM table_16039 WHERE "1999 Broadway" = 'Barbara McCulloh' | wikisql |
CREATE TABLE table_name_67 (
years VARCHAR,
decile VARCHAR,
name VARCHAR
) | Name the years when decile was less than 7 for waitoa school | SELECT years FROM table_name_67 WHERE decile < 7 AND name = "waitoa school" | sql_create_context |
CREATE TABLE table_name_57 (
home_team VARCHAR,
away_team VARCHAR
) | What home team played Fitzroy? | SELECT home_team FROM table_name_57 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_46336 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Record" text
) | Who made the decision when detroit was the home team and boston was the visitor? | SELECT "Decision" FROM table_46336 WHERE "Home" = 'detroit' AND "Visitor" = 'boston' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | whats the unabbreviated version of tox ef hydrocarb gas nec. | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tox ef hydrocarb gas nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tox ef hydrocarb gas nec' | mimic_iii |
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,
... | 患者26072107在编号为2159880的这个医院的就诊记录中,开出的单价最贵的药是什么?把药品的编码和名称及其单价分别列出来 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '26072107' AND gwyjzb.MED_SER_ORG_NO = '2159880' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '26072107' AND fg... | css |
CREATE TABLE table_45653 (
"Class" text,
"Team" text,
"Driver" text,
"Chassis \u2013 Engine" text,
"Laps" real
) | How many Laps did Team Primagaz Competition have? | SELECT "Laps" FROM table_45653 WHERE "Team" = 'primagaz competition' | wikisql |
CREATE TABLE table_47852 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | HOW MANY POINTS DOES ALEX SPERAFICO HAVE WITH A GRID LARGER THAN 17? | SELECT MIN("Points") FROM table_47852 WHERE "Driver" = 'alex sperafico' AND "Grid" > '17' | wikisql |
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... | 杨纳兰这名患者都有过什么住院诊断 | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zy... | css |
CREATE TABLE table_1295 (
"Country" text,
"Uranium required 2006-08" text,
"% of world demand" text,
"Indigenous mining production 2006" text,
"Deficit (-surplus)" text
) | How much uranium did Russia use in 2006 to 2008? | SELECT "Uranium required 2006-08" FROM table_1295 WHERE "Country" = 'Russia' | wikisql |
CREATE TABLE scientists (
Name VARCHAR,
ssn VARCHAR,
scientist VARCHAR
)
CREATE TABLE AssignedTo (
Name VARCHAR,
ssn VARCHAR,
scientist VARCHAR
) | Find the name of scientists who are not assigned to any project. | SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) | sql_create_context |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | For all storms with at least 1 death, compare the number of deaths by dates active with a bar graph, and could you rank by the y-axis in asc? | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths | nvbench |
CREATE TABLE table_name_44 (
total INTEGER,
rank VARCHAR,
bronze VARCHAR
) | How much Total has a Rank of 5, and a Bronze larger than 3? | SELECT SUM(total) FROM table_name_44 WHERE rank = "5" AND bronze > 3 | sql_create_context |
CREATE TABLE table_name_33 (
barrel_twist VARCHAR,
stock VARCHAR,
hand_guards VARCHAR
) | Which Barrel twist has a Stock of canadian 3rd generation and a Hand guards of short ribbed? | SELECT barrel_twist FROM table_name_33 WHERE stock = "canadian 3rd generation" AND hand_guards = "short ribbed" | 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,
... | 想知道医疗就诊33468513439的要住多久院 | SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '33468513439' | css |
CREATE TABLE table_75957 (
"Tournament" text,
"2006" text,
"2009" text,
"2012" text,
"2013" text
) | What is the Tournament when the 2013 is 2r, and a 2006 is 1r? | SELECT "Tournament" FROM table_75957 WHERE "2013" = '2r' AND "2006" = '1r' | 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,
... | what is the number of patients with s/p fall primary disease who had cerebrospinal fluid lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_204_4 (
id number,
"date" text,
"race" text,
"competition" text,
"rider" text,
"country" text,
"location" text
) | what are the total amount of times italy appears on this chart ? | SELECT COUNT(*) FROM table_204_4 WHERE "country" = 'italy' | squall |
CREATE TABLE table_name_25 (
total VARCHAR,
gold VARCHAR,
rank VARCHAR
) | Name the number of total for 3 gold and rank less than 3 | SELECT COUNT(total) FROM table_name_25 WHERE gold = 3 AND rank < 3 | sql_create_context |
CREATE TABLE table_10747 (
"Date" text,
"Name" text,
"Flag" text,
"Tonnage (GRT)" real,
"Sunk by" text
) | What is the flag for Terkoeli? | SELECT "Flag" FROM table_10747 WHERE "Name" = 'terkoeli' | wikisql |
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
dr... | Who are the players from Indonesia? | SELECT T2.player FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T1.country_name = "Indonesia" | spider |
CREATE TABLE table_66889 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average silver for a rank less than 8, were there were no more than 4 bronze and 12 in total? | SELECT AVG("Silver") FROM table_66889 WHERE "Rank" < '8' AND "Total" = '12' AND "Bronze" < '4' | wikisql |
CREATE TABLE table_19897896_7 (
season VARCHAR,
position VARCHAR
) | in which season the position was center | SELECT season FROM table_19897896_7 WHERE position = "Center" | sql_create_context |
CREATE TABLE table_name_44 (
winner_nominee_s_ VARCHAR,
result VARCHAR,
film VARCHAR
) | Who is nominated for the film Rugrats Go Wild? | SELECT winner_nominee_s_ FROM table_name_44 WHERE result = "nominated" AND film = "rugrats go wild" | sql_create_context |
CREATE TABLE table_203_221 (
id number,
"name" text,
"nationality" text,
"matches played" number,
"goals scored" number,
"notes" text
) | who has scored more goals than any other melbourne player ? | SELECT "name" FROM table_203_221 ORDER BY "goals scored" DESC LIMIT 1 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many white patients were diagnosed under icd9 code 7660? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "7660" | mimicsql_data |
CREATE TABLE table_36568 (
"Outcome" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which tournament included an opponent of Marinko Matosevic? | SELECT "Tournament" FROM table_36568 WHERE "Opponent" = 'marinko matosevic' | wikisql |
CREATE TABLE table_name_87 (
steals VARCHAR,
rebounds VARCHAR
) | Who was the leader in Steals when Travis Watson (9) was the leader in Rebounds? | SELECT steals FROM table_name_87 WHERE rebounds = "travis watson (9)" | 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 were admitted before the year 2121 whose lab test category was hematology ? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2121" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | Show me some Design Science Colloquium courses with 8 credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Design Science Colloquium%' OR name LIKE '%Design Science Colloquium%') AND credits = 8 | advising |
CREATE TABLE table_25479607_3 (
fixed_charge___rs__kwh_ VARCHAR,
tariff___rs__kwh_ VARCHAR
) | What is the fixed charge for the user who had a tariff of 11.30? | SELECT fixed_charge___rs__kwh_ FROM table_25479607_3 WHERE tariff___rs__kwh_ = "11.30" | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
location VARCHAR,
year VARCHAR
) | Tell me the date for warsaw 1929 | SELECT date FROM table_name_50 WHERE location = "warsaw" AND year = 1929 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | has ever been the sao2 of patient 002-2584 been ever greater than 94.0 since 12/02/2102? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-2584')) AND vitalperiodic.sao2 > 94.0 AND NOT vitalperiodic.sao2... | eicu |
CREATE TABLE table_name_70 (
height__m_ INTEGER,
year_built VARCHAR,
name VARCHAR
) | What is the sum of the heights in meters for the commerzbank tower built after 1984? | SELECT SUM(height__m_) FROM table_name_70 WHERE year_built > 1984 AND name = "commerzbank tower" | sql_create_context |
CREATE TABLE table_name_85 (
datacenter VARCHAR,
itanium VARCHAR,
features VARCHAR
) | What is the Datacenter for the Memory modules: hot addition Feature that has Yes listed for Itanium? | SELECT datacenter FROM table_name_85 WHERE itanium = "yes" AND features = "memory modules: hot addition" | sql_create_context |
CREATE TABLE table_name_27 (
attendance INTEGER,
venue VARCHAR,
round VARCHAR
) | What is the lowest attendance at Venue H in Round R2? | SELECT MIN(attendance) FROM table_name_27 WHERE venue = "h" AND round = "r2" | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | had patient 60763 undergone any procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60763) | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
... | TOP 150 Users from Bulgaria. | SELECT Id, DisplayName, Reputation, Location FROM Users WHERE Location LIKE '%Sofia%' OR Location LIKE '%Bulgaria%' ORDER BY Reputation DESC LIMIT 150 | sede |
CREATE TABLE table_24143253_5 (
deceased_spouse VARCHAR,
length_of_marriage VARCHAR
) | Who was the deceased spouse who was married for 4 years? | SELECT deceased_spouse FROM table_24143253_5 WHERE length_of_marriage = "4 years" | sql_create_context |
CREATE TABLE table_21595 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | What was the year when Ch nqi Ch sh ( ) was submitted? | SELECT "Year (Ceremony)" FROM table_21595 WHERE "Original title" = 'Chūnqiū cháshì (春秋茶室)' | wikisql |
CREATE TABLE table_67310 (
"Name" text,
"Party" text,
"Hometown" text,
"District" text,
"Term" text,
"Legislatures" text
) | What was the term of Bruce Biers Kendall whose hometown is Anchorage? | SELECT "Term" FROM table_67310 WHERE "Hometown" = 'anchorage' AND "Name" = 'bruce biers kendall' | wikisql |
CREATE TABLE table_14583 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Name the most pick # for overall of 204 | SELECT MAX("Pick #") FROM table_14583 WHERE "Overall" = '204' | wikisql |
CREATE TABLE table_27799 (
"Municipality" text,
"No. of s Barangay" real,
"Area (km\u00b2)" text,
"Population (2007)" real,
"Population (2010)" real
) | What is the municipality that has an area of exactly 214.44 sq. km? | SELECT "Municipality" FROM table_27799 WHERE "Area (km\u00b2)" = '214.44' | wikisql |
CREATE TABLE table_name_74 (
home_team VARCHAR,
away_team VARCHAR
) | What score did the opposing home team have against Melbourne | SELECT home_team AS score FROM table_name_74 WHERE away_team = "melbourne" | 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
)
... | what is the number of patients who are taking base type drug prescription and have diagnoses icd9 code 41031? | 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 = "41031" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_76 (
location VARCHAR,
event VARCHAR
) | Where was the event Kage Kombat 16? | SELECT location FROM table_name_76 WHERE event = "kage kombat 16" | sql_create_context |
CREATE TABLE table_60748 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What was the earliest year that an event held in Berlin, Germany had a 100 m hurdles event? | SELECT MIN("Year") FROM table_60748 WHERE "Venue" = 'berlin, germany' AND "Event" = '100 m hurdles' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | on a BREAKFAST flight from PHILADELPHIA to DALLAS via ATLANTA | 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, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'ATLANTA... | atis |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
... | 把医疗机构0195557做过项目0152检查的记录查看一下 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0195557' AND t_kc22.SOC_SRT_DIRE_CD = '0152' | css |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | This Summer , which upper-level LING classes are being offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer... | advising |
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 SuggestedEdits (
Id number,
PostId number,
CreationD... | intel tags: all posts from last n days. | WITH IntelTags AS (SELECT Id, TagName, Count FROM Tags WHERE Tags.TagName LIKE 'intel-%' OR Tags.TagName = 'intel'), IntelPostIds AS (SELECT DISTINCT PostTags.PostId FROM PostTags INNER JOIN IntelTags ON IntelTags.Id = PostTags.TagId) SELECT Id AS "post_link", Body, Tags, CreationDate, Score, ViewCount FROM Posts INNER... | sede |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to list from high to low by the total number. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_33017 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the lowest attendance for a game before 10 weeks on November 12, 1967 | SELECT MIN("Attendance") FROM table_33017 WHERE "Week" < '10' AND "Date" = 'november 12, 1967' | wikisql |
CREATE TABLE table_28561 (
"Film Festival" text,
"Date of ceremony" text,
"Category" text,
"Participants/Recipients" text,
"Result" text
) | What film festival was the participant/recipient Isao Tomita? | SELECT "Film Festival" FROM table_28561 WHERE "Participants/Recipients" = 'Isao Tomita' | 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,... | how many patients whose procedure long title is thoracentesis and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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 procedures (
... | count the number of patients whose year of death is less than or equal to 2133 and procedure long title is open and other replacement of mitral valve with tissue graft? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2133.0" AND procedures.long_title = "Open and other replacement of mitral valve with tissue graft" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | search comment by keyword and user id. | SELECT Id AS "comment_link", Text, CreationDate FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%##Keyword##%' ORDER BY CreationDate DESC | sede |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | Find Deleted Questions and Answers by User. shows all deleted answers for the specified user | SELECT DISTINCT p.Id AS "post_link", p.LastActivityDate, p.DeletionDate FROM Posts AS p JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE p.OwnerUserId = '##USERID##' AND NOT p.DeletionDate IS NULL ORDER BY p.LastActivityDate DESC | sede |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | Show me the correlation between the number of platforms and the number of total_passengers in a scatter chart. | SELECT SUM(Number_of_Platforms), SUM(Total_Passengers) FROM station GROUP BY Location | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | since 4 years ago, what are the top three most frequently performed laboratory tests given to patients within the same month after being diagnosed with atrial fibrillation - without hemodynamic compromise? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrillation - without hemodynamic compromise... | eicu |
CREATE TABLE problem_log (
problem_log_id number,
assigned_to_staff_id number,
problem_id number,
problem_category_code text,
problem_status_code text,
log_entry_date time,
log_entry_description text,
log_entry_fix text,
other_log_details text
)
CREATE TABLE problem_status_codes (
... | For the problem with id 10, return the ids and dates of its problem logs. | SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10 | spider |
CREATE TABLE table_25008327_8 (
словјански VARCHAR,
polish VARCHAR
) | What is every value for if polish is ksi ka? | SELECT словјански FROM table_25008327_8 WHERE polish = "książka" | sql_create_context |
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 TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and department_id , and visualize them by a bar chart, and I want to list in descending by the X please. | SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_name_46 (
round INTEGER,
method VARCHAR,
date VARCHAR
) | Which Round has a Method of ko, and a Date of 1958? | SELECT MIN(round) FROM table_name_46 WHERE method = "ko" AND date = "1958" | sql_create_context |
CREATE TABLE table_45506 (
"Pinnacle height" text,
"Year" real,
"Structure type" text,
"Main use" text,
"Country" text,
"Town" text
) | What is the main use for the structure listed in walker city, iowa? | SELECT "Main use" FROM table_45506 WHERE "Town" = 'walker city, iowa' | wikisql |
CREATE TABLE table_name_97 (
number_of_districts__kecamatan_ INTEGER,
province VARCHAR,
villages VARCHAR
) | What is the lowest number of districts (kecamatan) in the north sulawesi province with more than 1,510 villages? | SELECT MIN(number_of_districts__kecamatan_) FROM table_name_97 WHERE province = "north sulawesi" AND villages > 1 OFFSET 510 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | give me the number of patients whose discharge location is home health care and diagnoses long title is psoas muscle abscess? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.long_title = "Psoas muscle abscess" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.