context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_13403120_1 (
writer_s_ VARCHAR,
prodcode VARCHAR
) | who is the writer of the episode with prod.code 30-17 | SELECT writer_s_ FROM table_13403120_1 WHERE prodcode = "30-17" | sql_create_context |
CREATE TABLE table_name_53 (
venue VARCHAR,
score VARCHAR,
competition VARCHAR
) | What is the venue for the friendly competition and score of 4-0? | SELECT venue FROM table_name_53 WHERE score = "4-0" AND competition = "friendly" | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Please use a bar chart to show the minimum price of the rooms in a different decor, sort by the X-axis in desc please. | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC | nvbench |
CREATE TABLE table_name_91 (
_number_of_episodes INTEGER,
character VARCHAR
) | How many episodes had the character of Nick Lucas? | SELECT SUM(_number_of_episodes) FROM table_name_91 WHERE character = "nick lucas" | sql_create_context |
CREATE TABLE table_name_10 (
date VARCHAR,
partnering VARCHAR,
opponent_in_final VARCHAR
) | What is the Date, when Partnering is 'Francesca Lubiani', and when Opponent in Final is 'Yuliya Beygelzimer / Jennifer Hopkins'? | SELECT date FROM table_name_10 WHERE partnering = "francesca lubiani" AND opponent_in_final = "yuliya beygelzimer / jennifer hopkins" | sql_create_context |
CREATE TABLE table_43034 (
"Season" text,
"Team" text,
"Country" text,
"League" text,
"Level" real,
"Apps" real,
"Goals" real
) | What is the Country for the 2006-07 season? | SELECT "Country" FROM table_43034 WHERE "Season" = '2006-07' | wikisql |
CREATE TABLE table_68351 (
"Name" text,
"Park" text,
"Country" text,
"Inversions" real,
"Opened" text,
"Status" text
) | Name the opened for spain | SELECT "Opened" FROM table_68351 WHERE "Country" = 'spain' | wikisql |
CREATE TABLE table_74695 (
"Tujunga" text,
"La Crescenta- Montrose" text,
"Glendale" text,
"La Ca\u00f1ada Flintridge" text,
"Pasadena" text
) | What is the figure for La Crescenta-Montrose when Gelndale is $57,112? | SELECT "La Crescenta- Montrose" FROM table_74695 WHERE "Glendale" = '$57,112' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose diagnoses long title is unspecified fetal and neonatal jaundice and drug name is tamsulosin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified fetal and neonatal jaundice" AND prescriptions.drug = "Tamsulosin" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, find name and the sum of revenue , and group by attribute name, and visualize them by a bar chart. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name | nvbench |
CREATE TABLE table_30927 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (millions)" text
) | What is the original air date when the title is 'be prepared'? | SELECT "Original air date" FROM table_30927 WHERE "Title" = 'Be Prepared' | wikisql |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
de... | Return a bar chart about the distribution of date_address_to and the average of monthly_rental bin date_address_to by weekday. | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
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 patient 016-27397's intake for the first time on 12/26/this year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
CREATE TABLE table_name_43 (
silver INTEGER,
total VARCHAR,
rank VARCHAR,
nation VARCHAR
) | What is the lowest silver for France with a rank less than 5 and a total larger than 19? | SELECT MIN(silver) FROM table_name_43 WHERE rank < 5 AND nation = "france" AND total > 19 | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTasks (
Id num... | Top SO users in Krakow. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%krakow%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_2419754_1 (
enrollment INTEGER,
location VARCHAR
) | How many people are enrolled at the university in milwaukee, wisconsin | SELECT MIN(enrollment) FROM table_2419754_1 WHERE location = "Milwaukee, Wisconsin" | sql_create_context |
CREATE TABLE table_53546 (
"D 50 \u221a" text,
"D 49 \u221a" text,
"D 48 \u221a" text,
"D 47 \u221a" text,
"D 46 \u221a" text,
"D 45 \u221a" text,
"D 44 \u221a" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
) | What is the D 42 figure when D 46 is r 6? | SELECT "D 42 \u221a" FROM table_53546 WHERE "D 46 \u221a" = 'r 6' | wikisql |
CREATE TABLE table_name_86 (
rank INTEGER,
bronze INTEGER
) | Name the average rank for when bronze is more than 1 | SELECT AVG(rank) FROM table_name_86 WHERE bronze > 1 | sql_create_context |
CREATE TABLE table_73809 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Name who directed the production code 1l10 | SELECT "Directed by" FROM table_73809 WHERE "Production code" = '1L10' | wikisql |
CREATE TABLE table_21234111_10 (
robin VARCHAR,
result VARCHAR
) | What was Robin's score when she was eliminated? | SELECT robin FROM table_21234111_10 WHERE result = "Eliminated" | sql_create_context |
CREATE TABLE table_3083 (
"Name" text,
"Position" text,
"Period" text,
"Appearances\u00b9" real,
"Goals\u00b9" real,
"Nationality\u00b2" text
) | Name the period for uruguay | SELECT "Period" FROM table_3083 WHERE "Nationality\u00b2" = 'Uruguay' | wikisql |
CREATE TABLE table_name_62 (
away_team VARCHAR,
venue VARCHAR
) | What was the away team's score at the match played at The Western Oval? | SELECT away_team AS score FROM table_name_62 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is average age of patients whose death status is 0 and primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement ? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " | mimicsql_data |
CREATE TABLE table_27782 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
) | What was the LOA when the elapsed time was 3:06:41:37? | SELECT "LOA (Metres)" FROM table_27782 WHERE "Elapsed time d:hh:mm:ss" = '3:06:41:37' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is days of hospital stay and primary disease of subject id 8440? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "8440" | mimicsql_data |
CREATE TABLE table_name_8 (
week INTEGER,
date VARCHAR
) | What average week has october 8, 1950 as the date? | SELECT AVG(week) FROM table_name_8 WHERE date = "october 8, 1950" | sql_create_context |
CREATE TABLE table_68829 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
) | Which Casualties have a Location of kunduz, and Circumstances of suicide? | SELECT "Casualties" FROM table_68829 WHERE "Location" = 'kunduz' AND "Circumstances" = 'suicide' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id... | Questions that have ever contained this tag. | SELECT Posts.Id AS "post_link", Tags FROM Posts INNER JOIN PostHistory ON Posts.Id = PostHistory.PostId WHERE (PostHistoryTypeId = 3 OR PostHistoryTypeId = 6) AND PostHistory.Text LIKE '%##Tag##%' GROUP BY Posts.Id, Tags | sede |
CREATE TABLE table_name_64 (
status VARCHAR,
founded VARCHAR
) | What is the status of the institution that was founded in 1996? | SELECT status FROM table_name_64 WHERE founded = 1996 | sql_create_context |
CREATE TABLE table_14122 (
"Elector" text,
"Nationality" text,
"Cardinalatial order and title" text,
"Elevated" text,
"Elevator" text,
"Notes" text
) | What's the nationality of Cardinal-Bishop of Albano? | SELECT "Nationality" FROM table_14122 WHERE "Cardinalatial order and title" = 'cardinal-bishop of albano' | wikisql |
CREATE TABLE table_15142 (
"Name" text,
"Design" text,
"Manufacturer" text,
"Acquired" real,
"Disposed" text
) | What is the average year for Wallenstein with 1a1 design? | SELECT AVG("Acquired") FROM table_15142 WHERE "Design" = '1a1' AND "Name" = 'wallenstein' | wikisql |
CREATE TABLE table_70627 (
"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 was the losing bonus that had 1 draw and a 10 try bonus? | SELECT "Losing bonus" FROM table_70627 WHERE "Drawn" = '1' AND "Try bonus" = '10' | wikisql |
CREATE TABLE table_28298589_4 (
date VARCHAR,
visiting_team VARCHAR
) | What date was the game where Texas Southern was the visiting team? | SELECT date FROM table_28298589_4 WHERE visiting_team = "Texas Southern" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | since 2103, what are the top three most frequent drugs prescribed to patients within 2 months after the prescription of sodium chloride 0.9% 250 ml pb? | 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 = 'sodium chloride 0.9% 250 ml pb' AND STRFTIME('%y', ... | eicu |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | had the calcium gluconate, fosphenytoin or vancomycin been prescribed for patient 2498 until 1 year ago? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498) AND prescriptions.drug IN ('calcium gluconate', 'fosphenytoin', 'vancomycin') AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_71867 (
"Team" text,
"1st Match" text,
"Matches" text,
"Lost" text,
"% Won" text
) | Name the lost for % won of 55.37 | SELECT "Lost" FROM table_71867 WHERE "% Won" = '55.37' | 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... | 在医疗就诊00069816988中,为患者曹雅健的检验报告做审核的人有谁?他们的工号是什么 | SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '00069816988' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '00069816988' | css |
CREATE TABLE table_32306 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance when VFL played MCG? | SELECT MAX("Crowd") FROM table_32306 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE table_19864 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What year was the most recent US Open championship? | SELECT MAX("Year") FROM table_19864 WHERE "Championship" = 'US Open' | wikisql |
CREATE TABLE table_25229283_4 (
opponent VARCHAR,
points_for VARCHAR
) | Who was the opponent with a points for of 177? | SELECT opponent FROM table_25229283_4 WHERE points_for = 177 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | how much patient 22449's weight differs second measured on the last hospital visit compared to the value first measured on the last hospital 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 = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE table_204_686 (
id number,
"date" text,
"pos." text,
"name" text,
"from" text,
"fee" text
) | what is the last date on the chart ? | SELECT "date" FROM table_204_686 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what is the minimum amount of hospital cost that includes uric acid until 3 years ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'uric acid')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the date of birth for the patient name tina henderson? | SELECT demographic.dob FROM demographic WHERE demographic.name = "Tina Henderson" | mimicsql_data |
CREATE TABLE table_22862203_2 (
opponent VARCHAR,
record VARCHAR
) | Who were the opponents when the record was 11-2? | SELECT opponent FROM table_22862203_2 WHERE record = "11-2" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose insurance is medicare and diagnoses short title is dementia w/o behav dist? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Dementia w/o behav dist" | mimicsql_data |
CREATE TABLE table_25926 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Jasons team" text,
"Scores" text
) | Name the episode(s) that featured Duncan James and Johnny Vegas as Jason's team. | SELECT "Episode" FROM table_25926 WHERE "Jasons team" = 'Duncan James and Johnny Vegas' | wikisql |
CREATE TABLE table_name_72 (
opponent VARCHAR,
october VARCHAR,
game VARCHAR
) | Which opponent played in game 3 before October 18? | SELECT opponent FROM table_name_72 WHERE october < 18 AND game = 3 | sql_create_context |
CREATE TABLE table_name_11 (
home VARCHAR,
date VARCHAR
) | Name the home for 16 april 2008 | SELECT home FROM table_name_11 WHERE date = "16 april 2008" | sql_create_context |
CREATE TABLE table_65256 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | what is the score on 24 january 1976 with the tie no of 1? | SELECT "Score" FROM table_65256 WHERE "Date" = '24 january 1976' AND "Tie no" = '1' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | Most prolific upvoters: Weighted upvote ratio. | SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(UpVotes AS FLOAT) / (UpVotes + DownVotes), 1) * UpVotes AS Weighted FROM Users WHERE UpVotes > 0 AND Id > -1 ORDER BY Weighted DESC LIMIT 50 | sede |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
... | what type of ground transportation is there at the LAS VEGAS airport | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LAS VEGAS' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | in 2105, had lorazepam ever been prescribed to patient 11095? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11095) AND prescriptions.drug = 'lorazepam' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | SO highest accept rate of answers. | SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNER JOIN Posts AS q ON a.Paren... | sede |
CREATE TABLE table_name_83 (
nation VARCHAR,
points VARCHAR
) | What nation has 187.84 points? | SELECT nation FROM table_name_83 WHERE points = 187.84 | sql_create_context |
CREATE TABLE table_name_72 (
rank INTEGER,
total VARCHAR
) | Which Rank has a Total of 12? | SELECT AVG(rank) FROM table_name_72 WHERE total = 12 | sql_create_context |
CREATE TABLE table_65348 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie no when Chester is the away team? | SELECT "Tie no" FROM table_65348 WHERE "Away team" = 'chester' | wikisql |
CREATE TABLE table_35915 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What date was the game played at the venue of Hrazdan Stadium, Yerevan, Armenia? | SELECT "Date" FROM table_35915 WHERE "Venue" = 'hrazdan stadium, yerevan, armenia' | 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, and order y-axis in asc order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_32251 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | Which races have #2 podiums? | SELECT "Races" FROM table_32251 WHERE "Podiums" = '2' | wikisql |
CREATE TABLE table_21436373_4 (
stadium VARCHAR,
type_of_record VARCHAR
) | What was the stadium that had the regular season game? | SELECT stadium FROM table_21436373_4 WHERE type_of_record = "Regular season game" | sql_create_context |
CREATE TABLE table_name_8 (
location VARCHAR,
opponent VARCHAR
) | Where did they play against Clemson? | SELECT location FROM table_name_8 WHERE opponent = "clemson" | sql_create_context |
CREATE TABLE table_63717 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the most silver won by Norway? | SELECT MAX("Silver") FROM table_63717 WHERE "Nation" = 'norway' | 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, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, and I want to list in ascending by the the average of manager id. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_28769 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" real
) | What is the lowest Nick production number? | SELECT MIN("Nick prod. #") FROM table_28769 | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | tell me the number of patients taking drug via po/ng route who have diagnoses icd9 code v1581. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V1581" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE table_69439 (
"Engine" text,
"Displacement" text,
"Power" text,
"Torque" text,
"Year" real
) | How powerful is the model before 1999? | SELECT "Power" FROM table_69439 WHERE "Year" < '1999' | wikisql |
CREATE TABLE table_name_53 (
total_foreign_born__1000_ INTEGER,
born_in_a_non_eu_state__1000_ VARCHAR,
total_population__1000_ VARCHAR
) | What is the highest Total Foreign-born (1000) from a non EU state (1000) of 685 and a population (1000) smaller than 10,666? | SELECT MAX(total_foreign_born__1000_) FROM table_name_53 WHERE born_in_a_non_eu_state__1000_ = 685 AND total_population__1000_ > 10 OFFSET 666 | sql_create_context |
CREATE TABLE table_46636 (
"Model Number" text,
"Frequency" text,
"L2-Cache" text,
"Front Side Bus" text,
"Multiplier" text,
"Voltage" text,
"Socket" text
) | What is the Frequency for Model Number c3 850? | SELECT "Frequency" FROM table_46636 WHERE "Model Number" = 'c3 850' | wikisql |
CREATE TABLE table_40847 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
) | What is the average rank for players with under 205 matches and under 100 goals? | SELECT AVG("Rank") FROM table_40847 WHERE "Matches" < '205' AND "Goals" < '100' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevent... | what are the four most frequent drugs that were prescribed to male patients in their 30s during the same month after they had been diagnosed with chf nos during the last year? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | What is the maximum price of wines in each year? | SELECT Year, MAX(Price) FROM wine GROUP BY Year | nvbench |
CREATE TABLE table_name_63 (
points INTEGER,
engine VARCHAR
) | What are the average points for an engine of ford zetec-r v8? | SELECT AVG(points) FROM table_name_63 WHERE engine = "ford zetec-r v8" | sql_create_context |
CREATE TABLE table_69102 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which score has an Attendance of 31,178? | SELECT "Score" FROM table_69102 WHERE "Attendance" = '31,178' | wikisql |
CREATE TABLE table_11244302_1 (
air_date VARCHAR,
share VARCHAR
) | Which air date had an 11 share | SELECT air_date FROM table_11244302_1 WHERE share = 11 | sql_create_context |
CREATE TABLE ftxmzjzjlb (
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,
MZZYZD... | 在08年5月15日到2018年1月29日内患者49084699的检测指标968550是什么样的? | SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_name_97 (
league_cup INTEGER,
name VARCHAR,
premier_league VARCHAR
) | What is the highest league cup of danny collins, who has more than 1 premier league? | SELECT MAX(league_cup) FROM table_name_97 WHERE name = "danny collins" AND premier_league > 1 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the days of hospital stay and admission location of patient id 65759? | SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.subject_id = "65759" | mimicsql_data |
CREATE TABLE table_71505 (
"Member countries" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (billion US$)" text,
"GDP per capita (US$)" text
) | What is the population of the nation that has a GDP per capita (US$) of 11,929? | SELECT "Population" FROM table_71505 WHERE "GDP per capita (US$)" = '11,929' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Close as offtopic reason dist. | SELECT MAX(CreationDate) FROM Votes AS v WHERE VoteTypeId = 6 AND NOT UserId IS NULL | sede |
CREATE TABLE table_55107 (
"Team" text,
"City/Area" text,
"Arena" text,
"Capacity" text,
"Last season" text
) | What is the last season that the Scottish Rocks played? | SELECT "Last season" FROM table_55107 WHERE "Team" = 'scottish rocks' | wikisql |
CREATE TABLE table_12699 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is Res., when Round is greater than 2, and when Event is 'Midwest Cage Championships 25: Inferno'? | SELECT "Res." FROM table_12699 WHERE "Round" > '2' AND "Event" = 'midwest cage championships 25: inferno' | wikisql |
CREATE TABLE table_name_87 (
round INTEGER,
position VARCHAR
) | What round on average was a defensive tackle selected? | SELECT AVG(round) FROM table_name_87 WHERE position = "defensive tackle" | sql_create_context |
CREATE TABLE table_name_92 (
label VARCHAR,
chinese__simplified_ VARCHAR
) | What is 's Label? | SELECT label FROM table_name_92 WHERE chinese__simplified_ = "你 朋友" | sql_create_context |
CREATE TABLE table_43919 (
"Rank" real,
"Name" text,
"Period" text,
"Games" real,
"Goals" text
) | What is the name of the person with more than 299 games during the 1995 07 period? | SELECT "Name" FROM table_43919 WHERE "Games" > '299' AND "Period" = '1995–07' | wikisql |
CREATE TABLE table_204_234 (
id number,
"round" text,
"100 yd (91 m)" text,
"80 yd (73 m)" text,
"60 yd (55 m)" text,
"50 yd (46 m)" text,
"40 yd (37 m)" text
) | who shot the most at 91 m | SELECT "round" FROM table_204_234 ORDER BY "100 yd (91 m)" DESC LIMIT 1 | squall |
CREATE TABLE table_25101 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | Name the district for rep. warren r. davis died during previous congress | SELECT "District" FROM table_25101 WHERE "Reason for change" = 'Rep. Warren R. Davis died during previous congress' | wikisql |
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,
... | 医院1070682给名为卫祺祥的病人开出的单价最高的药品名称、编码和单价分别是什么 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '卫祺祥' AND t_kc21.MED_SER_ORG_NO = '1070682') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE table_name_41 (
stadium VARCHAR,
date VARCHAR
) | What is the Stadium held on november 29? | SELECT stadium FROM table_name_41 WHERE date = "november 29" | sql_create_context |
CREATE TABLE table_72838 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | Name the poles for 25th position | SELECT "Poles" FROM table_72838 WHERE "Position" = '25th' | wikisql |
CREATE TABLE table_51534 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the highest rebounds of the game with A. Johnson (6) as the highest assist? | SELECT "High rebounds" FROM table_51534 WHERE "High assists" = 'a. johnson (6)' | wikisql |
CREATE TABLE table_39533 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | Which Opponent has a Score of 2 6? | SELECT "Opponent" FROM table_39533 WHERE "Score" = '2–6' | wikisql |
CREATE TABLE table_name_72 (
date VARCHAR,
opponent VARCHAR
) | When was there a game against the Indianapolis colts? | SELECT date FROM table_name_72 WHERE opponent = "indianapolis colts" | sql_create_context |
CREATE TABLE table_name_72 (
pos INTEGER,
car__number VARCHAR
) | Which Pos has a Car # of 33? | SELECT SUM(pos) FROM table_name_72 WHERE car__number = 33 | sql_create_context |
CREATE TABLE ROLES (
role_name VARCHAR,
role_description VARCHAR,
role_code VARCHAR
)
CREATE TABLE Employees (
role_code VARCHAR,
employee_name VARCHAR
) | What is the role name and role description for employee called Ebba? | SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = "Ebba" | sql_create_context |
CREATE TABLE table_name_70 (
set_3 VARCHAR,
set_2 VARCHAR,
set_1 VARCHAR
) | What is the Set 3 when the Set 2 is 21 25, and a Set 1 is 25 21? | SELECT set_3 FROM table_name_70 WHERE set_2 = "21–25" AND set_1 = "25–21" | sql_create_context |
CREATE TABLE table_13301516_1 (
us_viewers__millions_ VARCHAR,
no_in_series VARCHAR
) | How many millions of U.S. viewers watched episode 185? | SELECT us_viewers__millions_ FROM table_13301516_1 WHERE no_in_series = 185 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many male patients are diagnosed for seroma complicating a procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Seroma complicating a procedure" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | how many hours have elapsed since patient 20898 first received an intake of criticare hn on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 20898) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE table_name_93 (
country VARCHAR,
year VARCHAR
) | What is Country, when Year is '1994'? | SELECT country FROM table_name_93 WHERE year = 1994 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.