context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_46084 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Score on January 23? | SELECT "Score" FROM table_46084 WHERE "Date" = 'january 23' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYE... | Bar chart of department_id from each first name, and show in ascending by the y-axis. | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE table_41525 (
"Outcome" text,
"Year" text,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | In what year was Xavier Malisse the runner-up with scores of 4 6, 6 4, [8 10]? | SELECT "Year" FROM table_41525 WHERE "Outcome" = 'runner-up' AND "Score" = '4–6, 6–4, [8–10]' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | when was the last time that patient 022-199074 was prescribed a medication via the oral mucosa route in their current hospital visit? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL)) AND me... | eicu |
CREATE TABLE table_name_47 (
venue VARCHAR,
home_team VARCHAR
) | Which Venue was used when the Home team was geelong? | SELECT venue FROM table_name_47 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_name_13 (
game_modes VARCHAR,
pinyin VARCHAR
) | Which game modes have Pinyin of ch oj m l u sh ji ? | SELECT game_modes FROM table_name_13 WHERE pinyin = "chāojí mǎlìōu shìjiè" | sql_create_context |
CREATE TABLE table_74203 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text,
"U.S. viewers (millions)" text
) | how man episodes in the season were titled 'that's so sonny'? | SELECT COUNT("No. in season") FROM table_74203 WHERE "Title" = 'That''s So Sonny' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 根据不同的入院诊断疾病和编码科室编码,列出医院2806498所有医疗就诊记录中患者有多大平均年龄? | SELECT MED_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2806498' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD | css |
CREATE TABLE table_36661 (
"Season" real,
"Driver" text,
"Team" text,
"Tyre" text,
"Points" real
) | What is total amount of points for the 2007 season? | SELECT SUM("Points") FROM table_36661 WHERE "Season" = '2007' | wikisql |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | where is jamerican cuisine in san francisco ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.id = location.restaurant_id AND restaurant.name = 'jamerican cuisine' | restaurants |
CREATE TABLE table_name_12 (
nationality VARCHAR,
pick VARCHAR
) | Name the nationality for pick of 16 | SELECT nationality FROM table_name_12 WHERE pick = 16 | sql_create_context |
CREATE TABLE table_65794 (
"Edition" text,
"Year" text,
"City" text,
"Country" text,
"Date" text,
"No. of Events" real,
"Top Team" text
) | How many Events have a Country of trinidad and tobago, and a Date of march 30-april 1? | SELECT "No. of Events" FROM table_65794 WHERE "Country" = 'trinidad and tobago' AND "Date" = 'march 30-april 1' | wikisql |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VA... | Return the lot details of lots that belong to investors with details 'l', and count them by a bar chart, and I want to rank by the bar in descending. | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY lot_details DESC | nvbench |
CREATE TABLE table_41912 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | When was Shannon Long the Centerfold model? | SELECT "Date" FROM table_41912 WHERE "Centerfold model" = 'shannon long' | wikisql |
CREATE TABLE table_54093 (
"Name" text,
"GNIS Feature ID" real,
"State" text,
"County" text,
"Type" text,
"USGS 7.5' Map" text
) | What is the total GNIS Feature ID with a County of idaho? | SELECT SUM("GNIS Feature ID") FROM table_54093 WHERE "County" = 'idaho' | wikisql |
CREATE TABLE table_71517 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
) | Which runner-up has a 10 strokes margin of victory? | SELECT "Runner-up" FROM table_71517 WHERE "Margin of victory" = '10 strokes' | wikisql |
CREATE TABLE Research_Staff (
staff_id INTEGER,
employer_organisation_id INTEGER,
staff_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARCHAR(10),
grant_id INTEGER,
sent_date DATETIME,
response_received_date DATETIME,
other_details VARCHAR(2... | What are the ids and details for all organizations that have grants of more than 6000 dollars. | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid num... | how much chest tube did patient 013-28507 produce today? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND intakeoutput.celllabel = 'chest... | eicu |
CREATE TABLE table_1341472_20 (
first_elected INTEGER
) | What is the first election year listed? | SELECT MIN(first_elected) FROM table_1341472_20 | sql_create_context |
CREATE TABLE table_16878 (
"Yard Name" text,
"Location (city, state)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"total vessels built" text
) | When was the delevery date when there were 12 ways of delivery? | SELECT "1st Ship Delivery Date" FROM table_16878 WHERE "Total Number of Ways" = '12 ways' | wikisql |
CREATE TABLE table_23214055_2 (
district VARCHAR,
nairs VARCHAR
) | Name the district for nairs 8.2 | SELECT district FROM table_23214055_2 WHERE nairs = "8.2" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Users (
Id number,
Reputation number,... | Top users: Santiago de Chile. List of Santiago-based users by reputation score.
Forked from an original query by BoltClock. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%santiago%chile%' ORDER BY Reputation DESC | sede |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | What are the name of the players who received a card in descending order of the hours of training? | SELECT pname FROM player WHERE ycard = 'yes' ORDER BY hs DESC | spider |
CREATE TABLE table_64375 (
"Chord" text,
"Root" text,
"Major third" text,
"Augmented fifth" text,
"Minor seventh" text
) | What is the listed chord for a Minor seventh of F? | SELECT "Chord" FROM table_64375 WHERE "Minor seventh" = 'f' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road, and list in descending by the Y-axis. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) DESC | nvbench |
CREATE TABLE table_name_42 (
date VARCHAR,
total VARCHAR,
venue VARCHAR
) | What day was the total smaller than 19 at Venue of anz stadium? | SELECT date FROM table_name_42 WHERE total < 19 AND venue = "anz stadium" | sql_create_context |
CREATE TABLE table_name_74 (
connection_with_australia VARCHAR,
connection_with_america VARCHAR
) | What is the connection with Australia when the connection with America shows born in the u.s.; mother is u.s. citizen? | SELECT connection_with_australia FROM table_name_74 WHERE connection_with_america = "born in the u.s.; mother is u.s. citizen" | sql_create_context |
CREATE TABLE table_65430 (
"Season" text,
"1st round" text,
"2nd round" text,
"3rd round" text,
"Finals" text
) | Which 3rd round has a 1st round of ? | SELECT "3rd round" FROM table_65430 WHERE "1st round" = '—' | wikisql |
CREATE TABLE table_78961 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
) | What is the highest Average, when Goals is '34', and when Matches is less than 37? | SELECT MAX("Average") FROM table_78961 WHERE "Goals" = '34' AND "Matches" < '37' | wikisql |
CREATE TABLE table_40902 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the number of silver where the rank is higher than 4 and bronze is smaller than 1? | SELECT COUNT("Silver") FROM table_40902 WHERE "Rank" > '4' AND "Bronze" < '1' | wikisql |
CREATE TABLE table_27713030_11 (
team VARCHAR,
score VARCHAR
) | Who was the opponent for the game with a score of w 94 88 (ot)? | SELECT team FROM table_27713030_11 WHERE score = "W 94–88 (OT)" | sql_create_context |
CREATE TABLE table_name_68 (
high_rebounds VARCHAR,
team VARCHAR
) | What is the High rebounds with a Team that is charlotte? | SELECT high_rebounds FROM table_name_68 WHERE team = "charlotte" | sql_create_context |
CREATE TABLE table_18791 (
"City of license /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Owned since" text,
"Primary affiliation" text
) | What city has channel tv (dt) 25 (31)? | SELECT "City of license /Market" FROM table_18791 WHERE "Channel TV ( DT )" = '25 (31)' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | Closed Status of All Questions by Reputation (including high-rep users). A graph what percentage of questions are closed, grouped by the reputation of the users who asked them. This graph includes high-rep users. For a zoomed in view of lower rep users (more interesting IMO) see https://data.stackexchange.com/stackover... | SELECT AVG(CAST(ROUND(Reputation, -FLOOR(LOG(10, Reputation))) AS INT)) AS UserReputation, SUM(CASE WHEN ClosedDate IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(Posts.Id) AS FLOAT) AS "PercentOpen" FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 1 GROUP BY ROUND(Reputation, -FLOOR(LOG(10, Re... | sede |
CREATE TABLE table_name_73 (
game VARCHAR,
road_team VARCHAR,
date VARCHAR
) | What game number was played on April 23, with Boston as the road team? | SELECT game FROM table_name_73 WHERE road_team = "boston" AND date = "april 23" | sql_create_context |
CREATE TABLE table_26558_1 (
record_low VARCHAR,
precip VARCHAR
) | What was the record lowest temperature with a precipitation of 1.71 in.? | SELECT record_low FROM table_26558_1 WHERE precip = "1.71 in." | sql_create_context |
CREATE TABLE table_52838 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In which venue did the home team score 10.11 (71) | SELECT "Venue" FROM table_52838 WHERE "Home team score" = '10.11 (71)' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what are the hospitals admission times of patient 002-35416 since 4 years ago? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-35416' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
CREATE TABLE table_name_35 (
country VARCHAR,
player VARCHAR
) | What country is Nick Price from? | SELECT country FROM table_name_35 WHERE player = "nick price" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | count the number of patients who are dead after being diagnosed with pneumothorax during the same month the last year. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumothorax') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos... | eicu |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | Return me a bar chart to show the average experience working length of journalists working on different role type. | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type | nvbench |
CREATE TABLE table_57257 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the score for the home team for the venue glenferrie oval? | SELECT "Home team score" FROM table_57257 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_53093 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendence of the game on 26 April 1948 and an away team of Hawthorn? | SELECT "Crowd" FROM table_53093 WHERE "Date" = '26 april 1948' AND "Away team" = 'hawthorn' | 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,
... | find the number of patients who passed away in or before the year 2131 had lab test item id 51248. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2131.0" AND lab.itemid = "51248" | mimicsql_data |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Count the last year of parties with theme 'Spring' or 'Teqnology' with a bar grpah, I want to rank in descending by the Y. | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year) DESC | nvbench |
CREATE TABLE table_20431 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text,
"Coat Of Cash Wearing Celebrity" text
) | Name the musical guest for panelists jermaine jackson and nora sands | SELECT "Musical Guest (Song performed)" FROM table_20431 WHERE "Who knows the most about the guest host? panelists" = 'Jermaine Jackson and Nora Sands' | wikisql |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city ... | weekday , and could you order in ascending by the y-axis? | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY COUNT(Year) | nvbench |
CREATE TABLE table_name_75 (
owner_s_ VARCHAR,
team VARCHAR,
driver_s_ VARCHAR
) | Who is the owner of RSS Racing that driver Ryan Sieg belongs to? | SELECT owner_s_ FROM table_name_75 WHERE team = "rss racing" AND driver_s_ = "ryan sieg" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Posts with a score of 9. | SELECT Score, Id AS "post_link" FROM Posts WHERE Score = 9 AND TIME_TO_STR(CreationDate, '%YEAR') = 2016 ORDER BY CreationDate DESC | sede |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | How many captains are in each rank, and show from low to high by the x axis please. | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE table_74998 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | What is the year when the Winner was the new york jets, with a Result of 24 17, played at giants stadium? | SELECT SUM("Year") FROM table_74998 WHERE "Winner" = 'new york jets' AND "Result" = '24–17' AND "Location" = 'giants stadium' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many hours since patient 006-124193 was admitted to hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-124193' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_40 (
school VARCHAR,
player VARCHAR
) | What School did Terrence Jones play for? | SELECT school FROM table_name_40 WHERE player = "terrence jones" | sql_create_context |
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,
... | how many patients aged below 67 years had an elective admission type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_51743 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the score of the away team where the home team scored 13.20 (98)? | SELECT "Away team score" FROM table_51743 WHERE "Home team score" = '13.20 (98)' | wikisql |
CREATE TABLE table_42191 (
"Name" text,
"Start of Reign" real,
"End of Reign" text,
"Birth Name" text,
"Title" text
) | What is the end of reign for Dimitar Stojkovski? | SELECT "End of Reign" FROM table_42191 WHERE "Birth Name" = 'dimitar stojkovski' | wikisql |
CREATE TABLE table_name_14 (
writer VARCHAR,
film VARCHAR
) | Who is the writer of the film Run? | SELECT writer FROM table_name_14 WHERE film = "run" | sql_create_context |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE status (
station_id numb... | Count the number of trips that did not end in San Francisco city. | SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> "San Francisco" | spider |
CREATE TABLE table_name_3 (
partner VARCHAR,
outcome VARCHAR,
opponents_in_the_final VARCHAR
) | WHich Partner has a Outcome of winner, and a Opponents in the final of rick leach jim pugh? | SELECT partner FROM table_name_3 WHERE outcome = "winner" AND opponents_in_the_final = "rick leach jim pugh" | sql_create_context |
CREATE TABLE table_22512 (
"Year" real,
"1st Place Team" text,
"2nd Place Team" text,
"3rd Place Team" text,
"4th Place Team" text,
"Host Location" text
) | How many years was the 2nd place team merchants, tampico, il? | SELECT COUNT("Year") FROM table_22512 WHERE "2nd Place Team" = 'Merchants, Tampico, IL' | wikisql |
CREATE TABLE table_name_3 (
analog_channel VARCHAR,
digital_channel VARCHAR
) | Digital channel of 32 belongs to what analog channel? | SELECT analog_channel FROM table_name_3 WHERE digital_channel = "32" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | what is the total number of inputs that patient 010-8740 has received on the first icu visit? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-8740') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_14395920_2 (
winner VARCHAR,
stage VARCHAR
) | Who won stage 18? | SELECT winner FROM table_14395920_2 WHERE stage = 18 | sql_create_context |
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
)
... | give me the procedure icd9 code and drug type of subject id 18480. | SELECT procedures.icd9_code, prescriptions.drug_type FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "18480" | mimicsql_data |
CREATE TABLE table_77997 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text
) | What is the Round with a Opponent with blackburn? | SELECT "Round" FROM table_77997 WHERE "Opponent" = 'blackburn' | wikisql |
CREATE TABLE table_train_126 (
"id" int,
"childhood_febrile_seizure" bool,
"neurodegenerative_disease" bool,
"cns_disease" bool,
"head_injury" bool,
"stroke" bool,
"renal_disease" bool,
"cerebrovascular_disease" bool,
"hepatic_disease" bool,
"headache" bool,
"cardiovascular_d... | history of head trauma with prolonged loss of consciousness ( > 10 minutes ) or any neurological condition including stroke or seizure ( excluding childhood febrile seizure ) or history of migraine headache. | SELECT * FROM table_train_126 WHERE head_injury = 1 OR (neurological_disease = 1 OR stroke = 1 OR (seizure_disorder = 1 AND childhood_febrile_seizure = 0) OR headache = 1) | criteria2sql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | Find the number of patients whose admission type is elective that had a procedure named umbilical vein catheterization. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Umbilical vein catheterization" | mimicsql_data |
CREATE TABLE table_204_905 (
id number,
"team" text,
"wins" number,
"losses" number,
"win %" number,
"gb" number
) | how many teams won at least 85 games ? | SELECT COUNT("team") FROM table_204_905 WHERE "wins" >= 85 | squall |
CREATE TABLE table_77982 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Which school is in Riverside, CA? | SELECT "School" FROM table_77982 WHERE "Hometown" = 'riverside, ca' | wikisql |
CREATE TABLE table_name_9 (
area VARCHAR,
years VARCHAR,
name VARCHAR
) | Which area has Years of 1 8, and a Name of broomfield school? | SELECT area FROM table_name_9 WHERE years = "1–8" AND name = "broomfield school" | sql_create_context |
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft varchar(50),
Description varchar(50),
Max_Gross_Weight varchar(50),
Total_disk_area varchar(50),
Max_disk_Loading varchar(50)
)
CREATE TABLE pilot (
Pilot_Id int(11),
Name varchar(50),
Age int(11)
)
CREATE TABLE airport_aircraft... | List the names of aircrafts and the number of times it won matches Plot them as bar chart, and order by the X-axis in descending. | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC | nvbench |
CREATE TABLE table_name_79 (
game_site VARCHAR,
week VARCHAR
) | What was the game site week 15? | SELECT game_site FROM table_name_79 WHERE week = 15 | sql_create_context |
CREATE TABLE table_name_40 (
team VARCHAR,
score VARCHAR
) | Which Team has a Score of 89-123? | SELECT team FROM table_name_40 WHERE score = "89-123" | sql_create_context |
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... | count how many hospital visits patient 015-66570 has in this year. | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '015-66570' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
... | Are there classes in the morning that are RELIGION 347 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RELIGION' AND course.number = 347 AND semester.semester = 'WN' AND semester.semester_id = course... | advising |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 项目563098在医疗机构4874710一共有多少检查记录? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098' UN... | css |
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... | 列出水天干这位患者在医院7539997住院的就诊记录里入院科室名字含有耳鼻喉科的记录 | SELECT * 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_zyjzjlb.YLJGDM AND hz_info_zyjz... | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart, could you list from low to high by the the average of manager id please? | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_48797 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Who is the rider with 22 laps and a +19.435 time/retired? | SELECT "Rider" FROM table_48797 WHERE "Laps" = '22' AND "Time/Retired" = '+19.435' | wikisql |
CREATE TABLE table_12534 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
) | Which Opponent has a Score of 92 93? | SELECT "Opponent" FROM table_12534 WHERE "Score" = '92–93' | wikisql |
CREATE TABLE table_54830 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When st kilda played as the away team, what date was that? | SELECT "Date" FROM table_54830 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_29666 (
"Episode Air Date" text,
"Audition City" text,
"Audition Date" text,
"Audition Venue" text,
"Guest Fourth Judge" text
) | List all episode air dates whose audition venues were Nego Quirido Sambadrome? | SELECT "Episode Air Date" FROM table_29666 WHERE "Audition Venue" = 'Nego Quirido Sambadrome' | wikisql |
CREATE TABLE table_name_44 (
year VARCHAR,
venue VARCHAR,
score VARCHAR
) | when is the venue nikos goumas stadium and the score is 2 2 4 4 a.e.t. 6 5 pso? | SELECT year FROM table_name_44 WHERE venue = "nikos goumas stadium" AND score = "2–2 4–4 a.e.t. 6–5 pso" | sql_create_context |
CREATE TABLE table_name_49 (
Id VARCHAR
) | what is 2005 when 2003 is A, 2007 is 2r and 2012 is 3r? | SELECT 2005 FROM table_name_49 WHERE 2003 = "a" AND 2007 = "2r" AND 2012 = "3r" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 患者李妮娜的α-羟丁酸脱氢酶情况在14年5月27日到2021年4月18日这段时间内怎么样? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id numb... | has there been any swab microbiology test since 2105 for patient 63676? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63676) AND microbiologyevents.spec_type_desc = 'swab' AND STRFTIME('%y', microbiologyevents.charttime) >= '2105' | mimic_iii |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | what is a procedure patient 74392 received for the first time until 2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74392) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' ORDER ... | mimic_iii |
CREATE TABLE table_name_85 (
place VARCHAR,
to_par VARCHAR
) | What is the place number for the player with a To Par score of 'E'? | SELECT place FROM table_name_85 WHERE to_par = "e" | sql_create_context |
CREATE TABLE table_53198 (
"Player" text,
"Car." real,
"Yards" text,
"Avg." text,
"TD's" real,
"Long" text
) | What is the long for the player with 26 carries? | SELECT "Long" FROM table_53198 WHERE "Car." = '26' | wikisql |
CREATE TABLE table_name_37 (
owgr_pts INTEGER,
dates VARCHAR
) | Which OWGR pts has Dates of may 10-13? | SELECT SUM(owgr_pts) FROM table_name_37 WHERE dates = "may 10-13" | sql_create_context |
CREATE TABLE table_name_79 (
opponent VARCHAR,
time VARCHAR
) | Which opponent has a time of 1:50? | SELECT opponent FROM table_name_79 WHERE time = "1:50" | sql_create_context |
CREATE TABLE table_58555 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the total average for swimsuits smaller than 9.62 in Colorado? | SELECT SUM("Average") FROM table_58555 WHERE "Swimsuit" < '9.62' AND "Country" = 'colorado' | 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... | 患有疾病H72.575的病患被开出的药品有哪些,提供一下编号和名称 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_CD = 'H72.575' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Top Users in Tag (in UK). | SELECT Users.DisplayName, Users.Location, SUM(Posts.Score) AS TotalScore, 'https://stackoverflow.com/users/' + CAST(Users.Id AS TEXT) AS Profile FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE TagName = '##ta... | sede |
CREATE TABLE table_20688030_1 (
mccain_percentage VARCHAR,
obama_percentage VARCHAR
) | What are McCain's Percent when Obama has 36.47%? | SELECT mccain_percentage FROM table_20688030_1 WHERE obama_percentage = "36.47%" | sql_create_context |
CREATE TABLE table_66704 (
"Year" text,
"Births (000s)" real,
"Deaths" real,
"Natural Growth" real,
"Total Fertility Rate" text
) | What was the amount of deaths that had a natural growth smaller than 3.4, and a total fertility rate of 1.63? | SELECT "Deaths" FROM table_66704 WHERE "Natural Growth" < '3.4' AND "Total Fertility Rate" = '1.63' | wikisql |
CREATE TABLE table_62004 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text,
"Winner's share ( $ )" real
) | What winning score has in-kyung kim as the runner(s)-up? | SELECT "Winning score" FROM table_62004 WHERE "Runner(s)-up" = 'in-kyung kim' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about Team_ID over the All_Road by a bar chart, I want to list by the X-axis in ascending please. | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE film (
film_id number,
rank_in_series number,
number_in_season number,
title text,
directed_by text,
original_air_date text,
production_code text
)
CREATE TABLE schedule (
cinema_id number,
film_id number,
date text,
show_times_per_day number,
price number
)... | What is total number of show times per dat for each cinema? | SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id | spider |
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 whose days of hospital stay is greater than 20 and drug code is ipra2h? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.formulary_drug_cd = "IPRA2H" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.