table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
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...
on this month/16, when was the last time that patient 65582 had a urine . output?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many days have pass since the last time patient 013-33898 stayed in ward 559 during their current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-33898' AND patient.wardid = 559 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
CREATE TABLE table_name_36 ( time_retired VARCHAR, laps VARCHAR, grid VARCHAR, constructor VARCHAR )
what is the time/retired when the grid is less than 13, the constructor is alfa romeo and the laps is more than 12?
SELECT time_retired FROM table_name_36 WHERE grid < 13 AND constructor = "alfa romeo" AND laps > 12
CREATE TABLE table_30331 ( "Year" real, "Team" text, "Number" real, "Games" real, "Kicks" real, "Handballs" real, "Total Disposals" real, "Marks" real, "Tackles" real, "Goals" real, "Behinds" real, "Goal Accuracy %" text, "Brownlow Medal Votes" real )
What was the goal accuracy % when the total disposals are 481?
SELECT "Goal Accuracy %" FROM table_30331 WHERE "Total Disposals" = '481'
CREATE TABLE item ( title VARCHAR, i_id VARCHAR ) CREATE TABLE review ( rating INTEGER )
Find the titles of items whose rating is higher than the average review rating of all items.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
Undergrads taking 382 - is that okay ?
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 382
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ...
How many professors whose office is located in DRE 102 are hired in each weekday? Return a bar chart, and rank Y in ascending order.
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' GROUP BY EMP_LNAME ORDER BY COUNT(EMP_HIREDATE)
CREATE TABLE table_9960 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Silver medals for the Nation of Turkey with a Total of less than 2?
SELECT SUM("Silver") FROM table_9960 WHERE "Nation" = 'turkey' AND "Total" < '2'
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
show me flights from DALLAS to BALTIMORE
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
CREATE TABLE table_29535057_4 ( time VARCHAR, location VARCHAR )
What was the time of the games that took place at the cassell coliseum blacksburg, va?
SELECT time FROM table_29535057_4 WHERE location = "Cassell Coliseum • Blacksburg, VA"
CREATE TABLE table_68285 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the to par that has macdonald smith as the player?
SELECT "To par" FROM table_68285 WHERE "Player" = 'macdonald smith'
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 (...
what is the number of patients whose days of hospital stay is greater than 0 and drug name is insulin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "insulin"
CREATE TABLE table_name_99 ( time VARCHAR, attendance VARCHAR )
What time was the match that had an attendance of 22,329?
SELECT time FROM table_name_99 WHERE attendance = "22,329"
CREATE TABLE table_name_70 ( opponent VARCHAR, event VARCHAR )
Who was the match against at the PRIDE 31 event?
SELECT opponent FROM table_name_70 WHERE event = "pride 31"
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...
what are the birth dates of patient 28600?
SELECT patients.dob FROM patients WHERE patients.subject_id = 28600
CREATE TABLE table_201_48 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nalt." number, "peak chart positions\nus\nmain. rock" number, "peak chart positions\naus" number, "peak chart positions\naut" number, "peak chart positions...
when did drowning peak at 24 in the us alternate group ?
SELECT "year" FROM table_201_48 WHERE "title" = '"drowning"' AND "peak chart positions\nus\nalt." = 24
CREATE TABLE table_25214321_1 ( winner VARCHAR, third_place VARCHAR )
Who was the winner when Mateus Rocha finished in 3rd place?
SELECT winner FROM table_25214321_1 WHERE third_place = "Mateus Rocha"
CREATE TABLE table_19745 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
Who was the team's opponent of October 25, 1970?
SELECT "Opponent" FROM table_19745 WHERE "Date" = 'October 25, 1970'
CREATE TABLE table_name_72 ( senator VARCHAR, state VARCHAR )
what is the senator in kentucky
SELECT senator FROM table_name_72 WHERE state = "kentucky"
CREATE TABLE table_49424 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Wickets" real, "Economy Rate" real, "Average" real, "Strike Rate" real, "Best Bowling" text )
How many matches were played that resulted in less than 59.1 overs and a 6.78 Economy rate?
SELECT SUM("Matches") FROM table_49424 WHERE "Overs" < '59.1' AND "Economy Rate" > '6.78'
CREATE TABLE table_35712 ( "Province" text, "Kibaki" text, "Raila" text, "Wamalwa" text, "Ngilu" text, "Others" text, "Registered Voters" text, "Turnout %" text )
What's listed for the Turnout % with a Ngilu of 30,535?
SELECT "Turnout %" FROM table_35712 WHERE "Ngilu" = '30,535'
CREATE TABLE services ( service_name VARCHAR, service_id VARCHAR ) CREATE TABLE first_notification_of_loss ( service_id VARCHAR )
Find the name of services that have been used for more than 2 times in first notification of loss.
SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2
CREATE TABLE table_61124 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What Player won the PGA in 1989?
SELECT "Player" FROM table_61124 WHERE "Year(s) won" = '1989'
CREATE TABLE table_name_85 ( population INTEGER, area_km_2 VARCHAR )
What is the Population of the Parish with an Area km 2 of 236.76?
SELECT MIN(population) FROM table_name_85 WHERE area_km_2 = 236.76
CREATE TABLE table_name_73 ( series VARCHAR, visitor VARCHAR, date VARCHAR )
What is the series score of the game with Vancouver as the visiting team on April 16?
SELECT series FROM table_name_73 WHERE visitor = "vancouver" AND date = "april 16"
CREATE TABLE table_name_92 ( region VARCHAR, label VARCHAR )
What was the region when the label was the universal music group?
SELECT region FROM table_name_92 WHERE label = "universal music group"
CREATE TABLE table_18592 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many races involve incumbent Pat Cannon?
SELECT COUNT("Result") FROM table_18592 WHERE "Incumbent" = 'Pat Cannon'
CREATE TABLE table_49397 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text )
What was part 2 when part 4 was *bl tanaz?
SELECT "Part 2" FROM table_49397 WHERE "Part 4" = '*blōtanaz'
CREATE TABLE table_27479 ( "Rank" real, "Rank w/o Hydropower" real, "State" text, "% Renewable" text, "% Renewable w/o Hydro" text, "Renewable electricity (GW\u00b7h)" real, "Renewable electricity w/o Hydro (GW\u00b7h)" real, "Total electricity (GW\u00b7h)" real )
How much was the minimum renewable electricity (GW-h) that is ranked 36?
SELECT MIN("Renewable electricity (GW\u00b7h)") FROM table_27479 WHERE "Rank" = '36'
CREATE TABLE table_13352 ( "Parameter" text, "Symbol" text, "Best fit (WMAP only)" text, "Best fit (WMAP, extra parameter)" text, "Best fit (all data)" text )
What is the parameter when the best fit (WMAP only) is .9 .1, and symbol is a?
SELECT "Parameter" FROM table_13352 WHERE "Best fit (WMAP only)" = '.9 ± .1' AND "Symbol" = 'a'
CREATE TABLE table_28286776_52 ( cap_s_ VARCHAR, club_s_ VARCHAR )
How many caps figures for the Doncaster Rovers?
SELECT COUNT(cap_s_) FROM table_28286776_52 WHERE club_s_ = "Doncaster Rovers"
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
Information schema for a Table. DON'T EDIT THIS QUERY! YOU HAVE LINKED TO IT FROM HERE: http://meta.stackexchange.com/a/2678/158100 REMEMBER?
SELECT c.Table_Name, CASE WHEN '##PK:string?id##' = c.column_name THEN CONCAT(c.column_name, ' (PK)') ELSE c.column_name END AS column_name, data_type, is_nullable, COALESCE(CHARACTER_MAXIMUM_LENGTH, numeric_precision, datetime_precision) AS "length/precision" FROM INFORMATION_SCHEMA.Columns AS c WHERE c.table_name = '...
CREATE TABLE table_67917 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the score for the 2014 FIFA World Cup Qual. competition?
SELECT "Score" FROM table_67917 WHERE "Competition" = '2014 fifa world cup qual.'
CREATE TABLE table_name_4 ( opponent VARCHAR, points VARCHAR, attendance VARCHAR )
What is the Opponent of the game with more than 13,567 in Attendance with more than 5 Points?
SELECT opponent FROM table_name_4 WHERE points > 5 AND attendance > 13 OFFSET 567
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeo...
what were the five most frequently taken lab tests this year for patients with age 20s?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')...
CREATE TABLE table_name_41 ( number VARCHAR, males VARCHAR )
Which number has 11 males?
SELECT number FROM table_name_41 WHERE males = "11"
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 (...
give me the number of patients whose death status is 0 and procedure icd9 code is 3995?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3995"
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of job_id and commission_pct , and I want to display in descending by the names.
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
When does Stephen Rassi teach 841 again ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 841 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Stephen Rassi%' AND offering_instructor.instr...
CREATE TABLE table_10032 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the date with home team of Stockport County?
SELECT "Date" FROM table_10032 WHERE "Home team" = 'stockport county'
CREATE TABLE table_2589963_1 ( institution VARCHAR, women VARCHAR )
What institution is represented by the lady saints?
SELECT institution FROM table_2589963_1 WHERE women = "Lady Saints"
CREATE TABLE table_204_693 ( id number, "place" text, "total" number, "men" number, "women" number, "children" number, "elderly" number, "serbs" number, "jews" number, "romani" number, "rusyns" number, "hungarians" number, "russians" number )
which place has more jews , durdevo or zabalj ?
SELECT "place" FROM table_204_693 WHERE "place" IN ('đurđevo', 'zabalj') ORDER BY "jews" DESC LIMIT 1
CREATE TABLE table_6578 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Who plays the right wing position?
SELECT "Player" FROM table_6578 WHERE "Position" = 'right wing'
CREATE TABLE table_204_262 ( id number, "rank" number, "athlete" text, "time" text, "notes" text, "q" text )
which athlete belongs to rank 10 ?
SELECT "athlete" FROM table_204_262 WHERE "rank" = 10
CREATE TABLE table_34131 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
Can you tell me the Gold that has the Silver of south korea, and the Year of 1986?
SELECT "Gold" FROM table_34131 WHERE "Silver" = 'south korea' AND "Year" = '1986'
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the change in calcium patient 021-95970 experiences last measured on the current hospital visit compared to the second to last value measured on the current 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 = '021-95970' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'calci...
CREATE TABLE table_25736 ( "Rank" real, "Team" text, "Total Points" real, "2008-09 Points" real, "2007-08 Points" real, "2006-07 Points" real, "2005-06 Points" real )
If the points is 1, what is the total points minimum?
SELECT MIN("Total Points") FROM table_25736 WHERE "2005-06 Points" = '1'
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
How many companies each investor has invested? Show me a bar chart, and could you sort in desc by the bar?
SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
Big serch mutiple tags users.
SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, SUM(a.Score) AS "tag_scores" FROM Users AS u INNER JOIN Posts AS a ON a.OwnerUserId = u.Id INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JO...
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 lab ( subject_id text, hadm_id text, ...
count the number of patients whose diagnoses icd9 code is 34830 and drug route is dialys?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "34830" AND prescriptions.route = "DIALYS"
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients whose diagnoses long title is chronic combined systolic and diastolic heart failure and drug route is ed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic combined systolic and diastolic heart failure" AND prescriptions.route = "ED"
CREATE TABLE table_1342338_5 ( district VARCHAR, incumbent VARCHAR )
In how many districts was the incumbent David Delano Glover?
SELECT COUNT(district) FROM table_1342338_5 WHERE incumbent = "David Delano Glover"
CREATE TABLE table_name_76 ( team VARCHAR, high_assists VARCHAR )
What team has brad miller (8) as the high assists?
SELECT team FROM table_name_76 WHERE high_assists = "brad miller (8)"
CREATE TABLE table_4718 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text )
What is the average number of players from Duquesne?
SELECT AVG("From") FROM table_4718 WHERE "School/Country" = 'duquesne'
CREATE TABLE table_name_44 ( date VARCHAR, tie_no VARCHAR )
what date did tie number 5 occur?
SELECT date FROM table_name_44 WHERE tie_no = "5"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
What number of patients have drug type main and a lab test named total protein, urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Total Protein, Urine"
CREATE TABLE table_name_39 ( bulgarian_commander VARCHAR, battle VARCHAR )
What is the Bulgarian Commander of the Battle of Rusion?
SELECT bulgarian_commander FROM table_name_39 WHERE battle = "battle of rusion"
CREATE TABLE table_20745754_1 ( _number VARCHAR, attendance VARCHAR )
What game number had an attendance of 2813?
SELECT _number FROM table_20745754_1 WHERE attendance = 2813
CREATE TABLE table_58156 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real )
How many points has a draw greater than 3 and 3rd place?
SELECT "Points" FROM table_58156 WHERE "Draw" > '3' AND "Place" = '3'
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Show the card type codes and the number of transactions Visualize by bar chart, and could you order Y in ascending order?
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*)
CREATE TABLE table_name_18 ( source VARCHAR, name VARCHAR )
What is the source for Laird?
SELECT source FROM table_name_18 WHERE name = "laird"
CREATE TABLE table_49839 ( "Rank" real, "Player" text, "Country" text, "Events" real, "Prize money( $ )" real )
What is the prize money for the player ranked 1?
SELECT MAX("Prize money( $ )") FROM table_49839 WHERE "Rank" = '1'
CREATE TABLE table_1553485_1 ( channel_tv___dt__ VARCHAR, station VARCHAR )
What channel tv (dt) plays the KPIX station?
SELECT channel_tv___dt__ FROM table_1553485_1 WHERE station = "KPIX"
CREATE TABLE table_name_88 ( parent_magazine VARCHAR, first_published VARCHAR )
What was the parent magazine of the magazine that was first published on december 16, 2004?
SELECT parent_magazine FROM table_name_88 WHERE first_published = "december 16, 2004"
CREATE TABLE table_3537 ( "Series #" real, "Season #" real, "Episode Title" text, "Original airdate" text, "Prod. No." text )
How many episodes had production number 2x13?
SELECT COUNT("Season #") FROM table_3537 WHERE "Prod. No." = '2x13'
CREATE TABLE table_48069 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Total has a Bronze larger than 2, a Gold smaller than 16, a Silver of 0, and a Rank of 13?
SELECT AVG("Total") FROM table_48069 WHERE "Bronze" > '2' AND "Gold" < '16' AND "Silver" = '0' AND "Rank" = '13'
CREATE TABLE table_61804 ( "2010" text, "2009" real, "2008" real, "2007" text, "2006" real, "2005" real, "2004" real, "2003" real, "2002" text )
What is the average 2003 with 2,154,170 in 2010 and a 2008 less than 2,266,716?
SELECT AVG("2003") FROM table_61804 WHERE "2010" = '2,154,170' AND "2008" < '2,266,716'
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
what are the three most commonly prescribed medications for patients, which were also previously prescribed to patients with flecainide acetate within 2 months in 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'flecainide acetate' AND STRFTIME('%y', prescriptions.startdate) =...
CREATE TABLE table_14143 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg...
What is the lowest MPG-US combined for a green rating of E, mpg in the UK- combined of under 42.2, manufacturer of Volkswagen, and an M6 transmission?
SELECT MIN("mpg-US Combined") FROM table_14143 WHERE "Green Rating" = 'e' AND "mpg-UK Combined" < '42.2' AND "Manufacturer" = 'volkswagen' AND "Transmission" = 'm6'
CREATE TABLE table_79357 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date had a tie no of replay, and an away team of watford?
SELECT "Date" FROM table_79357 WHERE "Tie no" = 'replay' AND "Away team" = 'watford'
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
Users by number of profile-trackable badges obtained. Total is 47; currently only Stack Overflow has users on the max.
SELECT * FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Fanatic', 'Illuminator', 'Legendary', 'Marshal', 'Socratic') OR Name IN ('Archaeologist', 'Civic Duty', 'Deputy', 'Enthusiast', 'Epic', 'Inquisitive', 'Necromancer', 'Refiner', 'Research Assistant', 'Sportsmanship', 'Strunk & White') LIMIT 500
CREATE TABLE table_25277262_2 ( title VARCHAR, no_in_season VARCHAR )
What is the name of the episode # 11 in the season?
SELECT title FROM table_25277262_2 WHERE no_in_season = 11
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 days ( days_code varchar, day_name varchar ) CR...
what flights from ATLANTA to WASHINGTON
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN...
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...
How many patients survived and procedured for regional lymph node exc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Regional lymph node exc"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 jobs ( JOB_ID varchar(10), JOB_...
For all employees who have the letters D or S in their first name, what is the relationship between employee_id and department_id ?
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE table_24293 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text )
Who is the winner when bigten (2-1) is the challenge leader?
SELECT "Winner" FROM table_24293 WHERE "Challenge Leader" = 'BigTen (2-1)'
CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, bao...
How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?
SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000
CREATE TABLE table_name_63 ( release_price___usd__ VARCHAR, socket VARCHAR )
Socket of without quickassist has what release price?
SELECT release_price___usd__ FROM table_name_63 WHERE socket = "without quickassist"
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Nam...
Show different teams of technicians and the number of technicians in each team with a bar chart, could you show the total number in descending order?
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC
CREATE TABLE table_31989 ( "Sixes" text, "Player" text, "Opponent" text, "Venue" text, "Date" text )
What is the date when Canada played?
SELECT "Date" FROM table_31989 WHERE "Opponent" = 'canada'
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
total count of different kinds of votes on different kinds of posts.
SELECT vt.Name AS votetype, pt.Name AS posttype, COUNT(*) AS num FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id INNER JOIN Posts AS p ON p.Id = v.PostId INNER JOIN PostTypes AS pt ON p.PostTypeId = pt.Id GROUP BY vt.Name, pt.Name
CREATE TABLE table_44495 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text )
When was the archbishop that was born on February 22, 1825 ordained as a bishop?
SELECT "Ordained Bishop" FROM table_44495 WHERE "Born" = 'february 22, 1825'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
how many times was dressing change performed until 2104?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'dressing change' AND STRFTIME('%y', treatment.treatmenttime) <= '2104'
CREATE TABLE table_15180 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average silver with a Rank smaller than 2 and more than 1 gold?
SELECT AVG("Silver") FROM table_15180 WHERE "Rank" < '2' AND "Gold" > '1'
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients less than 85 years of age were ordered mcv lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "MCV"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients diagnosed under icd9 code 76525 had cerebrospinal fluid as lab test fluid?
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.icd9_code = "76525" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
CREATE TABLE table_27744976_10 ( record VARCHAR, team VARCHAR )
What was the rocket's record when they played against Indiana?
SELECT record FROM table_27744976_10 WHERE team = "Indiana"
CREATE TABLE table_204_595 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what country won more gold medals than any other ?
SELECT "nation" FROM table_204_595 ORDER BY "gold" DESC LIMIT 1
CREATE TABLE table_24588 ( "Year" text, "MAAC" text, "Overall" text, "Regular Season Results" text, "MAAC Tournament Result" text, "NCAA Seed" text, "NCAA Round" text )
How many overall in the year 2010-2011?
SELECT COUNT("Overall") FROM table_24588 WHERE "Year" = '2010-2011'
CREATE TABLE table_72015 ( "Wicket" text, "Runs" text, "Partnerships" text, "Venue" text, "Date" text )
Which partnership has a run number of 27?
SELECT "Partnerships" FROM table_72015 WHERE "Runs" = '27'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
count the number of patients who have been treated with a creat esophagastr sphinc procedure in this year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.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 = 'creat esophagastr sphinc') AND DATETIME(procedures_i...
CREATE TABLE table_name_71 ( touchdowns VARCHAR, player VARCHAR, extra_points VARCHAR, position VARCHAR )
How many touchdowns are there when there were 0 extra points and Hal Weeks had left halfback?
SELECT touchdowns FROM table_name_71 WHERE extra_points = 0 AND position = "left halfback" AND player = "hal weeks"
CREATE TABLE table_26068 ( "Period" text, "Live births per year" text, "Deaths per year" text, "Natural change per year" text, "CBR*" text, "CDR*" text, "NC*" text, "TFR*" text, "IMR*" real, "Life expectancy total" text, "Life expectancy males" text, "Life expectancy fema...
How many imr* have 64.3 life expectancy males?
SELECT MIN("IMR*") FROM table_26068 WHERE "Life expectancy males" = '64.3'
CREATE TABLE table_name_81 ( other_deaths VARCHAR, israeli_and_or_foreigner_wounded VARCHAR )
How many other deaths were in the attack with 242 Israelis and/or foreigners wounded?
SELECT other_deaths FROM table_name_81 WHERE israeli_and_or_foreigner_wounded = "242"
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...
How many patients were admitted before the year 2203 with admission type as elective?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2203"
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostHistory ( Id number, ...
QUERY: Upvote Count, Specified User, Group by TagName.
SELECT t.TagName, SUM(Posts.Score), COUNT(*) FROM Posts INNER JOIN Posts AS pm ON Posts.ParentId = pm.Id INNER JOIN PostTags AS pt ON pm.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE Posts.OwnerUserId = '##UserId##' GROUP BY t.TagName ORDER BY SUM(Posts.Score) DESC
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subj...
A bar chart for finding the number of the enrollment date for all the tests that have 'Pass' result.
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
CREATE TABLE table_name_10 ( location VARCHAR, silver VARCHAR )
Which Location has a Silver of japan?
SELECT location FROM table_name_10 WHERE silver = "japan"
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
Find the total amount of loans offered by each bank branch, and sort in desc by the bar.
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname DESC
CREATE TABLE table_43962 ( "Bank type" text, "Number of branches" real, "On-site ATMs" real, "Off-site ATMs" real, "Total ATMs" real )
What is the total number of branches when the on-site ATMS is 1548, and the off-site ATMs is bigger than 3672?
SELECT SUM("Number of branches") FROM table_43962 WHERE "On-site ATMs" = '1548' AND "Off-site ATMs" > '3672'