table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_31 ( goals INTEGER, matches INTEGER )
What is the sum of Goals, when Matches is less than 29?
SELECT SUM(goals) FROM table_name_31 WHERE matches < 29
CREATE TABLE table_20989 ( "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 )
name all the winnings that the start appears to be 7
SELECT "Winnings" FROM table_20989 WHERE "Starts" = '7'
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
how many times had patient 57023 this year visited the icu?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
CREATE TABLE table_name_90 ( manager VARCHAR, shirt_sponsor VARCHAR )
Which manager sponsor arke shirt?
SELECT manager FROM table_name_90 WHERE shirt_sponsor = "arke"
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 average age of patients whose marital status is single and primary disease is bradycardia?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "BRADYCARDIA"
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
Users with high proportion of Au and Ag badges.
SELECT * FROM (SELECT UserId FROM Badges GROUP BY UserId) AS data
CREATE TABLE table_name_33 ( week INTEGER, result VARCHAR, attendance VARCHAR )
What's the week when the result was W 38-24 and attendance was less than 43,449?
SELECT SUM(week) FROM table_name_33 WHERE result = "w 38-24" AND attendance < 43 OFFSET 449
CREATE TABLE table_880 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real )
what's the highest position with artbeingt being frankie avalon
SELECT "Highest position" FROM table_880 WHERE "Artist" = 'Frankie Avalon'
CREATE TABLE table_name_34 ( area INTEGER, capital VARCHAR )
What is the average area with valpara so as the capital?
SELECT AVG(area) FROM table_name_34 WHERE capital = "valparaíso"
CREATE TABLE table_name_20 ( score VARCHAR, time VARCHAR )
Name the score for 1:36 time
SELECT score FROM table_name_20 WHERE time = "1:36"
CREATE TABLE table_name_42 ( gold INTEGER, silver VARCHAR, total VARCHAR )
What is the smallest number of gold where the total is less than 3 and the silver count is 2?
SELECT MIN(gold) FROM table_name_42 WHERE silver = 2 AND total < 3
CREATE TABLE table_name_87 ( country VARCHAR, killed VARCHAR, year VARCHAR )
What is Country, when Killed is '100.9', and when Year is greater than 1939.9?
SELECT country FROM table_name_87 WHERE killed = 100.9 AND year > 1939.9
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREAT...
How many books fall into each category, list by the total number from low to high.
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*)
CREATE TABLE table_30264 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
How many positions does Trent Bagnail play?
SELECT COUNT("Position") FROM table_30264 WHERE "Player" = 'Trent Bagnail'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what number of patients staying in the hospital for more than 3 days have lab test fluid as pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab.fluid = "Pleural"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is the number of patients whose primary disease is abdominal pain and age is less than 72?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "72"
CREATE TABLE table_19753079_35 ( party VARCHAR, candidates VARCHAR )
Name the party for yvette clarke (d) 90.6% hugh carr (r) 9.4%
SELECT party FROM table_19753079_35 WHERE candidates = "Yvette Clarke (D) 90.6% Hugh Carr (R) 9.4%"
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
Questions with at least two of my favorite tags.
SELECT p.Id, p.Title, p.Body, p.Tags, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate <= '2016-08-31 23:59:00.000' AND t.TagName IN ('security')
CREATE TABLE table_name_77 ( points INTEGER, played INTEGER )
What is the average points with less than 30 played?
SELECT AVG(points) FROM table_name_77 WHERE played < 30
CREATE TABLE table_20360 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What team had high assists Rafer Alston (5)?
SELECT "Team" FROM table_20360 WHERE "High assists" = 'Rafer Alston (5)'
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
What was the most common cause of fire between 2000 and 2005?
SELECT stat_cause_descr FROM fires WHERE fire_year BETWEEN 2000 AND 2005 GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_26976615_3 ( date_of_appointment VARCHAR, date_of_vacancy VARCHAR )
How many date of appointments are there when the date of vacancy was 2 october 2010?
SELECT COUNT(date_of_appointment) FROM table_26976615_3 WHERE date_of_vacancy = "2 October 2010"
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
Draw a bar chart about the distribution of meter_700 and ID .
SELECT meter_700, ID FROM swimmer
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 allergy ( allergy...
tell me the diagnosis price for oliguria - kidney transplant?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'oliguria - kidney transplant')
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...
Find ACC_Road and Team_ID , and group by attribute ACC_Home, and visualize them by a bar chart, and could you show X in descending order?
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC
CREATE TABLE table_69554 ( "Year" real, "Song" text, "Work done" text, "Artist(s)" text, "Album" text )
Which 2006 Cobra Starship song has work done of guest vocals?
SELECT "Song" FROM table_69554 WHERE "Work done" = 'guest vocals' AND "Year" = '2006' AND "Artist(s)" = 'cobra starship'
CREATE TABLE table_48324 ( "Year" real, "Venue" text, "Winner" text, "Runner Up" text, "Third Place" text )
In what year was this event held in Oslo, Norway?
SELECT "Year" FROM table_48324 WHERE "Venue" = 'oslo, norway'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is drug dose of drug name miconazole powder 2%?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Miconazole Powder 2%"
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...
count the number of patients whose year of birth is less than 2182 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2182" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE table_train_110 ( "id" int, "cholesterol" float, "body_weight" float, "creatinine_clearance_cl" float, "triglyceride_tg" float, "age" float, "NOUSE" float )
creatinine > 1.99 mg / dl at baseline
SELECT * FROM table_train_110 WHERE creatinine_clearance_cl > 1.99
CREATE TABLE table_15094 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What day did the Diamondbacks go 2-7?
SELECT "Date" FROM table_15094 WHERE "Opponent" = 'diamondbacks' AND "Score" = '2-7'
CREATE TABLE table_name_21 ( area__km_2__ INTEGER, area__sq_mi_ VARCHAR, location VARCHAR )
What is the average area in New York that is larger than 55 sq mi?
SELECT AVG(area__km_2__) FROM table_name_21 WHERE area__sq_mi_ > 55 AND location = "new york"
CREATE TABLE table_71757 ( "Date" real, "Category" text, "Team" text, "Rider 1" text, "Rider 2" text )
Which category earlier than 2006 has Bart Brentjens as rider 2?
SELECT "Category" FROM table_71757 WHERE "Date" < '2006' AND "Rider 2" = 'bart brentjens'
CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE d...
return me the homepage of the VLDB conference .
SELECT homepage FROM conference WHERE name = 'VLDB'
CREATE TABLE table_name_47 ( entrant VARCHAR, engine VARCHAR )
Which Entrant has a vanwall straight-4 engine?
SELECT entrant FROM table_name_47 WHERE engine = "vanwall straight-4"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is admission location and admission time of subject id 31066?
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "31066"
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed (...
How many documents in different ending date? Return a bar chart binning ending date by weekday.
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations
CREATE TABLE table_name_97 ( position INTEGER, speed VARCHAR )
What is the average Position, when Speed is '143.5km/h'?
SELECT AVG(position) FROM table_name_97 WHERE speed = "143.5km/h"
CREATE TABLE table_49679 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which years was there a To par of +1?
SELECT "Year(s) won" FROM table_49679 WHERE "To par" = '+1'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many patients with an iv bolus route of drug administration were admitted before 2170?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.route = "IV BOLUS"
CREATE TABLE table_name_42 ( nickname VARCHAR, colors VARCHAR )
What is the nickname of the team that has the colors blue and gold?
SELECT nickname FROM table_name_42 WHERE colors = "blue and gold"
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
Of all courses , which ones are worth 4 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 4 AND department = 'EECS'
CREATE TABLE table_21350772_2 ( gas_name VARCHAR )
What is the 20 year for Nitrous Oxide?
SELECT 20 AS _yr FROM table_21350772_2 WHERE gas_name = "Nitrous oxide"
CREATE TABLE table_20046379_3 ( title VARCHAR, us_viewers__millions_ VARCHAR )
What's the title of the episode seen by 3.8 million people in the US?
SELECT title FROM table_20046379_3 WHERE us_viewers__millions_ = "3.8"
CREATE TABLE table_8425 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the home team when the visiting team was Chicago Black Hawks, a game with a record of 0-2?
SELECT "Home" FROM table_8425 WHERE "Visitor" = 'chicago black hawks' AND "Record" = '0-2'
CREATE TABLE table_41884 ( "Month, year" text, "Sunk by U-Boat" real, "Sunk by aircraft" real, "Sunk by warship or raider" real, "Sunk by mines" real, "German submarines lost" real )
What is the total number of sunk by U-boats with less than 2 German submarines lost, 56328 sunk by aircrafts, and more than 8269 sunk by mines?
SELECT COUNT("Sunk by U-Boat") FROM table_41884 WHERE "German submarines lost" < '2' AND "Sunk by aircraft" = '56328' AND "Sunk by mines" > '8269'
CREATE TABLE table_name_89 ( seats VARCHAR, vote__percentage INTEGER )
Name the total number of seats for votes % more than 19.5
SELECT COUNT(seats) FROM table_name_89 WHERE vote__percentage > 19.5
CREATE TABLE table_203_247 ( id number, "district" text, "counties represented" text, "delegate" text, "party" text, "first elected" number, "committee" text )
what is the total amount of times the judiciary committee appears for delegates in the republican party ?
SELECT COUNT(*) FROM table_203_247 WHERE "committee" = 'judiciary' AND "party" = 'republican'
CREATE TABLE table_46877 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is the total number of To Par, when Player is 'Julius Boros', and when Total is greater than 295?
SELECT COUNT("To par") FROM table_46877 WHERE "Player" = 'julius boros' AND "Total" > '295'
CREATE TABLE table_15612 ( "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real, "Current Conference" text )
What is the average Joined with a Nickname of wildcats in longmeadow, massachusetts?
SELECT AVG("Joined") FROM table_15612 WHERE "Nickname" = 'wildcats' AND "Location" = 'longmeadow, massachusetts'
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
does there exist a record of a microbiology test for patient 20165's tissue in their last hospital encounter?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'tissue'
CREATE TABLE table_name_84 ( position VARCHAR, player VARCHAR )
What is Van Waiters position?
SELECT position FROM table_name_84 WHERE player = "van waiters"
CREATE TABLE table_name_18 ( score VARCHAR, date VARCHAR )
What was the Score on March 1?
SELECT score FROM table_name_18 WHERE date = "march 1"
CREATE TABLE table_15585 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text )
How many casualties were from the IED circumstance?
SELECT "Casualties" FROM table_15585 WHERE "Circumstances" = 'ied'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
tell me the short title and icd9 code of procedure for patient alice nixon.
SELECT procedures.icd9_code, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Alice Nixon"
CREATE TABLE table_24575253_4 ( division_one VARCHAR, division_four VARCHAR )
When real holmesdale reserves is division four who is in division one?
SELECT division_one FROM table_24575253_4 WHERE division_four = "Real Holmesdale Reserves"
CREATE TABLE table_6233 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which average attendance has stoneman (0-2) as the loss?
SELECT AVG("Attendance") FROM table_6233 WHERE "Loss" = 'stoneman (0-2)'
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
What is the easiest class I can take to meet the Other requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text )
who was the first to die after elisabeth irwin ?
SELECT "name" FROM table_203_449 WHERE "lifetime" > (SELECT "lifetime" FROM table_203_449 WHERE "name" = 'elisabeth irwin') ORDER BY "lifetime" LIMIT 1
CREATE TABLE table_29770377_1 ( destination VARCHAR, route_via VARCHAR )
What is the destination of the route kulitthurai,neyyattinkara?
SELECT destination FROM table_29770377_1 WHERE route_via = "Kulitthurai,Neyyattinkara"
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, ...
what airlines service PITTSBURGH airport
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
CREATE TABLE table_name_25 ( loss VARCHAR, record VARCHAR )
Who was the loss in the game with the record of 65-53?
SELECT loss FROM table_name_25 WHERE record = "65-53"
CREATE TABLE table_name_88 ( matches VARCHAR, strike_rate VARCHAR, balls VARCHAR )
Can you tell me the total number of Matched that has the Strike Rate smallet than 152.3, and the Balls of 395?
SELECT COUNT(matches) FROM table_name_88 WHERE strike_rate < 152.3 AND balls = 395
CREATE TABLE table_name_13 ( memory VARCHAR, release_date VARCHAR, socket VARCHAR )
What is the memory when release date is January 2010 and socket is BGA-1288?
SELECT memory FROM table_name_13 WHERE release_date = "january 2010" AND socket = "bga-1288"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, for department_id, hire_date, visualize the trend.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, and rank by the total number in ascending.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY)
CREATE TABLE table_name_72 ( overall INTEGER, round VARCHAR )
What was round 7's lowest overall?
SELECT MIN(overall) FROM table_name_72 WHERE round = 7
CREATE TABLE table_name_3 ( attendance VARCHAR, result VARCHAR )
Tell me the total number of attendance for result of l 18-6
SELECT COUNT(attendance) FROM table_name_3 WHERE result = "l 18-6"
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
tell me the average hospital cost that involves a procedure called a remove skull tongs?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove skull tongs')) GROUP BY cost.hadm_id) AS t1
CREATE TABLE table_name_81 ( country VARCHAR, year VARCHAR )
Name the country for 2002
SELECT country FROM table_name_81 WHERE year = 2002
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
For each party, return the name of the party and the number of delegates from that party. Plot them as bar chart.
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
CREATE TABLE contacts ( contact_id number, customer_id number, gender text, first_name text, last_name text, contact_phone text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text ) CREATE TABLE addresses ( address_id n...
Show the minimum, maximum, average price for all products.
SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products
CREATE TABLE table_60293 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What college/junior/club team is a left wing from Canada?
SELECT "College/junior/club team" FROM table_60293 WHERE "Position" = 'left wing' AND "Nationality" = 'canada'
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
i want to fly from BALTIMORE to PHILADELPHIA
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 = 'PHIL...
CREATE TABLE table_name_2 ( driver VARCHAR, constructor VARCHAR, location VARCHAR )
What is the name of the driver of the vehicle constructed by Bugatti in Anfa?
SELECT driver FROM table_name_2 WHERE constructor = "bugatti" AND location = "anfa"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Posts with many 'thank you' answers
SELECT p.ParentId AS "post_link", COUNT(p.Id) FROM Posts AS p INNER JOIN Posts AS parent ON parent.Id = p.ParentId WHERE p.PostTypeId = 2 AND LENGTH(p.Body) <= 200 AND (p.Body LIKE '%hank%') AND parent.AcceptedAnswerId IS NULL GROUP BY p.ParentId HAVING COUNT(p.Id) > 1 ORDER BY COUNT(p.Id) DESC
CREATE TABLE table_67333 ( "Club" text, "Australian Marquee" text, "International Marquee" text, "Junior Marquee player" text, "Captain" text, "Vice-Captain" text )
What club captain is John Hutchinson in?
SELECT "Club" FROM table_67333 WHERE "Captain" = 'john hutchinson'
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
what has the difference in weight of patient 7742 second measured on the last hospital visit compared to the first value measured on the last hospital visit?
SELECT (SELECT 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 = 7742 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND cha...
CREATE TABLE table_28183 ( "Country" text, "Name of bullion coin" text, "Fineness" text, "Denominations (Gold weight)" text, "Years of mintage" text )
How many catagories for denominations does Austria have?
SELECT COUNT("Denominations (Gold weight)") FROM table_28183 WHERE "Country" = 'Austria'
CREATE TABLE table_56548 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the lowest play with ue figueres club and a goal difference more than 16?
SELECT MIN("Played") FROM table_56548 WHERE "Club" = 'ue figueres' AND "Goal Difference" > '16'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
whats the cost to get a wbc disease nec diagnosis.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'wbc disease nec'))
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...
what is diagnoses short title and diagnoses long title of diagnoses icd9 code 4239?
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "4239"
CREATE TABLE table_8953 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text, "Independent Green" text, "Libertarian" text, "Other Party" text )
Who was the other party nominee that ran against Democratic Rick Boucher?
SELECT "Other Party" FROM table_8953 WHERE "Democratic" = 'rick boucher'
CREATE TABLE table_22597626_2 ( score_in_the_final VARCHAR, partner VARCHAR )
What is the final score if the partner is Woodforde?
SELECT score_in_the_final FROM table_22597626_2 WHERE partner = "Woodforde"
CREATE TABLE table_name_85 ( score VARCHAR, home_team VARCHAR )
What was the score of the game where the home team was the cairns taipans?
SELECT score FROM table_name_85 WHERE home_team = "cairns taipans"
CREATE TABLE table_1342256_11 ( candidates VARCHAR, first_elected VARCHAR )
Who ran for the House in the 1924 election?
SELECT candidates FROM table_1342256_11 WHERE first_elected = 1924
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
Search post's title and/or body for a string where the post contains an image. Returns posts where: 1) Body or Title contains query string. 2) Body contains images.
SELECT P.Score, P.Id AS "post_link" FROM Posts AS P JOIN Comments AS C ON C.PostId = P.Id WHERE (P.Body LIKE '%' + '##Query:string?Lattice##' + '%' OR P.Title LIKE '%' + '##Query:string?Lattice##' + '%') AND (P.PostTypeId = 1 OR P.PostTypeId = 2) AND (P.Body LIKE '%<img src%' OR C.Text LIKE '%<img src%' OR C.Text LIKE ...
CREATE TABLE table_33295 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the larges week for the date august 9, 1968 and less than 64,020 in attendance?
SELECT MAX("Week") FROM table_33295 WHERE "Date" = 'august 9, 1968' AND "Attendance" < '64,020'
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between employee_id and commission_pct .
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
CREATE TABLE table_name_20 ( tournament VARCHAR, date VARCHAR )
Which tournament was held on July 13, 2008?
SELECT tournament FROM table_name_20 WHERE date = "july 13, 2008"
CREATE TABLE TRANSACTIONS ( share_count INTEGER )
What is the total share of transactions?
SELECT SUM(share_count) FROM TRANSACTIONS
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, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
what is your last trip on 8 27 from WASHINGTON to BOSTON
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 = 'BOSTON' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d...
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate ti...
Comments with image links in them.
SELECT PostId AS "post_link", Text, CreationDate FROM Comments WHERE Text LIKE '%i.stack.imgur.com%'
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...
give the number of patients who speak russian and were discahrged at home.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "RUSS" AND demographic.discharge_location = "HOME"
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 diagnosis ( diagn...
how did patient 015-56556 enter the hospital last?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '015-56556' ORDER BY patient.hospitaladmittime DESC LIMIT 1
CREATE TABLE table_name_99 ( frequency__mhz_ INTEGER, call_letters VARCHAR )
Frequency (MHz) that has a Call letters of krmd-fm has what sum?
SELECT SUM(frequency__mhz_) FROM table_name_99 WHERE call_letters = "krmd-fm"
CREATE TABLE table_name_92 ( coach VARCHAR, big_ten VARCHAR )
What is the Coach with a Big Ten that is 3rd (278)?
SELECT coach FROM table_name_92 WHERE big_ten = "3rd (278)"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
provide the number of patients whose admission location is transfer from hosp/extram and admission year is less than 2166?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2166"
CREATE TABLE table_name_87 ( result VARCHAR, date VARCHAR )
what is the result on 9 october 2012?
SELECT result FROM table_name_87 WHERE date = "9 october 2012"
CREATE TABLE table_16446652_1 ( season VARCHAR, treasurer VARCHAR )
How many seasons was Dave Reid treasurer?
SELECT COUNT(season) FROM table_16446652_1 WHERE treasurer = "Dave Reid"