context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | tell me the price of a vancomycin - trough lab test? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vancomycin - trough') | eicu |
CREATE TABLE table_30049462_4 (
location_attendance VARCHAR,
team VARCHAR
) | What was the location and it's corresponding attendance during the game against Los Angeles? | SELECT location_attendance FROM table_30049462_4 WHERE team = "Los Angeles" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
... | Latest activity across all sites.. | SELECT DisplayName, ProfileImageUrl FROM Users WHERE DisplayName LIKE '%M%' AND ProfileImageUrl != '' | sede |
CREATE TABLE table_204_318 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"scorers" text
) | how many people attended the game in november against sunderland ? | SELECT "attendance" FROM table_204_318 WHERE "date" = 11 AND "opponent" = 'sunderland' | squall |
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, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, and order total number in descending order please. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_61671 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Player has a To par of 2? | SELECT "Player" FROM table_61671 WHERE "To par" = '–2' | wikisql |
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | Are any other requirements fulfilled for POLISH 432 besides general elective ? | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'POLISH' AND course.number = 432 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_16966 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | Which located featured the first prize of 33500? | SELECT "Location" FROM table_16966 WHERE "1st Prize( $ )" = '33500' | wikisql |
CREATE TABLE table_16449 (
"1973 Democratic initial primary" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Richmond [Staten Is.]" text,
"Total" real,
"%" text
) | What is the queens where richmond staten is 42%? | SELECT "Queens" FROM table_16449 WHERE "Richmond [Staten Is.]" = '42%' | wikisql |
CREATE TABLE table_63326 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What's the tie number of Chelsea when they were home? | SELECT "Tie no" FROM table_63326 WHERE "Home team" = 'chelsea' | wikisql |
CREATE TABLE table_50038 (
"Year" real,
"Round" text,
"Player" text,
"Nationality" text,
"Position" text,
"College/High School/Club" text
) | What is the round of the pf position player from 1996 and the college/high school/club mississippi state? | SELECT "Round" FROM table_50038 WHERE "Position" = 'pf' AND "Year" = '1996' AND "College/High School/Club" = 'mississippi state' | wikisql |
CREATE TABLE table_29285 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | How many date of appointment entries are there when the team is khazar lankaran? | SELECT COUNT("Date of appointment") FROM table_29285 WHERE "Team" = 'Khazar Lankaran' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATIO... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, I want to show by the the average of employee id in asc. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_80078 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Where is the school with state authority that has a roll of more than 157 students? | SELECT "Area" FROM table_80078 WHERE "Authority" = 'state' AND "Roll" > '157' | wikisql |
CREATE TABLE table_name_44 (
opponents_in_the_final VARCHAR,
partnering VARCHAR
) | Who are the finals opponents for the match with partner Ricardo Hocevar? | SELECT opponents_in_the_final FROM table_name_44 WHERE partnering = "ricardo hocevar" | sql_create_context |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the only nation to receive three gold medals ? | SELECT "nation" FROM table_204_775 WHERE "gold" = 3 | squall |
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... | get me the long title of diagnoses and primary disease of patient betty campbell. | SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Betty Campbell" | mimicsql_data |
CREATE TABLE table_name_27 (
republican_ticket VARCHAR,
prohibition_ticket VARCHAR
) | What kind of Republican ticket has a Prohibition ticket of stephen mead wing? | SELECT republican_ticket FROM table_name_27 WHERE prohibition_ticket = "stephen mead wing" | sql_create_context |
CREATE TABLE table_16429 (
"Rnd" real,
"Race Name" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Who drove the fastest lap at the Tenneco Automotive Grand Prix of Detroit? | SELECT "Fastest lap" FROM table_16429 WHERE "Race Name" = 'Tenneco Automotive Grand Prix of Detroit' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
C... | Tags Without Excerpt or Wiki (unbalanced). | SELECT c.TagName, c.CountPosts AS "Number of Posts", e.Body AS "Excerpt", w.Body AS "Wiki" FROM (SELECT t.TagName, t.ExcerptPostId, t.WikiPostId, COUNT(*) AS CountPosts FROM Tags AS t LEFT OUTER JOIN TagSynonyms AS s ON (t.TagName = s.SourceTagName) INNER JOIN PostTags AS p ON (p.TagId = t.Id) WHERE s.ApprovalDate IS N... | sede |
CREATE TABLE table_name_82 (
visitor VARCHAR,
leading_scorer VARCHAR
) | Which team was the visitor when Milt Palacio (15) was the leading scorer? | SELECT visitor FROM table_name_82 WHERE leading_scorer = "milt palacio (15)" | sql_create_context |
CREATE TABLE table_226619_12 (
points VARCHAR,
respect_toward_opponents VARCHAR
) | Name the points for 212 respect toward opponents | SELECT points FROM table_226619_12 WHERE respect_toward_opponents = 212 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose diagnoses short title is mv collision nos-driver and drug route is id? | 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.short_title = "Mv collision NOS-driver" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_76307 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Podiums" real,
"Points" text,
"Position" text
) | What is the race in the 8th position? | SELECT "Races" FROM table_76307 WHERE "Position" = '8th' | wikisql |
CREATE TABLE table_43314 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What was the pick number for the wide receiver drafted from Michigan State? | SELECT "Pick #" FROM table_43314 WHERE "Position" = 'wide receiver' AND "College" = 'michigan state' | wikisql |
CREATE TABLE table_1140117_5 (
report VARCHAR,
race_name VARCHAR
) | What's the report for the race name, XIII Grand Prix de l'Albigeois? | SELECT report FROM table_1140117_5 WHERE race_name = "XIII Grand Prix de l'Albigeois" | sql_create_context |
CREATE TABLE table_46750 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Country is Rocco Mediate from? | SELECT "Country" FROM table_46750 WHERE "Player" = 'rocco mediate' | wikisql |
CREATE TABLE table_28116528_1 (
original_air_date VARCHAR,
production_code VARCHAR
) | What date did the episode with a production code of 3x6316 originally air? | SELECT original_air_date FROM table_28116528_1 WHERE production_code = "3X6316" | sql_create_context |
CREATE TABLE table_name_68 (
attendance INTEGER,
home VARCHAR
) | What was the lowest attendance at a game when Pittsburgh was the home team? | SELECT MIN(attendance) FROM table_name_68 WHERE home = "pittsburgh" | sql_create_context |
CREATE TABLE table_31528 (
"Episode no." real,
"US Airdate" text,
"US Total viewers" text,
"UK Airdate" text,
"UK Total viewers" text
) | How many viewers in the UK did episode 50 have? | SELECT "UK Total viewers" FROM table_31528 WHERE "Episode no." = '50' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | How many users have a location in their profile. | SELECT HasLocation, COUNT(*) FROM (SELECT Id AS "user_link", CASE WHEN Location IS NULL THEN 'No' ELSE 'Yes' END AS HasLocation FROM Users) AS t GROUP BY HasLocation | sede |
CREATE TABLE table_1165 (
"Team" text,
"Copa Libertadores 1992" text,
"Supercopa Sudamericana 1992" text,
"Copa CONMEBOL 1992" text,
"Recopa Sudamericana 1992" text,
"Intercontinental Cup 1992" text
) | Name the recopa sudamericana 1992 for did not qualify for libertadores 1992 and round of 16 for bragantino | SELECT "Recopa Sudamericana 1992" FROM table_1165 WHERE "Copa Libertadores 1992" = 'Did not qualify' AND "Copa CONMEBOL 1992" = 'Round of 16' AND "Team" = 'Bragantino' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Questions with negative score favorited only by the OP. | SELECT Posts.Id AS "post_link", Posts.FavoriteCount, Posts.Score, Posts.CreationDate, Votes.UserId AS "user_link" FROM Votes JOIN Posts ON (Posts.Id = Votes.PostId) WHERE Posts.FavoriteCount = 1 AND Posts.Score < 0 AND VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Votes.UserId ORDER BY Posts.CreationD... | sede |
CREATE TABLE table_name_37 (
opponent VARCHAR,
home_away VARCHAR,
result VARCHAR
) | Name the opponent when the result is w 16-15 and has home/away of home | SELECT opponent FROM table_name_37 WHERE home_away = "home" AND result = "w 16-15" | sql_create_context |
CREATE TABLE table_name_79 (
notes VARCHAR,
title VARCHAR
) | What are the notes for Happy Camp? | SELECT notes FROM table_name_79 WHERE title = "happy camp" | sql_create_context |
CREATE TABLE table_36968 (
"Frequency (kHz)" real,
"Call letters" text,
"Licensed location" text,
"Type" text,
"Format" text
) | What is the smallest frequency (kHz) that is in the location of Longview? | SELECT MIN("Frequency (kHz)") FROM table_36968 WHERE "Licensed location" = 'longview' | wikisql |
CREATE TABLE table_8818 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Raymond Floyd's score? | SELECT "Score" FROM table_8818 WHERE "Player" = 'raymond floyd' | wikisql |
CREATE TABLE table_name_18 (
score VARCHAR,
record VARCHAR,
game VARCHAR,
decision VARCHAR
) | What's the score for a game over 56 with a record of 29-24-7 with a lundqvist decision? | SELECT score FROM table_name_18 WHERE game > 56 AND decision = "lundqvist" AND record = "29-24-7" | sql_create_context |
CREATE TABLE WINE (
Name VARCHAR,
price VARCHAR
) | List the names of all distinct wines ordered by price. | SELECT DISTINCT Name FROM WINE ORDER BY price | sql_create_context |
CREATE TABLE table_name_95 (
tournament VARCHAR,
opponents_in_the_final VARCHAR
) | What tournament had an opponent of Els Callens Nancy Feber? | SELECT tournament FROM table_name_95 WHERE opponents_in_the_final = "els callens nancy feber" | sql_create_context |
CREATE TABLE table_10015132_9 (
school_club_team VARCHAR,
player VARCHAR
) | What school/club team is Trey Johnson on? | SELECT school_club_team FROM table_10015132_9 WHERE player = "Trey Johnson" | sql_create_context |
CREATE TABLE table_19130829_4 (
team__number2 VARCHAR
) | What's the 2nd leg result in the round where Panionios is team #2? | SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number2 = "Panionios" | sql_create_context |
CREATE TABLE table_name_61 (
total_seats INTEGER,
share_of_votes VARCHAR
) | When the share of votes equals 21.8%, what's the sum of the total amount of seats? | SELECT SUM(total_seats) FROM table_name_61 WHERE share_of_votes = "21.8%" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | Calculate the total number of patients who had icd9 code v1006 and a duration of stay in hospital of more than 17 days | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.icd9_code = "V1006" | mimicsql_data |
CREATE TABLE table_204_938 (
id number,
"year" number,
"edmonton\nhundred" number,
"elthorne\nhundred" number,
"gore\nhundred" number,
"isleworth\nhundred" number,
"ossulstone\nhundred\nholborn\ndivision" number,
"ossulstone\nhundred\nfinsbury\ndivision" number,
"ossulstone\nhundred\... | what was the total population in 1801 ? | SELECT "total" FROM table_204_938 WHERE "year" = 1801 | squall |
CREATE TABLE table_name_28 (
number_ VARCHAR,
_name VARCHAR,
date INTEGER
) | What's the number & name for the date after 1954? | SELECT number_ & _name FROM table_name_28 WHERE date > 1954 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | during this year was patient 009-10007 prescribed pantoprazole sodium 40 mg po tbec? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10007')) AND medication.drugname = 'pantoprazole sodium 40 mg po tbec'... | eicu |
CREATE TABLE table_33181 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the attendance in week 6? | SELECT "Attendance" FROM table_33181 WHERE "Week" = '6' | 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
)
... | provide the number of patients whose insurance is private and lab test name is bilirubin, indirect? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Bilirubin, Indirect" | mimicsql_data |
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... | what is the name of the treatment that patient 006-43795 had been given two times during the first hospital encounter? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_67030 (
"Number" text,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"Home Town" text
) | Which player's home town is Swift Current, AB? | SELECT "Player" FROM table_67030 WHERE "Home Town" = 'swift current, ab' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 能知道患者苏家欣在2000.2.24到2009.4.29这段时间曾经去过哪几家医院看病吗 | SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_NM = '苏家欣' AND qtb.IN_HOSP_DATE BETWEEN '2000-02-24' AND '2009-04-29' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_NM = '苏家欣' AND gyb.IN_HOSP_DATE BETWEEN '2000-02-24' AND '2009-04-29' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zyb WHERE zy... | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在2015年7月7日到2018年2月18日内参保人88686860购买单一药品最大次数是多少? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '88686860' AND t_kc22.STA_DATE BETWEEN '2015-07-07' AND '2018-02-18' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_... | css |
CREATE TABLE table_train_83 (
"id" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"iq" int,
"geriatric_depression_scale_gds" int,
"NOUSE" float
) | systolic blood pressure ( supine ) >= 100 mmhg; | SELECT * FROM table_train_83 WHERE systolic_blood_pressure_sbp >= 100 | criteria2sql |
CREATE TABLE city (
Status VARCHAR
) | Please show the different statuses, ordered by the number of cities that have each. | SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) | sql_create_context |
CREATE TABLE table_name_58 (
long INTEGER,
avg_g VARCHAR,
loss VARCHAR,
gain VARCHAR
) | How much Long has a Loss larger than 2, and a Gain of 157, and an Avg/G smaller than 129? | SELECT SUM(long) FROM table_name_58 WHERE loss > 2 AND gain = 157 AND avg_g < 129 | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | What are the different ship flags, and how many ships have each. Show a pie chart. | SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag | nvbench |
CREATE TABLE table_name_79 (
perfect_stem VARCHAR,
future_stem VARCHAR
) | What is the perfect stem for the word that has a future stem of emango? | SELECT perfect_stem FROM table_name_79 WHERE future_stem = "emango" | sql_create_context |
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
C... | For each position, what is the average number of points for players in that position Plot them as bar chart, could you show y axis from low to high order? | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY AVG(Points) | nvbench |
CREATE TABLE table_75591 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is his low win total when he has over 3 top 25s and under 9 cuts made? | SELECT MIN("Wins") FROM table_75591 WHERE "Top-25" = '3' AND "Cuts made" < '9' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_... | how much does a FIRST class ticket cost from BOSTON to SAN FRANCISCO round trip | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... | atis |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_nam... | What is the lowest price of product, grouped by product type? Show a bar chart. | SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code | nvbench |
CREATE TABLE table_75388 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | Game smaller than 34, and a December smaller than 14, and a Score of 10 - 6 has what opponent? | SELECT "Opponent" FROM table_75388 WHERE "Game" < '34' AND "December" < '14' AND "Score" = '10 - 6' | wikisql |
CREATE TABLE table_31649 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What is the margin at the Nabisco Championship? | SELECT "Margin" FROM table_31649 WHERE "Championship" = 'nabisco championship' | wikisql |
CREATE TABLE table_name_27 (
bronze INTEGER,
gold VARCHAR,
silver VARCHAR,
total VARCHAR
) | Name the average bronze with silver more than 0, total of 6 and gold more than 0 | SELECT AVG(bronze) FROM table_name_27 WHERE silver > 0 AND total = 6 AND gold > 0 | sql_create_context |
CREATE TABLE table_57476 (
"Name" text,
"Block" text,
"Launch date/time (UTC)" text,
"COSPAR ID" text,
"Rocket" text
) | What block has a COSPAR ID of 1995-060a? | SELECT "Block" FROM table_57476 WHERE "COSPAR ID" = '1995-060a' | wikisql |
CREATE TABLE table_45790 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | On what date is Jerilyn Britz the runner-up? | SELECT "Date" FROM table_45790 WHERE "Runner(s)-up" = 'jerilyn britz' | wikisql |
CREATE TABLE table_2718 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | Name the number of conference tournament for james madison | SELECT COUNT("Conference Tournament") FROM table_2718 WHERE "Tournament Winner" = 'James Madison' | wikisql |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 患者04369427被开出过拉莫三嗪片在哪几家医院? | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '04369427' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '04369427' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE ... | css |
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... | count the number of patients whose diagnosis short title is ath ext ntv at w claudct. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Ath ext ntv at w claudct" | mimicsql_data |
CREATE TABLE table_train_273 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"hba1c" float,
"insulin_requirement" float,
"body_mass_index_bmi" float,
"NOUSE" float
) | body mass index ( bmi ) of 27 to 45 kg / m2 with weight < / = 136 kg ( 300 lbs. | SELECT * FROM table_train_273 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 45 AND body_weight <= 136 | criteria2sql |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code ... | For those payments processed with Visa, bin the payment day into Year interval and compute the average amount payment as the Y-axis. | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' | nvbench |
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
Order_ID INTEGER,
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID ... | Show all payment method codes and the number of orders for each code in a bar chart, show by the payment_method_code in descending please. | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code DESC | nvbench |
CREATE TABLE table_name_28 (
seats INTEGER,
_percentage_change VARCHAR,
_percentage_votes VARCHAR
) | What are the fewest seats with a -3.7% change and more than 4.7% votes? | SELECT MIN(seats) FROM table_name_28 WHERE _percentage_change = -3.7 AND _percentage_votes > 4.7 | sql_create_context |
CREATE TABLE table_69873 (
"Year" text,
"Team" text,
"Number" text,
"BB +HBP" real,
"BA (Place)" text
) | In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)? | SELECT "BA (Place)" FROM table_69873 WHERE "BB +HBP" > '49' AND "Team" = 'seibu lions' AND "Year" = '1992' | wikisql |
CREATE TABLE table_76915 (
"Year" real,
"Film" text,
"Role" text,
"Director" text,
"Studio" text
) | What is the Year of the Film Klondike Annie? | SELECT SUM("Year") FROM table_76915 WHERE "Film" = 'klondike annie' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is drug name and drug route of drug code asa325? | SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ASA325" | mimicsql_data |
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 demographic (... | give the number of patients who were admitted before the year 2158 and whose diagnosis long title is unspecified pleural effusion. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Unspecified pleural effusion" | mimicsql_data |
CREATE TABLE table_46528 (
"car model" text,
"displacement & configuration" text,
"max. motive power @ rpm" text,
"max. torque @ rpm" text,
"max. speed" text,
"emissions CO2" text
) | What is the displacement & configuration with CO2 of 204 g/km emissions? | SELECT "displacement & configuration" FROM table_46528 WHERE "emissions CO2" = '204 g/km' | wikisql |
CREATE TABLE table_51708 (
"Year" real,
"Category" text,
"Character" text,
"For The Show" text,
"Result" text
) | What show had a nomination for best actor in a lead role female (popular) in 2006? | SELECT "For The Show" FROM table_51708 WHERE "Category" = 'best actor in a lead role – female (popular)' AND "Year" = '2006' | wikisql |
CREATE TABLE table_name_95 (
home_team VARCHAR,
crowd INTEGER
) | What home team has had a crowd bigger than 20,000? | SELECT home_team FROM table_name_95 WHERE crowd > 20 OFFSET 000 | sql_create_context |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 二零零三年七月一日到二零二一年三月二十九日,医疗机构3916890处理异地就诊的次数有多少 | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3916890' AND qtb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3916890' AND gyb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND g... | css |
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | Of the courses being offered this Fall , which are upper-level CHEMBIO classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CHEMBIO' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | advising |
CREATE TABLE table_56287 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | When Nashville was the visiting team what was the lowest Attendance shown? | SELECT MIN("Attendance") FROM table_56287 WHERE "Visitor" = 'nashville' | wikisql |
CREATE TABLE table_26548 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the name of episode number 77 in the series? | SELECT "Title" FROM table_26548 WHERE "No. in series" = '77' | wikisql |
CREATE TABLE table_60959 (
"Cover Date" text,
"Story Title" text,
"Writer/s" text,
"Letterer/s" text,
"Colourist/s" text
) | Who is the Colourist that has a Story Title of Broken Glass (part 3) and a Letterer of Albers? | SELECT "Colourist/s" FROM table_60959 WHERE "Letterer/s" = 'albers' AND "Story Title" = 'broken glass (part 3)' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what is the drug patient 013-3028 was prescribed for within 2 days after being diagnosed with acute renal failure until 09/2105? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-3028') AND diagnosis.diagnosi... | eicu |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Find the names of stadiums that some Australian swimmers have been to, and count them by a bar chart | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 对应的患者姓名在门诊就诊中开出的检验报告单99312004581上是什么? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '9... | css |
CREATE TABLE table_13139 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | Who was the player for Japan when the to par was smaller than 7? | SELECT "Player" FROM table_13139 WHERE "To par" < '7' AND "Country" = 'japan' | wikisql |
CREATE TABLE table_201_44 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | which of elizabeth berkley 's films got her the most award nominations ? | SELECT "title" FROM table_201_44 ORDER BY "notes" DESC LIMIT 1 | squall |
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 the number of patients whose gender is m and procedure icd9 code is 102? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "102" | mimicsql_data |
CREATE TABLE table_name_90 (
second VARCHAR,
lead VARCHAR
) | Who is the Second when Michel Gribi is the lead? | SELECT second FROM table_name_90 WHERE lead = "michel gribi" | sql_create_context |
CREATE TABLE table_53294 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team plays at Arden Street Oval? | SELECT "Away team" FROM table_53294 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE table_39182 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | Which Game has a Series of bruins lead 3 1? | SELECT SUM("Game") FROM table_39182 WHERE "Series" = 'bruins lead 3–1' | wikisql |
CREATE TABLE table_name_90 (
tournament INTEGER,
total VARCHAR,
team VARCHAR
) | How many tournament titles for iowa state with 3 total titles? | SELECT MAX(tournament) FROM table_name_90 WHERE total = 3 AND team = "iowa state" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | 在43389483198这次医疗就诊中,需要住院的时间如何 | SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '43389483198' | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | what is the name of the procedure that patient 5887 has undergone two times the last month? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 588... | mimic_iii |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what was the name of the drug that patient 007-9853 was prescribed for the first time in 10/2102 via inhale route? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853')) AND medication.routeadmin = 'inhale' AND STRFTIME('%y-%... | eicu |
CREATE TABLE table_32421 (
"Season" real,
"Driver" text,
"Team" text,
"Engine" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Points" real,
"Margin of defeat" real
) | What is the most recent season when Fernando Alonso had more than 13 podiums in a car with a Ferrari engine? | SELECT MAX("Season") FROM table_32421 WHERE "Engine" = 'ferrari' AND "Driver" = 'fernando alonso' AND "Podiums" > '13' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.