context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_21753 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text
) | Which battle of the planets where ova (harmony gold dub) is solaris? | SELECT "Battle of the Planets" FROM table_21753 WHERE "OVA (Harmony Gold Dub)" = 'Solaris' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
serial VARCHAR
) | What is the date for the 10b serial? | SELECT date FROM table_name_46 WHERE serial = "10b" | 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,... | find the primary disease and procedure name for rafael stewart. | SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Rafael Stewart" | mimicsql_data |
CREATE TABLE table_32300 (
"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's score in the match at Victoria Park? | SELECT "Away team score" FROM table_32300 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dep... | Give the number of departments with greater than average budget in each building with a bar chart. | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building | nvbench |
CREATE TABLE table_name_57 (
date VARCHAR,
tie_no VARCHAR,
away_team VARCHAR
) | What date had a tie no of replay, and an away team of watford? | SELECT date FROM table_name_57 WHERE tie_no = "replay" AND away_team = "watford" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | how many patients born before year 2087 had the lab test fluid pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_18 (
korean_dialect VARCHAR,
rr_romaja VARCHAR
) | What is the Korean dialect with a jeolla RR Romaja? | SELECT korean_dialect FROM table_name_18 WHERE rr_romaja = "jeolla" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
... | Are any morning classes available for ENGR 151 ? | 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 = 'ENGR' AND course.number = 151 AND semester.semester = 'WN' AND semester.semester_id = course_off... | advising |
CREATE TABLE table_73001 (
"Round" real,
"Date" text,
"Grand Prix" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text
) | Who had the fastest lap in the Dutch TT Grand Prix? | SELECT "Fastest Lap" FROM table_73001 WHERE "Grand Prix" = 'Dutch TT' | wikisql |
CREATE TABLE table_79039 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | What Circuit has a Date of 25 july? | SELECT "Circuit" FROM table_79039 WHERE "Date" = '25 july' | wikisql |
CREATE TABLE table_20526 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | What year was the team named the Raiders established? | SELECT MAX("Founded") FROM table_20526 WHERE "Team Nickname" = 'Raiders' | wikisql |
CREATE TABLE table_75343 (
"Station" text,
"Services" text,
"Local authority" text,
"Zone 2007" text,
"Zone 2008" text,
"Zone 2010" text,
"Zone 2013" text
) | Which Station has a Zone 2008 of 8, and a Zone 2007 of outside zones, and Services of london overground? | SELECT "Station" FROM table_75343 WHERE "Zone 2008" = '8' AND "Zone 2007" = 'outside zones' AND "Services" = 'london overground' | wikisql |
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... | Find the number of rooms with price higher than 120 for different decor. Show bar chart. | SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor | nvbench |
CREATE TABLE table_40097 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | What is the average year for Team Oreca? | SELECT AVG("Year") FROM table_40097 WHERE "Team" = 'team oreca' | wikisql |
CREATE TABLE table_204_287 (
id number,
"outcome" text,
"no." number,
"date" number,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
) | how many championships are listed ? | SELECT COUNT("championship") FROM table_204_287 | squall |
CREATE TABLE table_33785 (
"Rank" real,
"City" text,
"State" text,
"GDP in $ID B" text,
"Population M (LUZ)" real,
"GDP per capita $ID K" text,
"Eurozone" text
) | What is the Eurozone result for Population M (LUZ) of 3.08? | SELECT "Eurozone" FROM table_33785 WHERE "Population M (LUZ)" = '3.08' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | Recent comments on posts by a deleted user. | SELECT p.Id AS "post_link", c.Text AS Comment, c.CreationDate FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE p.OwnerDisplayName = '##Name:string##' ORDER BY c.CreationDate DESC | sede |
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... | how many patients are admitted before the year 2187 and diagnosed with cardia tamponade? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Cardiac tamponade" | mimicsql_data |
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... | The top 100 worst posts.. | SELECT Id AS "post_link", Score, Body FROM Posts ORDER BY Score LIMIT 100 | sede |
CREATE TABLE table_42722 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is the Opponents on a clay surface with christophe rochus as partner? | SELECT "Opponents" FROM table_42722 WHERE "Surface" = 'clay' AND "Partner" = 'christophe rochus' | wikisql |
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 number of widowed patients who have ivpca route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
) | List the writers of the books in ascending alphabetical order, and count them by a bar chart | SELECT Writer, COUNT(Writer) FROM book GROUP BY Writer ORDER BY Writer | nvbench |
CREATE TABLE table_51069 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Jay Nixon" text,
"Republican: Kenny Hulshof" text,
"Lead Margin" real
) | What was the lead margin when Nixon had 48% and reporting was done by Rasmussen Reports? | SELECT COUNT("Lead Margin") FROM table_51069 WHERE "Democrat: Jay Nixon" = '48%' AND "Poll Source" = 'rasmussen reports' | wikisql |
CREATE TABLE table_name_61 (
poles INTEGER,
position VARCHAR,
wins VARCHAR,
top_5 VARCHAR
) | What is the lowest poles that have 0 as a win, 0 as the top 5, with 66th as the postion? | SELECT MIN(poles) FROM table_name_61 WHERE wins = 0 AND top_5 = 0 AND position = "66th" | sql_create_context |
CREATE TABLE table_22096 (
"Rank" real,
"Airport Name" text,
"Location" text,
"IATA Code" text,
"Passengers" text,
"% Chg. 2009/10" text
) | If the passengers are 15,505,566, what is the iata code? | SELECT "IATA Code" FROM table_22096 WHERE "Passengers" = '15,505,566' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | how many patients were prescribed the drug norepinephrine during the same month after being diagnosed with gi bleeding, since 4 years ago? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'gi bleeding' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELEC... | eicu |
CREATE TABLE table_23292220_13 (
first_broadcast VARCHAR,
episode VARCHAR
) | How many episodes are numbered 12x03? | SELECT COUNT(first_broadcast) FROM table_23292220_13 WHERE episode = "12x03" | sql_create_context |
CREATE TABLE table_78271 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On which date was a game played at Junction Oval? | SELECT "Date" FROM table_78271 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_19121 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | tell the score when the times gone was 75 | SELECT "Points against" FROM table_19121 WHERE "Tries against" = '75' | wikisql |
CREATE TABLE table_13681_2 (
currency_name VARCHAR,
highest_monthly_inflation_rate VARCHAR
) | what's the currency name with highest monthly inflation rate being 29,500% | SELECT currency_name FROM table_13681_2 WHERE highest_monthly_inflation_rate = "29,500%" | sql_create_context |
CREATE TABLE table_48467 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
) | For the game played against the L.A. Lakers, where was the match played and what was the attendance level? | SELECT "Location Attendance" FROM table_48467 WHERE "Team" = 'l.a. lakers' | wikisql |
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),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_3 (
venue VARCHAR,
against VARCHAR,
date VARCHAR
) | Where was the match on 10/11/2001 against 15? | SELECT venue FROM table_name_3 WHERE against = 15 AND date = "10/11/2001" | sql_create_context |
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... | 医疗机构6692074目前在院一共多少人? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6692074' AND gwyjzb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6692074' AND fgwyjzb.HOSP_STS > 0 | css |
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,... | count the number of patients whose primary disease is bowel obstruction and age is less than 56? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age < "56" | mimicsql_data |
CREATE TABLE table_name_60 (
year VARCHAR,
nominee VARCHAR
) | what year was michele assaf nominated | SELECT year FROM table_name_60 WHERE nominee = "michele assaf" | sql_create_context |
CREATE TABLE cinema (
cinema_id number,
name text,
openning_year number,
capacity number,
location text
)
CREATE TABLE schedule (
cinema_id number,
film_id number,
date text,
show_times_per_day number,
price number
)
CREATE TABLE film (
film_id number,
rank_in_series nu... | What is the location with the most cinemas opened in year 2010 or later? | SELECT location FROM cinema WHERE openning_year >= 2010 GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_47654 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which NFL team has a player that came from a college in Washington? | SELECT "NFL Team" FROM table_47654 WHERE "College" = 'washington' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | R questions and answers per month (2). How many questions per month does each tag in the top 10 tags get | SELECT Month, COUNT(*) AS count FROM (SELECT Id, PostTypeId, DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month" FROM Posts LEFT JOIN PostTags ON PostId = Id WHERE TagId = 4452) AS tmp GROUP BY Month, PostTypeId ORDER BY Month, PostTypeId | sede |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | Top answerers on the site. A list of the top users with the highest average answer score excluding
community wiki / closed posts or users with fewer than 10 answers | WITH UserAvgAnswerScore AS (SELECT Users.Id AS UserId, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVI... | sede |
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
)
... | provide the number of patients whose insurance is government and diagnoses long title is microscopic hematuria? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Microscopic hematuria" | mimicsql_data |
CREATE TABLE table_73841 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the series episode number of the episode titled 'sound and vision'? | SELECT MAX("Series #") FROM table_73841 WHERE "Title" = 'Sound and Vision' | wikisql |
CREATE TABLE table_5148 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the sum of laps that has a time/retired that is +19.475? | SELECT SUM("Laps") FROM table_5148 WHERE "Time/Retired" = '+19.475' | 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by time. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_76254 (
"Date From" text,
"Date To" text,
"Position" text,
"Name" text,
"From" text
) | What was the from for the Date From of 2007-08-08? | SELECT "From" FROM table_76254 WHERE "Date From" = '2007-08-08' | wikisql |
CREATE TABLE table_77264 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"College" text
) | WHAT COLLEGE HAS A ROUND LARGER THAN 9, WITH BUTCH WEBSTER? | SELECT "College" FROM table_77264 WHERE "Round" > '9' AND "Player" = 'butch webster' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE restriction ... | could i have a list of flights in FIRST class on monday from SAN FRANCISCO to PITTSBURGH starting at 1200 and afterwards | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT... | atis |
CREATE TABLE table_55759 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many total Silver has a Bronze larger than 19 and a Total smaller than 125? | SELECT SUM("Silver") FROM table_55759 WHERE "Bronze" > '19' AND "Total" < '125' | wikisql |
CREATE TABLE table_7441 (
"geohash length" real,
"lat bits" real,
"lng bits" real,
"lat error" text,
"lng error" text,
"km error" text
) | What is the highest geohash length when the lat error is 0.00068, and the lat bits larger than 17? | SELECT MAX("geohash length") FROM table_7441 WHERE "lat error" = '±0.00068' AND "lat bits" > '17' | wikisql |
CREATE TABLE table_2126 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | What is the lowest rank? | SELECT MIN("Rank") FROM table_2126 | wikisql |
CREATE TABLE table_71531 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was the value in 2012 when 2002 was Q1 and 2010 was 1R? | SELECT "2012" FROM table_71531 WHERE "2002" = 'q1' AND "2010" = '1r' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | what are the three most commonly prescribed medications for patients for whom albumin human 25% is also prescribed at the same time, since 2103? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'albumin human 25%' AND STRFTIME('%y', medication.dr... | eicu |
CREATE TABLE table_name_29 (
conference VARCHAR,
awards VARCHAR
) | Where the Vancouver Grizzlies is the awards, what is the conference? | SELECT conference FROM table_name_29 WHERE awards = "vancouver grizzlies" | sql_create_context |
CREATE TABLE table_name_3 (
country VARCHAR,
player VARCHAR
) | What is the country for the player Tiger Woods? | SELECT country FROM table_name_3 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE table_42421 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the sum of the pick numbers for the player that went to San Miguel Beermen who played at San Sebastian? | SELECT SUM("Pick") FROM table_42421 WHERE "PBA team" = 'san miguel beermen' AND "College" = 'san sebastian' | wikisql |
CREATE TABLE table_67044 (
"Ship" text,
"Pennant number" text,
"Laid down" text,
"Launched" text,
"Commissioned" text
) | Which Laid down has a Ship of fearless? | SELECT "Laid down" FROM table_67044 WHERE "Ship" = 'fearless' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | since 12/30/2105, was patient 004-13127's temperature less than 37.778? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND vitalperiodic.temperature < 37.778 AND NOT vitalper... | eicu |
CREATE TABLE table_203_353 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"time" text
) | how many songs are at most 3 minutes long ? | SELECT COUNT("title") FROM table_203_353 WHERE "time" < 3 | squall |
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,... | 列一下2402730这家医院所有的就诊记载里病人的平均的年纪有多大,依照科室与入院诊断病名的差异把其中小于14岁的记录留下来 | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2402730' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 14 | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what are the new meds of patient 006-172277 today compared to the one yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-172277') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is discharge location and discharge time of subject id 2560? | SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 这个患者吕秀艳以前的门诊诊断都有什么? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_... | css |
CREATE TABLE pilot_record (
record_id number,
pilot_id number,
aircraft_id number,
date text
)
CREATE TABLE pilot (
pilot_id number,
pilot_name text,
rank number,
age number,
nationality text,
position text,
join_year number,
team text
)
CREATE TABLE aircraft (
airc... | Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000. | SELECT position FROM pilot WHERE join_year < 2000 INTERSECT SELECT position FROM pilot WHERE join_year > 2005 | spider |
CREATE TABLE table_name_30 (
record VARCHAR,
attendance VARCHAR
) | What is the record of the game with 28,135 people in attendance? | SELECT record FROM table_name_30 WHERE attendance = "28,135" | sql_create_context |
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machi... | Show different teams of technicians and the number of technicians in each team, list by the bar in desc. | SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team DESC | nvbench |
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
c... | A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and display by the y-axis from high to low. | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description) DESC | nvbench |
CREATE TABLE table_65357 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the PBA team for roberto jabar who was picked before number 11? | SELECT "PBA team" FROM table_65357 WHERE "Pick" < '11' AND "Player" = 'roberto jabar' | wikisql |
CREATE TABLE table_1566850_8 (
interview_subject VARCHAR,
date VARCHAR
) | Who was the interview subject on the date 1-97? | SELECT interview_subject FROM table_1566850_8 WHERE date = "1-97" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and I want to rank by the how many nationality from high to low. | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | on the last intensive care unit visit', what was maximum respiration of patient 007-11182? | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182') AND NOT patient.unitdischargetime IS N... | eicu |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | what type of aircraft is used on the flight from ATLANTA to PHILADELPHIA before 1200 | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.departure_time < 1200 AND fl... | atis |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE faculty... | Show the rank, first name, and last name for all the faculty. | SELECT rank, fname, lname FROM faculty | spider |
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
) | Show me a bar chart comparing the total number of captains of different classes. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what is the first test that patient 027-185580 had in their last hospital encounter? | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-185580' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmitt... | eicu |
CREATE TABLE table_name_74 (
fastest_lap VARCHAR,
name VARCHAR
) | What time was the fastest lap during Stoh's 200 in 1982? | SELECT fastest_lap FROM table_name_74 WHERE name = "stoh's 200" | sql_create_context |
CREATE TABLE table_55033 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which date has a Score of 4 6, 2 6? | SELECT "Date" FROM table_55033 WHERE "Score" = '4–6, 2–6' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | how many times does patient 015-20584 produce hemovac #1 since 03/30/2102? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-20584')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_15945862_1 (
december VARCHAR,
september VARCHAR
) | What septembers are 17.1 in December? | SELECT december FROM table_15945862_1 WHERE september = "17.1" | sql_create_context |
CREATE TABLE table_32563 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the date of the game where Collingwood was the home team? | SELECT "Date" FROM table_32563 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_name_44 (
height VARCHAR,
position VARCHAR,
year_born VARCHAR
) | Born in 1982, this guard has what listed as a height? | SELECT height FROM table_name_44 WHERE position = "guard" AND year_born = 1982 | sql_create_context |
CREATE TABLE table_name_49 (
date VARCHAR,
venue VARCHAR,
player VARCHAR
) | What date did Josh Taumalolo play at Nuku'alofa? | SELECT date FROM table_name_49 WHERE venue = "nuku'alofa" AND player = "josh taumalolo" | sql_create_context |
CREATE TABLE table_203_788 (
id number,
"year" number,
"author" text,
"illustrator" text,
"title" text,
"publisher" text
) | how many titles did walker publish ? | SELECT COUNT("title") FROM table_203_788 WHERE "publisher" = 'walker' | squall |
CREATE TABLE table_62138 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the highest goal difference of the club with more than 34 played? | SELECT MAX("Goal Difference") FROM table_62138 WHERE "Played" > '34' | wikisql |
CREATE TABLE table_61050 (
"Model" text,
"Years" text,
"Engine" text,
"Power" text,
"0\u2013100km/h (62mph)" text,
"Top Speed" text
) | How fast can the SLK200K, with a top speed of 236km/h (147mph), accelerate to 100km/h (62mph)? | SELECT "0\u2013100km/h (62mph)" FROM table_61050 WHERE "Model" = 'slk200k' AND "Top Speed" = '236km/h (147mph)' | wikisql |
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 number of patients whose death status is 0 and drug code is docu100l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.formulary_drug_cd = "DOCU100L" | mimicsql_data |
CREATE TABLE table_26397277_3 (
role_s_ VARCHAR,
pick__number VARCHAR
) | Name the role for pick number 17 | SELECT role_s_ FROM table_26397277_3 WHERE pick__number = 17 | sql_create_context |
CREATE TABLE table_204_395 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | which year had the most competitions ? | SELECT "year" FROM table_204_395 GROUP BY "year" ORDER BY COUNT("competition") DESC LIMIT 1 | squall |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | Show the number of companies in each headquarter with a bar chart, and show x-axis in ascending order. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters | nvbench |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
... | what's the difference between the total output and the amount of input for patient 16088 since 182 days ago? | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 16088)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-182 d... | mimic_iii |
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... | BIOMATLS 576 has never been taught by which professors ? | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING... | advising |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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... | Which upper-level electives are offered in the Spring and Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '... | advising |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
... | show me all flights from PITTSBURGH to BALTIMORE tomorrow | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND... | atis |
CREATE TABLE table_19869 (
"Eviction No." real,
"Nominee" text,
"Vote to Save" text,
"Vote to Evict" text,
"Net vote" text,
"Eviction result" text
) | How many nominees had a net voice of 15.17% | SELECT COUNT("Nominee") FROM table_19869 WHERE "Net vote" = '15.17%' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients are diagnosed with pressure ulcer, stage iv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Pressure ulcer, stage IV" | mimicsql_data |
CREATE TABLE products (
Name VARCHAR,
Price INTEGER,
manufacturer VARCHAR
)
CREATE TABLE Manufacturers (
name VARCHAR,
code VARCHAR
) | Select the name of each manufacturer along with the name and price of its most expensive product. | SELECT T1.Name, MAX(T1.Price), T2.Name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.Name | sql_create_context |
CREATE TABLE table_33959 (
"Element" text,
"Wood" text,
"Fire" text,
"Earth" text,
"Metal" text,
"Water" text
) | Which Water has a Metal of contracting? | SELECT "Water" FROM table_33959 WHERE "Metal" = 'contracting' | wikisql |
CREATE TABLE table_52583 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | what is the result for the world group, semifinals after the year 1997? | SELECT "Result" FROM table_52583 WHERE "Year" > '1997' AND "Competition" = 'world group, semifinals' | wikisql |
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
... | Give me a stacked bar chart to show how many things in different types of each thing, and the details of the organization that owns it, show in desc by the Y. | SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details, Type_of_Thing_Code ORDER BY COUNT(Type_of_Thing_Code) DESC | nvbench |
CREATE TABLE table_name_19 (
studio_host VARCHAR,
play_by_play VARCHAR,
studio_analysts VARCHAR
) | Who is the studio host for the game that has Paul Sunderland as play by play commentator and Jack Haley as the Studio Analyst? | SELECT studio_host FROM table_name_19 WHERE play_by_play = "paul sunderland" AND studio_analysts = "jack haley" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.