context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_64160 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Where was the match that lasted less than 3 rounds and was won by submission (triangle choke)? | SELECT "Location" FROM table_64160 WHERE "Round" < '3' AND "Method" = 'submission (triangle choke)' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | let me know the birth date and short title of diagnoses for patient fernando wontor. | SELECT demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Fernando Wontor" | mimicsql_data |
CREATE TABLE table_40535 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | Which Cover model has a 20 Questions of christina applegate? | SELECT "Cover model" FROM table_40535 WHERE "20 Questions" = 'christina applegate' | wikisql |
CREATE TABLE table_204_917 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | in how many games were than more than 80,000 people attending | SELECT COUNT(*) FROM table_204_917 WHERE "attendance" > 80000 | squall |
CREATE TABLE table_49729 (
"Team" text,
"Sets+" real,
"Sets\u2013" real,
"Points+" real,
"Points\u2013" real
) | What is the Sets+ for Team unicaja almer a where the Sets- were less than 21 and the Points+ were less than 1497? | SELECT SUM("Sets+") FROM table_49729 WHERE "Sets\u2013" < '21' AND "Team" = 'unicaja almería' AND "Points+" < '1497' | wikisql |
CREATE TABLE table_15038373_1 (
license VARCHAR,
version VARCHAR
) | How many licenses have version 1.2.2.0? | SELECT COUNT(license) FROM table_15038373_1 WHERE version = "1.2.2.0" | sql_create_context |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | Return a bar graph for the name of the school that has the smallest enrollment in each state, and order from high to low by the x axis. | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName 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... | when was patient 031-1337 first tested for microbiology on their first hospital encounter? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ... | eicu |
CREATE TABLE table_name_41 (
opponent VARCHAR,
game INTEGER
) | Who were the opponents in games before number 54? | SELECT opponent FROM table_name_41 WHERE game < 54 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | Get all posts since 2016-01-01. | SELECT AnswerCount, Body, CommentCount, CreationDate, FavoriteCount, Posts.Id AS Posts_ID, LastActivityDate, OwnerUserId, PostTypeId, Score, Tags, Title, ViewCount FROM Posts WHERE PostTypeId = 1 AND CreationDate >= '2016-01-01' | sede |
CREATE TABLE table_name_9 (
score VARCHAR,
comp VARCHAR
) | What is the Score of the Shooter with a Comp of OG? | SELECT score FROM table_name_9 WHERE comp = "og" | sql_create_context |
CREATE TABLE table_name_12 (
seats INTEGER,
_percentage_votes VARCHAR,
change VARCHAR
) | What are the fewest seats with fewer than 5.4% seats and more than -1 change? | SELECT MIN(seats) FROM table_name_12 WHERE _percentage_votes < 5.4 AND change > -1 | sql_create_context |
CREATE TABLE table_66936 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | In the Formula One World Championships, which entrant had 0 points with a Ferrari 156 Chassis after 1961? | SELECT "Entrant" FROM table_66936 WHERE "Points" = '0' AND "Year" > '1961' AND "Chassis" = 'ferrari 156' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 36916045402的就诊状态代码和名称在门诊就诊里都分别是什么? | SELECT wdmzjzjlb.JZZTDM, wdmzjzjlb.JZZTMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '36916045402' UNION SELECT bdmzjzjlb.JZZTDM, bdmzjzjlb.JZZTMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '36916045402' | css |
CREATE TABLE table_name_87 (
total INTEGER,
year_won VARCHAR,
to_par VARCHAR
) | What is the Total of the Player with a To par of 6 and Year won after 1993? | SELECT MIN(total) FROM table_name_87 WHERE year_won > 1993 AND to_par = 6 | sql_create_context |
CREATE TABLE table_4920 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team's score when the Home team score is 19.15 (129)? | SELECT "Away team score" FROM table_4920 WHERE "Home team score" = '19.15 (129)' | wikisql |
CREATE TABLE table_name_70 (
grid INTEGER,
laps VARCHAR,
bike VARCHAR,
time VARCHAR
) | What is the largest Grid that has a Bike of honda cbr1000rr, and a Time of +20.848, and a Lap greater than 24? | SELECT MAX(grid) FROM table_name_70 WHERE bike = "honda cbr1000rr" AND time = "+20.848" AND laps > 24 | sql_create_context |
CREATE TABLE table_30663 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | Name the trine dehli cleve for english waltz | SELECT MIN("Trine Dehli Cleve") FROM table_30663 WHERE "Style" = 'English Waltz' | wikisql |
CREATE TABLE table_name_85 (
total INTEGER,
finish VARCHAR
) | How many totals have t6 as the finish? | SELECT SUM(total) FROM table_name_85 WHERE finish = "t6" | sql_create_context |
CREATE TABLE table_20736 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | On what dates where games played at Football Park? | SELECT "Date" FROM table_20736 WHERE "Ground" = 'Football Park' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | what are the flights from MILWAUKEE to TAMPA | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMP... | atis |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
... | Find the name and budget of departments whose budgets are more than the average budget Visualize by bar chart, 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 table_32394 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Which venue is in the city of Villanova? | SELECT "Venue" FROM table_32394 WHERE "City" = 'villanova' | 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 (
... | what was the first procedure patient 028-66126 had in the last year. | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-66126')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE table_50639 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What place did Fred Couples finish in? | SELECT "Place" FROM table_50639 WHERE "Player" = 'fred couples' | wikisql |
CREATE TABLE table_name_22 (
males VARCHAR,
language VARCHAR
) | What males speak Polish? | SELECT males FROM table_name_22 WHERE language = "polish" | sql_create_context |
CREATE TABLE table_64827 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many golds have a bronze greater than 1, a silver greater than 1, with total as the rank? | SELECT COUNT("Gold") FROM table_64827 WHERE "Bronze" > '1' AND "Silver" > '1' AND "Rank" = 'total' | 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 those employees who did not have any job in the past, draw a scatter chart about the correlation between commission_pct and department_id . | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_46 (
females INTEGER,
males VARCHAR,
rank VARCHAR
) | What is the biggest number of females where the males are at 28.2 with a rank greater than 5? | SELECT MAX(females) FROM table_name_46 WHERE males = 28.2 AND rank > 5 | sql_create_context |
CREATE TABLE table_37081 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s) up" text
) | On what date was the winning score 20 (68-67-65-64=264)? | SELECT "Date" FROM table_37081 WHERE "Winning score" = '–20 (68-67-65-64=264)' | wikisql |
CREATE TABLE table_name_24 (
field VARCHAR,
commissioned VARCHAR
) | What Field was Commissioned in 1958, 2005? | SELECT field FROM table_name_24 WHERE commissioned = "1958, 2005" | sql_create_context |
CREATE TABLE table_name_32 (
date VARCHAR,
loser VARCHAR,
location VARCHAR
) | What date did the Chicago Bears beat the Green bay Packers 31-20? | SELECT date FROM table_name_32 WHERE loser = "green bay packers" AND location = "green bay" | sql_create_context |
CREATE TABLE table_1341663_26 (
incumbent VARCHAR,
candidates VARCHAR
) | How many times was the candidates dick gephardt (d) 81.9% lee buchschacher (r) 18.1%? | SELECT COUNT(incumbent) FROM table_1341663_26 WHERE candidates = "Dick Gephardt (D) 81.9% Lee Buchschacher (R) 18.1%" | sql_create_context |
CREATE TABLE table_1949994_7 (
premiere_air_dates VARCHAR,
country VARCHAR
) | When did the season located in the Netherlands premier? | SELECT premiere_air_dates FROM table_1949994_7 WHERE country = "The Netherlands" | sql_create_context |
CREATE TABLE table_52745 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Which visiting team had a final score of 14-34? | SELECT "Visiting Team" FROM table_52745 WHERE "Final Score" = '14-34' | wikisql |
CREATE TABLE table_56588 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What suface during the game that had Yevgeny Kafelnikov as an opponent? | SELECT "Surface" FROM table_56588 WHERE "Opponent" = 'yevgeny kafelnikov' | wikisql |
CREATE TABLE table_name_61 (
in_malayalam VARCHAR,
saka_era VARCHAR
) | WHAT IS THE IN MALAYALAM WITH kartika agrahayana? | SELECT in_malayalam FROM table_name_61 WHERE saka_era = "kartika–agrahayana" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name by a bar chart. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_40101 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which Lost has an Against of 49 and a Played smaller than 20? | SELECT COUNT("Lost") FROM table_40101 WHERE "Against" = '49' AND "Played" < '20' | wikisql |
CREATE TABLE table_17177 (
"Name of ground" text,
"Location" text,
"Year" text,
"FC matches" real,
"LA matches" real,
"T20 matches" real,
"Total" real
) | Where is ropery lane and la matches 7 location? | SELECT "Location" FROM table_17177 WHERE "LA matches" = '7' AND "Name of ground" = 'Ropery Lane' | wikisql |
CREATE TABLE table_78404 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the name of the competition that took place on may 31, 2008? | SELECT "Competition" FROM table_78404 WHERE "Date" = 'may 31, 2008' | wikisql |
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,
... | 有哪些人报告超过13份检验报告单在医疗就诊24605485299中?列出这些报告人有什么工号和姓名? | SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '24605485299' GROUP BY zyjybgb.BGRGH HAVING COUNT(*) > 13 UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '24605485299' GROUP BY mzjybgb.BGRGH HAVING COUNT(*) > 13 | css |
CREATE TABLE table_name_63 (
lost INTEGER,
name VARCHAR,
position VARCHAR
) | What is the average Lost that has a Name of ec amberg (n), and a Position smaller than 4? | SELECT AVG(lost) FROM table_name_63 WHERE name = "ec amberg (n)" AND position < 4 | sql_create_context |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | To satisfy the MDE requirement , which classes are the least demanding ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE table_17918238_1 (
maximum_diameter VARCHAR,
owner_operator VARCHAR
) | What is Esperance pipeline co total diameter? | SELECT maximum_diameter FROM table_17918238_1 WHERE owner_operator = "Esperance Pipeline Co" | sql_create_context |
CREATE TABLE table_79635 (
"Year" real,
"Title" text,
"US Country" text,
"RIAA" text,
"Label" text
) | What label had the album after 1978? | SELECT "Label" FROM table_79635 WHERE "Year" > '1978' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 00929这个科室的896561药品的开药量从02年11月23日到19年3月7日的数目多少? | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_CD = '00929' AND STA_DATE BETWEEN '2002-11-23' AND '2019-03-07' AND SOC_SRT_DIRE_CD = '896561' | css |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
... | list flights from PITTSBURGH to BOSTON leaving after 1500 in the afternoon | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_name_48 (
date VARCHAR,
home VARCHAR
) | What Date has a Home listed as Calgary? | SELECT date FROM table_name_48 WHERE home = "calgary" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | did patient 015-21757 receive any procedure since 4 years ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-21757')) AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | what was the last value of the platelet count lab test of patient 10624 since 03/2105? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER B... | mimic_iii |
CREATE TABLE table_71862 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
) | What is the earliest first game for a rugby team that has 7 lost games and 0 draws? | SELECT MIN("First game") FROM table_71862 WHERE "Lost" = '7' AND "Drawn" < '0' | wikisql |
CREATE TABLE table_203_584 (
id number,
"date" text,
"race name" text,
"d(f)" number,
"course" text,
"prize (\u00a3)" number,
"odds" text,
"runners" number,
"place" number,
"margin" number,
"winner/runner-up" text,
"time" text,
"jockey" text
) | what was the only race won by the jockey charles wood ? | SELECT "race name" FROM table_203_584 WHERE "date" = 'charles wood' | squall |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | Please tell the salary of each hire date using a line chart, I want to list x-axis in ascending order. | SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Questions from top 20 by vote delta. | SELECT Posts.OwnerUserId, COUNT(OwnerUserId) FROM Posts WHERE Posts.ParentId IS NULL AND OwnerUserId IN (SELECT Users.Id FROM Users WHERE Id != -1 ORDER BY UpVotes - DownVotes LIMIT 20) GROUP BY OwnerUserId | sede |
CREATE TABLE table_name_52 (
rank VARCHAR
) | what is the ranking for 2010 production of 2,903,000? | SELECT rank FROM table_name_52 WHERE 2010 = "2,903,000" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of code , and group by attribute name, sort in ascending by the x axis. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | what was the first time that patient 80119 was prescribed a medication in 01/last year? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80119) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '01... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientuni... | how many hours has it been since patient 025-50213 was last diagnosed with lower urinary tract infection during their current hospital encounter. | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213... | eicu |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 列出号码为93974875753的与号码为40947115629这两位在就诊过程中开出了哪些一样名的药品?这些药品都叫什么名称? | SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '93974875753' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ... | css |
CREATE TABLE table_name_7 (
zx_spectrum VARCHAR,
c64 VARCHAR,
title VARCHAR,
c VARCHAR
) | Which ZX Spectrum has a C=64 of c64, and a Title of ankh? | SELECT zx_spectrum FROM table_name_7 WHERE c = 64 = c64 AND title = "ankh" | 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 2087? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2087" | mimicsql_data |
CREATE TABLE table_23744 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) | What was Obama's percentage in the county of Surry? | SELECT "Obama%" FROM table_23744 WHERE "County" = 'Surry' | wikisql |
CREATE TABLE table_name_19 (
date VARCHAR
) | what is the 1st prize for may 21 | SELECT SUM(1 AS st_prize___) AS $__ FROM table_name_19 WHERE date = "may 21" | sql_create_context |
CREATE TABLE table_203_296 (
id number,
"country" text,
"total gdp (nominal)\n(billion us$)" text,
"gdp per capita\n(us$, ppp)" text,
"gdp growth,\n2007-2011\n(in %)" number,
"hdi" text
) | how many countries have their total gdp as 2.2 billion dollars ? | SELECT COUNT("country") FROM table_203_296 WHERE "total gdp (nominal)\n(billion us$)" = 2.2 | squall |
CREATE TABLE table_24074130_5 (
surface VARCHAR,
against VARCHAR
) | What is every surface against Sweden? | SELECT surface FROM table_24074130_5 WHERE against = "Sweden" | sql_create_context |
CREATE TABLE table_name_67 (
original_channel VARCHAR,
year VARCHAR,
note VARCHAR
) | what is the original channel when the year is before 2006 and the note is supporting? | SELECT original_channel FROM table_name_67 WHERE year < 2006 AND note = "supporting" | sql_create_context |
CREATE TABLE table_9205 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | When the Overall is under 102, what's the round played? | SELECT "Round" FROM table_9205 WHERE "Overall" < '102' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients diagnosed with uncontrolled diabetes with hyperosmolarity, type ii or unspecified type had delta abnormal lab test status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "DMII hprosmlr uncontrold" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_78877 (
"Pick #" real,
"Brand (to)" text,
"Employee (Real name)" text,
"Role" text,
"Brand (from)" text
) | What role did Pick # 10 have? | SELECT "Role" FROM table_78877 WHERE "Pick #" = '10' | wikisql |
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,
... | give me the number of patients whose days of hospital stay is greater than 9 and diagnoses icd9 code is 311? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "9" AND diagnoses.icd9_code = "311" | mimicsql_data |
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,
... | what is the admission time and discharge time for the patient name charles nilsson? | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Charles Nilsson" | mimicsql_data |
CREATE TABLE table_1235 (
"Element" text,
"Nuclide" text,
"Z ( p )" real,
"N ( n )" real,
"isotopic mass ( u )" text
) | What is the name of the element with isotopic mass of 158.925 34(2)? | SELECT "Element" FROM table_1235 WHERE "isotopic mass ( u )" = '158.925 34(2)' | wikisql |
CREATE TABLE table_name_56 (
goal_difference VARCHAR,
points_1 VARCHAR,
goals_against VARCHAR
) | When the Points 1 was 51 and the Goals Against was less than 66, what was the Goal Difference? | SELECT goal_difference FROM table_name_56 WHERE points_1 = "51" AND goals_against < 66 | sql_create_context |
CREATE TABLE table_27755784_8 (
date VARCHAR,
team VARCHAR
) | What is the date when the team is listed as New Orleans? | SELECT date FROM table_27755784_8 WHERE team = "New Orleans" | sql_create_context |
CREATE TABLE table_name_57 (
total INTEGER,
t_score VARCHAR,
e_score VARCHAR
) | What is the total of the team with a T score greater than 8 and an E score less than 8.4? | SELECT SUM(total) FROM table_name_57 WHERE t_score > 8 AND e_score < 8.4 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose gender is f and diagnoses short title is rheumatoid arthritis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Rheumatoid arthritis" | mimicsql_data |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Show different teams in eliminations and the number of eliminations from each team by a bar chart, list x-axis in ascending order. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team | nvbench |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | A bar chart about how many music festivals have had each kind of result, ordered descending by count? | SELECT Result, COUNT(*) FROM music_festival GROUP BY Result ORDER BY COUNT(*) DESC | nvbench |
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,
... | provide the number of patients whose admission type is urgent and lab test name is bilirubin, direct? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct" | mimicsql_data |
CREATE TABLE table_28540539_2 (
version VARCHAR,
release VARCHAR
) | What's the number of the 1.0.12 release version? | SELECT COUNT(version) FROM table_28540539_2 WHERE release = "1.0.12" | sql_create_context |
CREATE TABLE table_24143 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Matches" real,
"Caught" real,
"Stumped" real
) | What rank does Rodney Marsh have? | SELECT MAX("Rank") FROM table_24143 WHERE "Player" = 'Rodney Marsh' | wikisql |
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,
... | among patients aged below 45, calculate the total number of those to whom drug was adminitered via ih route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 在一三年一月八日到二一年四月二十七日之内27285110患者以前在医院就诊过几回? | SELECT (SELECT COUNT(*) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '27285110' AND zzmzjzjlb.JZKSRQ BETWEEN '2013-01-08' AND '2021-04-27' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjz... | css |
CREATE TABLE table_name_39 (
year VARCHAR,
theme VARCHAR,
issue_price VARCHAR
) | How many years have a theme of Toronto Maple Leafs and an Issue Price of 24.95? | SELECT COUNT(year) FROM table_name_39 WHERE theme = "toronto maple leafs" AND issue_price = 24.95 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 郑红香这位患者自10.12.12起,到15.4.16止,看过的最主要的病是什么 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郑红香' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-12-12' AND '2015-04-16' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_69985 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Who was the Opponent on July 29? | SELECT "Opponent" FROM table_69985 WHERE "Date" = 'july 29' | wikisql |
CREATE TABLE match (
match_id number,
date text,
venue text,
score text,
result text,
competition text
)
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
regional_population number,
gdp number
)
CREATE TABLE hosting_city (
year number,
... | Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities? | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city | spider |
CREATE TABLE table_80095 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Attendance" real
) | Who was the opponent at the qf(r) round? | SELECT "Opponent" FROM table_80095 WHERE "Round" = 'qf(r)' | wikisql |
CREATE TABLE table_67686 (
"Club" text,
"Played" 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
) | What is the value for Lost, when the value for Try bonus is 2, and when the value for Losing bonus is 4? | SELECT "Lost" FROM table_67686 WHERE "Try bonus" = '2' AND "Losing bonus" = '4' | wikisql |
CREATE TABLE table_name_34 (
county VARCHAR,
median_family_income VARCHAR
) | Which country has a $46,426 median family income? | SELECT county FROM table_name_34 WHERE median_family_income = "$46,426" | sql_create_context |
CREATE TABLE table_21114902_1 (
submissions_of_the_night INTEGER,
fighter VARCHAR
) | How many submission of the night occurred when the fighter was matt wiman? | SELECT MAX(submissions_of_the_night) FROM table_21114902_1 WHERE fighter = "Matt Wiman" | sql_create_context |
CREATE TABLE table_56917 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the total of crowd at Venue of mcg? | SELECT SUM("Crowd") FROM table_56917 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | i'd like to see flights from BALTIMORE to ATLANTA that arrive before 1200 | 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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.arrival_time <= 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_202_173 (
id number,
"track" number,
"title" text,
"translation" text,
"composer" text,
"recorded" text
) | when month were most of the songs recorded on this album ? | SELECT "recorded" FROM table_202_173 GROUP BY "recorded" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepi... | until 1338 days ago, list the yearly average respiration of patient 035-6788. | SELECT AVG(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 = '035-6788')) AND NOT vitalperiodic.respiration IS N... | eicu |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 门诊诊断患者许智鑫为疾病P13.012的二氧化碳的单位和结果定量分别是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_name_59 (
record VARCHAR,
game_site VARCHAR,
date VARCHAR
) | What was the record at Memorial Stadium on September 19, 1965? | SELECT record FROM table_name_59 WHERE game_site = "memorial stadium" AND date = "september 19, 1965" | sql_create_context |
CREATE TABLE table_1399994_5 (
opponents VARCHAR,
year VARCHAR
) | Who were all of the opponents in 1984? | SELECT opponents FROM table_1399994_5 WHERE year = "1984" | sql_create_context |
CREATE TABLE table_54166 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What player had a school of missouri | SELECT "Player" FROM table_54166 WHERE "School/Club Team/Country" = 'missouri' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.