instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what team was the visitor in the chicago game | CREATE TABLE table_name_33 (visitor VARCHAR,home VARCHAR) | SELECT visitor FROM table_name_33 WHERE home = "chicago" |
Tell me the championship for runner-up outcome of 2010 | CREATE TABLE table_31919 ("Outcome" text,"Year" real,"Championship" text,"Opponent in the final" text,"Score (l) = score in legs,(s) = score in sets." text) | SELECT "Championship" FROM table_31919 WHERE "Outcome" = 'runner-up' AND "Year" = '2010' |
what is patient 15754's yearly minimum level of protein, total since 2105? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)C... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15754) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein, total') AND STRFTIME('%y', labevents.charttime) >= '2105' GROUP BY... |
how many days has passed since the last time patient 15447 has had lactated ringers intake on the current intensive care unit visit? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 15447) AND icustays.outtime IS NULL) ... |
Show the number of accounts for each customer in a bar chart grouping by customer's last name, and rank x-axis in descending order. | CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,invoice_number INTEGER,product_id INTEGER,product_title VARCHAR(80),product_quantity VARCHAR(50),product_price DECIMAL(19,4),derived_product_cost DECIMAL(19,4),derived_vat_payable DECIMAL(19,4),derived_total_cost DECIMAL(19,4))CREATE TABLE Products (product_id INTE... | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_last_name DESC |
for the rank more than 1 and nationality of netherlands, what is the lane? | CREATE TABLE table_69150 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT AVG("Lane") FROM table_69150 WHERE "Nationality" = 'netherlands' AND "Rank" > '1' |
Which Total Pld has a Total Pts smaller than 153, and a 2004 05 Pts of 43, and a 2005 06 Pts smaller than 49? | CREATE TABLE table_61304 ("Team" text,"2003\u201304 Pts" text,"2004\u201305 Pts" text,"2005\u201306 Pts" real,"Total Pts" real,"Total Pld" real) | SELECT MIN("Total Pld") FROM table_61304 WHERE "Total Pts" < '153' AND "2004\u201305 Pts" = '43' AND "2005\u201306 Pts" < '49' |
For Appl of Radiation , are there any advisory prerequisites ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement v... | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Appl of Radiation%' |
What was the value in 2010 for the airport coded OTP/LROP? | CREATE TABLE table_name_62 (code__iata_icao_ VARCHAR) | SELECT MAX(2010) FROM table_name_62 WHERE code__iata_icao_ = "otp/lrop" |
Which Record has a Year larger than 1974, and a Finish of 3rd? | CREATE TABLE table_name_33 (record VARCHAR,year VARCHAR,finish VARCHAR) | SELECT record FROM table_name_33 WHERE year > 1974 AND finish = "3rd" |
How many distinct cause of the fire descriptions are there in the database? | CREATE TABLE fires (fire_year number,discovery_date number,discovery_doy number,discovery_time text,stat_cause_code number,stat_cause_descr text,cont_date text,cont_doy text,cont_time text,fire_size number,fire_size_class text,latitude number,longitude number,owner_code number,owner_descr text,state text,county text,fi... | SELECT COUNT(DISTINCT stat_cause_descr) FROM fires |
Name the record when attendance 42827 | CREATE TABLE table_1146 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real) | SELECT "Record" FROM table_1146 WHERE "Attendance" = '42827' |
What is the lowest value for Points, when Games is greater than 34, and when Name is Andrew Panko? | CREATE TABLE table_42025 ("Rank" real,"Name" text,"Team" text,"Games" real,"Points" real) | SELECT MIN("Points") FROM table_42025 WHERE "Games" > '34' AND "Name" = 'andrew panko' |
give me the number of patients whose admission year is less than 2121 and diagnoses short title is constipation nos? | 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)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2121" AND diagnoses.short_title = "Constipation NOS" |
what are the flights from ORLANDO to KANSAS CITY | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufactu... | 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 = 'ORLANDO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS... |
when was patient morgan mcgee discharged? also specify his primary disease | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.name = "Morgan Mcgee" |
What is Launched, when Commissioned is '25 July 1998'? | CREATE TABLE table_61233 ("Ship" text,"Hull Number" text,"Laid down" text,"Launched" text,"Commissioned" text) | SELECT "Launched" FROM table_61233 WHERE "Commissioned" = '25 july 1998' |
A bar chart about how many departments are in each school? | CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCH... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT |
Give me the number of the dates when the max temperature was higher than 85. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city T... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 |
in their first hospital encounter what was the first time of patient 25628's microbiology test? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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,insurance text,language text,marital_status t... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25628 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY microbiologyevents.charttime LIMIT 1 |
What Population has a Median family income of $38,044? | CREATE TABLE table_name_18 (population VARCHAR,median_family_income VARCHAR) | SELECT population FROM table_name_18 WHERE median_family_income = "$38,044" |
What are the profits (in billions) of the company with a market value of 172.9 billion? | CREATE TABLE table_21112 ("Rank" real,"Company" text,"Headquarters" text,"Industry" text,"Sales (billion $)" text,"Profits (billion $)" text,"Assets (billion $)" text,"Market Value (billion $)" text) | SELECT "Profits (billion $)" FROM table_21112 WHERE "Market Value (billion $)" = '172.9' |
What is the 2009 when 2012 is Year-End Championship? | CREATE TABLE table_name_38 (Id VARCHAR) | SELECT 2009 FROM table_name_38 WHERE 2012 = "year-end championship" |
WHAT IS THE LOWEST DIAMETER FOR A LATITIDE OF 52.0S? | CREATE TABLE table_name_78 (diameter__km_ INTEGER,latitude VARCHAR) | SELECT MIN(diameter__km_) FROM table_name_78 WHERE latitude = "52.0s" |
What is the largest crowd with Home team of hawthorn? | CREATE TABLE table_53188 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_53188 WHERE "Home team" = 'hawthorn' |
Give me a bar chart for how many competition type of each competition type | CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE club_rank (... | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type |
make a count of the number of patients who are discharged from the hospital during this year. | 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,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
Top 100 most upvoted comments. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT Score, Id, PostId AS "post_link", Id AS "comment_link", UserId AS "user_link" FROM Comments WHERE Id > 97900000 AND Text LIKE '%Thank%' AND LENGTH(Text) < 18 ORDER BY Id LIMIT 100 |
What was the title of the episode written by Keith Temple? | CREATE TABLE table_2406 ("Episode No." real,"Series No." real,"Title" text,"Directed by" text,"Written by" text,"Viewers (millions)" text,"Original airdate" text) | SELECT "Title" FROM table_2406 WHERE "Written by" = 'Keith Temple' |
when is patient 702 prescribed the drug for the last time on their last hospital encounter? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,di... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 702 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1 |
Which Country has a To par of 2, and a Player of jim thorpe? | CREATE TABLE table_62392 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Country" FROM table_62392 WHERE "To par" = '–2' AND "Player" = 'jim thorpe' |
Count the number of colors. | CREATE TABLE product_characteristics (product_id number,characteristic_id number,product_characteristic_value text)CREATE TABLE ref_colors (color_code text,color_description text)CREATE TABLE ref_product_categories (product_category_code text,product_category_description text,unit_of_measure text)CREATE TABLE products ... | SELECT COUNT(*) FROM ref_colors |
which date did a team score 4 points ? | CREATE TABLE table_203_675 (id number,"match" number,"date" text,"round" text,"home/away" text,"opponent team" text,"score" text,"scorers" text) | SELECT "date" FROM table_203_675 WHERE "score" = 4 |
which type of admission did patient with patient id 6983 have? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "6983" |
Which title has xbox as the platform with a year prior to 2006? | CREATE TABLE table_80124 ("Title" text,"Year" real,"Developer" text,"Publisher" text,"Platform" text) | SELECT "Title" FROM table_80124 WHERE "Platform" = 'xbox' AND "Year" < '2006' |
team that won before mazowszanka pekaes pruszk w | CREATE TABLE table_203_341 (id number,"season" text,"champion" text,"runner-up" text,"score" text,"third place" text) | SELECT "champion" FROM table_203_341 WHERE "season" < (SELECT "season" FROM table_203_341 WHERE "champion" = 'mazowszanka pekaes pruszkow') ORDER BY "season" DESC LIMIT 1 |
What was the away team that played at Corio Oval? | CREATE TABLE table_name_9 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_9 WHERE venue = "corio oval" |
how big is the difference in patient 006-254182's weight measured at 2104-09-10 20:41:00 compared to the value measured at 2104-09-08 21:57:00? | 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,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitst... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2104-09-10 20:41:00') - (SELECT patient.admissionweight FROM ... |
Which venue has a Score of 1 0, and a Competition of 2002 world cup qualifier? | CREATE TABLE table_10865 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_10865 WHERE "Score" = '1–0' AND "Competition" = '2002 world cup qualifier' |
When they played at Chicago Bulls, what was the Location/Attendance? | CREATE TABLE table_46152 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Location/Attendance" FROM table_46152 WHERE "Opponent" = 'at chicago bulls' |
What is the lowest when pohang steelyard is the stadium? | CREATE TABLE table_73341 ("Team" text,"Stadium" text,"Match played" text,"Highest" real,"Lowest" real,"Average" real) | SELECT "Lowest" FROM table_73341 WHERE "Stadium" = 'Pohang Steelyard' |
Which vehicle has a class 6c3g? | CREATE TABLE table_name_20 (vehicle VARCHAR,class VARCHAR) | SELECT vehicle FROM table_name_20 WHERE class = "6c3g" |
Who has canidae as family and canis rufus audubon & bachman, 1851 as species/authority? | CREATE TABLE table_name_24 (name VARCHAR,family VARCHAR,species_authority VARCHAR) | SELECT name FROM table_name_24 WHERE family = "canidae" AND species_authority = "canis rufus audubon & bachman, 1851" |
how many widowed patients have procedure icd9 code 5771? | 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,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "5771" |
What is the maturity date of the ISIN labeled DE000A0BVBN3? | CREATE TABLE table_2488 ("Issuer" text,"Issue Date" text,"ISIN" text,"Amount Issued [\u20ac]" text,"Coupon" text,"Maturity" text) | SELECT "Maturity" FROM table_2488 WHERE "ISIN" = 'DE000A0BVBN3' |
What year is guard Mario Chalmers? | CREATE TABLE table_5731 ("Name" text,"Position" text,"Height" text,"Weight" real,"Year" text,"Home Town" text) | SELECT "Year" FROM table_5731 WHERE "Position" = 'guard' AND "Name" = 'mario chalmers' |
what is patient 006-35134's minimum heartrate, on 07/07/this year? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid ... | SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-35134')) AND NOT vitalperiodic.heartrate IS NULL... |
How many accounts for different statement details? Draw a bar chart, list by the bars in descending. | CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Projects (Pro... | SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details DESC |
How many total catagories are there for La Paz? | CREATE TABLE table_21249915_1 (total VARCHAR,department VARCHAR) | SELECT COUNT(total) FROM table_21249915_1 WHERE department = "La Paz" |
What pick in round 5 did the 49ers pick Jim Pilot? | CREATE TABLE table_name_69 (pick INTEGER,player VARCHAR,round VARCHAR) | SELECT SUM(pick) FROM table_name_69 WHERE player = "jim pilot" AND round > 5 |
Which Country has a IATA of vie? | CREATE TABLE table_name_32 (country VARCHAR,iata VARCHAR) | SELECT country FROM table_name_32 WHERE iata = "vie" |
when did patient 73693 the last time had urine out foley output on last month/06? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiolog... | 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 = 73693)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... |
Visualize a bar chart for how many books fall into each category?, order by the Y in ascending. | CREATE TABLE movie (movie_id int,Title text,Year int,Director text,Budget_million real,Gross_worldwide int)CREATE TABLE culture_company (Company_name text,Type text,Incorporated_in text,Group_Equity_Shareholding real,book_club_id text,movie_id text)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) |
how many patients diagnosed under icd9 code 34830 were admitted before the year 2157? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.icd9_code = "34830" |
Which of the 400 -level courses are n't courses with labs ? | 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 int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400 |
Find the name all districts with city area greater than 10 or population larger than 100000 | CREATE TABLE district (district_name VARCHAR,city_area VARCHAR,City_Population VARCHAR) | SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000 |
For Other classes , what is the average difficulty ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname 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 int,grade... | SELECT AVG(workload) FROM program_course WHERE category LIKE '%Other%' |
What is Director, when Result is nominee, and when Year (Ceremony) is 1969 (42nd)? | CREATE TABLE table_name_65 (director VARCHAR,result VARCHAR,year__ceremony_ VARCHAR) | SELECT director FROM table_name_65 WHERE result = "nominee" AND year__ceremony_ = "1969 (42nd)" |
What's the Finish rank of 31? | CREATE TABLE table_80352 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Finish" FROM table_80352 WHERE "Rank" = '31' |
how many patients whose marital status is single and diagnoses long title is late effects of cerebrovascular disease, hemiplegia affecting unspecified side? | 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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side" |
what was the last time patient 006-195316 received a prescription for trazodone, since 09/2105? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitst... | 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 = '006-195316')) AND medication.drugname = 'trazodone' AND STRFTI... |
how many patients whose admission type is newborn and drug route is po/ng? | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "PO/NG" |
How many winning teams are there on LMP2 if Gabriele Gardel Patrice Goueslard Fernando Rees was the GT1 Winning Team on the Algarve circuit? | CREATE TABLE table_27149 ("Rnd." real,"Circuit" text,"LMP1 Winning Team" text,"LMP2 Winning Team" text,"FLM Winning Team" text,"GT1 Winning Team" text,"GT2 Winning Team" text,"Results" text) | SELECT COUNT("LMP2 Winning Team") FROM table_27149 WHERE "GT1 Winning Team" = 'Gabriele Gardel Patrice Goueslard Fernando Rees' AND "Circuit" = 'Algarve' |
What is the highest number of bronzes for teams ranked number 7 with more than 0 silver? | CREATE TABLE table_76003 ("Rank" real,"Republic" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Bronze") FROM table_76003 WHERE "Silver" > '0' AND "Rank" = '7' |
What is the name for the best of 1:45.361? | CREATE TABLE table_44255 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text) | SELECT "Name" FROM table_44255 WHERE "Best" = '1:45.361' |
Day of Week Most Popular for Posting. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CR... | Go |
Which episode was directed by Jean de Segonzac? | CREATE TABLE table_16364 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT "Title" FROM table_16364 WHERE "Directed by" = 'Jean de Segonzac' |
What's the total Lost that has a Played that's larger than 42? | CREATE TABLE table_name_35 (lost INTEGER,played INTEGER) | SELECT SUM(lost) FROM table_name_35 WHERE played > 42 |
how many total times has the jnp been the winning party ? | CREATE TABLE table_203_398 (id number,"year" number,"vidhan sabha" text,"members of legislative assembly" text,"winning party" text,"nearest contesting party" text) | SELECT COUNT(*) FROM table_203_398 WHERE "winning party" = 'jnp' |
What is the highest poplulation in July 2012 in the country with an area of 2149690 square kilometers? | CREATE TABLE table_20923 ("Country" text,"Region" text,"Joined OPEC" real,"Population (July 2012)" real,"Area (km\u00b2)" real,"Production (bbl /day)" text) | SELECT MAX("Population (July 2012)") FROM table_20923 WHERE "Area (km\u00b2)" = '2149690' |
How many Lost have a Team of flamengo, and an Against smaller than 5? | CREATE TABLE table_name_92 (lost VARCHAR,team VARCHAR,against VARCHAR) | SELECT COUNT(lost) FROM table_name_92 WHERE team = "flamengo" AND against < 5 |
What was the 2011 gross revenue for the venue that had a gross revenue of $156,315 in 1982? | CREATE TABLE table_name_78 (gross_revenue__2011_ VARCHAR,gross_revenue__1982_ VARCHAR) | SELECT gross_revenue__2011_ FROM table_name_78 WHERE gross_revenue__1982_ = "$156,315" |
show me the last ward identification of patient 030-40287 until 2 years ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid n... | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-40287') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.unitadmittime DESC LIMIT 1 |
What is Place, when Score is '73-71=144', and when Player is 'Scott Simpson'? | CREATE TABLE table_48026 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_48026 WHERE "Score" = '73-71=144' AND "Player" = 'scott simpson' |
For the next semester , how many REES classes are offered ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester i... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'REES' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Which shoulder charge has restricted as the body tackle? | CREATE TABLE table_name_45 (shoulder_charge VARCHAR,body_tackle VARCHAR) | SELECT shoulder_charge FROM table_name_45 WHERE body_tackle = "restricted" |
Find the name and salary of the instructors who are advisors of any student from History department? | CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,tim... | SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History' |
What district did Donald Ray Matthews belong to? | CREATE TABLE table_18401 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "District" FROM table_18401 WHERE "Incumbent" = 'Donald Ray Matthews' |
What is the date when the opponent is the New England Patriots? | CREATE TABLE table_18847736_2 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_18847736_2 WHERE opponent = "New England Patriots" |
What rank is the nation that has a bronze of source: Maltese Olympic Committee? | CREATE TABLE table_name_29 (rank VARCHAR,bronze VARCHAR) | SELECT rank FROM table_name_29 WHERE bronze = "source: maltese olympic committee" |
What 1976 has a Tournament of overall win loss? | CREATE TABLE table_name_67 (tournament VARCHAR) | SELECT 1976 FROM table_name_67 WHERE tournament = "overall win – loss" |
tag wiki's and excerpts that might contain migration advice. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)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)CREATE T... | SELECT p.Id AS "post_link", Body, pt.Name FROM Posts AS p INNER JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE PostTypeId IN (4, 5) AND (Body LIKE '%superuser.com%' OR Body LIKE '%serverfault.com%' OR Body LIKE '%.stackexchange.com%') |
what drug is actually the drug that patient 022-47102 is allergic to during their last hospital encounter? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patientheal... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47102' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... |
Who was the opponent at the week 4 game? | CREATE TABLE table_12812 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Opponent" FROM table_12812 WHERE "Week" = '4' |
What is the 1st prize of the tournament in Scotland? | CREATE TABLE table_name_95 (location VARCHAR) | SELECT 1 AS st_prize___$__ FROM table_name_95 WHERE location = "scotland" |
What was the result of the 2007 gulf cup of nations? | CREATE TABLE table_name_39 (result VARCHAR,competition VARCHAR) | SELECT result FROM table_name_39 WHERE competition = "2007 gulf cup of nations" |
Which city had the charleston area convention center as its callback location | CREATE TABLE table_11129123_1 (audition_city VARCHAR,callback_venue VARCHAR) | SELECT audition_city FROM table_11129123_1 WHERE callback_venue = "Charleston Area Convention Center" |
when did since 09/2105 patient 025-44495 last receive a microbiology test? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid numbe... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= ... |
Which Home Town has a Took Office of 1983, and a District larger than 15? | CREATE TABLE table_50939 ("Senator" text,"Party" text,"District" real,"Home Town" text,"Took Office" real) | SELECT "Home Town" FROM table_50939 WHERE "Took Office" = '1983' AND "District" > '15' |
I want to know the 2013 when 2001 was wta premier 5 tournaments | CREATE TABLE table_55665 ("Tournament" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text) | SELECT "2013" FROM table_55665 WHERE "2001" = 'wta premier 5 tournaments' |
iPhone thread volume with accepted answers by month. | 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,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT COUNT(*) AS AnsweredVolume, TIME_TO_STR(P.CreationDate, '%Y') AS Year, TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<iphone%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId > 0 GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_... |
What is Justin Leonard with a To par of 7's Score? | CREATE TABLE table_12811 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_12811 WHERE "To par" = '–7' AND "Player" = 'justin leonard' |
What score has january 19 as the date? | CREATE TABLE table_50987 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text) | SELECT "Score" FROM table_50987 WHERE "Date" = 'january 19' |
Show the number of documents in different starting date and bin starting date by weekday interval with a bar chart, list in ascending by the Y-axis. | CREATE TABLE Ref_Calendar (Calendar_Date DATETIME,Day_Number INTEGER)CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destruction_Authorised_by_Employee_ID INTEGER,Destroyed_by_Employee_ID INTEGER,Planned_Destruction_Date DATETIME,Actual_Destruction_Date DATETIME,Other_Details VARCHAR(255))CREATE TABLE Ref_D... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From) |
What is the weight when 20 is the number? | CREATE TABLE table_2625 ("Name" text,"#" real,"Position" text,"Height" text,"Weight" real,"Year" text,"Home Town" text,"High School" text) | SELECT MAX("Weight") FROM table_2625 WHERE "#" = '20' |
StackOverflow Users by Location and Skill sorted by Average Score. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId numbe... | SELECT DISTINCT Users.Id, Users.DisplayName, Users.Location, Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_score", Users.AboutMe AS About, Users.Reputation AS Reputation FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND Commu... |
Show me how many home team by home team in a histogram | CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team text,Score text,Competition text)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendan... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team |
What was the team's record at the game attended by 30,452? | CREATE TABLE table_66968 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Record" FROM table_66968 WHERE "Attendance" = '30,452' |
count the number of patients with drug code thiam100i who were born before 1821. | 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 (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1821" AND prescriptions.formulary_drug_cd = "THIAM100I" |
Which area has Years of 1 8, a Decile smaller than 7, and a Name of waikari school? | CREATE TABLE table_67630 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real) | SELECT "Area" FROM table_67630 WHERE "Years" = '1–8' AND "Decile" < '7' AND "Name" = 'waikari school' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.