context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_42168 (
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Record" text
) | On what date was a game played, which left the team with a record of 5-7? | SELECT "Date" FROM table_42168 WHERE "Record" = '5-7' | wikisql |
CREATE TABLE table_name_24 (
score VARCHAR,
surface VARCHAR
) | What was the score of the game that was played on a grass surface? | SELECT score FROM table_name_24 WHERE surface = "grass" | sql_create_context |
CREATE TABLE table_47333 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What is the score of the match with deportes savio as the away team? | SELECT "Score" FROM table_47333 WHERE "Away" = 'deportes savio' | wikisql |
CREATE TABLE table_203_759 (
id number,
"year" number,
"company" text,
"number of members affected" number,
"duration of strike" text,
"notes" text
) | before 1989 how many strikes were there ? | SELECT COUNT(*) FROM table_203_759 WHERE "year" < 1989 | squall |
CREATE TABLE pitstops (
raceid number,
driverid number,
stop number,
lap number,
time text,
duration text,
milliseconds number
)
CREATE TABLE seasons (
year number,
url text
)
CREATE TABLE circuits (
circuitid number,
circuitref text,
name text,
location text,
c... | What are the ids and last names of all drivers who participated in the most races? | SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | TOP 100 users from Cambridge, UK. Lists the top 100 users (ranked by reputation) that are located Cambridge, UK according to their profile information. | SELECT Id AS "user_link", Reputation, WebsiteUrl, Location FROM Users WHERE (Location LIKE '%Cambridge%' AND NOT Location LIKE '%MA%') ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_32575 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score for the away team when they played collingwood? | SELECT "Away team score" FROM table_32575 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
... | What are the first and last names of all customers with more than 2 payments? | SELECT T2.first_name, T2.last_name FROM customer_payments AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_47228 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the highest number of rebounds of the san antonio spurs? | SELECT "High rebounds" FROM table_47228 WHERE "Team" = 'san antonio spurs' | wikisql |
CREATE TABLE table_name_78 (
place_of_birth VARCHAR,
elevated VARCHAR,
cardinalatial_title VARCHAR
) | What is the place of birth when elevated is May 16, 1288, and cardinalatial title is Deacon of S. Eustachio? | SELECT place_of_birth FROM table_name_78 WHERE elevated = "may 16, 1288" AND cardinalatial_title = "deacon of s. eustachio" | sql_create_context |
CREATE TABLE table_79986 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the outcome of the game played on 19-Sep-2006? | SELECT "Outcome" FROM table_79986 WHERE "Date" = '19-sep-2006' | wikisql |
CREATE TABLE table_name_43 (
points VARCHAR,
year VARCHAR,
chassis VARCHAR,
entrant VARCHAR,
engine VARCHAR
) | How many points does an entrant of Martini Racing, the engine of an Alfa Romeo flat-12 a chassis of brabham bt45, and the year 1976 have? | SELECT COUNT(points) FROM table_name_43 WHERE entrant = "martini racing" AND engine = "alfa romeo flat-12" AND chassis = "brabham bt45" AND year = 1976 | sql_create_context |
CREATE TABLE table_66969 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the attendance at the game that had a loss of Crabtree (0-1)? | SELECT "Attendance" FROM table_66969 WHERE "Loss" = 'crabtree (0-1)' | wikisql |
CREATE TABLE table_22538587_3 (
l_g VARCHAR,
c_g VARCHAR,
c_apps VARCHAR
) | Name the total number of lg for cg is larger than 1.0 for c apps is 3 | SELECT COUNT(l_g) FROM table_22538587_3 WHERE c_g > 1.0 AND c_apps = 3 | sql_create_context |
CREATE TABLE table_46292 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the total laps when manufacturer of gilera has time of 40:19.910 and grid is larger than 3? | SELECT SUM("Laps") FROM table_46292 WHERE "Manufacturer" = 'gilera' AND "Time" = '40:19.910' AND "Grid" > '3' | wikisql |
CREATE TABLE table_4975 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Name the total number of overall for brent hawkins and pick # more than 28 | SELECT COUNT("Overall") FROM table_4975 WHERE "Name" = 'brent hawkins' AND "Pick #" > '28' | wikisql |
CREATE TABLE table_48510 (
"Year" real,
"Award" text,
"Nominated Work" text,
"Category" text,
"Result" text
) | What is Award, when Category is Cabello Maluco? | SELECT "Award" FROM table_48510 WHERE "Category" = 'cabello maluco' | wikisql |
CREATE TABLE table_1341707_45 (
incumbent VARCHAR,
district VARCHAR
) | Who is the incumbent in district Texas 15? | SELECT incumbent FROM table_1341707_45 WHERE district = "Texas 15" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少? | (SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ... | css |
CREATE TABLE table_34975 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals? | SELECT AVG("Extra points") FROM table_34975 WHERE "Touchdowns" < '2' AND "Player" = 'herrnstein' AND "Field goals" < '0' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | what number of days have passed since patient 71689's hospital admission? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 71689 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_name_66 (
driver VARCHAR,
total_time VARCHAR
) | What driver had a total time of 16:58? | SELECT driver FROM table_name_66 WHERE total_time = "16:58" | sql_create_context |
CREATE TABLE table_22597626_17 (
opponents_in_the_final VARCHAR,
score_in_the_final VARCHAR
) | Who were the opponents in the final where the score in the final is 6 4, 7 6 2? | SELECT opponents_in_the_final FROM table_22597626_17 WHERE score_in_the_final = "6–4, 7–6 2" | sql_create_context |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CO... | How many courses for each course description? Show me a bar chart, sort y-axis from low to high order. | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | Next semester in all departments , how many classes are being offered ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_28 (
grid VARCHAR,
rider VARCHAR
) | What is the grid of rider shinya nakano? | SELECT grid FROM table_name_28 WHERE rider = "shinya nakano" | sql_create_context |
CREATE TABLE table_68126 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the attendance of the Blue Jays' game when their record was 47-43? | SELECT SUM("Attendance") FROM table_68126 WHERE "Record" = '47-43' | wikisql |
CREATE TABLE table_2602958_3 (
original_air_date VARCHAR,
director VARCHAR
) | What is the original air date for the episode directed by kevin dowling? | SELECT original_air_date FROM table_2602958_3 WHERE director = "Kevin Dowling" | sql_create_context |
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE ... | Show me the trend about the amount of date_address_to over date_address_to , and group by attribute other_details with a line chart. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC | nvbench |
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... | provide the diagnoses icd9 code for kelly gallardo. | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_name_16 (
Id VARCHAR
) | What is in 2007 has 2004 olympic games? | SELECT 2007 FROM table_name_16 WHERE 2004 = "olympic games" | sql_create_context |
CREATE TABLE table_name_15 (
fa_cup INTEGER,
total VARCHAR,
league VARCHAR
) | How many FA Cups on average have a larger total than 32 and a larger league than 24? | SELECT AVG(fa_cup) FROM table_name_15 WHERE total > 32 AND league > 24 | sql_create_context |
CREATE TABLE Projects (
project_id VARCHAR,
project_details VARCHAR
)
CREATE TABLE Tasks (
task_details VARCHAR,
task_id VARCHAR,
project_id VARCHAR
)
CREATE TABLE Project_outcomes (
project_id VARCHAR
) | What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes? | SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.proje... | sql_create_context |
CREATE TABLE table_203_497 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many gold medals did india win ? | SELECT "gold" FROM table_203_497 WHERE "nation" = 'india' | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | how many patients are with primary disease gangrene? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GANGRENE" | mimicsql_data |
CREATE TABLE table_name_25 (
points VARCHAR,
points_for VARCHAR
) | What is Points, when Points For is '562'? | SELECT points FROM table_name_25 WHERE points_for = "562" | sql_create_context |
CREATE TABLE table_55619 (
"Rank" real,
"Movie" text,
"Year" real,
"Studio(s)" text,
"Single Day Net Gross" real,
"Day in Release" text,
"Day of Week" real
) | What is the average year for releases on Friday and weeks larger than 2 days? | SELECT AVG("Year") FROM table_55619 WHERE "Day in Release" = 'friday' AND "Day of Week" > '2' | wikisql |
CREATE TABLE table_name_83 (
position VARCHAR,
year VARCHAR
) | What position is 1999? | SELECT position FROM table_name_83 WHERE year = 1999 | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 患者06445268在医院5566440入院确诊疾病名称包含病的是什么医疗就诊记录序号? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '06445268' AND gwyjzb.MED_SER_ORG_NO = '5566440' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%病%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '06445268' AND fgwyjzb.MED_SER_ORG_NO = '5566440' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%病%' | css |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),... | Visualize a bar chart for how many hours do the students spend studying in each department?, and sort DEPT_CODE from high to low order. | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | nvbench |
CREATE TABLE table_66390 (
"Year" real,
"Title" text,
"Type" text,
"Label" text,
"Label-Nr" text
) | What is the song title from 1963 on the Pacific Jazz label, and a Label-Nr of st-81? | SELECT "Title" FROM table_66390 WHERE "Label" = 'pacific jazz' AND "Year" = '1963' AND "Label-Nr" = 'st-81' | wikisql |
CREATE TABLE table_name_29 (
title VARCHAR,
no_in_series INTEGER
) | What are the titles for episodes prior to episode 4? | SELECT title FROM table_name_29 WHERE no_in_series < 4 | sql_create_context |
CREATE TABLE suppliers (
supplier_id number,
supplier_name text,
supplier_phone text
)
CREATE TABLE supplier_addresses (
supplier_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_f... | List the names of all the distinct customers who bought a keyboard. | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = "keyboard" | spider |
CREATE TABLE table_train_198 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"fasting_plasma_glucose" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"type_1_patients" bool,
"NOUSE" float
) | hemoglobin a1c of 7 _ 10 % at screening. | SELECT * FROM table_train_198 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 10 | criteria2sql |
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptro... | Who are the lieutenant governor and comptroller from the democratic party? | SELECT lieutenant_governor, comptroller FROM party WHERE party = "Democratic" | spider |
CREATE TABLE table_28783 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" real
) | who directed and produced 176452? | SELECT "Directed by" FROM table_28783 WHERE "Production code" = '176452' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | Badge progress for Curious, Inquisitive, and Socratic. For users interested in their badge progress. | SELECT CASE WHEN days >= 5 THEN 'Yes' ELSE CONCAT(days, '/', 5) END AS Curious, CASE WHEN days >= 30 THEN 'Yes' ELSE CONCAT(days, '/', 30) END AS Inquisitive, CASE WHEN days >= 100 THEN 'Yes' ELSE CONCAT(days, '/', 100) END AS Socratic FROM (SELECT COUNT(*) AS days FROM (SELECT DATEDIFF(d, CreationDate, GETDATE()) AS c... | sede |
CREATE TABLE table_21436373_8 (
type_of_record VARCHAR,
result_games VARCHAR
) | What record was set when the result/game was equal to 9 games (28,595 avg.) | SELECT type_of_record FROM table_21436373_8 WHERE result_games = "9 games (28,595 avg.)" | sql_create_context |
CREATE TABLE table_17541 (
"Country" text,
"Currency" text,
"1 Euro =" text,
"1 USD =" text,
"Central bank" text
) | What's the name of the country where 1 USD equals 1.71577 of the local currency. | SELECT "Country" FROM table_17541 WHERE "1 USD =" = '1.71577' | wikisql |
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
... | What are the ids and locations of all circuits in France or Belgium Show bar chart, could you sort X-axis from high to low order? | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY location DESC | nvbench |
CREATE TABLE table_15625 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | When was there a score of 7-1? | SELECT "Date" FROM table_15625 WHERE "Score" = '7-1' | wikisql |
CREATE TABLE table_20217811_1 (
green VARCHAR,
electorate VARCHAR
) | Name the green for otaki | SELECT green FROM table_20217811_1 WHERE electorate = "Otaki" | sql_create_context |
CREATE TABLE table_68513 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | Tell me the name for time of 25.74 | SELECT "Name" FROM table_68513 WHERE "Time" = '25.74' | wikisql |
CREATE TABLE table_43287 (
"Ship" text,
"Hull No." text,
"Commissioned" text,
"Builder" text,
"Home Port" text,
"NVR Page" text
) | What is the NVR Page of the ship with a Home Port of Sasebo, Japan? | SELECT "NVR Page" FROM table_43287 WHERE "Home Port" = 'sasebo, japan' | wikisql |
CREATE TABLE table_25627 (
"County" text,
"Gore %" text,
"Gore #" real,
"Bush %" text,
"Bush #" real,
"Others %" text,
"Others #" text
) | Name the number of bush % for elko | SELECT COUNT("Bush %") FROM table_25627 WHERE "County" = 'Elko' | wikisql |
CREATE TABLE table_10534 (
"Number" real,
"District" text,
"Size km\u00b2" real,
"Population" real,
"Density hab/km" real,
"Councilman" text,
"Party" text
) | what is the size km when the density hab/km is 8,321? | SELECT SUM("Size km\u00b2") FROM table_10534 WHERE "Density hab/km" = '8,321' | wikisql |
CREATE TABLE table_name_14 (
high_rebounds VARCHAR,
location_attendance VARCHAR
) | What is High Rebounds, when Location Attendance is 'Time Warner Cable Arena 10,848'? | SELECT high_rebounds FROM table_name_14 WHERE location_attendance = "time warner cable arena 10,848" | sql_create_context |
CREATE TABLE table_40426 (
"Season" text,
"Conference" text,
"Division" text,
"Finish" text,
"Wins" text,
"Losses" text
) | What shows for Wins when there was a Conference of , western division, in the 1967 68 season? | SELECT "Wins" FROM table_40426 WHERE "Conference" = '—' AND "Division" = 'western' AND "Season" = '1967–68' | wikisql |
CREATE TABLE table_name_22 (
engine VARCHAR,
driver VARCHAR
) | What was the Michele Alboreto's engine? | SELECT engine FROM table_name_22 WHERE driver = "michele alboreto" | sql_create_context |
CREATE TABLE table_406 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Home Town" text,
"High School" text
) | Crockett High School had which number(#)? | SELECT "#" FROM table_406 WHERE "High School" = 'Crockett' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | what time did patient 017-20711 get his last urine output on last month/15? | 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 = '017-20711')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_26419 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Name the outcome for zurich | SELECT "Outcome" FROM table_26419 WHERE "Championship" = 'Zurich' | wikisql |
CREATE TABLE table_14105 (
"Season" text,
"Division" text,
"Tms." text,
"Pos." text,
"PFF NMCC" text,
"UFL Cup" text,
"AFC PC" text
) | Which PFF NMCC has a AFC PC of dnq? | SELECT "PFF NMCC" FROM table_14105 WHERE "AFC PC" = 'dnq' | wikisql |
CREATE TABLE table_52955 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps does peter arundell have? | SELECT "Laps" FROM table_52955 WHERE "Driver" = 'peter arundell' | wikisql |
CREATE TABLE table_name_61 (
crowd INTEGER,
venue VARCHAR
) | What is the crowd size of the game at Brunswick Street Oval? | SELECT SUM(crowd) FROM table_name_61 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE table_name_3 (
tournament VARCHAR,
winner VARCHAR
) | Name the tournament for patrick rafter winning | SELECT tournament FROM table_name_3 WHERE winner = "patrick rafter" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Popularity of JavaScript frameworks (Ang, BB, Emb & KO) by month for a given time period. | SELECT LEFT(TagName, 7) AS Tag, COUNT(PostId) AS NumPosts, CAST(YEAR(Posts.CreationDate) AS TEXT(4)) + '-' + RIGHT('0' + CAST(MONTH(Posts.CreationDate) AS TEXT(3)), 2) FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND TagName IN ('ember.js', 'ember', 'emberjs', 'angular', 'angular.js',... | sede |
CREATE TABLE table_name_39 (
catalogue VARCHAR,
format VARCHAR
) | Which catalogue has a formate of 'CD Remastered with 3 bonus tracks'? | SELECT catalogue FROM table_name_39 WHERE format = "cd remastered with 3 bonus tracks" | sql_create_context |
CREATE TABLE table_64539 (
"Rank" text,
"Group" text,
"Name" text,
"Nationality" text,
"Mark" text
) | What rank has a mark of NM and is from India? | SELECT "Rank" FROM table_64539 WHERE "Mark" = 'nm' AND "Nationality" = 'india' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
V... | What are the number of the category of music festivals with result 'Awarded'?, I want to rank y-axis in desc order please. | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what is the difference of sao2 of patient 006-153198 last measured on the last intensive care unit visit compared to the first value measured on the last intensive care unit visit. | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198') AND NOT patient.unitdischargetime IS NULL... | eicu |
CREATE TABLE table_24470 (
"Team" text,
"Sport" text,
"League" text,
"Established" real,
"Began in St. Louis" real,
"Venue" text,
"Championships in St. Louis" text,
"Left St. Louis" real
) | How may championships were won by the team that started in 1950? | SELECT "Championships in St. Louis" FROM table_24470 WHERE "Began in St. Louis" = '1950' | wikisql |
CREATE TABLE table_name_61 (
wins VARCHAR,
season VARCHAR,
conference VARCHAR,
division VARCHAR
) | What shows for Wins when there was a Conference of , western division, in the 1967 68 season? | SELECT wins FROM table_name_61 WHERE conference = "—" AND division = "western" AND season = "1967–68" | sql_create_context |
CREATE TABLE table_34122 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bulls score" real,
"Opponent score" real,
"Record" text,
"Streak" text
) | Which Record has an Opponent of detroit, and an Opponent score smaller than 87? | SELECT "Record" FROM table_34122 WHERE "Opponent" = 'detroit' AND "Opponent score" < '87' | wikisql |
CREATE TABLE table_21133193_1 (
languages VARCHAR,
member_countries VARCHAR
) | Name the languages for cyprus | SELECT languages FROM table_21133193_1 WHERE member_countries = "Cyprus" | sql_create_context |
CREATE TABLE table_36802 (
"Player" text,
"Attempts" real,
"Yards" real,
"Average" real,
"Long" real,
"Touchdowns" real
) | What is the number of touchdowns with the average is less than 2.6? | SELECT COUNT("Touchdowns") FROM table_36802 WHERE "Average" < '2.6' | wikisql |
CREATE TABLE table_62913 (
"Round" real,
"Date" text,
"Home" text,
"Result" text,
"Visitor" text,
"Venue" text,
"Attendance" real
) | Who is the visitor at the axa sports center in round 20? | SELECT "Visitor" FROM table_62913 WHERE "Venue" = 'axa sports center' AND "Round" = '20' | wikisql |
CREATE TABLE table_58657 (
"Matches" real,
"Wins" real,
"Draw" real,
"Losses" real,
"Against" real
) | How many matches has 51 draws and more than 6 against? | SELECT SUM("Matches") FROM table_58657 WHERE "Against" > '6' AND "Draw" = '51' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train... | Count the number of services by services. | SELECT services, COUNT(services) FROM station GROUP BY services | nvbench |
CREATE TABLE table_27379 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Who was the draft pick for Kansas City Chiefs? | SELECT "Player" FROM table_27379 WHERE "NFL Team" = 'Kansas City Chiefs' | wikisql |
CREATE TABLE table_11677100_3 (
school VARCHAR,
player VARCHAR
) | What school does Kerry Wood play for? | SELECT school FROM table_11677100_3 WHERE player = "Kerry Wood" | sql_create_context |
CREATE TABLE table_26250 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
) | What is every year born for height of 1.88? | SELECT "Year born" FROM table_26250 WHERE "Height (m)" = '1.88' | wikisql |
CREATE TABLE table_77647 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Which team was home on October 13? | SELECT "Home" FROM table_77647 WHERE "Date" = 'october 13' | wikisql |
CREATE TABLE table_13967239_2 (
senior__4th_year_ VARCHAR,
sophomore__grade_8_ VARCHAR
) | What is after intermediate algebra | SELECT senior__4th_year_ FROM table_13967239_2 WHERE sophomore__grade_8_ = "Intermediate Algebra" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | patient 12952 was admitted into the hospital in 2105? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 12952 AND STRFTIME('%y', admissions.admittime) = '2105' | mimic_iii |
CREATE TABLE table_28952 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | In how many different parts was the incumbent Abraham B. Venable? | SELECT COUNT("Party") FROM table_28952 WHERE "Incumbent" = 'Abraham B. Venable' | wikisql |
CREATE TABLE table_61845 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the 2013 with a 2r in 2010 and a qf in 2011? | SELECT "2013" FROM table_61845 WHERE "2010" = '2r' AND "2011" = 'qf' | wikisql |
CREATE TABLE table_name_91 (
Id VARCHAR
) | What is the 2001 statistic for the product that had 2,360,000 tonnes in 2002? | SELECT 2001 FROM table_name_91 WHERE 2002 = "2,360,000 tonnes" | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 排序团伙成员邹阳旭最常去的医院都是那几个? | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '邹阳旭' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '邹阳旭' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_77 (
score VARCHAR,
date VARCHAR
) | What was the score on February 17? | SELECT score FROM table_name_77 WHERE date = "february 17" | sql_create_context |
CREATE TABLE fzzmzjzjlb (
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... | 患者谢天心的身高多少?体重多少? | SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb 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 WHERE person_info.XM = '谢天心' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ... | css |
CREATE TABLE table_32895 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What venue is located in Indiana and hosted at Purdue University? | SELECT "Venue" FROM table_32895 WHERE "State" = 'indiana' AND "Host" = 'purdue university' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | is the heartrate of patient 004-49903 last measured on the last intensive care unit visit less than compared to the value first measured on the last intensive care unit visit? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-49903') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 列出医院6110651医疗就诊记录中所有患者的平均年龄有多大,根据不同的科室名称和入院诊断疾病名称? | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6110651' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM | css |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | find the number of single patients diagnosed with myopia. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Myopia" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id, and could you rank X-axis from high to low order? | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_78191 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What score did the home team of north melbourne get? | SELECT "Home team score" FROM table_78191 WHERE "Home team" = 'north melbourne' | 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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | What will be the time for PERSIAN 102 lectures next semester ? | SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PERSIAN' AND course... | advising |
CREATE TABLE Attribute_Definitions (
attribute_name VARCHAR,
attribute_id VARCHAR
)
CREATE TABLE Catalog_Contents_Additional_Attributes (
attribute_id VARCHAR,
attribute_value VARCHAR
) | Find the name and attribute ID of the attribute definitions with attribute value 0. | SELECT t1.attribute_name, t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 | sql_create_context |
CREATE TABLE table_11275 (
"Year of award" real,
"Date(s)" text,
"Sport" text,
"Winner" text,
"Loser" text
) | What losing team plays hockey? | SELECT "Loser" FROM table_11275 WHERE "Sport" = 'hockey' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.