context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_78 (
score VARCHAR,
attendance VARCHAR
) | When the attendance was 3188 what was the score? | SELECT score FROM table_name_78 WHERE attendance = 3188 | sql_create_context |
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 mzjzjlb (
HXPLC number,
HZXM ... | 门诊诊断患者冯弘毅患有心脏病,他做的检测白介素-6的结果定量是什么?对应的单位呢 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_name_80 (
undecided VARCHAR,
source VARCHAR,
murray VARCHAR
) | What is the undecided percentage of the poll from Suffolk University with Murray at 11%? | SELECT undecided FROM table_name_80 WHERE source = "suffolk university" AND murray = "11%" | sql_create_context |
CREATE TABLE table_56872 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | Who had the time of 1:23.32.41? | SELECT "Rider" FROM table_56872 WHERE "Time" = '1:23.32.41' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | when did patient 808 enter for the last time in the hospital since 2105? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 808 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_train_46 (
"id" int,
"bleeding" int,
"active_infection" bool,
"hypotension" bool,
"burn_injury" int,
"hypertension" bool,
"age" float,
"NOUSE" float
) | 10 % of body surface area acute burn injury | SELECT * FROM table_train_46 WHERE burn_injury > 10 | criteria2sql |
CREATE TABLE table_52647 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Who constructed Chris Amon's car? | SELECT "Constructor" FROM table_52647 WHERE "Driver" = 'chris amon' | wikisql |
CREATE TABLE table_name_45 (
Id VARCHAR
) | What is the value in 1990 when it is A in 1989, 1985, and 1993? | SELECT 1990 FROM table_name_45 WHERE 1989 = "a" AND 1985 = "a" AND 1993 = "a" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | how much vancomycin has been prescribed to patient 1784 in total? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784) AND prescriptions.drug = 'vancomycin' | mimic_iii |
CREATE TABLE table_62740 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
) | What's the circuit that had an event cancelled? | SELECT "Circuit" FROM table_62740 WHERE "Winner" = 'event cancelled' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | when did patient 032-21820 first have a maximum value of respiration on this month/23? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-21820')) AND NOT vitalperiodic.respiration IS N... | eicu |
CREATE TABLE table_69769 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | Date of october 8 happened at what time? | SELECT "Time" FROM table_69769 WHERE "Date" = 'october 8' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Parent... | Users active in the last fortnight. | SELECT Id AS "user_link", LastAccessDate FROM Users WHERE LastAccessDate > DATEDIFF(DAY, 1, GETDATE()) ORDER BY LastAccessDate | sede |
CREATE TABLE table_38574 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Surface has a Tournament of st. petersburg , russia? | SELECT "Surface" FROM table_38574 WHERE "Tournament" = 'st. petersburg , russia' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Answer count by post (2011). | SELECT Id, CreationDate, CommunityOwnedDate, AnswerCount FROM Posts WHERE YEAR(CreationDate) = 2011 AND PostTypeId = 1 ORDER BY CreationDate | sede |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
) | what year had the highest total number ? | SELECT "year" FROM table_203_355 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
... | For each city, return the highest latitude among its stations. Show a pie chart. | SELECT city, MAX(lat) FROM station GROUP BY city | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | has patient 013-33898 received a procedure of antihyperlipidemic agent - fenofibrate in 2105? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND treatment.treatmentname = 'antihyperlipidemic agent - fenof... | eicu |
CREATE TABLE table_204_757 (
id number,
"state" text,
"interview" number,
"swimsuit" number,
"evening gown" number,
"average" number
) | what is the largest evening gown amount ? | SELECT MAX("evening gown") FROM table_204_757 | squall |
CREATE TABLE table_18466 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the number of party in the arkansas 1 district | SELECT COUNT("Party") FROM table_18466 WHERE "District" = 'Arkansas 1' | wikisql |
CREATE TABLE table_name_52 (
runner_s__up VARCHAR,
date VARCHAR
) | On the Date of 2 Aug 2009, who was the Runner(s)-up? | SELECT runner_s__up FROM table_name_52 WHERE date = "2 aug 2009" | sql_create_context |
CREATE TABLE table_65134 (
"Year" real,
"Place" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | Who won bronze in 1994? | SELECT "Bronze" FROM table_65134 WHERE "Year" = '1994' | wikisql |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes', could you rank by the names from low to high please? | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 employees (
EMPLO... | For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, rank names in ascending order. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
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
)
... | count the number of patients whose admission type is elective and lab test name is triglycer? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Triglycer" | mimicsql_data |
CREATE TABLE table_23453931_5 (
opponent VARCHAR,
date VARCHAR
) | Name the opponents for december 3 | SELECT COUNT(opponent) FROM table_23453931_5 WHERE date = "December 3" | sql_create_context |
CREATE TABLE table_32879 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What day did the VFL pay MCG? | SELECT "Date" FROM table_32879 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE table_63942 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Time ( sec )" real,
"Notes" text
) | Which athlete is ranked less than 5 with time over 11.22? | SELECT "Athlete" FROM table_63942 WHERE "Time ( sec )" > '11.22' AND "Rank" < '5' | wikisql |
CREATE TABLE table_name_97 (
original_name VARCHAR,
film_title_used_in_nomination VARCHAR
) | Name the original name for last days of the victim | SELECT original_name FROM table_name_97 WHERE film_title_used_in_nomination = "last days of the victim" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose age is less than 31 and procedure icd9 code is 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | compare usage of tag combinations: [excel] [vba] [excel-vba]. | SELECT 'EorV_hasEV' AS x, COUNT(Id) AS y FROM Posts WHERE (Tags LIKE '%<excel>%' OR Tags LIKE '%<vba>%') AND NOT Tags LIKE '%<excel-vba>%' | sede |
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... | 从一二年五月二十五日到一五年十二月二十四日,患者55865228的医保个人账户总共被刷了多少金额 | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '55865228' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-05-25' AND '2015-12-24' | css |
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 medication (
medi... | what was the number of times hydromorphone 1 mg/1 ml syr was prescribed for patient 030-53416 in 06/this year? | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND medication.drugname = 'hydromorphone 1 mg/1 ml syr' AND DATET... | eicu |
CREATE TABLE table_name_47 (
third VARCHAR,
skip VARCHAR
) | What is the name of the third who has Barbora Vojtusova as Skip? | SELECT third FROM table_name_47 WHERE skip = "barbora vojtusova" | sql_create_context |
CREATE TABLE table_9572 (
"Year" real,
"Character" text,
"Title" text,
"Author" text,
"Artist" text,
"Imprint" text
) | what is the imprint when the title is owari no chronicle (ahead series)? | SELECT "Imprint" FROM table_9572 WHERE "Title" = 'owari no chronicle (ahead series)' | wikisql |
CREATE TABLE table_36285 (
"Name" text,
"Championship" real,
"FA Cup" real,
"League Cup" real,
"Total" real
) | League Cup smaller than 0 is what sum of the total? | SELECT SUM("Total") FROM table_36285 WHERE "League Cup" < '0' | wikisql |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
S... | What about the average amounts of payments by each method code? You can give me a bar chart, display from high to low by the X. | SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code DESC | nvbench |
CREATE TABLE table_69059 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
) | Which city of license has a wriq Call sign? | SELECT "City of license" FROM table_69059 WHERE "Call sign" = 'wriq' | wikisql |
CREATE TABLE table_name_29 (
country VARCHAR,
hdtv VARCHAR,
content VARCHAR
) | What is Country, when HDTV is yes, and when Content is cinema? | SELECT country FROM table_name_29 WHERE hdtv = "yes" AND content = "cinema" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE market (
Mar... | Visualize a bar chart for how films are produced by each studio?, list bar from low to high order. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what was patient 002-58884's first time of lr intake on last month/14? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
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 prescription... | give me the number of patients whose diagnoses short title is choledochlith nos w obst? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Choledochlith NOS w obst" | mimicsql_data |
CREATE TABLE table_name_63 (
laps VARCHAR,
driver VARCHAR
) | What are the total number of laps for Tom Bridger? | SELECT COUNT(laps) FROM table_name_63 WHERE driver = "tom bridger" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | how many times did a replace indwelling cath procedure be done? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'replace indwelling cath') | mimic_iii |
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 demographic (
subject_id text,
hadm_id t... | what is minimum age of patients whose marital status is divorced and primary disease is brain mass;intracranial hemorrhage? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_34991 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the average game number that took place after February 13 against the Toronto Maple Leafs and more than 47 points were scored? | SELECT AVG("Game") FROM table_34991 WHERE "February" > '13' AND "Opponent" = 'toronto maple leafs' AND "Points" > '47' | wikisql |
CREATE TABLE table_44722 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What was the score for set 3 when set 1 was 14 25? | SELECT "Set 3" FROM table_44722 WHERE "Set 1" = '14–25' | wikisql |
CREATE TABLE Documents (
document_id INTEGER,
document_status_code CHAR(15),
document_type_code CHAR(15),
shipping_agent_code CHAR(15),
receipt_date DATETIME,
receipt_number VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Shipping_Agents (
shipping_agent_code CHAR(15),
s... | Show a bar chart about how many employees does each role have?, I want to order by the the total number in descending. | SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what was the last thing patient 20603 received for intake since 987 days ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_78990 (
"Model" text,
"Chassis" real,
"Engine" real,
"Year From" real,
"Year To" real
) | How many engines have a Model of sl600, and a Year From of 1994, and a Year To smaller than 1995? | SELECT COUNT("Engine") FROM table_78990 WHERE "Model" = 'sl600' AND "Year From" = '1994' AND "Year To" < '1995' | wikisql |
CREATE TABLE table_17330069_1 (
time_retired VARCHAR,
points VARCHAR
) | If there are 28 points, what is the time/retired? | SELECT time_retired FROM table_17330069_1 WHERE points = "28" | sql_create_context |
CREATE TABLE table_15236 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text
) | Which player has an A-League of 113 (0)? | SELECT "Name" FROM table_15236 WHERE "A-League" = '113 (0)' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | what was the name of the first lab test patient 51177 had received since 03/2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
CREATE TABLE table_15119 (
"Year" real,
"Division I" text,
"Division II" text,
"Division III" text,
"Division IV" text,
"Division V" text
) | What Division III has Bishop Brady in Division V and Hanover in Division IV? | SELECT "Division III" FROM table_15119 WHERE "Division V" = 'bishop brady' AND "Division IV" = 'hanover' | wikisql |
CREATE TABLE table_67890 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
) | What is the number drawn when the try BP is 1? | SELECT "Drawn" FROM table_67890 WHERE "Try BP" = '1' | wikisql |
CREATE TABLE table_name_34 (
opponent VARCHAR,
record VARCHAR
) | Who was the opponent the Buffalo Bills played when their record was 4-4? | SELECT opponent FROM table_name_34 WHERE record = "4-4" | sql_create_context |
CREATE TABLE table_57011 (
"Year" real,
"Author" text,
"English title" text,
"Original title" text,
"Representing" text
) | What is the year for the ocean? | SELECT "Year" FROM table_57011 WHERE "English title" = 'the ocean' | wikisql |
CREATE TABLE table_73185 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position is the player who went to Regina? | SELECT "Position" FROM table_73185 WHERE "College" = 'Regina' | wikisql |
CREATE TABLE table_62772 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text
) | What is 1994 Grand Slam Tournament if 1993 is also grand slam tournaments? | SELECT "1994" FROM table_62772 WHERE "1993" = 'grand slam tournaments' | wikisql |
CREATE TABLE table_name_52 (
Id VARCHAR
) | What is the 2005 that has a grand slam tournaments in 2007? | SELECT 2005 FROM table_name_52 WHERE 2007 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_67600 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the number of the rank when the time is 2:15.98, in a lane larger than 7? | SELECT COUNT("Rank") FROM table_67600 WHERE "Time" = '2:15.98' AND "Lane" > '7' | wikisql |
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | How many hosts does each nationality have? List the nationality and the count Visualize by bar chart, and sort X-axis from high to low order. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality 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 born before year 2170 have lab test fluid as other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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... | what is the aircraft type with the greatest seating capacity | SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1) | atis |
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 procedure short title of subject id 6983? | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_37630 (
"Date" text,
"Title" text,
"Origin" text,
"Label & Cat. no." text,
"Chart no." real
) | What is origin country for a title that charted at 52? | SELECT "Origin" FROM table_37630 WHERE "Chart no." = '52' | wikisql |
CREATE TABLE table_18055005_1 (
no_in_series VARCHAR,
prod_code VARCHAR
) | What's the series number of the episode with production code 329? | SELECT no_in_series FROM table_18055005_1 WHERE prod_code = "329" | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Return the room and number of reservations made for each of the rooms to draw a bar chart, I want to sort Y-axis in descending order. | SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_88 (
week__number VARCHAR,
original_artist VARCHAR
) | What is the week number with Phil Collins as the original artist? | SELECT week__number FROM table_name_88 WHERE original_artist = "phil collins" | sql_create_context |
CREATE TABLE table_name_56 (
team VARCHAR,
college VARCHAR
) | What's the team of the player who went to lawrence tech? | SELECT team FROM table_name_56 WHERE college = "lawrence tech" | sql_create_context |
CREATE TABLE table_68037 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
) | What tournament has nov. 21, 1999 as the date? | SELECT "Tournament" FROM table_68037 WHERE "Date" = 'nov. 21, 1999' | wikisql |
CREATE TABLE table_name_62 (
nfl_team VARCHAR,
position VARCHAR
) | What NFL team did the Tight End position belong to? | SELECT nfl_team FROM table_name_62 WHERE position = "tight end" | sql_create_context |
CREATE TABLE table_name_92 (
builder VARCHAR,
works_number VARCHAR
) | Who was the Builder for the locomotive that has a works number of 323? | SELECT builder FROM table_name_92 WHERE works_number = "323" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text... | On what days are most questions posted?. | SELECT COUNT(*) AS "# votes", TIME_TO_STR(v.CreationDate, '%h') AS "hour" FROM Votes AS v GROUP BY TIME_TO_STR(v.CreationDate, '%h') | sede |
CREATE TABLE table_name_59 (
margin_of_victory VARCHAR,
winning_score VARCHAR
) | When the Winning score is 68-65-65-68=266, what is the Margin of victory? | SELECT margin_of_victory FROM table_name_59 WHERE winning_score = 68 - 65 - 65 - 68 = 266 | sql_create_context |
CREATE TABLE table_25431 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" real,
"Scoring average" text,
"Scoring rank" real
) | If the year is 2007, what is the top ten? | SELECT "Top 10s" FROM table_25431 WHERE "Year" = '2007' | wikisql |
CREATE TABLE table_23564 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Foochow" text,
"Area" real,
"Population" real,
"Density" real
) | Name the foochow for pingnan county | SELECT "Foochow" FROM table_23564 WHERE "English Name" = 'Pingnan County' | wikisql |
CREATE TABLE table_name_12 (
city___state VARCHAR,
winner VARCHAR,
circuit VARCHAR
) | In what City/State did John Bowe win at Phillip Island Grand Prix Circuit? | SELECT city___state FROM table_name_12 WHERE winner = "john bowe" AND circuit = "phillip island grand prix circuit" | sql_create_context |
CREATE TABLE table_8742 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What iwas the attendance of the game that took place on december 6, 1998? | SELECT "Attendance" FROM table_8742 WHERE "Date" = 'december 6, 1998' | wikisql |
CREATE TABLE table_1342451_16 (
district VARCHAR,
incumbent VARCHAR
) | What district did James O'Connor belong to? | SELECT district FROM table_1342451_16 WHERE incumbent = "James O'Connor" | sql_create_context |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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, visualize a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, order Y in desc order please. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20)... | Show the transaction type and the number of transactions by a bar chart. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type | nvbench |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | which township has the least water area in miles ? | SELECT "township" FROM table_203_510 WHERE "water area\n(mi2)" = (SELECT MIN("water area\n(mi2)") FROM table_203_510) | squall |
CREATE TABLE table_name_28 (
year INTEGER
) | Which Year Inducted is the highest one that has a Year smaller than 1965? | SELECT MAX(year) AS Inducted FROM table_name_28 WHERE year < 1965 | sql_create_context |
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... | 患者戚绮玉被开出的药品都不高出4979.12元在哪几次医疗记录中?医疗就诊序列号分别都是多少? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚绮玉' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4979.12) | css |
CREATE TABLE table_16974 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"W\u2013L" text,
"Result" text
) | What date was the result 6 2, 4 6, 6 4? | SELECT "Date" FROM table_16974 WHERE "Result" = '6–2, 4–6, 6–4' | wikisql |
CREATE TABLE table_name_18 (
artist VARCHAR,
album VARCHAR
) | Who is the artist of the album Soul? | SELECT artist FROM table_name_18 WHERE album = "soul" | sql_create_context |
CREATE TABLE table_5045 (
"Year" text,
"Title" text,
"Role" text,
"Producer" text,
"Director" text
) | What is Director Erik Matti's Producer? | SELECT "Producer" FROM table_5045 WHERE "Director" = 'erik matti' | wikisql |
CREATE TABLE table_name_85 (
club VARCHAR,
stadium VARCHAR,
founded VARCHAR,
joined_prsl VARCHAR
) | what is the club that was founded before 2007, joined prsl in 2008 and the stadium is yldefonso sol morales stadium? | SELECT club FROM table_name_85 WHERE founded < 2007 AND joined_prsl = 2008 AND stadium = "yldefonso solá morales stadium" | sql_create_context |
CREATE TABLE table_51826 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What was the championship that had final score of 6 2, 5 7, 6 4, 6 2 and was on a clay surface? | SELECT "Championship" FROM table_51826 WHERE "Surface" = 'clay' AND "Score in the final" = '6–2, 5–7, 6–4, 6–2' | 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,
... | get the number of patients who were hospitalized for more than 27 days and had aortic valve insufficiency/aortic valve replacement/sda primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.days_stay > "27" | 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... | 68054249569的检验报告单,其标本是采集的哪个部位 | SELECT zyjybgb.BBCJBW FROM zyjybgb WHERE zyjybgb.BGDH = '68054249569' UNION SELECT mzjybgb.BBCJBW FROM mzjybgb WHERE mzjybgb.BGDH = '68054249569' | css |
CREATE TABLE table_name_7 (
rank VARCHAR,
studio VARCHAR,
director VARCHAR
) | WHAT IS THE RANK OF UNIVERSAL, AND DIRECTOR JOHN HUGHES? | SELECT rank FROM table_name_7 WHERE studio = "universal" AND director = "john hughes" | sql_create_context |
CREATE TABLE table_25131572_3 (
season__number INTEGER,
written_by VARCHAR
) | What is the highest season# for the writer Daegan Fryklind? | SELECT MAX(season__number) FROM table_25131572_3 WHERE written_by = "Daegan Fryklind" | sql_create_context |
CREATE TABLE table_1132600_3 (
round VARCHAR,
winning_constructor VARCHAR,
pole_position VARCHAR,
fastest_lap VARCHAR
) | Which round had Michael Schumacher in the pole position, David Coulthard with the fastest lap, and McLaren - Mercedes as the winning constructor? | SELECT COUNT(round) FROM table_1132600_3 WHERE pole_position = "Michael Schumacher" AND fastest_lap = "David Coulthard" AND winning_constructor = "McLaren - Mercedes" | 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,... | 把二零零七年七月二日到二零一一年五月十二日期间,开出的酸枣仁颗粒的总数量及总金额查看一下 | SELECT SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '酸枣仁颗粒' AND STA_DATE BETWEEN '2007-07-02' AND '2011-05-12' | css |
CREATE TABLE table_52532 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
) | What is the name of the player with an Overall larger than 227? | SELECT "Player" FROM table_52532 WHERE "Overall" > '227' | wikisql |
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code tex... | Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names. | SELECT T2.guest_first_name, T2.guest_last_name FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" | spider |
CREATE TABLE table_71364 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronze medals did the country with 7 medals and over 5 silver medals receive? | SELECT SUM("Bronze") FROM table_71364 WHERE "Total" = '7' AND "Silver" > '5' | wikisql |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | What are card ids, customer ids, card types, and card numbers for each customer card?, and could you show y axis in desc order? | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.