context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_65194 (
"Country or territory" text,
"2000" real,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011" real
) | Which 2007 has a Country or territory of china, and a 2002 smaller than 670,099? | SELECT MIN("2007") FROM table_65194 WHERE "Country or territory" = 'china' AND "2002" < '670,099' | wikisql |
CREATE TABLE table_299121_2 (
season VARCHAR,
viewers__in_millions_ VARCHAR
) | When did the season premiere that saw 8.4 million viewers first air? | SELECT season AS premiere FROM table_299121_2 WHERE viewers__in_millions_ = "8.4" | sql_create_context |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
bud... | Display a bar chart for what are the names and budgets of departments with budgets greater than the average?, and I want to order from low to high by the x-axis please. | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY dept_name | nvbench |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)... | Which is the earliest paper by aravind rajeswaran ? | SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'aravind rajeswaran' AND paper.year = (SELECT MIN(PAPERalias1.year) FROM author AS AUTHORalias1, paper AS PAPERalias1, writes AS WRITESalias1 WHERE AUTHORalias1.authorname = 'aravind rajeswaran' AND WRITESalias1.authorid = AU... | scholar |
CREATE TABLE table_16940409_1 (
points INTEGER,
team VARCHAR
) | Name the most points for independiente | SELECT MAX(points) FROM table_16940409_1 WHERE team = "Independiente" | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what is the first flight from BOSTON to STAPLETON airport for tomorrow | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, date_day, days, flight WHERE ((airport.airport_name LIKE 'STAPLETON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airpo... | atis |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | Show how many rank from each rank, and show x axis in descending order. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank DESC | nvbench |
CREATE TABLE table_42408 (
"Name" text,
"Date of Birth" text,
"Height" real,
"Weight" real,
"Spike" real
) | What is the smallest number of spikes for players with a weight of 83 and height over 190? | SELECT MIN("Spike") FROM table_42408 WHERE "Weight" = '83' AND "Height" > '190' | wikisql |
CREATE TABLE railway (
Builder VARCHAR
) | List the builders of railways in ascending alphabetical order. | SELECT Builder FROM railway ORDER BY Builder | sql_create_context |
CREATE TABLE table_2140071_12 (
episode VARCHAR,
coach VARCHAR
) | Name the episode summary for travis brown | SELECT episode AS Summary FROM table_2140071_12 WHERE coach = "Travis Brown" | sql_create_context |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rati... | where is a restaurant in alameda ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE table_17595 (
"Year" real,
"Denomination" text,
"Alloy" text,
"Reverse" text,
"Diameter" text,
"Weight" text,
"Obverse" text,
"Mintage" real,
"Series" text
) | what's the alloy with series being ii series | SELECT "Alloy" FROM table_17595 WHERE "Series" = 'II series' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | The classes with labs are not taught by which professors ? | SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr... | advising |
CREATE TABLE table_40495 (
"Pos." real,
"Driver" text,
"Qualifying" real,
"Race 1" text,
"Race 2" text,
"Race 3" text,
"Points" real
) | What is the total number of positions with less than 10 points, more than 7 qualifying, ret value in Race 1, and Jonathan Grant driving? | SELECT COUNT("Pos.") FROM table_40495 WHERE "Points" < '10' AND "Qualifying" > '7' AND "Race 1" = 'ret' AND "Driver" = 'jonathan grant' | wikisql |
CREATE TABLE table_62700 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | On what date is the venue Sam Nujoma Stadium, Windhoek, Namibia? | SELECT "Date" FROM table_62700 WHERE "Venue" = 'sam nujoma stadium, windhoek, namibia' | wikisql |
CREATE TABLE table_77958 (
"Series" text,
"Monday" text,
"Tuesday" text,
"Thursday" text,
"Saturday" text
) | Which Thursday does big brother 13 air? | SELECT "Thursday" FROM table_77958 WHERE "Series" = 'big brother 13' | wikisql |
CREATE TABLE table_78154 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who is the opponent on april 16? | SELECT "Opponent" FROM table_78154 WHERE "Date" = 'april 16' | wikisql |
CREATE TABLE table_name_93 (
home VARCHAR,
score VARCHAR
) | Who was the home team when the score was 4 3? | SELECT home FROM table_name_93 WHERE score = "4–3" | sql_create_context |
CREATE TABLE table_79216 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text,
"Arena" text,
"Points" text
) | What is the Arena when there were 65 points? | SELECT "Arena" FROM table_79216 WHERE "Points" = '65' | wikisql |
CREATE TABLE table_66189 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What Tournament has a Winning score of 16 (66-64-67=197)? | SELECT "Tournament" FROM table_66189 WHERE "Winning score" = '−16 (66-64-67=197)' | wikisql |
CREATE TABLE table_42856 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
) | What is the lowest match that has a lost greater than 3, and kolejarz rawicz as the team? | SELECT MIN("Match") FROM table_42856 WHERE "Lost" > '3' AND "Team" = 'kolejarz rawicz' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | what was the top three most frequently performed procedures that patients were given during the same hospital visit after being diagnosed with oth lymp unsp xtrndl org since 1 year ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | mimic_iii |
CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | known pre _ existing left ventricular dysfunction ( ef < 45 % prior to admission ) | SELECT * FROM table_test_22 WHERE left_ventricular_dysfunction = 1 OR ejection_fraction_ef < 45 | criteria2sql |
CREATE TABLE table_name_74 (
score VARCHAR,
date VARCHAR
) | What was the final score of the game on June 17? | SELECT score FROM table_name_74 WHERE date = "june 17" | sql_create_context |
CREATE TABLE table_52376 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | what was the away team for the north melbourne home team? | SELECT "Away team" FROM table_52376 WHERE "Home team" = 'north melbourne' | wikisql |
CREATE TABLE table_40961 (
"Model" text,
"Books / PUs" text,
"IFLs / uIFLs" text,
"zAAPs / zIIPs" text,
"ICFs" text,
"Opt SAPs" text,
"Std SAPs" real,
"Std Spares" real,
"Standard Memory (GB)" text,
"Flexible Memory (GB)" text
) | For Model e64 what is the zAAPs/zIIPs? | SELECT "zAAPs / zIIPs" FROM table_40961 WHERE "Model" = 'e64' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | how much difference of heart rate has patient 14982 experienced last measured on the last intensive care unit visit compared to the value first measured on the last intensive care unit visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14982) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
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... | 病患50606376在2011-11-27之后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE table_25388 (
"Magnet" text,
"B r (T)" text,
"H ci (kA/m)" text,
"(BH) max (kJ/m 3 )" text,
"T c (\u00b0C)" text
) | When 0.6 1.4 is the b r (t) what is the h ci (ka/m)? | SELECT "H ci (kA/m)" FROM table_25388 WHERE "B r (T)" = '0.6–1.4' | wikisql |
CREATE TABLE table_name_42 (
home_team VARCHAR,
away_team VARCHAR
) | What team did team carlton play while away? | SELECT home_team FROM table_name_42 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE table_203_438 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | what role did damon play most throughout his career ? | SELECT "role" FROM table_203_438 GROUP BY "role" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_53 (
pick__number VARCHAR,
round VARCHAR,
overall VARCHAR,
position VARCHAR
) | In Round 13, what was the Pick # of the Guard Position with an Overall greater than 23? | SELECT pick__number FROM table_name_53 WHERE overall > 23 AND position = "guard" AND round = 13 | sql_create_context |
CREATE TABLE table_name_51 (
hypertransport_version VARCHAR,
max_aggregate_bandwidth__bi_directional_ VARCHAR
) | What Hyper Transport version has 22.4 gb/s of Max. Aggregate bandwidth? | SELECT hypertransport_version FROM table_name_51 WHERE max_aggregate_bandwidth__bi_directional_ = "22.4 gb/s" | sql_create_context |
CREATE TABLE table_59145 (
"Event" text,
"Time" text,
"Swimmer" text,
"School" text,
"Year" real
) | What is Time, when Year is greater than 2011, and when Event is '800 Freestyle Relay'? | SELECT "Time" FROM table_59145 WHERE "Year" > '2011' AND "Event" = '800 freestyle relay' | wikisql |
CREATE TABLE table_name_73 (
location VARCHAR,
district VARCHAR
) | What is the location of the tiruchirappalli district? | SELECT location FROM table_name_73 WHERE district = "tiruchirappalli district" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose discharge location is short term hospital and year of birth is less than 1837? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "1837" | mimicsql_data |
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate number,
film_id number,
type text,
market_id number,
year number
)
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,... | Which studios have an average gross of over 4500000? | SELECT studio FROM film GROUP BY studio HAVING AVG(gross_in_dollar) >= 4500000 | spider |
CREATE TABLE table_22719 (
"interval name" text,
"size (steps)" real,
"size (cents)" real,
"just ratio" text,
"just (cents)" text,
"error" text,
"audio" text
) | If the just cents is 84.46, what is the just ratio? | SELECT "just ratio" FROM table_22719 WHERE "just (cents)" = '84.46' | 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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | when was the first microbiology test of patient 28447, in this month? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevent... | mimic_iii |
CREATE TABLE table_4185 (
"#" text,
"Project" text,
"Shipyard" text,
"Laid down" text,
"Launched" text,
"Commissioned" text,
"Status" text
) | what project was initially started before september 20, 1968 | SELECT "Commissioned" FROM table_4185 WHERE "Launched" = 'September 20, 1968' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | Number of votes per month. Accounting only for votes cast on questions less than 31 days after the question was created. | WITH UpVotesByDay AS (SELECT DATEADD(day, DATEDIFF(day, 0, CreationDate), 0) AS "day", COUNT(v.Id) AS Votes FROM Votes AS v JOIN Posts AS p ON (p.Id = v.PostId) AND p.PostTypeId = 1 WHERE v.VoteTypeId = 2 GROUP BY DATEADD(day, DATEDIFF(day, 0, CreationDate), 0)), DownVotesByDay AS (SELECT DATEADD(day, DATEDIFF(day, 0, ... | sede |
CREATE TABLE table_67278 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Bonus points" text,
"Points" text
) | How many points did the Castres have? | SELECT "Points for" FROM table_67278 WHERE "Club" = 'castres' | wikisql |
CREATE TABLE table_53886 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What is the record of the game when Los Angeles was the home team? | SELECT "Record" FROM table_53886 WHERE "Home" = 'los angeles' | wikisql |
CREATE TABLE table_65864 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | What is the lowest total of player tommy ring, who has a rank greater than 1? | SELECT MIN("Total") FROM table_65864 WHERE "Player" = 'tommy ring' AND "Rank" > '1' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
... | Papers from ACL 2016 ? | SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' | scholar |
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,
... | 编号99383862652的医疗就诊中,患者的病情描述有哪些症状 | SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '99383862652' | css |
CREATE TABLE table_name_43 (
rider VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Who was teh rider with 18 laps and a grid of 25? | SELECT rider FROM table_name_43 WHERE laps = 18 AND grid = 25 | sql_create_context |
CREATE TABLE table_25438110_5 (
road VARCHAR,
county VARCHAR
) | What road is associated with Carson Valley county? | SELECT road FROM table_25438110_5 WHERE county = "Carson Valley" | sql_create_context |
CREATE TABLE table_name_61 (
election_year INTEGER,
birth_state VARCHAR
) | What is the election year of the president with a Birth State of lost connecticut? | SELECT AVG(election_year) FROM table_name_61 WHERE birth_state = "lost connecticut" | sql_create_context |
CREATE TABLE table_79010 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | What is the score for the United States when Harry Hampton is the player and the money is $73? | SELECT "Score" FROM table_79010 WHERE "Country" = 'united states' AND "Money ( $ )" = '73' AND "Player" = 'harry hampton' | wikisql |
CREATE TABLE table_name_76 (
top_5 INTEGER,
events VARCHAR,
top_25 VARCHAR
) | In the tournament that has 15 events, and less than 6 top-25's, how many top-5's did he have? | SELECT SUM(top_5) FROM table_name_76 WHERE events = 15 AND top_25 < 6 | sql_create_context |
CREATE TABLE table_46266 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the average laps completed by riders with times of +2:11.524? | SELECT AVG("Laps") FROM table_46266 WHERE "Time" = '+2:11.524' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule... | Plot openning year by how many openning year as a trend line, display by the x axis in ascending please. | SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year | nvbench |
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,
... | what is the daily average amount of glucose of patient 025-35599 until 4 years ago? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-35599')) AND lab.labname = 'glucose' AND DATETIME(lab.labresulttime) <= DATETI... | eicu |
CREATE TABLE table_10466 (
"Independent" text,
"Lost" real,
"Tied" real,
"Pct." real,
"Years" real,
"Total Games" real
) | What is the PCT when the total number of games is less than 944? | SELECT "Pct." FROM table_10466 WHERE "Total Games" < '944' | wikisql |
CREATE TABLE table_77592 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Who built the car that ran out of fuel before 28 laps? | SELECT "Constructor" FROM table_77592 WHERE "Laps" < '28' AND "Time/Retired" = 'out of fuel' | 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 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 year of birth is less than 2168 and diagnoses short title is rheumatic heart failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2168" AND diagnoses.short_title = "Rheumatic heart failure" | mimicsql_data |
CREATE TABLE table_204_638 (
id number,
"year" number,
"tournament" text,
"surface" text,
"round" text,
"winner" text,
"score" text
) | who won the last tourament ? | SELECT "winner" FROM table_204_638 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find the total student enrollment for different affiliation type schools Plot them as bar chart, could you rank in asc by the bar please? | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation | nvbench |
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... | 2594151这个医院涉及医疗费总额不少于4929.26元的科室有多少?时间范围是2004-10-21到2007-11-27 | SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2594151' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-21' AND '2007-11-27' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 4929.26 UNION SELECT fgwyjzb... | css |
CREATE TABLE table_1342149_24 (
result VARCHAR,
district VARCHAR
) | Name the result for mississippi 2 | SELECT result FROM table_1342149_24 WHERE district = "Mississippi 2" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Draw a pie chart about the proportion of ACC_Road and the sum of School_ID. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CREATE T... | Show me a bar chart for 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 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... | 看看这位25889961的患者在01年1月12日到16年5月16日期间,去医院看过最主要的疾病是什么 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '25889961' AND qtb.IN_HOSP_DATE BETWEEN '2001-01-12' AND '2016-05-16' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '25889961' AND gyb.IN_HOSP_DATE... | css |
CREATE TABLE table_name_98 (
location_attendance VARCHAR,
high_points VARCHAR
) | Can you tell me Location Attendance that has the High points of andrew bogut (17)? | SELECT location_attendance FROM table_name_98 WHERE high_points = "andrew bogut (17)" | sql_create_context |
CREATE TABLE table_name_26 (
type VARCHAR,
rank VARCHAR
) | What is the type for rank 2? | SELECT type FROM table_name_26 WHERE rank = 2 | sql_create_context |
CREATE TABLE table_204_20 (
id number,
"represent" text,
"contestant" text,
"age" number,
"height" text,
"hometown" text
) | who is the tallest delegate ? | SELECT "contestant" FROM table_204_20 ORDER BY "height" DESC LIMIT 1 | squall |
CREATE TABLE procedures (
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,
... | calculate the maximum days for which patients who died before 2111 stayed in hospital. | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2111.0" | mimicsql_data |
CREATE TABLE table_24648983_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who wrote the episode with 8.61 million U.S. viewers? | SELECT written_by FROM table_24648983_1 WHERE us_viewers__million_ = "8.61" | sql_create_context |
CREATE TABLE table_name_48 (
ages VARCHAR,
dance VARCHAR,
pair VARCHAR
) | How old were Mitchell & Jessica when they danced the Cha-Cha-Cha? | SELECT ages FROM table_name_48 WHERE dance = "cha-cha-cha" AND pair = "mitchell & jessica" | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Which prerequisite for most classes is offered this semester ? | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... | advising |
CREATE TABLE table_68699 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What round was the opponent Manny Gamburyan? | SELECT "Round" FROM table_68699 WHERE "Opponent" = 'manny gamburyan' | wikisql |
CREATE TABLE table_name_37 (
Id VARCHAR
) | What is the 2005 value for the 2010 grand slam tournaments? | SELECT 2005 FROM table_name_37 WHERE 2010 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_train_24 (
"id" int,
"systolic_blood_pressure_sbp" int,
"do_not_resuscitate_dnr" bool,
"temperature" float,
"hypotension" bool,
"cardiac_arrest" bool,
"age" float,
"NOUSE" float
) | presence of fever: temperature >= 38 c | SELECT * FROM table_train_24 WHERE temperature > 38 | criteria2sql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | CLARCH 856 is taught on what days of the week ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... | advising |
CREATE TABLE table_name_77 (
ppv_buyrate VARCHAR,
date VARCHAR,
event VARCHAR
) | On September 10 during Strikeforce: Heavyweight Grand Prix Semifinals, what was the PPV buyrate? | SELECT ppv_buyrate FROM table_name_77 WHERE date = "september 10" AND event = "strikeforce: heavyweight grand prix semifinals" | sql_create_context |
CREATE TABLE table_56482 (
"Class" text,
"Type" text,
"Quantity" real,
"Date" text,
"LNER Class" text
) | What is the Quantity of Type 2-4-2t? | SELECT SUM("Quantity") FROM table_56482 WHERE "Type" = '2-4-2t' | wikisql |
CREATE TABLE table_name_73 (
school VARCHAR,
season_outcome VARCHAR
) | Name the school for Season Outcome of loss in first round of div. i playoffs | SELECT school FROM table_name_73 WHERE season_outcome = "loss in first round of div. i playoffs" | sql_create_context |
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,
... | how many patients were newborn and born before the year 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2200" | mimicsql_data |
CREATE TABLE table_name_22 (
record VARCHAR,
opponent VARCHAR,
loss VARCHAR
) | What was the record at the game against the Blue Jays with a loss of Batista (0 3)? | SELECT record FROM table_name_22 WHERE opponent = "blue jays" AND loss = "batista (0–3)" | sql_create_context |
CREATE TABLE table_73972 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" real
) | Who wrote episode number 28? | SELECT "Written by" FROM table_73972 WHERE "No." = '28' | wikisql |
CREATE TABLE table_name_52 (
record VARCHAR,
loss VARCHAR
) | Loss of willis has what record? | SELECT record FROM table_name_52 WHERE loss = "willis" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe tex... | User Answers With 0 Score. | SELECT Id AS "post_link", Score, Body, CreationDate FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId##' AND Score = 0 ORDER BY CreationDate DESC | sede |
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value_billion text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE building... | List the number of each company whose office is in the building in a bar chart. | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name | nvbench |
CREATE TABLE table_name_1 (
opponent_number VARCHAR,
result VARCHAR
) | Who was the opponent when the result was w24-7? | SELECT opponent_number FROM table_name_1 WHERE result = "w24-7" | sql_create_context |
CREATE TABLE news_report (
journalist_id number,
event_id number,
work_type text
)
CREATE TABLE event (
event_id number,
date text,
venue text,
name text,
event_attendance number
)
CREATE TABLE journalist (
journalist_id number,
name text,
nationality text,
age text,
... | Find the average age and experience working length of journalists working on different role type. | SELECT AVG(t1.age), AVG(years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type | spider |
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE p... | What are the ids of documents with the type code CV that do not have expenses. | SELECT document_id FROM documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM documents_with_expenses | spider |
CREATE TABLE table_12834315_8 (
barrel_length VARCHAR,
rear_sight VARCHAR,
barrel_profile VARCHAR
) | How many inches is the barrel length when the rear sight is weaver and the barrel profile is A2? | SELECT barrel_length FROM table_12834315_8 WHERE rear_sight = "Weaver" AND barrel_profile = "A2" | 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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what are the two year survival probability of a patient diagnosed with rupture of artery? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_name_65 (
home_team VARCHAR,
venue VARCHAR
) | What was the home team score when the VFL played at Western Oval? | SELECT home_team AS score FROM table_name_65 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE instructor (... | Find the average capacity among rooms in each building with a bar chart, and rank by the bars in ascending. | SELECT building, AVG(capacity) FROM classroom GROUP BY building ORDER BY building | nvbench |
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,
... | What are the dates in which the mean sea level pressure was between 30.3 and 31, and count them by a bar chart | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | What did you try?' Comments. | SELECT C.PostId AS "post_link", C.Text, C.CreationDate, C.UserId, U.DisplayName FROM Comments AS C JOIN Users AS U ON C.UserId = U.Id WHERE REPLACE(UPPER(C.Text), ' ', '') = 'WHATDIDYOUTRY?' ORDER BY C.CreationDate | sede |
CREATE TABLE table_22804 (
"Club" text,
"Position in 2012\u201313" text,
"First season in top division" text,
"Number of seasons in top division" real,
"First season of current spell in top division" text,
"Top division titles" real,
"Last top division title" text
) | when did the club Citizen achieve its last top division title? | SELECT "Last top division title" FROM table_22804 WHERE "Club" = 'Citizen' | wikisql |
CREATE TABLE table_name_21 (
date VARCHAR,
tournament VARCHAR,
score VARCHAR
) | What day was the score for tournament of alcoba a 6 3, 2 6, 7 5? | SELECT date FROM table_name_21 WHERE tournament = "alcobaça" AND score = "6–3, 2–6, 7–5" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 患者10580420所做的检验报告中有哪些报告对应的检验结果指标均正常?列出检验报告单号即可 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '10580420' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_name_97 (
netflix VARCHAR,
segment_a VARCHAR
) | Segment A of heather gems is what netflix episode? | SELECT netflix FROM table_name_97 WHERE segment_a = "heather gems" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | Get me the number of patients who have private health insurance and are diagnosed with late effects of cerebrovascular disease hemiplegia affecting an unaffected side. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Late ef-hemplga side NOS" | mimicsql_data |
CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
) | how many catalogs were released ? | SELECT COUNT("catalog") FROM table_204_966 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | How many of the total number of patients have a black/cape verdean ethnic origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.