context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_56 ( Id VARCHAR )
What is the 2006 value with a 1r in 2011?
SELECT 2006 FROM table_name_56 WHERE 2011 = "1r"
sql_create_context
CREATE TABLE table_name_18 ( result VARCHAR, opponent VARCHAR )
WHAT IS THE RESULT WHEN THE OPPONENT WAS CHICAGO BEARS?
SELECT result FROM table_name_18 WHERE opponent = "chicago bears"
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, ...
how many patients whose age is less than 77 and diagnoses long title is abscess of intestine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "77" AND diagnoses.long_title = "Abscess of intestine"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
Closed non-duplicate questions answered by a user.
SELECT q.Id AS "post_link", q.Score AS "question_score", a.Score AS "answer_score", q.AcceptedAnswerId AS "accepted_answer" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE NOT q.ClosedDate IS NULL AND a.OwnerUserId = '##UserId##' AND q.Id NOT IN (SELECT PostId FROM PostLinks) ORDER BY q.ClosedDate DESC
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ...
My Profiles Across Stack Exchange.
SELECT * FROM sys.databases
sede
CREATE TABLE table_30027 ( "Year" real, "Location" text, "Distance (miles)" real, "Rider Names" text, "Horse Name" text, "Best-Conditioned Horse" text )
How many different riders are there that won riding Omr Tsunami?
SELECT COUNT("Rider Names") FROM table_30027 WHERE "Horse Name" = 'OMR Tsunami'
wikisql
CREATE TABLE table_train_248 ( "id" int, "anemia" bool, "prostate_specific_antigen_psa" float, "hemoglobin_a1c_hba1c" float, "body_weight" float, "fasting_triglycerides" int, "hyperlipidemia" bool, "hgb" int, "fasting_total_cholesterol" int, "fasting_ldl_cholesterol" int, "bo...
hyperlipidemia ( fasting total cholesterol > 240 mg / dl and / or fasting triglycerides > 200 mg / dl and / or fasting ldl cholesterol > 140 mg / dl ) ;
SELECT * FROM table_train_248 WHERE hyperlipidemia = 1 OR (fasting_total_cholesterol > 240 OR fasting_triglycerides > 200 OR fasting_ldl_cholesterol > 140)
criteria2sql
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在2006年5月28日到2010年11月23日之间患者柏蕴秀所有检验结果指标记录的检测人为花嘉淑的检验指标流水号分别是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jyb...
css
CREATE TABLE table_name_24 ( round INTEGER, position VARCHAR, pick__number VARCHAR, overall VARCHAR )
What is the highest round with a pick# of 11, a position of offensive tackle, and overall less than 414?
SELECT MAX(round) FROM table_name_24 WHERE pick__number = 11 AND overall < 414 AND position = "offensive tackle"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the total number of patients who had brain mass, intracranial hemorrhage as primary disease and had a lab test for ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_80 ( player VARCHAR, score VARCHAR )
What Player had a Score of 70-71=141?
SELECT player FROM table_name_80 WHERE score = 70 - 71 = 141
sql_create_context
CREATE TABLE table_3072 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" text )
What ends lost came out to 37?
SELECT "Stolen Ends" FROM table_3072 WHERE "Ends Lost" = '37'
wikisql
CREATE TABLE table_3141 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
How many people attended the game at Jahn-sportpark?
SELECT MIN("Attendance") FROM table_3141 WHERE "Game site" = 'Jahn-Sportpark'
wikisql
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...
Show me about the correlation between ACC_Percent and All_Games_Percent in a scatter chart.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_name_31 ( fat32 VARCHAR, ntfs VARCHAR )
Which FAT32 has yes v1.0/v1.1 for NTFS?
SELECT fat32 FROM table_name_31 WHERE ntfs = "yes v1.0/v1.1"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
沈玉堂这个患者所有检验报告单中的标本在2002年6月12日到2006年8月24日期间内采集的都是啥呀?
SELECT jybgb.BBCJBW 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 person_info.XM = ...
css
CREATE TABLE table_203_330 ( id number, "year of election" number, "candidates elected" number, "# of seats available" number, "# of votes" number, "% of popular vote" text )
how many more seats were available in 1975 than 1963 ?
SELECT (SELECT "# of seats available" FROM table_203_330 WHERE "year of election" = 1975) - (SELECT "# of seats available" FROM table_203_330 WHERE "year of election" = 1963)
squall
CREATE TABLE table_8631 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
what is the sum of points when lost is less than 10, name is vfl denklingen and position is higher than 2?
SELECT SUM("Points") FROM table_8631 WHERE "Lost" < '10' AND "Name" = 'vfl denklingen' AND "Position" > '2'
wikisql
CREATE TABLE table_7239 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which venue held the Euro 2012 Qualifier?
SELECT "Venue" FROM table_7239 WHERE "Competition" = 'euro 2012 qualifier'
wikisql
CREATE TABLE table_38655 ( "Discipline" text, "Peter" real, "Adam" real, "Jade" real, "Plat'num" real )
What is Adam's score when Peter's score is less than 3 and the plat'num is greater than 6?
SELECT MIN("Adam") FROM table_38655 WHERE "Peter" < '3' AND "Plat'num" > '6'
wikisql
CREATE TABLE table_21800 ( "Scientific name" text, "Common name" text, "Length (male)" text, "Length (female)" text, "Color" text, "Lifespan (years)" text )
Name the number of color for furcifer pardalis
SELECT COUNT("Color") FROM table_21800 WHERE "Scientific name" = 'Furcifer pardalis'
wikisql
CREATE TABLE table_23248940_10 ( high_assists VARCHAR, game VARCHAR )
How many people led in assists on game 71?
SELECT COUNT(high_assists) FROM table_23248940_10 WHERE game = 71
sql_create_context
CREATE TABLE table_22785 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text )
When 3t7461 is the production code who is the director?
SELECT "Directed by" FROM table_22785 WHERE "Production code" = '3T7461'
wikisql
CREATE TABLE table_204_670 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "attendance" number )
what is the number of fans who attended the december 7 , 1969 game against the broncos ?
SELECT "attendance" FROM table_204_670 WHERE "date" = 'december 7, 1969'
squall
CREATE TABLE procedures ( 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 ...
on which date was the patient with patient id 74463 born?
SELECT demographic.dob FROM demographic WHERE demographic.subject_id = "74463"
mimicsql_data
CREATE TABLE table_203_41 ( id number, "name" text, "variant name(s)" text, "source" text, "source coordinates" text, "length" text, "mouth" text, "mouth coordinates" text )
which tributary has at least 3 variant names ?
SELECT "name" FROM table_203_41 WHERE "variant name(s)" >= 3
squall
CREATE TABLE table_name_70 ( date VARCHAR, record VARCHAR )
Record of 92 70 had what date?
SELECT date FROM table_name_70 WHERE record = "92–70"
sql_create_context
CREATE TABLE table_20928682_1 ( game INTEGER, opponent VARCHAR )
Which game number was played against Georgia?
SELECT MIN(game) FROM table_20928682_1 WHERE opponent = "Georgia"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
Number of bounties with accepted answer depending on the day (time) when bounty started.
WITH tmp AS (SELECT p.Id, p.AcceptedAnswerId AS Acc, Period = CASE @Frequency WHEN 1 THEN TIME_TO_STR(bs.CreationDate, '%h') WHEN 2 THEN TIME_TO_STR(bs.CreationDate, '%W') WHEN 3 THEN ROUND((CAST(TIME_TO_STR(bs.CreationDate, '%W') AS FLOAT) + CAST(TIME_TO_STR(bs.CreationDate, '%h') AS FLOAT) / 24), 2) END FROM Posts AS...
sede
CREATE TABLE table_name_47 ( date VARCHAR, opponent VARCHAR )
On what Date was the Opponent the Tennessee Titans?
SELECT date FROM table_name_47 WHERE opponent = "tennessee titans"
sql_create_context
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
患者的a1酸性糖蛋白在门诊诊断为疾病K80.961的参考值范围有什么下限和上限?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'K80.961' AND jyjgzbb.JCZBMC = 'a1酸性糖蛋白' UNION SELECT jyjgzbb.CKZFW...
css
CREATE TABLE table_name_27 ( rank INTEGER, name VARCHAR )
What is the greatest rank for Fifth third center?
SELECT MAX(rank) FROM table_name_27 WHERE name = "fifth third center"
sql_create_context
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
what is the difference between the number of employees at mundelein elementary school district 75 and fremon school district 79 ?
SELECT ABS((SELECT "# of employees" FROM table_203_737 WHERE "employer" = 'mundelein elementary school district 75') - (SELECT "# of employees" FROM table_203_737 WHERE "employer" = 'fremont school district 79'))
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
tell me the last careunit patient 8908 got until 2104?
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8908) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) <= '2104' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_43191 ( "Team" text, "Match" text, "Points" text, "Draw" text, "Lost" text )
What is the draw for a match that had 10 points?
SELECT "Draw" FROM table_43191 WHERE "Points" = '10'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( ro...
what were the top three most frequent diagnoses that patients were given within 2 months after being diagnosed with acidosis this year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE table_70377 ( "Year" real, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "Avg. Attendance" text )
Which regular season was 2013 in?
SELECT "Regular Season" FROM table_70377 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_63766 ( "Coaster Name" text, "Park" text, "Location" text, "Track" text, "Builder" text, "Year Opened" text )
What is the coaster name that was opened in 1978, and have wooden track?
SELECT "Coaster Name" FROM table_63766 WHERE "Year Opened" = '1978' AND "Track" = 'wooden'
wikisql
CREATE TABLE table_61166 ( "Distance" text, "Event" text, "Time" text, "Meet" text, "Location" text )
What Meet has a Time of 1:04.84?
SELECT "Meet" FROM table_61166 WHERE "Time" = '1:04.84'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
列出患者赵星波被开出的所有检验报告单在2011-11-25到2013-05-15期间的检验报告单号是什么?
SELECT jybgb.BGDH 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 jybg...
css
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 were the five most frequently ordered procedures for patients who had previously been given angiogram - with stenting during the same hospital encounter in 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'angio...
eicu
CREATE TABLE table_name_97 ( office VARCHAR, greenback_ticket VARCHAR )
Which office was Richard M. Griffin vying for on the Greenback ticket?
SELECT office FROM table_name_97 WHERE greenback_ticket = "richard m. griffin"
sql_create_context
CREATE TABLE airport ( id number, city text, country text, iata text, icao text, name text ) CREATE TABLE flight ( id number, vehicle_flight_number text, date text, pilot text, velocity number, altitude number, airport_id number, company_id number ) CREATE TABLE...
What are the names and types of the companies that have ever operated a flight?
SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
spider
CREATE TABLE table_train_21 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "limited_care" bool, "septic_shock" bool, "coagulopathy" bool, "age" float, "lactate" int, "NOUSE" float )
patients greater than 18 years of age who present to the emergency department with the diagnosis of severe sepsis / septic shock.
SELECT * FROM table_train_21 WHERE age > 18 AND (severe_sepsis = 1 OR septic_shock = 1)
criteria2sql
CREATE TABLE table_51569 ( "Season" text, "Champion" text, "Team" text, "Chassis" text, "Engine" text )
What was the winning car's chassis for the 1982 season?
SELECT "Chassis" FROM table_51569 WHERE "Season" = '1982'
wikisql
CREATE TABLE table_9131 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text )
Where was the tournament where monica seles was the finalist who played on a hard surface?
SELECT "Tournament" FROM table_9131 WHERE "Surface" = 'hard' AND "Finalist" = 'monica seles'
wikisql
CREATE TABLE table_name_75 ( goals_against VARCHAR, minutes VARCHAR )
What is the goals against for the goalkeeper with 2520 minutes?
SELECT goals_against FROM table_name_75 WHERE minutes = 2520
sql_create_context
CREATE TABLE table_66161 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What is John Curtice's position?
SELECT "Position" FROM table_66161 WHERE "Player" = 'john curtice'
wikisql
CREATE TABLE table_35758 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What 9:00 has entertainment tonight as 7:00?
SELECT "9:00" FROM table_35758 WHERE "7:00" = 'entertainment tonight'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
Java questions from higher-rep users.
SELECT DISTINCT A.Id, A.CreationDate, C.Reputation FROM Posts AS A INNER JOIN PostTypes AS B ON A.PostTypeId = B.Id INNER JOIN Users AS C ON A.OwnerUserId = C.Id INNER JOIN PostTags AS D ON A.Id = D.PostId INNER JOIN Tags AS E ON D.TagId = E.Id WHERE A.CreationDate > DATEADD(week, DATEDIFF(week, 0, GETDATE()) - 1, -1) ...
sede
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, ...
how many patients who died in or before 2111 had undergone the lab test lactate dehydrogenase (ld)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.label = "Lactate Dehydrogenase (LD)"
mimicsql_data
CREATE TABLE table_204_465 ( id number, "#" number, "temple name" text, "hangul" text, "hanja" text, "period of reign" text, "personal name" text, "relationship" text, "note" text )
who reigned longer , geunchogo or chaekgye ?
SELECT "temple name" FROM table_204_465 WHERE "temple name" IN ('geunchogo', 'chaekgye') ORDER BY "period of reign" - "period of reign" DESC LIMIT 1
squall
CREATE TABLE table_name_88 ( venue VARCHAR, home_team VARCHAR )
Which venue has a Home team of south melbourne?
SELECT venue FROM table_name_88 WHERE home_team = "south melbourne"
sql_create_context
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), ...
Show all allergy types and the number of allergies in each type in a bar chart, and show in descending by the total number please.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_57961 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
What format is catalogue WPCR13504 in?
SELECT "Format" FROM table_57961 WHERE "Catalogue" = 'wpcr13504'
wikisql
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) )
What is the name of the project that has a scientist assigned to it whose name contains 'Smith', and count them by a bar chart
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name
nvbench
CREATE TABLE table_name_76 ( year INTEGER, departed_from VARCHAR )
From how many years did tampa, FL depart?
SELECT SUM(year) FROM table_name_76 WHERE departed_from = "tampa, fl"
sql_create_context
CREATE TABLE people ( people_id number, name text, age number, height number, hometown text ) CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizo...
List the names of gymnasts in ascending order by their heights.
SELECT T2.name FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.height
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
count the number of patients who have died in or before year 2148 with 3970 as the diagnosis icd9 code.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2148.0" AND diagnoses.icd9_code = "3970"
mimicsql_data
CREATE TABLE table_name_2 ( score VARCHAR, place VARCHAR )
How many scores have a Place of t5?
SELECT COUNT(score) FROM table_name_2 WHERE place = "t5"
sql_create_context
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
这位患者54994299以前有哪些住院诊断结果咋样啊?
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '54994299' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE region ( region_code VARCHAR, region_name VARCHAR )
Show all region code and region name sorted by the codes.
SELECT region_code, region_name FROM region ORDER BY region_code
sql_create_context
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...
Is there an exam for every upper-level class ?
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_75349 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the lowest number of field goals when the points were less than 5?
SELECT MIN("Field goals") FROM table_75349 WHERE "Points" < '5'
wikisql
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name tex...
Give me a histogram for how many members are in each party?, display by the Y from low to high.
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_76514 ( "Verb" text, "2 (VF)" text, "2 (F)" text, "3 (F)" text, "2/3 (P)" text )
What is the verb for Khola?
SELECT "3 (F)" FROM table_76514 WHERE "Verb" = 'khola'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what are the changes in the value of pt of patient 007-10135 last measured on the first hospital visit compared to the second to last value measured on the first hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text )
What are the authors of submissions and their colleges?
SELECT author, college FROM submission
spider
CREATE TABLE table_name_55 ( city VARCHAR, home_arena VARCHAR )
Which city includes Barclays Center?
SELECT city FROM table_name_55 WHERE home_arena = "barclays center"
sql_create_context
CREATE TABLE table_name_95 ( rank INTEGER, province VARCHAR )
What is the average rank of the province alborz, which had more than 14526 in 1956?
SELECT AVG(rank) FROM table_name_95 WHERE province = "alborz" AND 1956 > 14526
sql_create_context
CREATE TABLE table_214479_8 ( y_ VARCHAR, _2008 VARCHAR, expression VARCHAR )
what is the y = 2008 when the expression is easter day (julian calendar)?
SELECT y_ = _2008 FROM table_214479_8 WHERE expression = "Easter Day (Julian calendar)"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
根据不同的科室编码和出院诊断疾病编码,医疗就诊记录在医院9593496中所有患者的平均年龄都列出来是哪些?
SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9593496' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD
css
CREATE TABLE ship ( name VARCHAR, built_year VARCHAR, CLASS VARCHAR )
List all ship names in the order of built year and class.
SELECT name FROM ship ORDER BY built_year, CLASS
sql_create_context
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 Team_ID over the All_Neutral , I want to show All_Neutral in desc order.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
患者90955811自费金额高于1737.24元的药品量有多少,时间是在01年2月2日到07年3月1日内
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '90955811' AND t_kc22.STA_DATE BETWEEN '2001-02-02' AND '2007-03-01' AND t_kc22.SELF_PAY_AMO > 1737.24
css
CREATE TABLE table_63419 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What's the draw that's played less than 36 and has 42 points?
SELECT AVG("Draw") FROM table_63419 WHERE "Points" = '42' AND "Played" < '36'
wikisql
CREATE TABLE table_name_70 ( opponent VARCHAR, record VARCHAR )
Who did the Mariners play when their record was 26 32?
SELECT opponent FROM table_name_70 WHERE record = "26–32"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Welcome comments on posts older than 14 days.
SELECT c.CreationDate, c.Id AS "comment_link", c.Text FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId WHERE Text LIKE 'Welcome to%' AND DATEDIFF(day, p.LastActivityDate, GETDATE()) >= 14 ORDER BY c.CreationDate DESC
sede
CREATE TABLE table_75795 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What is Package/Option, when Content is Poker?
SELECT "Package/Option" FROM table_75795 WHERE "Content" = 'poker'
wikisql
CREATE TABLE table_55949 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team plays at Lake Oval?
SELECT "Home team" FROM table_55949 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE table_5228 ( "Season" text, "Tier" real, "League" text, "Pos." real, "Postseason" text, "European competitions" text )
What is the total number of tiers for the postseason of semifinalist?
SELECT SUM("Tier") FROM table_5228 WHERE "Postseason" = 'semifinalist'
wikisql
CREATE TABLE table_60481 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text )
What clay surface edition had an opponent of miho saeki?
SELECT "Edition" FROM table_60481 WHERE "Surface" = 'clay' AND "Opponent" = 'miho saeki'
wikisql
CREATE TABLE table_26316 ( "Rank" real, "Operators Name" text, "Technology" text, "Subscribers (in millions)" text, "Ownership" text, "Market Share" text )
What was the rank of operator whose technology is CDMA EVDO?
SELECT MIN("Rank") FROM table_26316 WHERE "Technology" = 'CDMA EVDO'
wikisql
CREATE TABLE table_9630 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the attendance for the week 1 game?
SELECT "Attendance" FROM table_9630 WHERE "Week" = '1'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
when did patient 031-24513 in their last hospital encounter first get a urine, voided specimen microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_26507 ( "Team" text, "Location" text, "Stadium" text, "Capacity" real, "Manager" text, "Captain" text )
Who is the captain in Chaguaramas?
SELECT "Captain" FROM table_26507 WHERE "Location" = 'Chaguaramas'
wikisql
CREATE TABLE table_32096 ( "2nd component" text, "b.p. 2nd comp. (\u02daC)" real, "3rd component" text, "b.p. 3rd comp. (\u02daC)" text, "b.p. azeo. (\u02daC)" text, "% wt 1st" text, "% wt 2nd" text, "% wt 3rd" text )
Tell me the 3rd component for bp azeo of 62.1
SELECT "3rd component" FROM table_32096 WHERE "b.p. azeo. (\u02daC)" = '62.1'
wikisql
CREATE TABLE table_51578 ( "Club" text, "Leagues" text, "Venue" text, "Location" text, "Capacity" real, "Established" real )
What is the capacity at the nop aquatic centre, established after 1929?
SELECT COUNT("Capacity") FROM table_51578 WHERE "Venue" = 'nop aquatic centre' AND "Established" > '1929'
wikisql
CREATE TABLE table_49641 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real, "2000 result" text )
How many votes went to other candidates in the county that gave 1.9% votes to them, and 160,390 total votes to Bush?
SELECT MIN("Others#") FROM table_49641 WHERE "Others%" = '1.9%' AND "Bush#" < '160,390'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
i need to find a plane from BOSTON to SAN FRANCISCO on friday
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6...
atis
CREATE TABLE table_56136 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Away team score has a Home team of richmond?
SELECT "Away team score" FROM table_56136 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_name_73 ( date VARCHAR, attendance VARCHAR )
Which Date has an Attendance of 9,535?
SELECT date FROM table_name_73 WHERE attendance = "9,535"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
what time was patient 1902 prescribed for a medication for the last time since 05/2105?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-05' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_7956 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest Bronze with a Silver greater than 0 and a Gold of 7 and a total less than 29
SELECT MAX("Bronze") FROM table_7956 WHERE "Silver" > '0' AND "Gold" = '7' AND "Total" < '29'
wikisql
CREATE TABLE table_52524 ( "Munsee Delaware" text, "Unami Delaware" text, "De Laet (1633)" text, "Campanius (ca. 1645)" text, "Interpreter (1684?)" text, "Thomas (1698)" text )
What is the Unami Delaware value for a Thomas value of nacha?
SELECT "Unami Delaware" FROM table_52524 WHERE "Thomas (1698)" = 'nacha'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilege...
Number of answers and views of answers in year.
SELECT COUNT(*) AS Count, SUM(q.ViewCount) AS Views FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.OwnerUserId = '##userId##' AND a.PostTypeId = 2 AND q.PostTypeId = 1 AND a.CreationDate >= '##year##0101' AND a.CreationDate <= '##year##1231'
sede
CREATE TABLE table_8670 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
Which score was associated with an attendance of 275?
SELECT "Score" FROM table_8670 WHERE "Attendance" = '275'
wikisql
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, return a scatter chart about the correlation between code and price , and group by attribute founder.
SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_73073 ( "Date" text, "B-52 Model" text, "Serial #" text, "Unit" text, "Bomb Capacity" text, "Mission/Target" text, "Cause of Loss" text )
When 7th bw attached to 43rd sw is the unit what is the b-52 model?
SELECT "B-52 Model" FROM table_73073 WHERE "Unit" = '7th BW attached to 43rd SW'
wikisql
CREATE TABLE table_name_22 ( set_3 VARCHAR, time VARCHAR, set_2 VARCHAR )
Which Set 3 has a Time of 10:00, and a Set 2 of 25 19?
SELECT set_3 FROM table_name_22 WHERE time = "10:00" AND set_2 = "25–19"
sql_create_context