table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
Find the number of the name of the project for which a scientist whose name contains Smith is assigned to.
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name
CREATE TABLE table_1341472_34 ( first_elected VARCHAR, district VARCHAR )
Name the first elected for new york 1
SELECT COUNT(first_elected) FROM table_1341472_34 WHERE district = "New York 1"
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_ty...
what are the five most common microbiology tests that patients had within 2 months after receiving colonoscopy the previous year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
CREATE TABLE table_10015132_1 ( school_club_team VARCHAR, no VARCHAR )
What school did player number 6 come from?
SELECT school_club_team FROM table_10015132_1 WHERE no = "6"
CREATE TABLE table_19357 ( "Team" text, "Average" text, "Points" real, "Played" real, "1987-88" text, "1988-89" text, "1989-90" real )
How many points total for san lorenzo?
SELECT COUNT("Points") FROM table_19357 WHERE "Team" = 'San Lorenzo'
CREATE TABLE table_24520 ( "Period" real, "Civilians" text, "Security forces" text, "Insurgents" text, "Total per period" real )
How many figures are named for security forces in 1998?
SELECT COUNT("Security forces") FROM table_24520 WHERE "Period" = '1998'
CREATE TABLE table_16799784_8 ( diameter__km_ VARCHAR, name VARCHAR )
What is the diameter in km of the feature named Colette Patera?
SELECT diameter__km_ FROM table_16799784_8 WHERE name = "Colette Patera"
CREATE TABLE table_4802 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd size at the match that had an away team score of 6.8 (44)?
SELECT SUM("Crowd") FROM table_4802 WHERE "Away team score" = '6.8 (44)'
CREATE TABLE table_37807 ( "Tournament" text, "2006" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Name the 2008 for 2012 of sf
SELECT "2008" FROM table_37807 WHERE "2012" = 'sf'
CREATE TABLE table_12344 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
Which report had a circuit of Cagliari?
SELECT "Report" FROM table_12344 WHERE "Circuit" = 'cagliari'
CREATE TABLE table_name_18 ( track VARCHAR, year VARCHAR )
What's the track for 1982?
SELECT track FROM table_name_18 WHERE year = 1982
CREATE TABLE table_31424 ( "Prefix class" text, "Type and usage" text, "Example" text, "Equivalent" text, "Reference" text )
What is every reference for the example of AF117?
SELECT "Reference" FROM table_31424 WHERE "Example" = 'AF117'
CREATE TABLE table_54797 ( "Year" text, "Winner and nominees" text, "Original title" text, "Country" text, "Director" text )
What is the original title for the winner and nominees 'Secrets & Lies'?
SELECT "Original title" FROM table_54797 WHERE "Winner and nominees" = 'secrets & lies'
CREATE TABLE table_name_92 ( pick__number VARCHAR, nhl_team VARCHAR )
What is the pick# for the California Golden Seals?
SELECT pick__number FROM table_name_92 WHERE nhl_team = "california golden seals"
CREATE TABLE table_name_26 ( round INTEGER, player VARCHAR )
What is recorded as the lowest Round for the Player Jim Thompson?
SELECT MIN(round) FROM table_name_26 WHERE player = "jim thompson"
CREATE TABLE table_name_60 ( pick__number INTEGER, position VARCHAR, overall VARCHAR )
What is the highest Pick that is wide receiver with overall of 29?
SELECT MAX(pick__number) FROM table_name_60 WHERE position = "wide receiver" AND overall = 29
CREATE TABLE addresses ( address_id number, address_content text, city text, zip_postcode text, state_province_county text, country text, other_address_details text ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, activ...
Find the names of customers who never ordered product Latte.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'
CREATE TABLE table_30115 ( "Player" text, "Matches" real, "Innings" real, "Wickets" real, "Average" text, "BBI" text, "BBM" text, "5wi" real )
How many innings for the player with an average of 30.03?
SELECT MIN("Innings") FROM table_30115 WHERE "Average" = '30.03'
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Name the courses required for PORTUG 232 ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'PORTUG' AND COURSE_0.numbe...
CREATE TABLE table_name_72 ( rider VARCHAR, manufacturer VARCHAR, grid VARCHAR )
Who is the rider for Honda with a grid of 25?
SELECT rider FROM table_name_72 WHERE manufacturer = "honda" AND grid = "25"
CREATE TABLE table_33104 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
How many goals have a Lokomotiv Plovdiv club and goals against larger than 58?
SELECT COUNT("Goals for") FROM table_33104 WHERE "Club" = 'lokomotiv plovdiv' AND "Goals against" > '58'
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 demographic (...
count the number of patients whose discharge location is short term hospital and procedure long title is other endoscopy of small intestine.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Other endoscopy of small intestine"
CREATE TABLE table_7984 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
Which frequency belongs to the cihr-fm call sign?
SELECT "Frequency" FROM table_7984 WHERE "Call sign" = 'cihr-fm'
CREATE TABLE table_21576644_2 ( mens_2nd_xi VARCHAR, mens_1st_xi VARCHAR )
When 6th, south division 2 is the mens 1st xi what is the mens 2nd xi?
SELECT mens_2nd_xi FROM table_21576644_2 WHERE mens_1st_xi = "6th, South Division 2"
CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE...
Visualize the general trend of the number of planned delivery date over the planned delivery date.
SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings
CREATE TABLE table_203_224 ( id number, "title" text, "year" number, "channel" text, "role" text, "notes" text )
what television title did she perform in directly after loose women ?
SELECT "title" FROM table_203_224 WHERE id = (SELECT id FROM table_203_224 WHERE "title" = 'loose women') + 1
CREATE TABLE table_name_85 ( part_number_s_ VARCHAR, turbo VARCHAR )
what is the part number that has a turbo of low power?
SELECT part_number_s_ FROM table_name_85 WHERE turbo = "low power"
CREATE TABLE table_9407 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which Label has a Format of cd, a Country of Japan and a Catalog of vjcp-68403?
SELECT "Label" FROM table_9407 WHERE "Format" = 'cd' AND "Country" = 'japan' AND "Catalog" = 'vjcp-68403'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what's the minimum total cost of the hospital that involves a procedure called hormonal therapy (for varices) - vasopressin during this year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hormonal therapy (for varices) - vasopressin...
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...
how many patients whose procedure long title is annuloplasty and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Annuloplasty" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
CREATE TABLE table_27539272_5 ( record VARCHAR, score VARCHAR )
what is the record that had a score of 5-3?
SELECT record FROM table_27539272_5 WHERE score = "5-3"
CREATE TABLE table_105344_2 ( aircraft_kilometers INTEGER, departures VARCHAR )
Of the years that had exactly 17096 departures, what is the greatest number of aircraft kilometers flown?
SELECT MAX(aircraft_kilometers) FROM table_105344_2 WHERE departures = 17096
CREATE TABLE gradeconversion ( lettergrade text, gradepoint number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE facult...
What are the last names of faculty who are part of the computer science department?
SELECT T2.lname FROM department AS T1 JOIN faculty AS T2 ON T1.dno = T3.dno JOIN member_of AS T3 ON T2.facid = T3.facid WHERE T1.dname = "Computer Science"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
how much patient 005-66412 has changed in pt last measured on the last hospital visit compared to the first value measured on the last 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 = '005-66412' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
Is there such a thing as an NEUROSCI 4 -credit course ?
SELECT DISTINCT name, number FROM course WHERE department = 'NEUROSCI' AND credits = 4
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 whose diagnoses short title is abn react-procedure nos and lab test fluid is cerebrospinal fluid (csf)?
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 = "Abn react-procedure NOS" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
when was the first time that patient 15119 had a minimum po2 in 03/2105?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15119) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND STRFTIME('%y-%m', labevents.charttime) = '2105-03' ORDER BY labevents...
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 ) ...
give me the number of patients less than 41 years who are categorized under chemistry lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab."CATEGORY" = "Chemistry"
CREATE TABLE table_name_36 ( first_elected INTEGER, results VARCHAR, incumbent VARCHAR )
What is re-elected Incumbent Jerry Costello's First elected date?
SELECT MIN(first_elected) FROM table_name_36 WHERE results = "re-elected" AND incumbent = "jerry costello"
CREATE TABLE table_14940519_1 ( week INTEGER, date VARCHAR )
Name the least week for september 25, 1983
SELECT MAX(week) FROM table_14940519_1 WHERE date = "September 25, 1983"
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
during the last hospital visit how old was patient 86404?
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 86404 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
CREATE TABLE table_name_43 ( province VARCHAR, _community VARCHAR, contestant VARCHAR )
What is the province with a contestant of tatiana vargas rosales?
SELECT province, _community FROM table_name_43 WHERE contestant = "tatiana vargas rosales"
CREATE TABLE table_name_38 ( date VARCHAR, round VARCHAR )
What is Date, when Round is '2'?
SELECT date FROM table_name_38 WHERE round = 2
CREATE TABLE table_61560 ( "Draw" real, "Artist" text, "Song" text, "Results" text, "Place" text )
What is the result of the song 'ride'?
SELECT "Results" FROM table_61560 WHERE "Song" = 'ride'
CREATE TABLE table_8491 ( "Name" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
When did grid 8 finish?
SELECT "Time/Retired" FROM table_8491 WHERE "Grid" = '8'
CREATE TABLE table_40657 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the average attendance for the New York Jets?
SELECT AVG("Attendance") FROM table_40657 WHERE "Opponent" = 'new york jets'
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
what club is after the sevilla fc ?
SELECT "club" FROM table_204_256 WHERE "position" = (SELECT "position" FROM table_204_256 WHERE "club" = 'sevilla fc') + 1
CREATE TABLE table_1705429_1 ( no INTEGER, constituency VARCHAR )
Name the most number of leitrim
SELECT MAX(no) FROM table_1705429_1 WHERE constituency = "Leitrim"
CREATE TABLE table_201_25 ( id number, "party" text, "leader" text, "from" text, "to" text )
which party had only one leader and only a three year office term ?
SELECT "party" FROM table_201_25 GROUP BY "party" HAVING COUNT("leader") = 1 AND "to" - "from" = 3
CREATE TABLE Rooms ( decor VARCHAR, RoomId VARCHAR ) CREATE TABLE Reservations ( Room VARCHAR )
What kind of decor has the least number of reservations?
SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) LIMIT 1
CREATE TABLE table_name_54 ( date_of_vacancy VARCHAR, date_of_appointment VARCHAR )
what is the date of vacancy when the date of appointment is 1 january 2009?
SELECT date_of_vacancy FROM table_name_54 WHERE date_of_appointment = "1 january 2009"
CREATE TABLE table_name_32 ( game INTEGER, date VARCHAR )
What is the average game that has December 17 as the date?
SELECT AVG(game) FROM table_name_32 WHERE date = "december 17"
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, ...
Show all customer ids and the number of accounts for each customer. Show the correlation.
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id
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, ...
provide the number of patients whose age is less than 51 and diagnoses short title is preterm nec 2500+g?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "51" AND diagnoses.short_title = "Preterm NEC 2500+g"
CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address...
find the total checkins in Moroccan restaurant in ' Los Angeles
SELECT SUM(checkin.count) FROM business, category AS CATEGORY_0, category AS CATEGORY_1, checkin WHERE business.city = 'Los Angeles' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Moroccan' A...
CREATE TABLE table_name_55 ( chassis VARCHAR, points VARCHAR )
Which chassis scored 52 points?
SELECT chassis FROM table_name_55 WHERE points = 52
CREATE TABLE table_66108 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
What is the Romanji title for around40 on TBS?
SELECT "Romaji Title" FROM table_66108 WHERE "TV Station" = 'tbs' AND "Japanese Title" = 'around40〜注文の多いオンナたち〜'
CREATE TABLE table_name_32 ( tournament VARCHAR )
Name the tournament for 2012 grand slam tournaments
SELECT tournament FROM table_name_32 WHERE 2012 = "grand slam tournaments"
CREATE TABLE table_12261714_2 ( general_classification VARCHAR, stage VARCHAR )
Who's leading in the general classification in stage 1a?
SELECT general_classification FROM table_12261714_2 WHERE stage = "1a"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many patients have been discharged from the hospital in just since 2100?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) >= '2100'
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
show me the flights on friday from NEWARK to TAMPA
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 = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat...
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 procedures ( ...
provide the number of private health insurance patients who have had single internal mammary-coronary artery bypass.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Single internal mammary-coronary artery bypass"
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Total number of registered users over time. Shows the total number of registered users for every month since site inception.
WITH c AS (SELECT TIME_TO_STR(CreationDate, '%Y') AS Year, TIME_TO_STR(CreationDate, '%m') AS Month, TIME_TO_STR(CreationDate, '%d') AS Day FROM Users), d AS (SELECT Year, Month, Day, COUNT(*) OVER (PARTITION BY Year, Month, Day) AS Count FROM c), e AS (SELECT Year, Month, Day, Count FROM d GROUP BY Year, Month, Day, C...
CREATE TABLE table_27756164_2 ( game VARCHAR, high_rebounds VARCHAR )
In how many different games did Roy Hibbert (16) did the most high rebounds?
SELECT COUNT(game) FROM table_27756164_2 WHERE high_rebounds = "Roy Hibbert (16)"
CREATE TABLE table_44953 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the smallest round with a time of 1:12?
SELECT MIN("Round") FROM table_44953 WHERE "Time" = '1:12'
CREATE TABLE table_15876 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
Which positions were in Toronto in 2004?
SELECT "Position" FROM table_15876 WHERE "Years in Toronto" = '2004'
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 departments ( DEPARTMENT_ID decimal...
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 average of employee_id over the hire_date bin hire_date by weekday by a bar chart, could you sort by the y axis from low to high please?
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID)
CREATE TABLE table_21196 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who was the high rebound for the high assists of d. j. augustin (8)?
SELECT "High rebounds" FROM table_21196 WHERE "High assists" = 'D. J. Augustin (8)'
CREATE TABLE Songs ( SongId VARCHAR ) CREATE TABLE Band ( firstname VARCHAR, id VARCHAR ) CREATE TABLE Performance ( bandmate VARCHAR )
Find the first name of the band mate that has performed in most songs.
SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
how many patients have received a phenobarbital test?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'phenobarbital')
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
what is the top five most frequent output events in this year?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ...
CREATE TABLE table_27112 ( "Afghan" text, "Albanian" text, "Arabic" text, "Bangladeshi" text, "Bosnian" text, "Chinese" text, "Colombian" text, "Cook Islands" text )
how many bosnian in cook islands is macedonian
SELECT COUNT("Cook Islands") FROM table_27112 WHERE "Bosnian" = 'Macedonian'
CREATE TABLE table_27902171_4 ( high_assists VARCHAR, record VARCHAR )
Who had the high assist total when the team was 0-1?
SELECT high_assists FROM table_27902171_4 WHERE record = "0-1"
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there Plot them as bar chart, and rank by the x-axis from high to low.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country DESC
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
what are the top four most frequent diagnoses among patients of age 20s until 4 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
CREATE TABLE table_22367 ( "Voting order" real, "Country" text, "Spokespersons" text, "Commentator" text, "Broadcaster" text )
wich spokesperson talked on luxembourg
SELECT "Spokespersons" FROM table_22367 WHERE "Country" = 'Luxembourg'
CREATE TABLE table_name_63 ( round INTEGER, pick VARCHAR, player VARCHAR )
What round was jerry corcoran drafted in as pick number 114?
SELECT MAX(round) FROM table_name_63 WHERE pick > 114 AND player = "jerry corcoran"
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 ) ...
Specify the route of drug administration for Indomethacin
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Indomethacin"
CREATE TABLE table_52283 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
What was the report when Mario Andretti held pole position and Jean-Pierre Jarier had the fastest lap?
SELECT "Report" FROM table_52283 WHERE "Pole Position" = 'mario andretti' AND "Fastest Lap" = 'jean-pierre jarier'
CREATE TABLE table_204_363 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text )
what was the total number of wins ?
SELECT COUNT(*) FROM table_204_363 WHERE "res." = 'win'
CREATE TABLE table_name_4 ( venue VARCHAR, rank VARCHAR )
Which venue is rank 3?
SELECT venue FROM table_name_4 WHERE rank = "3"
CREATE TABLE table_204_477 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
which driver finished first in the 1998 marlboro grand prix of miami ?
SELECT "driver" FROM table_204_477 WHERE "pos" = 1
CREATE TABLE table_name_99 ( overall INTEGER, college VARCHAR, round VARCHAR )
What is the total number of overall figures when duke was the college and the round was higher than 7?
SELECT SUM(overall) FROM table_name_99 WHERE college = "duke" AND round > 7
CREATE TABLE table_15628 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the date of the game after week 6 with the New York Jets as the opponent?
SELECT "Date" FROM table_15628 WHERE "Week" > '6' AND "Opponent" = 'new york jets'
CREATE TABLE table_43192 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1980\u20131981 Team" text )
What was the 1980-1981 team of the player born in Warroad, Minnesota?
SELECT "1980\u20131981 Team" FROM table_43192 WHERE "Birthplace" = 'warroad, minnesota'
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, ...
ground transportation PHILADELPHIA
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code
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...
list the number of patients who are male and admission type is newborn.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "NEWBORN"
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
Top ten lowest scored answers with OwnerUserID.
SELECT 'id' AS "post_link", 'score', 'owneruserid' AS "user_link" FROM Posts WHERE 'posttypeid' = 2 AND 'score' < 0 ORDER BY 'score' LIMIT 10
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 whose diagnoses short title is mal neo liver, primary and drug route is pb?
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.short_title = "Mal neo liver, primary" AND prescriptions.route = "PB"
CREATE TABLE table_43041 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What is Away, when Home is Guelph Gargoyles?
SELECT "Away" FROM table_43041 WHERE "Home" = 'guelph gargoyles'
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget n...
Bar chart of how many building from each building, rank by the Y in asc.
SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY COUNT(building)
CREATE TABLE table_10812938_5 ( pick__number INTEGER, cfl_team VARCHAR )
What's the pick number of the player from Toronto Argonauts?
SELECT MIN(pick__number) FROM table_10812938_5 WHERE cfl_team = "Toronto Argonauts"
CREATE TABLE table_65371 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Name the the Best of rodolfo lav n
SELECT "Best" FROM table_65371 WHERE "Name" = 'rodolfo lavín'
CREATE TABLE table_11391954_3 ( Half INTEGER )
What is the minimum number for the half marathon (womens)?
SELECT MIN(Half) AS marathon__womens_ FROM table_11391954_3
CREATE TABLE table_29678 ( "Tournament" text, "Games played" real, "Points per game" text, "Rebounds per game" text, "Assists per game" text )
How many points per game did he have when he had 1.5 assists per game?
SELECT "Points per game" FROM table_29678 WHERE "Assists per game" = '1.5'
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
what is the monthly minimum of the weight of patient 20693 since 4 years ago?
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20693)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
CREATE TABLE table_26739 ( "Series No." real, "Episode No." real, "Title" text, "Directed by" text, "Written by" text, "UK Ratings (BBC2 Rank)" text, "Original air date" text )
Who wrote the episode what had the rating 2.27m (5)?
SELECT "Written by" FROM table_26739 WHERE "UK Ratings (BBC2 Rank)" = '2.27m (5)'
CREATE TABLE table_44686 ( "Conference" text, "Bids" real, "Record" text, "Win %" real, "Quarterfinals" text, "Semifinals" text, "Final" text, "Champions" text )
What is Bids, when Champions is '1'?
SELECT "Bids" FROM table_44686 WHERE "Champions" = '1'
CREATE TABLE table_name_12 ( silver VARCHAR, republic VARCHAR, total VARCHAR )
Can you tell me total number of Silver that has the Republic of latvian ssr, and the Total larger than 6?
SELECT COUNT(silver) FROM table_name_12 WHERE republic = "latvian ssr" AND total > 6
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id numb...
until 1 year ago, what were the four most common input events?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4)