table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
did patient 71129 have the diagnosis of gu infection-antepartum since 2101?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gu infection-antepartum') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71129) AND STRFTIME('%y', dia...
CREATE TABLE table_27755603_7 ( high_rebounds VARCHAR, date VARCHAR )
For how many games on December 19 is there information on who scored the most rebounds?
SELECT COUNT(high_rebounds) FROM table_27755603_7 WHERE date = "December 19"
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 the number of patients whose admission type is newborn and diagnoses long title is hyperpotassemia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Hyperpotassemia"
CREATE TABLE table_203_545 ( id number, "single/ep" text, "release date" text, "label" text, "format(s)" text, "uk singles chart position" number, "notes" text )
what is the difference in chart position between bleach and you & me ?
SELECT (SELECT "uk singles chart position" FROM table_203_545 WHERE "single/ep" = '"bleach"') - (SELECT "uk singles chart position" FROM table_203_545 WHERE "single/ep" = '"you & me"')
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
i would like to know flights on 6 15 from LONG BEACH to COLUMBUS after 1200 please
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 ((date_day.day_number = 15 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
CREATE TABLE table_29033869_3 ( round INTEGER, opponent VARCHAR, date VARCHAR )
What is the round number of the round against melbourne on saturday, 4 april 2:10pm?
SELECT MIN(round) FROM table_29033869_3 WHERE opponent = "Melbourne" AND date = "Saturday, 4 April 2:10pm"
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EN...
Bar chart x axis crs code y axis the total number
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE
CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, ...
A bar chart for giveing me the number of the descriptions of the service types that cost more than 100, sort by the total number from high to low.
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC
CREATE TABLE table_name_85 ( copies_sold VARCHAR, oricon_position VARCHAR, year VARCHAR )
How many copies were sold where the position is lager than 1 in 1988?
SELECT copies_sold FROM table_name_85 WHERE oricon_position > 1 AND year = 1988
CREATE TABLE table_name_49 ( visitor VARCHAR, home VARCHAR, date VARCHAR )
Who was the Visitor when the Home team was Anaheim on the Date of April 12?
SELECT visitor FROM table_name_49 WHERE home = "anaheim" AND date = "april 12"
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...
Give the number of patients whose admission type is emergency and were born before the year 2064.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2064"
CREATE TABLE table_8563 ( "Placement" real, "Name" text, "Event" text, "Final" text, "Year" real )
What was the lowest placement with a final of 23.92?
SELECT MIN("Placement") FROM table_8563 WHERE "Final" = '23.92'
CREATE TABLE table_23296 ( "#" real, "Player" text, "Age" real, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real )
Who won the French Open in 1999?
SELECT "Player" FROM table_23296 WHERE "French Open" = '1999'
CREATE TABLE table_23936 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
How many people voted for Obama in the county where McCain got 72.75% of the votes?
SELECT MIN("Obama#") FROM table_23936 WHERE "McCain%" = '72.75%'
CREATE TABLE table_name_80 ( home_team VARCHAR, away_team VARCHAR )
What home team has blackpool as the away team?
SELECT home_team FROM table_name_80 WHERE away_team = "blackpool"
CREATE TABLE table_34129 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
Which Year is the lowest one that has a Regular Season of 5th, atlantic, and a Division larger than 4?
SELECT MIN("Year") FROM table_34129 WHERE "Regular Season" = '5th, atlantic' AND "Division" > '4'
CREATE TABLE table_55207 ( "Year" real, "Category" text, "Character" text, "For The Show" text, "Result" text )
For 2006 what category has the Show of kasautii zindagii kay?
SELECT "Category" FROM table_55207 WHERE "For The Show" = 'kasautii zindagii kay' AND "Year" = '2006'
CREATE TABLE table_name_98 ( team_1 VARCHAR, team_2 VARCHAR )
What is the team 1 when Ulisses is team 2?
SELECT team_1 FROM table_name_98 WHERE team_2 = "ulisses"
CREATE TABLE table_43712 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Comp" text )
Where was the game played when the score was 1-4?
SELECT "Venue" FROM table_43712 WHERE "Score" = '1-4'
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
when is patient 4758's arterial bp [systolic] last measured on 07/30/this year?
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 = 4758)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
CREATE TABLE table_2897457_3 ( college_junior_club_team VARCHAR, player VARCHAR )
Which college/junior/club team has jim mathieson as the player?
SELECT college_junior_club_team FROM table_2897457_3 WHERE player = "Jim Mathieson"
CREATE TABLE table_name_56 ( location_attendance VARCHAR, date VARCHAR )
On December 3, where was the game held and how many were in attendance?
SELECT location_attendance FROM table_name_56 WHERE date = "december 3"
CREATE TABLE table_name_95 ( transfer_window VARCHAR, ends INTEGER )
Which transfer window ends after 2006?
SELECT transfer_window FROM table_name_95 WHERE ends > 2006
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, I want to list by the Y from high to low.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC
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 ...
When it comes to the Dance Laboratory course , what 's the course number ?
SELECT DISTINCT number FROM course WHERE (description LIKE '%Dance Laboratory%' OR name LIKE '%Dance Laboratory%') AND department = 'EECS'
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
What is my Archaeologist badge progress?.
SELECT COUNT(*) FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE p.Title = 'Site statistics'
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
what is the number of hours since patient 15447 last visited ward 23 on this hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL)) AND transfers...
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give the number of patients whose diagnoses title is abn react-procedure nos.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Abn react-procedure NOS"
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number )
what is the number of parties that had more than 3 candidates in their party ?
SELECT COUNT("party") FROM table_203_354 WHERE "candidate(s)" > 3
CREATE TABLE table_name_40 ( tyres VARCHAR, chassis VARCHAR )
What tyres were used with the mp4/14 chassis?
SELECT tyres FROM table_name_40 WHERE chassis = "mp4/14"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
when is the first time patient 002-13750 was prescribed a drug in 04/this year?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13750')) AND DATETIME(medication.drugstarttime, 'start of ...
CREATE TABLE table_71644 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text )
What is the English title of the film directed by Fernando Meirelles?
SELECT "English title" FROM table_71644 WHERE "Director(s)" = 'fernando meirelles'
CREATE TABLE table_name_87 ( Id VARCHAR )
What is the 2010 when the 2009 is 1r, and a 2008 is 1r?
SELECT 2010 FROM table_name_87 WHERE 2009 = "1r" AND 2008 = "1r"
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_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday, show in ascending by the y-axis.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
what intake did patient 462 take since 02/05/2104 for the first time?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 462)) AND STRFTIME('%y-%m-%d', input...
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
when did patient 3929 this year last get discharged from the hospital?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 3929 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime DESC LIMIT 1
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, and sort total number in ascending order.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
what are the three most frequently ordered medications?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
CREATE TABLE table_name_6 ( constructor VARCHAR, grid INTEGER )
What is the constructor for the driver with grid less than 2?
SELECT constructor FROM table_name_6 WHERE grid < 2
CREATE TABLE table_23565 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Foochow" text, "Area" real, "Population" real, "Density" real )
Name the pinyin for ci - ng-g ing
SELECT "Pinyin" FROM table_23565 WHERE "Foochow" = 'Ciá-ìng-gâing'
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE party_host ( party_id number, host_id number, is...
List the names of hosts who did not serve as a host of any party in our record.
SELECT name FROM host WHERE NOT host_id IN (SELECT host_id FROM party_host)
CREATE TABLE table_38187 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
what team played on may 20 on the home side
SELECT "Home Team" FROM table_38187 WHERE "Date" = 'may 20'
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ( row_id number, ...
how many days has it elapsed since patient 2518 was admitted to the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL
CREATE TABLE table_203_460 ( id number, "player" text, "played" number, "legs won" number, "legs lost" number, "lwat" number, "100+" number, "140+" number, "180s" number, "high checkout" number, "3-dart average" number )
was andy smith or kevin painter 's 3 dart average 96.71 ?
SELECT "player" FROM table_203_460 WHERE "player" IN ('andy smith', 'kevin painter') AND "3-dart average" = 96.71
CREATE TABLE table_68356 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
Name the to par for score of 69-73-68-70=280
SELECT "To par" FROM table_68356 WHERE "Score" = '69-73-68-70=280'
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Selecting posts with a score higher than 8.
SELECT Id, Title, Body, Tags FROM Posts WHERE Id < 500000 AND Score >= 8
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
what was the last time patient 95088 has had the hospital discharge in the previous year?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 95088 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime DESC LIMIT 1
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
Percentage of (non-deleted) questions which get closed as duplicates, month by month.
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", CAST(COUNT(CASE WHEN (NOT Posts.ClosedDate IS NULL AND PostHistory.PostHistoryTypeId = 10 AND PostHistory.Comment IN ('1', '101')) THEN 1 ELSE NULL END) AS FLOAT) * 100 / COUNT(CASE WHEN PostHistory.PostHistoryTypeId = 1 THEN 1 ELSE NULL END) AS "Du...
CREATE TABLE table_name_55 ( bronze VARCHAR, silver VARCHAR, gold VARCHAR )
What bronze has tatiana ryabkina as the silver, anne margrethe hausken as the gold?
SELECT bronze FROM table_name_55 WHERE silver = "tatiana ryabkina" AND gold = "anne margrethe hausken"
CREATE TABLE table_21498 ( "Season" text, "Games" real, "GS" real, "Points" text, "Rebounds" text, "Assists" text, "Blocks" text, "Steals" text, "Turnovers" text )
Name the steals for season 2007/2008
SELECT "Steals" FROM table_21498 WHERE "Season" = '2007/2008'
CREATE TABLE table_204_251 ( id number, "community" text, "area" text, "location" text, "population" number, "date established" text )
total population of millbrook first nation
SELECT "population" FROM table_204_251 WHERE "community" = 'millbrook 27'
CREATE TABLE table_33927 ( "Model Number" text, "Stepping" text, "Frequency" text, "L2 Cache" text, "Multi 1" text, "V Core" text, "Socket" text, "Release Date" text, "Part Number(s)" text )
What is the part number of athlon x2 4850e?
SELECT "Part Number(s)" FROM table_33927 WHERE "Model Number" = 'athlon x2 4850e'
CREATE TABLE table_31928 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text )
What was the surface made of in the contest where Paula Ormaechea was the partner?
SELECT "Surface" FROM table_31928 WHERE "Partner" = 'paula ormaechea'
CREATE TABLE table_18248 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who is the incumbent that is listed with the candidates listed as marilyn lloyd (d) 57.4% harold w. coker (r) 42.6%?
SELECT "Incumbent" FROM table_18248 WHERE "Candidates" = 'Marilyn Lloyd (D) 57.4% Harold W. Coker (R) 42.6%'
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) 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 appellations ( No...
Show mean max(price) from each year, display in ascending by the Y.
SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price))
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Find meter_400 and meter_100 , and visualize them by a bar chart.
SELECT meter_400, meter_100 FROM swimmer
CREATE TABLE table_21731 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original airdate" text, "Production Code" text )
What was the original airdate of the episode 'The Cold Turkey', which was viewed by 3.73 million viewers?
SELECT "Original airdate" FROM table_21731 WHERE "U.S. viewers (million)" = '3.73'
CREATE TABLE table_23215145_2 ( team VARCHAR )
What is the 2006-2007 points minimum is the team is Overmach Parma?
SELECT MIN(2006 AS _07_points) FROM table_23215145_2 WHERE team = "Overmach Parma"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
give a count of the number of intensive care unit visits of patient 027-69449 in 2105.
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-69449') AND STRFTIME('%y', patient.unitadmittime) = '2105'
CREATE TABLE table_28725 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text )
How many million U.S. viewers watched the episode with the production code 3x6004?
SELECT "U.S. viewers (million)" FROM table_28725 WHERE "Production code" = '3X6004'
CREATE TABLE table_75354 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the FCC info of the translator with an Irmo, South Carolina city license?
SELECT "FCC info" FROM table_75354 WHERE "City of license" = 'irmo, south carolina'
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 have drug code meto25?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METO25"
CREATE TABLE table_name_9 ( opponent VARCHAR, home_away VARCHAR, date VARCHAR )
Name the opponent which has a home/away of home and date of july 27
SELECT opponent FROM table_name_9 WHERE home_away = "home" AND date = "july 27"
CREATE TABLE table_28027307_1 ( directed_by VARCHAR, production_code VARCHAR )
Who directed the episode with the production code of 6AKY11?
SELECT directed_by FROM table_28027307_1 WHERE production_code = "6AKY11"
CREATE TABLE table_name_48 ( sr INTEGER, average VARCHAR, balls_faced VARCHAR )
Which average S.R. has an Average of 39.13 and Balls Faced larger than 318?
SELECT AVG(sr) FROM table_name_48 WHERE average = 39.13 AND balls_faced > 318
CREATE TABLE table_name_8 ( score VARCHAR, home VARCHAR, record VARCHAR )
What is the Score when the Home team is Chicago Black Hawks and the Record is 3-3?
SELECT score FROM table_name_8 WHERE home = "chicago black hawks" AND record = "3-3"
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What 's the workload like in EECS 201 ?
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 201 AND program_course.course_id = course.course_id
CREATE TABLE table_203_35 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number )
what is the difference between marcellino lucchi 's points and max biaggi 's points ?
SELECT (SELECT "points" FROM table_203_35 WHERE "rider" = 'max biaggi') - (SELECT "points" FROM table_203_35 WHERE "rider" = 'marcellino lucchi')
CREATE TABLE table_76367 ( "Poll source" text, "Dates administered" text, "Arlen Specter*" text, "Pat Toomey" text, "Tom Ridge*" text, "Peg Luksik" text )
Which Poll source has a Peg Luksik of 9%, and Dates administered of may 12, 2010?
SELECT "Poll source" FROM table_76367 WHERE "Peg Luksik" = '9%' AND "Dates administered" = 'may 12, 2010'
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(...
Show the average of account details for different statement details in a bar chart, and show by the names from low to high.
SELECT Statement_Details, AVG(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details
CREATE TABLE table_name_66 ( round VARCHAR, overall VARCHAR, position VARCHAR )
How many rounds have an Overall larger than 17, and a Position of quarterback?
SELECT COUNT(round) FROM table_name_66 WHERE overall > 17 AND position = "quarterback"
CREATE TABLE table_73917 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Where the outcome is Winner and surface is Hard (i), what is the No.?
SELECT "No." FROM table_73917 WHERE "Outcome" = 'Winner' AND "Surface" = 'Hard (i)'
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE ...
List the distinct director of all films.
SELECT DISTINCT director FROM film
CREATE TABLE table_47981 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
What was the result for the match with entry Match Reports?
SELECT "Result" FROM table_47981 WHERE "Match" = 'match reports'
CREATE TABLE table_74210 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many people had the high points when a. webb (7) had the high assists?
SELECT COUNT("High points") FROM table_74210 WHERE "High assists" = 'A. Webb (7)'
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 diagnoses short title is neonatal thrombocytopen and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Neonatal thrombocytopen" AND lab.flag = "delta"
CREATE TABLE table_21618 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
Name the series number directed by richard thorpe written by dee johnson
SELECT MAX("Series #") FROM table_21618 WHERE "Directed by" = 'Richard Thorpe' AND "Written by" = 'Dee Johnson'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients whose primary disease is gastrointestinal bleed and admission year is less than 2124?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.admityear < "2124"
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
What is the number of professors for different school Plot them as bar chart, and show by the names from high to low.
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE DESC
CREATE TABLE table_78659 ( "Season" real, "Average Attendance Home" real, "Highest Attendance Home" text, "Average Attendance Away" real, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" real )
How many season have an average attendance league of 2.456?
SELECT SUM("Season") FROM table_78659 WHERE "Average Attendance League" = '2.456'
CREATE TABLE table_52273 ( "Year" real, "Theme" text, "Artist" text, "Issue Price" real, "Special Notes" text )
What is the special notes value for years under 2009?
SELECT "Special Notes" FROM table_52273 WHERE "Year" < '2009'
CREATE TABLE product ( product_name VARCHAR, product_id VARCHAR )
List all the distinct product names ordered by product id?
SELECT DISTINCT product_name FROM product ORDER BY product_id
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
what is patient 52456's minimum value of lipase last month?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52456) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lipase') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CUR...
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time by a bar chart, and could you display by the total number in desc?
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC
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...
give me the number of patients whose diagnoses short title is encephalopathy nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS"
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
Bar graph to show meter_100 from different meter 400, and show in descending by the total number.
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC
CREATE TABLE table_name_86 ( listed VARCHAR, county VARCHAR, location VARCHAR )
What is the listed for the bridge at Daniel in Sublette county?
SELECT listed FROM table_name_86 WHERE county = "sublette" AND location = "daniel"
CREATE TABLE table_name_30 ( manner_of_departure VARCHAR, date_of_vacancy VARCHAR )
What was the manner of departure for the vacancy date of 20 September 2009?
SELECT manner_of_departure FROM table_name_30 WHERE date_of_vacancy = "20 september 2009"
CREATE TABLE table_6206 ( "Speaker" text, "Party" text, "City" text, "County" text, "Term" text )
what city is brule in
SELECT "City" FROM table_6206 WHERE "County" = 'brule'
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
Draw a bar chart about the distribution of middle_name and author_id .
SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE table_27887723_1 ( race_name VARCHAR, uci_rating VARCHAR )
what race name had a uci rating of cn?
SELECT race_name FROM table_27887723_1 WHERE uci_rating = "CN"
CREATE TABLE table_45203 ( "Name" text, "Category" text, "Eliminated" text, "Date" text, "Special Guest" text )
On what date was elimination on final night?
SELECT "Date" FROM table_45203 WHERE "Eliminated" = 'final night'
CREATE TABLE table_name_74 ( place VARCHAR, country VARCHAR, player VARCHAR )
Where did Bob Murphy of the United States place?
SELECT place FROM table_name_74 WHERE country = "united states" AND player = "bob murphy"
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text )
Which students are unaffected by allergies?
SELECT stuid FROM student EXCEPT SELECT stuid FROM has_allergy
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
Of the following [ classes ] , EECS 698 and EECS 442 , which is easiest ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 698 OR course.number = 442) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
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 demographic ...
how many patients are diagnosed with icd9 code e9300 and tested with main drug type?
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 = "E9300" AND prescriptions.drug_type = "MAIN"
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 primary disease of the patient id 3343?
SELECT demographic.diagnosis FROM demographic WHERE demographic.subject_id = "3343"
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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, could you display in ascending by the names?
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
CREATE TABLE table_52878 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was the grid associated with under 26 laps and a Time/Retired of +6.077?
SELECT AVG("Grid") FROM table_52878 WHERE "Time/Retired" = '+6.077' AND "Laps" < '26'
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 diagnoses ( ...
give me the number of patients whose death status is 1 and diagnoses short title is sec neuroend tumor-liver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Sec neuroend tumor-liver"