context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Customers ( customer_...
Return a histogram on what are the first names and ids for customers who have two or more accounts?, and show in ascending by the x axis.
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name
nvbench
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Cust...
Draw a bar chart of product type code versus minimal product price, and rank in desc by the X.
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_203_211 ( id number, "pos." number, "time" text, "athlete" text, "country" text, "venue" text, "date" text )
what are the total number of athletes representing bulgaria ?
SELECT COUNT("athlete") FROM table_203_211 WHERE "country" = 'bulgaria'
squall
CREATE TABLE table_name_36 ( game VARCHAR, score VARCHAR )
How many games have a score of 85-92?
SELECT COUNT(game) FROM table_name_36 WHERE score = "85-92"
sql_create_context
CREATE TABLE table_53774 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" real )
Which Livery has a Description of 20t tanker, with a date later than 1941?
SELECT "Livery" FROM table_53774 WHERE "Description" = '20t tanker' AND "Date" > '1941'
wikisql
CREATE TABLE table_name_32 ( episodes INTEGER, average_ratings VARCHAR )
When the average ratings is 10.3%, what is the average episodes?
SELECT AVG(episodes) FROM table_name_32 WHERE average_ratings = "10.3%"
sql_create_context
CREATE TABLE table_13979 ( "Stadium" text, "Capacity" real, "City" text, "Region" text, "Home Team" text, "Opened" real )
What total number of opened has a stadium of stade de la mosson and is larger than 32,939 capacity?
SELECT COUNT("Opened") FROM table_13979 WHERE "Stadium" = 'stade de la mosson' AND "Capacity" > '32,939'
wikisql
CREATE TABLE table_3919 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (millions)" text )
Who wrote the episode that had 5.93 million viewers?
SELECT "Writer" FROM table_3919 WHERE "Viewers (millions)" = '5.93'
wikisql
CREATE TABLE table_68366 ( "Year" real, "Population (Region total)" real, "Population (Maryborough)" real, "Population (Hervey Bay)" real, "Population (Woocoo)" real, "Population (Tiaro)" real )
Name the most population hervey bay for when population maryborough of 22,977 and population tiaro less than 3,287
SELECT MAX("Population (Hervey Bay)") FROM table_68366 WHERE "Population (Maryborough)" = '22,977' AND "Population (Tiaro)" < '3,287'
wikisql
CREATE TABLE document_structures ( document_structure_code text, parent_document_structure_code text, document_structure_description text ) CREATE TABLE document_sections ( section_id number, document_code text, section_sequence number, section_code text, section_title text ) CREATE TA...
Return the name of the document that has the most sections.
SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
what was the top four most commonly prescribed drugs in 2102?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) = '2102' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Top New York City JavaScript answerers.
SELECT u.DisplayName, u.Reputation, u.WebsiteUrl, COUNT(*) AS JavaScriptAnswers FROM Users AS u, Posts AS p, Posts AS pp WHERE u.Id IN (SELECT Id FROM Users WHERE Location LIKE ('%New York')) AND p.OwnerUserId = u.Id AND pp.Id = p.ParentId AND pp.Tags LIKE ('%<javascript>%') GROUP BY u.DisplayName, u.Reputation, u.Webs...
sede
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Users with the most X badges.
SELECT UserId AS "user_link", COUNT(*) AS "badge_count" FROM Badges WHERE Name = '##Badge:string##' GROUP BY UserId HAVING COUNT(*) > 1 ORDER BY 'badge_count' DESC LIMIT 100
sede
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 ...
列出从06年5月31日开始2008年2月24日结束袁乐英患者所有检验结果指标记录的质检人为水嘉淑的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 ...
css
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 ...
在2012年9月17日到2021年6月15日内84842097患者被开出的所有检验报告单的检验报告单号一共都有哪些?
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 = '84842097' AND jybgb.BGRQ BETWEEN '2012-09-17' AND '2021-06-15' UNION...
css
CREATE TABLE table_203_672 ( id number, "week" number, "date" text, "opponent" text, "result" text, "venue" text, "attendance" number )
what month were the most games played ?
SELECT "date" FROM table_203_672 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_10294071_1 ( ties_played INTEGER, player VARCHAR )
what is the maximum ties played where player is josip palada category:articles with hcards
SELECT MAX(ties_played) FROM table_10294071_1 WHERE player = "Josip Palada Category:Articles with hCards"
sql_create_context
CREATE TABLE table_name_41 ( date VARCHAR, opponent VARCHAR )
what is the date when the opponent is real espa a?
SELECT date FROM table_name_41 WHERE opponent = "real españa"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what is patient 003-50177's height for the first time on the last hospital visit?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-50177' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER...
eicu
CREATE TABLE table_25920798_2 ( leader_battle VARCHAR, eliminated VARCHAR )
Name the leader battle for plamen
SELECT leader_battle FROM table_25920798_2 WHERE eliminated = "Plamen"
sql_create_context
CREATE TABLE table_name_74 ( airport VARCHAR, iata VARCHAR )
Name the airport with IATA of dmk
SELECT airport FROM table_name_74 WHERE iata = "dmk"
sql_create_context
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu...
What are the first names and offices of history professors who don't have Ph.D.s?
SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'
spider
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
indicate the yearly minimum amount of arterial bp [diastolic] for patient 5142 since 07/2103.
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many female patients were given the drug with drug code acet1000i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "ACET1000I"
mimicsql_data
CREATE TABLE table_name_62 ( season VARCHAR, title VARCHAR, winner VARCHAR, attendance VARCHAR )
What season had Kanto Gakuin University as the winner, with an attendance of n/a, and a title of 37th?
SELECT season FROM table_name_62 WHERE winner = "kanto gakuin university" AND attendance = "n/a" AND title = "37th"
sql_create_context
CREATE TABLE table_name_80 ( top_5 INTEGER, tournament VARCHAR, top_25 VARCHAR )
what is the top-5 when the tournament is totals and the top-25 is more than 4?
SELECT AVG(top_5) FROM table_name_80 WHERE tournament = "totals" AND top_25 > 4
sql_create_context
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...
查一下6673315这个医疗机构在零六年五月二十一到一二年八月四号的统筹金额消耗量
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6673315' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-05-21' AND '2012-08-04'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
which patients have cyclosporine (sandimmune) prescription?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "CycloSPORINE (Sandimmune)"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
Has PERIODON 789 been taught by David Canter ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PERIODON' AND course.number = 789 AND instructor.name LIKE '%David Canter%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruct...
advising
CREATE TABLE table_name_12 ( nationality VARCHAR, round VARCHAR )
What country does Round 4 come from?
SELECT nationality FROM table_name_12 WHERE round = 4
sql_create_context
CREATE TABLE table_name_43 ( score VARCHAR, location VARCHAR, champion VARCHAR )
When John Mcenroe won at Montreal, what was the score?
SELECT score FROM table_name_43 WHERE location = "montreal" AND champion = "john mcenroe"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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...
出院状态在住院就诊51689517780中有什么代码?
SELECT CYZTDM FROM zyjzjlb WHERE JZLSH = '51689517780'
css
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 prescriptions ( subject_id text, hadm_id...
Which patients with infected right thigh graft as their primary disease have long term care as their hospital discharge?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT"
mimicsql_data
CREATE TABLE table_74747 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of the home team when the away team scored 14.12 (96)?
SELECT "Home team score" FROM table_74747 WHERE "Away team score" = '14.12 (96)'
wikisql
CREATE TABLE table_16195 ( "Rank" real, "Member Association" text, "Points" text, "Group stage" real, "Play-off" real, "AFC Cup" real )
Did any team score games that totaled up to 860.5?
SELECT "Play-off" FROM table_16195 WHERE "Points" = '860.5'
wikisql
CREATE TABLE table_15217 ( "Field" text, "Geological Trend" text, "Reserves" text, "Discovery" text, "Operator(s)" text )
Which Geological Trend has an Operator(s) of woc?
SELECT "Geological Trend" FROM table_15217 WHERE "Operator(s)" = 'woc'
wikisql
CREATE TABLE table_5243 ( "Years" text, "Building" text, "City" text, "Height" text, "Storeys" real )
What is the height for less than 45 storeys in Scotia Centre?
SELECT "Height" FROM table_5243 WHERE "Storeys" < '45' AND "Building" = 'scotia centre'
wikisql
CREATE TABLE table_name_83 ( name VARCHAR, overall VARCHAR, college VARCHAR )
What is Name, when Overall is less than 175, and when College is 'Georgia'?
SELECT name FROM table_name_83 WHERE overall < 175 AND college = "georgia"
sql_create_context
CREATE TABLE table_11677691_4 ( college VARCHAR, school VARCHAR )
Which college did the player attend that went to Mission Viejo High School?
SELECT college FROM table_11677691_4 WHERE school = "Mission Viejo High school"
sql_create_context
CREATE TABLE table_13437 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is Germany's lowest heat ranked after 24?
SELECT MIN("Heat") FROM table_13437 WHERE "Nationality" = 'germany' AND "Rank" > '24'
wikisql
CREATE TABLE table_203_507 ( id number, "#" text, "player" text, "\u03c3 points" number, "qual." number, "final" number )
jan schulz is ranked immediately below which player ?
SELECT "player" FROM table_203_507 WHERE id = (SELECT id FROM table_203_507 WHERE "player" = 'jan schulz') - 1
squall
CREATE TABLE table_35533 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" text, "Cubic inches (exact)" text, "Metric value" text, "Imperial value" text, "US Customary" text )
What are the exact Cubic inches of the Unit of kruzhka?
SELECT "Cubic inches (exact)" FROM table_35533 WHERE "Unit" = 'kruzhka'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the total number of patients who had sternal wound infection and lab test for blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS...
Show the GPA of the students with the top 5 GPAs in a bar chart.
SELECT STU_FNAME, STU_GPA FROM STUDENT ORDER BY STU_GPA DESC LIMIT 5
nvbench
CREATE TABLE table_name_84 ( pop_area__1_km²_ INTEGER, no_p VARCHAR, name VARCHAR )
Which Pop/Area (1/km ) has a No P. larger than 1, and a Name of albergaria-a-velha?
SELECT AVG(pop_area__1_km²_) FROM table_name_84 WHERE no_p > 1 AND name = "albergaria-a-velha"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE...
A bar chart about how many classes are held in each department?
SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and list All_Home in desc order.
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_2480 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What position did he finish in the year his average start was 16.8?
SELECT "Position" FROM table_2480 WHERE "Avg. Start" = '16.8'
wikisql
CREATE TABLE table_name_9 ( school_year VARCHAR, volleyball VARCHAR, cross_country VARCHAR, soccer VARCHAR )
What is School Year, when Cross Country is Lexington, when Soccer is Ashland, and when Volleyball is Wooster?
SELECT school_year FROM table_name_9 WHERE cross_country = "lexington" AND soccer = "ashland" AND volleyball = "wooster"
sql_create_context
CREATE TABLE table_28663 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
Name the least week for l 26 42
SELECT MIN("Week") FROM table_28663 WHERE "Final score" = 'L 26–42'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
Count of self-answers on a specific tag, record holders.
SELECT MIN(Tags.TagName) AS TagName, Q.OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts AS Q, Posts AS A, PostTags, Tags WHERE A.ParentId = Q.Id AND PostTags.PostId = Q.Id AND Q.OwnerUserId > 0 AND Q.OwnerUserId = A.OwnerUserId AND Tags.Id = PostTags.TagId GROUP BY PostTags.TagId, Q.OwnerUserId ORDER BY Count D...
sede
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
Could you explain to me about the special topics classes for the next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE table_38002 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text )
What is the lowest attendance of a game that has the result of 2-0?
SELECT MIN("Attendance") FROM table_38002 WHERE "Result" = '2-0'
wikisql
CREATE TABLE table_78561 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was the highest score of t5 place finisher brandt jobe?
SELECT MAX("Score") FROM table_78561 WHERE "Place" = 't5' AND "Player" = 'brandt jobe'
wikisql
CREATE TABLE table_27292 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
In what district was keith ellison the incumbent?
SELECT "District" FROM table_27292 WHERE "Incumbent" = 'Keith Ellison'
wikisql
CREATE TABLE table_56080 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When an away team scored 6.12 (48), what was the home team?
SELECT "Home team" FROM table_56080 WHERE "Away team score" = '6.12 (48)'
wikisql
CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements ...
What are the names of all aicrafts that have never won any match?
SELECT aircraft FROM aircraft WHERE NOT aircraft_id IN (SELECT winning_aircraft FROM match)
spider
CREATE TABLE table_25356 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text )
If the poverty rate is 12.9%, what is the market income per capita?
SELECT "Market Income Per Capita" FROM table_25356 WHERE "Poverty Rate" = '12.9%'
wikisql
CREATE TABLE table_11851 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who constructed the car that retired due to brakes with a grid larger than 17?
SELECT "Constructor" FROM table_11851 WHERE "Grid" > '17' AND "Time/Retired" = 'brakes'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients who have been diagnosed with unspecified encephalopathy and abnormal lab test status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_90 ( date VARCHAR, region VARCHAR )
Which Date has a Region of france?
SELECT date FROM table_name_90 WHERE region = "france"
sql_create_context
CREATE TABLE table_train_5 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "protein_c" int, "liver_disease" bool, "chronic_respiratory_disease" bool, "child_pugh_score" int, "septic_shock" bool, "myocardial_infarction" bool, "NOUSE" float )
severe chronic liver disease ( child pugh score of 11 15 ) ,
SELECT * FROM table_train_5 WHERE liver_disease = 1 OR (child_pugh_score > 11 AND child_pugh_score < 15)
criteria2sql
CREATE TABLE table_18424435_3 ( written_by VARCHAR, canadian_viewers__million_ VARCHAR )
Who wrote the episodes watched by 1.816 million people in Canada?
SELECT written_by FROM table_18424435_3 WHERE canadian_viewers__million_ = "1.816"
sql_create_context
CREATE TABLE table_1560673_1 ( position_in_2013 VARCHAR, number_of_seasons_in_second_tier VARCHAR )
What was the players position in 2013 who had 29 seasons in the second tier
SELECT position_in_2013 FROM table_1560673_1 WHERE number_of_seasons_in_second_tier = "29"
sql_create_context
CREATE TABLE table_13981938_1 ( wine_style VARCHAR, village VARCHAR )
what's the wine style with village being puligny-montrachet [d ]
SELECT wine_style FROM table_13981938_1 WHERE village = "Puligny-Montrachet [d ]"
sql_create_context
CREATE TABLE table_13844 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
what is the gpu model when the frequency is 3.4 ghz and the sspec number is sr00b(d2)?
SELECT "GPU model" FROM table_13844 WHERE "Frequency" = '3.4 ghz' AND "sSpec number" = 'sr00b(d2)'
wikisql
CREATE TABLE table_41915 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text )
Who was the Centerfild model that used Bruce Willis as her Interview subject?
SELECT "Centerfold model" FROM table_41915 WHERE "Interview subject" = 'bruce willis'
wikisql
CREATE TABLE table_203_108 ( id number, "kilometers" number, "name" text, "location" text, "intersecting routes" text )
after you complete deganya road , what portion comes next ?
SELECT "name" FROM table_203_108 WHERE id = (SELECT id FROM table_203_108 WHERE "name" = 'deganya road') + 1
squall
CREATE TABLE table_name_21 ( acronym VARCHAR, name_in_english VARCHAR )
What is the acronym for the English name Northern management and technological institute?
SELECT acronym FROM table_name_21 WHERE name_in_english = "northern management and technological institute"
sql_create_context
CREATE TABLE albums ( title VARCHAR, id VARCHAR ) CREATE TABLE tracks ( album_id VARCHAR )
List title of albums have the number of tracks greater than 10.
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10
sql_create_context
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 diagnoses ( ...
which type of drug is ferrous sulfate?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate"
mimicsql_data
CREATE TABLE table_name_6 ( draws INTEGER, byes INTEGER )
What is the lowest Draws, when Byes is less than 2?
SELECT MIN(draws) FROM table_name_6 WHERE byes < 2
sql_create_context
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
What is the oldest age for each gender of student? Return a bar chart, and order by the x axis in asc please.
SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_name_33 ( weight VARCHAR, internal_storage VARCHAR, wireless_network VARCHAR )
What is the weight of the display that has an internal storage of 16-64 GB and uses a wi-fi, 3G wireless network?
SELECT weight FROM table_name_33 WHERE internal_storage = "16-64 gb" AND wireless_network = "wi-fi, 3g"
sql_create_context
CREATE TABLE table_11677691_5 ( school VARCHAR, player VARCHAR )
Zach Banner is a player at which school?
SELECT school FROM table_11677691_5 WHERE player = "Zach Banner"
sql_create_context
CREATE TABLE table_24003 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cardinals points" real, "Opponents" real, "Record" text )
What was the record for the game where the cardinals scored 7 points?
SELECT "Record" FROM table_24003 WHERE "Cardinals points" = '7'
wikisql
CREATE TABLE table_name_62 ( opponent VARCHAR, time VARCHAR, result VARCHAR )
What is the Opponent with a time of 2:05 p.m., and the results were w 26 20?
SELECT opponent FROM table_name_62 WHERE time = "2:05 p.m." AND result = "w 26–20"
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...
袁文栋这位参保人在0四年九月二十九日到二一年十月四日期间,单一种药品的最大购买次数有过几次
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '袁文栋' AND t_kc22.STA_DATE BETWEEN '2004-09-29' AND '2021-10-04' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
count the number of patients who had been discharged from the hospital.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL
mimic_iii
CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABL...
What is the average credit score for customers who have never taken a loan?
SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan)
spider
CREATE TABLE table_name_6 ( decision VARCHAR, attendance VARCHAR )
What was the decision when the attendance was 19,592?
SELECT decision FROM table_name_6 WHERE attendance = "19,592"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what's the three most frequent drugs that were prescribed in the same hospital encounter to the male patients of age 20s after they have been diagnosed with atrial fibrillation until 2 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_38404 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many silver medals had a rank of 3 with bronze larger than 0?
SELECT COUNT("Silver") FROM table_38404 WHERE "Rank" = '3' AND "Bronze" > '0'
wikisql
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...
what is the number of patients whose days of hospital stay is greater than 1?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "1"
mimicsql_data
CREATE TABLE table_79477 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
With a Col (m) larger than 2012, what is Mount Kazbek's Prominence (m)?
SELECT "Prominence (m)" FROM table_79477 WHERE "Col (m)" > '2012' AND "Peak" = 'mount kazbek'
wikisql
CREATE TABLE table_name_57 ( max_1_min_wind_mph__km_h_ VARCHAR, min_press___mbar__ VARCHAR )
What is the max 1-min wind mph when the minimum press is 997?
SELECT max_1_min_wind_mph__km_h_ FROM table_name_57 WHERE min_press___mbar__ = "997"
sql_create_context
CREATE TABLE table_name_25 ( silver INTEGER, total VARCHAR, gold VARCHAR, nation VARCHAR )
What's the highest silver and 1 gold that the nation of djibouti received with a total less than 3?
SELECT MAX(silver) FROM table_name_25 WHERE gold = 1 AND nation = "djibouti" AND total < 3
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, ...
give me the flights from DENVER to BALTIMORE on UA
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN...
atis
CREATE TABLE table_80307 ( "Year" real, "Winner" text, "Country" text, "Purse ( $ )" real, "Score" text, "First Prize ( $ )" real )
What was the top first place prize in 1997?
SELECT MAX("First Prize ( $ )") FROM table_80307 WHERE "Year" = '1997'
wikisql
CREATE TABLE table_77334 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" rea...
What is the total 30 to 34 when the 40 to 44 is greater than 3,003, and the 50 to 54 is greater than 4,184?
SELECT SUM("30 to 34") FROM table_77334 WHERE "40 to 44" > '3,003' AND "50 to 54" > '4,184'
wikisql
CREATE TABLE table_204_477 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many teams competed in the 1998 marlboro grand prix of miami ?
SELECT COUNT("team") FROM table_204_477
squall
CREATE TABLE table_name_24 ( house VARCHAR, abbr VARCHAR )
Which house has an abbreviation of D?
SELECT house FROM table_name_24 WHERE abbr = "d"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( la...
what is the name of the drug that patient 015-59552 was prescribed for within 2 days after having been diagnosed since 123 months ago with anemia?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552') AND diagnosis.diagnos...
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Find out the maximum age of patients who were admitted in or after 2151 and have aortic valve insufficiency/aortic valve replacement/sda as their primary disease.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.admityear >= "2151"
mimicsql_data
CREATE TABLE table_50405 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which Round has a Name of john goodyear?
SELECT "Round" FROM table_50405 WHERE "Name" = 'john goodyear'
wikisql
CREATE TABLE table_name_77 ( dcsf_number INTEGER, name VARCHAR, ofsted_number VARCHAR )
What's the lowest DCSF number in Aycliffe Drive but an Ofsted number smaller than 117335?
SELECT MIN(dcsf_number) FROM table_name_77 WHERE name = "aycliffe drive" AND ofsted_number < 117335
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
what flights are available from SAN FRANCISCO to PITTSBURGH on thursday evening
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 = 'PITTSBURGH' AND date_day.day_number = 24 AND date_day.month_number = 5 A...
atis
CREATE TABLE table_28403 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
When was the private/baptist school founded?
SELECT "Founded" FROM table_28403 WHERE "Type" = 'Private/Baptist'
wikisql
CREATE TABLE table_8158 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which 2nd leg has a 1st leg of 2 0?
SELECT "2nd leg" FROM table_8158 WHERE "1st leg" = '2–0'
wikisql
CREATE TABLE table_75063 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the date of the game that had a visitor of Chicago?
SELECT "Date" FROM table_75063 WHERE "Visitor" = 'chicago'
wikisql