context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATET... | How many courses for each subject? Plot a bar chart, could you display bar in ascending order? | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name | nvbench |
CREATE TABLE table_69280 (
"Year" real,
"Class" text,
"Tyres" text,
"Team" text,
"Co-Drivers" text,
"Laps" real,
"Pos." text
) | Are there any Teams after 1997? | SELECT "Team" FROM table_69280 WHERE "Year" > '1997' | wikisql |
CREATE TABLE table_75427 (
"Country" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What skip has angela tuvaeva as the lead? | SELECT "Skip" FROM table_75427 WHERE "Lead" = 'angela tuvaeva' | wikisql |
CREATE TABLE Mailshot_Customers (
mailshot_id INTEGER,
customer_id INTEGER,
outcome_code VARCHAR(15),
mailshot_customer_date DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Mailshot_Campaigns (
mailshot_id INT... | Create a pie chart showing the total number across outcome code. | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code | nvbench |
CREATE TABLE table_name_95 (
home VARCHAR,
score VARCHAR
) | What is Home, when Score is 103-93? | SELECT home FROM table_name_95 WHERE score = "103-93" | sql_create_context |
CREATE TABLE table_name_11 (
television_service VARCHAR,
hdtv VARCHAR,
language VARCHAR
) | What is Television Service, when HDTV is No, and when Language is Italian? | SELECT television_service FROM table_name_11 WHERE hdtv = "no" AND language = "italian" | sql_create_context |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
... | Bin all date of transactions into the YEAR interval, and give the average of the share count for each bin. What is the trend? | SELECT date_of_transaction, AVG(share_count) FROM Transactions | nvbench |
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 ReviewTaskResults (
Id number,
Review... | Highest voted answers that have no competition. | SELECT Id AS "post_link", Score FROM Posts WHERE PostTypeId = 2 AND ParentId IN (SELECT Id FROM Posts WHERE AnswerCount = 1) ORDER BY Score DESC | sede |
CREATE TABLE table_3005915_3 (
starts INTEGER
) | What is the maximum number of starts? | SELECT MAX(starts) FROM table_3005915_3 | sql_create_context |
CREATE TABLE table_24524 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Margin of victory on no. 4 was? | SELECT "Margin of victory" FROM table_24524 WHERE "No." = '4' | wikisql |
CREATE TABLE table_name_56 (
original_broadway_cast VARCHAR,
original_west_end_cast VARCHAR
) | What is the name of the person who was in the Original Broadway Cast that was Original West End Cast of sheila hancock? | SELECT original_broadway_cast FROM table_name_56 WHERE original_west_end_cast = "sheila hancock" | sql_create_context |
CREATE TABLE table_204_35 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | did they place better in 1987/88 or 1993/94 ? | SELECT "season" FROM table_204_35 WHERE "season" IN ('1987/88', '1993/94') ORDER BY "place" LIMIT 1 | squall |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' Visualize by bar chart, list from high to low by the Y. | SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) DESC | nvbench |
CREATE TABLE table_name_12 (
class VARCHAR,
rank VARCHAR
) | Tell me the class with rank of 89th | SELECT class FROM table_name_12 WHERE rank = "89th" | sql_create_context |
CREATE TABLE table_55144 (
"Title" text,
"Publisher" text,
"First Year" text,
"Last Year" text,
"Genre" text
) | What is the first year for Popgun? | SELECT "First Year" FROM table_55144 WHERE "Title" = 'popgun' | wikisql |
CREATE TABLE table_38210 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
) | what character did Masaharu satou play | SELECT "Character Name" FROM table_38210 WHERE "Voice Actor (Japanese)" = 'masaharu satou' | wikisql |
CREATE TABLE table_16858 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What years did number 54 play for the jazz | SELECT "Years for Jazz" FROM table_16858 WHERE "No." = '54' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | For each director, how many reviews have they received Visualize by bar chart, and could you rank from high to low by the Y-axis? | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_6 (
played INTEGER,
position VARCHAR,
goals_against VARCHAR
) | Which lowest played has a Position of 2, and Goals against larger than 53? | SELECT MIN(played) FROM table_name_6 WHERE position = 2 AND goals_against > 53 | sql_create_context |
CREATE TABLE table_name_53 (
english_title VARCHAR,
director_s_ VARCHAR
) | What is the English title of the film directed by Fernando Meirelles? | SELECT english_title FROM table_name_53 WHERE director_s_ = "fernando meirelles" | sql_create_context |
CREATE TABLE table_19548 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the college/junior club team for pick number 63 | SELECT "College/junior/club team" FROM table_19548 WHERE "Pick #" = '63' | wikisql |
CREATE TABLE table_204_761 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total number of silver medals won by russia , norway , and sweden combined ? | SELECT SUM("silver") FROM table_204_761 WHERE "nation" IN ('russia', 'norway', 'sweden') | squall |
CREATE TABLE shop (
shop_id number,
address text,
num_of_staff text,
score number,
open_year text
)
CREATE TABLE happy_hour (
hh_id number,
shop_id number,
month text,
num_of_shaff_in_charge number
)
CREATE TABLE member (
member_id number,
name text,
membership_card tex... | Find the number of members living in each address. | SELECT COUNT(*), address FROM member GROUP BY address | spider |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what is the variation of patient 006-181433's weight second measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1)... | eicu |
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,
... | how many patients with death status 0 had procedure icd9 code as 5011? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "5011" | mimicsql_data |
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, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and I want to display x axis in descending order please. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
CREATE TABLE table_name_43 (
to_par VARCHAR,
place VARCHAR
) | What is To Par, when Place is 3? | SELECT to_par FROM table_name_43 WHERE place = "3" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | what age does patient 71192 have on the last hospital encounter? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_15 (
date_of_release VARCHAR,
title VARCHAR
) | On what date was god & guns released? | SELECT date_of_release FROM table_name_15 WHERE title = "god & guns" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | From 11:00 to 4:00 , are there ECON 442 sections ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '4:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number... | advising |
CREATE TABLE table_19130829_4 (
team__number1 VARCHAR
) | What's the 2nd leg result in the round where team #1 is Iraklis? | SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number1 = "Iraklis" | sql_create_context |
CREATE TABLE table_204_692 (
id number,
"publication" text,
"score" text,
"review" text
) | what number of publications are indicated as being in print ? | SELECT COUNT("publication") FROM table_204_692 WHERE "review" = 'print' | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | had patient 005-80291 been prescribed 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg/5ml po susp, potassium chloride 2 meq/ml iv soln or ondansetron hcl 4 mg/2ml ij soln since 2105? | 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 = '005-80291')) AND medication.drugname IN ('30 ml cup : alum & mag hydroxide... | eicu |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, and sort from low to high by the y axis. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID | nvbench |
CREATE TABLE table_21885 (
"Season" text,
"Date" text,
"Driver" text,
"Team" text,
"Chassis" text,
"Engine" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | When 228 is the lap and chip ganassi racing is the team what is the race time? | SELECT "Race Time" FROM table_21885 WHERE "Team" = 'Chip Ganassi Racing' AND "Laps" = '228' | wikisql |
CREATE TABLE table_29668 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" text,
"Result" text
) | Which song was picked that was originally performed by Marisa Monte? | SELECT "Song Choice" FROM table_29668 WHERE "Original Artist" = 'Marisa Monte' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | Scores of users in specific tag. | WITH scorestags_cte AS (SELECT pt.TagId AS TagId, p.OwnerUserId AS uid, p.OwnerDisplayName AS udn, SUM(p.Score) AS sco, COUNT(p.Id) AS num FROM Posts AS p INNER JOIN Posts AS q ON q.Id = p.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE (p.CommunityOwnedDate IS NULL) GROUP BY pt.TagId, p.OwnerUserId, p.Own... | sede |
CREATE TABLE table_name_83 (
population INTEGER,
median_household_income VARCHAR,
number_of_households VARCHAR
) | What is the population where the median household income is $87,832 and there are fewer than 64,886 households? | SELECT AVG(population) FROM table_name_83 WHERE median_household_income = "$87,832" AND number_of_households < 64 OFFSET 886 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose procedure icd9 code is 5771 and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_18686317_1 (
rank VARCHAR,
yardage VARCHAR
) | What is the rank of the player who got 58179 in yardage? | SELECT rank FROM table_18686317_1 WHERE yardage = 58179 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | 沈玉堂这个患者所有检验报告单中的标本在2002年6月12日到2006年8月24日期间内采集的都是啥呀? | (SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈玉堂' AND j... | css |
CREATE TABLE Courses (
course_name VARCHAR,
course_id VARCHAR
)
CREATE TABLE Student_Course_Enrolment (
course_id VARCHAR
) | What is the name of the course that has the most student enrollment? | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_39196 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Podiums" real
) | What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy? | SELECT MAX("Wins") FROM table_39196 WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy' | wikisql |
CREATE TABLE table_name_38 (
away_team VARCHAR,
tie_no VARCHAR
) | What away team has 7 as the tie no.? | SELECT away_team FROM table_name_38 WHERE tie_no = "7" | sql_create_context |
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... | 列出医院6135153所有医疗就诊记录中患者的平均年龄是多大,根据不同的科室编码和出院诊断疾病名称? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6135153' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '61... | css |
CREATE TABLE table_train_71 (
"id" int,
"gender" string,
"language" string,
"intention_to_arterial_catheter" bool,
"renal_disease" bool,
"sepsis" bool,
"allergy_to_hydroxyethyl_starch" bool,
"age" float,
"NOUSE" float
) | male or female ages >= 3.5 years and <= 18 years on day of sepsis recognition | SELECT * FROM table_train_71 WHERE (gender = 'male' OR gender = 'female') AND (age >= 3.5 AND age <= 18) AND sepsis = 1 | criteria2sql |
CREATE TABLE table_67049 (
"Quarter" text,
"Score" text,
"Club" text,
"Opponent" text,
"Year" text,
"Round" text,
"Venue" text
) | Which year has a Round of 17? | SELECT "Year" FROM table_67049 WHERE "Round" = '17' | wikisql |
CREATE TABLE table_203_379 (
id number,
"first issued" text,
"design" text,
"slogan" text,
"serial format" text,
"serials issued" text,
"notes" text
) | how many license plates were issued before 1960 ? | SELECT COUNT(*) FROM table_203_379 WHERE "first issued" < 1960 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | when was patient 035-24054's ventric #1 output for the last time on the current intensive care unit visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS NULL) AN... | eicu |
CREATE TABLE table_name_66 (
runner_up VARCHAR,
year VARCHAR,
champion VARCHAR
) | Which runner-up placed in a year prior to 2006 and whose Champion was Elon? | SELECT runner_up FROM table_name_66 WHERE year < 2006 AND champion = "elon" | sql_create_context |
CREATE TABLE table_name_81 (
touchdowns INTEGER,
points VARCHAR,
field_goals VARCHAR
) | Which Touchdowns is the lowest one that has Points of 5, and a Field goals larger than 0? | SELECT MIN(touchdowns) FROM table_name_81 WHERE points = 5 AND field_goals > 0 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | give me the number of patients whose admission location is transfer from hosp/extram and procedure icd9 code is 5781? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "5781" | mimicsql_data |
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'm interested in a flight from DALLAS to WASHINGTON and i'm also interested in going to BALTIMORE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... | atis |
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 religion of subject id 26746? | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "26746" | mimicsql_data |
CREATE TABLE table_name_33 (
constructor VARCHAR,
laps VARCHAR,
driver VARCHAR
) | who is the constructor when the laps is more than 72 and the driver is eddie irvine? | SELECT constructor FROM table_name_33 WHERE laps > 72 AND driver = "eddie irvine" | sql_create_context |
CREATE TABLE table_name_88 (
total INTEGER,
silver VARCHAR,
bronze VARCHAR,
gold VARCHAR
) | What is the average total for teams with under 34 bronzes, 0 silver, and under 14 gold? | SELECT AVG(total) FROM table_name_88 WHERE bronze < 34 AND gold < 14 AND silver < 0 | sql_create_context |
CREATE TABLE table_15405 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What are the highest points with a Chassis of gordini t16, and a Year smaller than 1954? | SELECT MAX("Points") FROM table_15405 WHERE "Chassis" = 'gordini t16' AND "Year" < '1954' | wikisql |
CREATE TABLE table_29318 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who wrote the episodes with 7.70 u.s. viewers (million) ? | SELECT "Written by" FROM table_29318 WHERE "U.S. viewers (million)" = '7.70' | 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 prescriptions (
subject_id text,
hadm_id... | calculate the total number of patients diagnosed with other b-complex deficiencies | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other B-complex deficiencies" | mimicsql_data |
CREATE TABLE table_68185 (
"Season" real,
"Overall" text,
"Slalom" text,
"Giant Slalom" text,
"Super G" text,
"Downhill" text,
"Combined" text
) | What super g was before 1998, had 2 giant slaloms and 24 downhills? | SELECT "Super G" FROM table_68185 WHERE "Season" < '1998' AND "Giant Slalom" = '2' AND "Downhill" = '24' | wikisql |
CREATE TABLE table_name_40 (
pick VARCHAR,
round VARCHAR,
player VARCHAR
) | Which pick's round was 5 when Kellen Davis was a player? | SELECT pick FROM table_name_40 WHERE round = "5" AND player = "kellen davis" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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... | 给患有癫痫性精神病的病患都开出了哪些药品它们的编号和名称各是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '癫痫性精神病' | css |
CREATE TABLE table_23117208_5 (
title VARCHAR,
written_by VARCHAR
) | What is the name of the episode that was written by Michael Rauch? | SELECT title FROM table_23117208_5 WHERE written_by = "Michael Rauch" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 给患者邹慧英做检验的科室编码及名称是什么,在04419107006这次医疗就诊中 | SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '04419107006' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '04419107006' | css |
CREATE TABLE gwyjzb (
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,
... | 查一下范升荣这个病人的医疗记录中,有哪几次医疗记录中被开出过金额超过5540.22元的药品?列出医疗就诊编码 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '范升荣' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5540.22) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '范升荣' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22... | css |
CREATE TABLE table_32413 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team score when the home team was Carlton? | SELECT "Away team score" FROM table_32413 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 医疗机构7265817金额前24名的项目有哪些 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7265817' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 24 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_k... | css |
CREATE TABLE table_21323 (
"Rank" real,
"1-year peak" text,
"5-year peak" text,
"10-year peak" text,
"15-year peak" text,
"20-year peak" text
) | What is every 5-year peak when Emanuel Lasker, 2847 is the 10-year peak? | SELECT "5-year peak" FROM table_21323 WHERE "10-year peak" = 'Emanuel Lasker, 2847' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | List people who signed up during private beta. | SELECT u.Id AS "user_link", u.Id, u.CreationDate FROM Users AS u WHERE u.CreationDate < '2011-08-30 00:00:00.00' | sede |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | how old is each student and how many students are each age? | SELECT Age, COUNT(*) FROM Student GROUP BY Age | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
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, show me the trend about department_id over hire_date with a line chart, show by the x-axis in desc. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_40605 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | What is the total number of Games, when Rank is less than 4, and when Rebounds is less than 102? | SELECT COUNT("Games") FROM table_40605 WHERE "Rank" < '4' AND "Rebounds" < '102' | wikisql |
CREATE TABLE table_39930 (
"Date" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Which Pictorials has a 20 Questions of eva longoria? | SELECT "Pictorials" FROM table_39930 WHERE "20 Questions" = 'eva longoria' | wikisql |
CREATE TABLE table_name_18 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
) | What is the nomination title used for the original film, Monsieur Hawarden? | SELECT film_title_used_in_nomination FROM table_name_18 WHERE original_title = "monsieur hawarden" | sql_create_context |
CREATE TABLE table_name_74 (
net_capacity VARCHAR,
gross_capacity VARCHAR,
unit VARCHAR
) | What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4? | SELECT net_capacity FROM table_name_74 WHERE gross_capacity = "1,126 mw" AND unit = "tianwan-4" | sql_create_context |
CREATE TABLE table_5084 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"10:00" text,
"10:30" text
) | Name the 10:30 for 8:00 of charmed | SELECT "10:30" FROM table_5084 WHERE "8:00" = 'charmed' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
) | what was the last winner 's album name ? | SELECT "album" FROM table_204_655 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_80452 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many Silver medals were won in total by all those with more than 3 bronze and exactly 16 gold? | SELECT SUM("Silver") FROM table_80452 WHERE "Bronze" > '3' AND "Gold" = '16' | wikisql |
CREATE TABLE table_21021 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" ... | Name the memory for frequency of 1.6 ghz | SELECT "Memory" FROM table_21021 WHERE "Frequency" = '1.6 GHz' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
... | what is the name of procedure patient 51200 has been given two times 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 = 512... | mimic_iii |
CREATE TABLE table_name_86 (
competition VARCHAR,
season VARCHAR,
opponent VARCHAR
) | What is the Competition for Season 2002 03, and the Opponent was zenit st. petersburg? | SELECT competition FROM table_name_86 WHERE season = "2002–03" AND opponent = "zenit st. petersburg" | sql_create_context |
CREATE TABLE table_name_75 (
name VARCHAR,
apparent_magnitude VARCHAR,
ra___j2000__ VARCHAR
) | Which Name has Apparent Magnitude smaller than 11.4, and R.A. (J2000) of 04h17m35.8s? | SELECT name FROM table_name_75 WHERE apparent_magnitude < 11.4 AND ra___j2000__ = "04h17m35.8s" | sql_create_context |
CREATE TABLE table_name_19 (
area__km²_ INTEGER,
density___km²_ VARCHAR,
official_website VARCHAR
) | What is the sum of the area values for districts having density over 462 and websites of http://krishna.nic.in/? | SELECT SUM(area__km²_) FROM table_name_19 WHERE density___km²_ > 462 AND official_website = "http://krishna.nic.in/" | sql_create_context |
CREATE TABLE table_name_17 (
wins INTEGER,
ties VARCHAR,
win__percentage VARCHAR,
name VARCHAR
) | Which Wins have a Win % smaller than 0.8270000000000001, and a Name of rick mirer, and Ties smaller than 1? | SELECT SUM(wins) FROM table_name_17 WHERE win__percentage < 0.8270000000000001 AND name = "rick mirer" AND ties < 1 | sql_create_context |
CREATE TABLE table_55784 (
"Ordinary income rate" text,
"Long-term capital gain rate" text,
"Short-term capital gain rate" text,
"Long-term gain on commercial buildings*" text,
"Long-term gain on collectibles" text
) | What is the long-term capital gain rate when the long-term gain on commercial buildings is 25% and long term gain on collectibles is 28% while short-term capital gain rate is 33%? | SELECT "Long-term capital gain rate" FROM table_55784 WHERE "Long-term gain on commercial buildings*" = '25%' AND "Long-term gain on collectibles" = '28%' AND "Short-term capital gain rate" = '33%' | 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... | 在门诊诊断为患者牙列缺失的的检测指标492909数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '牙列缺失' AND jyjgzbb.JCZBDM = '492... | css |
CREATE TABLE table_20200 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | What is the number of the player who attended Delta State? | SELECT MAX("No.") FROM table_20200 WHERE "School/Club Team" = 'Delta State' | wikisql |
CREATE TABLE table_48568 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the to par of the player with more than $4,100 and a score of 69-67-72-70=278? | SELECT "To par" FROM table_48568 WHERE "Money ( $ )" > '4,100' AND "Score" = '69-67-72-70=278' | wikisql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Show name and distance for all aircrafts by a bar chart, list by the y axis in ascending please. | SELECT name, distance FROM aircraft ORDER BY distance | nvbench |
CREATE TABLE table_21530474_1 (
region_s_ VARCHAR,
chassis_code VARCHAR
) | Name the regions for usf45 | SELECT region_s_ FROM table_21530474_1 WHERE chassis_code = "USF45" | sql_create_context |
CREATE TABLE table_name_18 (
laps VARCHAR,
driver VARCHAR,
grid VARCHAR
) | How many laps for robin montgomerie-charrington, and a Grid smaller than 15? | SELECT COUNT(laps) FROM table_name_18 WHERE driver = "robin montgomerie-charrington" AND grid < 15 | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | show me all flights on WN from SAN DIEGO to SAN FRANCISCO | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_name_17 (
driver VARCHAR,
engine VARCHAR,
chassis VARCHAR
) | who is the driver with the engine era 1.5 l6 s and the chassis is era b? | SELECT driver FROM table_name_17 WHERE engine = "era 1.5 l6 s" AND chassis = "era b" | sql_create_context |
CREATE TABLE table_name_8 (
crowd INTEGER,
home_team VARCHAR
) | What is the average crowd size for games with hawthorn as the home side? | SELECT AVG(crowd) FROM table_name_8 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_43573 (
"Result" text,
"TUF Competitor" text,
"Opponent" text,
"Method" text,
"Event" text,
"Date" text
) | who is the opponent when the method is tko (punches) at 4:26 of round 1? | SELECT "Opponent" FROM table_43573 WHERE "Method" = 'tko (punches) at 4:26 of round 1' | wikisql |
CREATE TABLE table_11271 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | What's the sum of draw for artist hari mata hari with less than 70 points? | SELECT SUM("Draw") FROM table_11271 WHERE "Artist" = 'hari mata hari' AND "Points" < '70' | wikisql |
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | A bar chart about the name and age for all male people who don't have a wedding, could you display by the x axis in ascending? | SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name | nvbench |
CREATE TABLE table_15226 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
) | What number pick was the player for the Oakland Athletics who plays the 1B position? | SELECT "Pick" FROM table_15226 WHERE "Position" = '1b' AND "Team" = 'oakland athletics' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_cod... | ground transportation in WESTCHESTER COUNTY | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WESTCHESTER COUNTY' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_50265 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the high amount of assists before game 60? | SELECT "High assists" FROM table_50265 WHERE "Game" < '60' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.