context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_516 ( id number, "date" text, "opponents" text, "h / a" text, "result\nf - a" text, "scorers" text, "attendance" number )
what was the date of the last game of the 1933-1934 season ?
SELECT "date" FROM table_204_516 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_name_59 ( field_goals__5_points_ VARCHAR, total_points VARCHAR, touchdowns__5_points_ VARCHAR )
How many Field goals (5 points) have a Total Points of 123, and Touchdowns (5 points) larger than 13?
SELECT COUNT(field_goals__5_points_) FROM table_name_59 WHERE total_points = 123 AND touchdowns__5_points_ > 13
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
Reputation Gained until a Certain Date.
SELECT SUM((CASE WHEN (p.PostTypeId = 1 AND v.VoteTypeId = 2 AND (p.CommunityOwnedDate > v.CreationDate OR p.CommunityOwnedDate IS NULL)) THEN 5 WHEN (p.PostTypeId = 2 AND v.VoteTypeId = 2 AND (p.CommunityOwnedDate > v.CreationDate OR p.CommunityOwnedDate IS NULL)) THEN 10 WHEN (v.VoteTypeId = 3 AND (p.CommunityOwnedDa...
sede
CREATE TABLE table_204_128 ( id number, "region" text, "date" text, "label" text, "format" text, "catalog" text )
how many more releases were in compact disc format than cassette tape ?
SELECT (SELECT COUNT(*) FROM table_204_128 WHERE "format" = 'compact disc') - (SELECT COUNT(*) FROM table_204_128 WHERE "format" = 'cassette tape')
squall
CREATE TABLE table_203_790 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
how many games were played in the month of november
SELECT COUNT(*) FROM table_203_790 WHERE "date" = 11
squall
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_r...
does patient 1249's arterial bp mean have been normal?
SELECT COUNT(*) > 0 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 = 1249)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' ...
mimic_iii
CREATE TABLE table_45942 ( "Day 1" text, "Day 2" text, "Day 3" text, "Day 4" text, "Day 5" text, "Wednesday" text )
What is day 4 when day 2 is PAAQ?
SELECT "Day 4" FROM table_45942 WHERE "Day 2" = 'paaq'
wikisql
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
among patients who were prescribed dornase alfa *nf* after having been diagnosed with fx dorsal vertebra-close show me the two year survival rate.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_204_598 ( id number, "name" text, "state of residence" text, "took office" text, "left office" text, "president served under" text )
how many years did david plouffe serve ?
SELECT "left office" - "took office" FROM table_204_598 WHERE "name" = 'david plouffe'
squall
CREATE TABLE player ( pName VARCHAR, pID VARCHAR ) CREATE TABLE tryout ( pID VARCHAR )
Find the name of all students who were in the tryout sorted in alphabetic order.
SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
sql_create_context
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
In the next 6 semesters what are the classes offered ?
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE table_67625 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Championships (Years)" text )
Which League has a Venue of martin luther king, jr. recreation center?
SELECT "League" FROM table_67625 WHERE "Venue" = 'martin luther king, jr. recreation center'
wikisql
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
Show me a bar chart for how many captains with younger than 50 are in each rank?, list by the y-axis in asc.
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*)
nvbench
CREATE TABLE table_61454 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text )
Which Score has an Opponent in the final of chris haggard robbie koenig?
SELECT "Score" FROM table_61454 WHERE "Opponent in the final" = 'chris haggard robbie koenig'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
06038186这个病人在2020-12-13以前有哪些门诊就诊的检验报告单?查一下这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '06038186' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2020-12-13' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_25401874_1 ( name VARCHAR, points VARCHAR )
How many names are listed for the player with 50 points?
SELECT COUNT(name) FROM table_25401874_1 WHERE points = 50
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
Of all the courses on Advanced Statistical Methods , which have no prerequisites ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Advanced Statistical Methods%' OR course.description LIKE '%Advanced Statistical Methods%' OR course.name LIKE '%Advanced Statistical Methods%') AND course.enforced_requ...
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
名字叫郎高义的病患他的身高和体重都是多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '郎高义'
css
CREATE TABLE table_78876 ( "Team" text, "Average" real, "Points" real, "Played" real, "1989-90" text, "1990-91" text, "1991-1992" real )
How much 1991-1992 has a Team of gimnasia de la plata, and more than 113 points?
SELECT COUNT("1991-1992") FROM table_78876 WHERE "Team" = 'gimnasia de la plata' AND "Points" > '113'
wikisql
CREATE TABLE table_69478 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the partner for may 2, 1993
SELECT "Partner" FROM table_69478 WHERE "Date" = 'may 2, 1993'
wikisql
CREATE TABLE table_22244 ( "Commune" text, "Area (km 2 )" text, "2002 population" real, "Pop. density (km 2 )" text, "Municipality website" text )
What commune has an area of 12.4 sq.km.?
SELECT "Commune" FROM table_22244 WHERE "Area (km 2 )" = '12.4'
wikisql
CREATE TABLE table_204_658 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
what is the number of games played at olympic stadium this season ?
SELECT COUNT(*) FROM table_204_658 WHERE "game site" = 'olympic stadium'
squall
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
检验结果指标记录60978673374的结果定性、结果定量、定量单位分别为?
SELECT JCZBJGDX, JCZBJGDL, JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '60978673374'
css
CREATE TABLE table_name_90 ( game_site VARCHAR, opponent VARCHAR )
What Game site has an Opponent of Miami Dolphins?
SELECT game_site FROM table_name_90 WHERE opponent = "miami dolphins"
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 minimum age of patients whose gender is f and admission type is newborn?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "NEWBORN"
mimicsql_data
CREATE TABLE table_name_39 ( player VARCHAR, country VARCHAR, to_par VARCHAR )
WHo has a Country of united states and a To par of 3?
SELECT player FROM table_name_39 WHERE country = "united states" AND to_par = "–3"
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 number of patients whose admission type is urgent and with procedure prophylactic administration of vaccine against other diseases?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Prophylactic administration of vaccine against other diseases"
mimicsql_data
CREATE TABLE table_67639 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" text, "Investing Dragon(s)" text )
Which Entrepreneur(s) have mixalbum?
SELECT "Entrepreneur(s)" FROM table_67639 WHERE "Company or product name" = 'mixalbum'
wikisql
CREATE TABLE table_72784 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Time" text )
Name the time for saturday 4 march 1995
SELECT "Time" FROM table_72784 WHERE "Date" = 'Saturday 4 March 1995'
wikisql
CREATE TABLE table_name_12 ( runner_up VARCHAR, rank VARCHAR )
What is the runner-up for rank of 7?
SELECT runner_up FROM table_name_12 WHERE rank = 7
sql_create_context
CREATE TABLE table_22640051_3 ( replaced_by VARCHAR, date_of_appointment VARCHAR )
Name the total number of replaced by for 13 june 2009
SELECT COUNT(replaced_by) FROM table_22640051_3 WHERE date_of_appointment = "13 June 2009"
sql_create_context
CREATE TABLE table_21968 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" real, "Location of the Church" text )
Name the number of parish for vilnes kyrkje
SELECT COUNT("Parish (Prestegjeld)") FROM table_21968 WHERE "Church Name" = 'Vilnes kyrkje'
wikisql
CREATE TABLE table_203_358 ( id number, "pos." number, "athlete" text, "run 1" number, "run 2" number, "total" text )
what was the total time for filip trejbal ?
SELECT "total" FROM table_203_358 WHERE "athlete" = 'filip trejbal'
squall
CREATE TABLE table_14889048_1 ( draws VARCHAR, conceded VARCHAR )
Name the number of draws for when conceded is 25
SELECT COUNT(draws) FROM table_14889048_1 WHERE conceded = 25
sql_create_context
CREATE TABLE Addresses ( city VARCHAR, address_id VARCHAR ) CREATE TABLE Customers ( customer_address_id VARCHAR )
Which city does has most number of customers?
SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
Return a bar chart on how many eliminations did each team have?, list in ascending by the bar.
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team
nvbench
CREATE TABLE table_64427 ( "Player" text, "Original Season" text, "Gender" text, "Eliminated" text, "Placing" text )
Who's the player eliminated on episode 5?
SELECT "Player" FROM table_64427 WHERE "Eliminated" = 'episode 5'
wikisql
CREATE TABLE table_24043 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
How many millions viewers watched the episode that ran 23:25?
SELECT "Viewers (in millions)" FROM table_24043 WHERE "Run time" = '23:25'
wikisql
CREATE TABLE table_63091 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Silver has a Nation of total, and a Bronze smaller than 18?
SELECT MAX("Silver") FROM table_63091 WHERE "Nation" = 'total' AND "Bronze" < '18'
wikisql
CREATE TABLE table_name_83 ( overall INTEGER, college VARCHAR, pick VARCHAR )
What is Central Michigan's average overall when the pick was 8?
SELECT AVG(overall) FROM table_name_83 WHERE college = "central michigan" AND pick = 8
sql_create_context
CREATE TABLE table_49177 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text )
Which owner has the time 2:03.00 and the year of 1991 kd?
SELECT "Owner" FROM table_49177 WHERE "Time" = '2:03.00' AND "Year" = '1991 kd'
wikisql
CREATE TABLE table_27310 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the number of district for bill shuster
SELECT COUNT("District") FROM table_27310 WHERE "Incumbent" = 'Bill Shuster'
wikisql
CREATE TABLE table_name_65 ( player VARCHAR, position VARCHAR, round VARCHAR )
Who has a round less than 9 and a position of G?
SELECT player FROM table_name_65 WHERE position = "g" AND round < 9
sql_create_context
CREATE TABLE table_22050 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
What is the opponent played on October 4?
SELECT "Opponent" FROM table_22050 WHERE "Date" = 'October 4'
wikisql
CREATE TABLE table_1090 ( "Place" real, "Shooter" text, "Total" real, "Round 1" real, "Round 2" real, "Round 3" real, "Round 4" real, "Round 5" real, "Round 6" real )
Who shot an 80 in round 3
SELECT "Shooter" FROM table_1090 WHERE "Round 3" = '80'
wikisql
CREATE TABLE table_26412 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text )
How many were promoted from the league when Esher was relegated to the league?
SELECT COUNT("Promoted from league") FROM table_26412 WHERE "Relegated to league" = 'Esher'
wikisql
CREATE TABLE table_name_22 ( tournament VARCHAR, opponent_in_the_final VARCHAR, score VARCHAR )
Which tournament has an opponent in the final of nadia petrova and a score of 6 3, 4 6, 6 1??
SELECT tournament FROM table_name_22 WHERE opponent_in_the_final = "nadia petrova" AND score = "6–3, 4–6, 6–1"
sql_create_context
CREATE TABLE table_74153 ( "Product Name" text, "Form Factor" text, "Storage Medium" text, "Max Usable Capacity (GB)" real, "Speed ( IOPS )" real, "Latency (microseconds)" real, "Bandwidth (GB/s)" text )
List the number of ramsan-720 hard drives?
SELECT COUNT("Storage Medium") FROM table_74153 WHERE "Product Name" = 'RamSan-720'
wikisql
CREATE TABLE table_name_45 ( category VARCHAR, outcome VARCHAR )
What category was the winner in?
SELECT category FROM table_name_45 WHERE outcome = "winner"
sql_create_context
CREATE TABLE table_name_33 ( Id VARCHAR )
What is 2001, when 1990 is A, when 1987 is NME, and when 1997 is 1R?
SELECT 2001 FROM table_name_33 WHERE 1990 = "a" AND 1987 = "nme" AND 1997 = "1r"
sql_create_context
CREATE TABLE table_54714 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team score when the home team essendon was playing?
SELECT "Away team score" FROM table_54714 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_22382 ( "Species" text, "Common name" text, "Trinidad" text, "Tobago" text, "Bocas Is." text, "Other" text )
Name the trindad for yellow-bellied puffing snake
SELECT "Trinidad" FROM table_22382 WHERE "Common name" = 'Yellow-bellied puffing snake'
wikisql
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE ...
Find the busiest destination airport that runs most number of routes in China.
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_2401326_1 ( bush_number VARCHAR, bush_percentage VARCHAR )
How many different counts of the votes for Bush are there in the county where he got 69.7% of the votes?
SELECT COUNT(bush_number) FROM table_2401326_1 WHERE bush_percentage = "69.7%"
sql_create_context
CREATE TABLE table_1108394_34 ( the_bronx VARCHAR, manhattan VARCHAR )
What percentage of The Bronx voters occured when Manhattan had 29.9% of voters?
SELECT the_bronx FROM table_1108394_34 WHERE manhattan = "29.9_percentage"
sql_create_context
CREATE TABLE table_204_140 ( id number, "round" number, "#" number, "player" text, "position" text, "nationality" text, "college/junior/club team (league)" text )
the total number of players picked
SELECT COUNT("player") FROM table_204_140
squall
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt ...
can you list all flights leaving from ST. LOUIS and arriving in MILWAUKEE
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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILW...
atis
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 microlab ( microl...
how much did patient 006-202432 change in magnesium 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 = '006-202432' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp...
eicu
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE area ( course_id int...
Which teachers have taught a class in which an NRE minor has received a B+ ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec...
advising
CREATE TABLE table_name_43 ( city_of_license VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR )
What City of license has a Frequency MHz smaller than 95.9 with w223au as the call sign?
SELECT city_of_license FROM table_name_43 WHERE frequency_mhz < 95.9 AND call_sign = "w223au"
sql_create_context
CREATE TABLE table_name_19 ( region VARCHAR, catalog VARCHAR )
Which region had a catalog number of 570 734-2?
SELECT region FROM table_name_19 WHERE catalog = "570 734-2"
sql_create_context
CREATE TABLE table_69106 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
What is the location of the gold medal match?
SELECT "Location" FROM table_69106 WHERE "Competition" = 'gold medal match'
wikisql
CREATE TABLE table_name_76 ( co_drivers VARCHAR, year VARCHAR, laps VARCHAR )
Who are the co-drivers before 2010 with under 326 laps?
SELECT co_drivers FROM table_name_76 WHERE year < 2010 AND laps < 326
sql_create_context
CREATE TABLE table_name_18 ( year INTEGER, theme VARCHAR, mintage VARCHAR )
What is the earliest year when the 25th Anniversary Loonie was the theme, and the mintage was less than 35,000?
SELECT MIN(year) FROM table_name_18 WHERE theme = "25th anniversary loonie" AND mintage < 35 OFFSET 000
sql_create_context
CREATE TABLE table_64371 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the Week number on October 10, 1976?
SELECT COUNT("Week") FROM table_64371 WHERE "Date" = 'october 10, 1976'
wikisql
CREATE TABLE table_53880 ( "Interregnum began" text, "Interregnum ended" text, "Duration" text, "Count Palatine of Saxony" text, "Count Palatine of the Rhine" text )
What is the Interregnum ended for the person with a Duration of 3 months, 6 days?
SELECT "Interregnum ended" FROM table_53880 WHERE "Duration" = '3 months, 6 days'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CH...
Pie chart. how many bookings does each booking status have? List the booking status code and the number of corresponding bookings.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
CREATE TABLE table_name_12 ( nomination VARCHAR, director VARCHAR )
Tell me the nomination for goran paskaljevic
SELECT nomination FROM table_name_12 WHERE director = "goran paskaljevic"
sql_create_context
CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Clients ( Client_ID INTEGER, Address_ID INTEGER, Customer_Email_Address V...
Show all the planned delivery dates and bin by year in a line chart, sort in descending by the X.
SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row...
when was the last time patient 702 measured its respiratory rate less than 28.0?
SELECT chartevents.charttime 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 = 702)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirator...
mimic_iii
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
tags from the answers the user posted.
SELECT P1.Tags, P.ParentId, P.Id, P.OwnerUserId, P.Body FROM Posts AS P, Users AS U, Posts AS P1 WHERE P.Id != P.ParentId AND P1.Id = P.ParentId AND P.OwnerUserId = U.Id AND U.Id = @UserId
sede
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
how many patients received umbilical vein cath after the first cont inv mec ven <96 hrs procedure within 2 months since 2102?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv me...
mimic_iii
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
select * WHERE BountyAmount > 0.
SELECT * FROM Votes WHERE BountyAmount > 0 ORDER BY CreationDate DESC
sede
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number...
Delete my old 'Accept an answer' comments. search for questions where I've prompted the OP to accept an answer, and they have, but my comment is still out there. 'If any of the answers solved your problem, please...
SELECT c.PostId AS "post_link", c.CreationDate, c.Text FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%solved your problem%' AND c.UserId = '##UserId:Int?117549##' AND NOT p.AcceptedAnswerId IS NULL ORDER BY c.CreationDate DESC
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flig...
what are the different classes that an airline offers
SELECT DISTINCT booking_class FROM class_of_service
atis
CREATE TABLE table_43195 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
Which average draw has points greater than 12?
SELECT AVG("Draw") FROM table_43195 WHERE "Points" > '12'
wikisql
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 aged less than 72 years have collagenase ointment prescription?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.drug = "Collagenase Ointment"
mimicsql_data
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the discharge location and primary disease of patient id 74032?
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "74032"
mimicsql_data
CREATE TABLE table_204_467 ( id number, "date" text, "opponents" text, "h/a" text, "result\nf-a" text, "scorers" text, "attendance" number )
which game had the largest attendance ?
SELECT "date" FROM table_204_467 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_72941 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original U.S. air date" text, "Prod. code" real, "Viewers (millions)" text )
Who was the directed for the episode titled 'twister: part 1'?
SELECT "Directed by" FROM table_72941 WHERE "Title" = 'Twister: Part 1'
wikisql
CREATE TABLE table_name_75 ( Id VARCHAR )
What is the 2010 value with a 1r in 2012 and an A in 2005?
SELECT 2010 FROM table_name_75 WHERE 2012 = "1r" AND 2005 = "a"
sql_create_context
CREATE TABLE table_66826 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Venue on 26 jan 2005
SELECT "Venue" FROM table_66826 WHERE "Date" = '26 jan 2005'
wikisql
CREATE TABLE college ( college_id number, name text, leader_name text, college_location text ) CREATE TABLE member ( member_id number, name text, country text, college_id number ) CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_rou...
Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.
SELECT T2.name, T1.college_location FROM college AS T1 JOIN member AS T2 ON T1.college_id = T2.college_id ORDER BY T2.name
spider
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者55185411在2003年4月12日到2008年9月25日内检查了几次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '55185411' AND t_kc22.STA_DATE BETWEEN '2003-04-12' AND '2008-09-25' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
How many injured players not suffering from injury of 'Knee problem' in each match? Show me a bar chart grouping by number of matches, I want to display from high to low by the bar please.
SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY Number_of_matches DESC
nvbench
CREATE TABLE table_13712 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
Which Total Goals have an FA Cup Goals of 0, and an FA Cup Apps of 3, and a Position of fw?
SELECT AVG("Total Goals") FROM table_13712 WHERE "FA Cup Goals" = '0' AND "FA Cup Apps" = '3' AND "Position" = 'fw'
wikisql
CREATE TABLE table_334 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
Which players were number 3?
SELECT "Player" FROM table_334 WHERE "No.(s)" = '3'
wikisql
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 COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE...
Display a bar chart for how many credits does the department offer?
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_name_62 ( record VARCHAR, round VARCHAR, event VARCHAR )
Which Record has a Round larger than 2, and an Event of bellator 38?
SELECT record FROM table_name_62 WHERE round > 2 AND event = "bellator 38"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Top users from Uruguay by rep.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%uruguay%' ORDER BY Reputation DESC
sede
CREATE TABLE table_619 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
How many gold medals does each school who has a total of 1 medal have?
SELECT "Gold Medals" FROM table_619 WHERE "Total Medals" = '1'
wikisql
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text )
Where is the safest area?
SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) LIMIT 1
greatermanchestercrime
CREATE TABLE table_name_67 ( name VARCHAR, took_office VARCHAR )
Who has Took Office of march 4, 1875?
SELECT name FROM table_name_67 WHERE took_office = "march 4, 1875"
sql_create_context
CREATE TABLE table_60806 ( "Rank" real, "Res." text, "Wind" text, "Athlete" text, "Date" text, "Location" text )
What was the wind at New York City when the rank was smaller than 6?
SELECT "Wind" FROM table_60806 WHERE "Rank" < '6' AND "Location" = 'new york city'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
A bar chart for what are the number of the wines that have prices lower than 50 and have appelations in Monterey county?
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name
nvbench
CREATE TABLE table_3726 ( "#" real, "Matches As Captain" text, "Player" text, "Asian Cup Played As A Captain" text, "Years Active" text, "Caps(Goals)" text )
What is the total number of years active listings where Asian Cup played as a captain is Japan 1992?
SELECT COUNT("Years Active") FROM table_3726 WHERE "Asian Cup Played As A Captain" = 'Japan 1992'
wikisql
CREATE TABLE table_name_41 ( club VARCHAR, bowling_style VARCHAR, name VARCHAR )
What club is R. H. C. Human who has a right arm medium pace bowling style a member of?
SELECT club FROM table_name_41 WHERE bowling_style = "right arm medium pace" AND name = "r. h. c. human"
sql_create_context
CREATE TABLE table_28959 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name the writers for 46 in series
SELECT "Writer(s)" FROM table_28959 WHERE "No. in series" = '46'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
list flights from SAN FRANCISCO to DENVER 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 = 'DENVER' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出所有姓蒋的医师开具的药品,主要针对98665662783这个医疗就诊
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '98665662783' AND t_kc22.HOSP_DOC_NM LIKE '蒋%'
css