instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many patients have gotten discharged from the hospital this year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage tex... | 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') |
How much Against has Draws of 2, and Losses smaller than 4? | CREATE TABLE table_name_17 (against INTEGER,draws VARCHAR,losses VARCHAR) | SELECT SUM(against) FROM table_name_17 WHERE draws = 2 AND losses < 4 |
in the 1974-75 golden seals hockey season , how many draft picks were canadian ? | CREATE TABLE table_204_385 (id number,"round" number,"pick" number,"player" text,"nationality" text,"college/junior/club team" text) | SELECT COUNT("pick") FROM table_204_385 WHERE "nationality" = 'canada' |
how many willy deville albums have reached the chart ? | CREATE TABLE table_204_471 (id number,"year" number,"title" text,"peak chart positions\nger" number,"label" text,"artist" text) | SELECT COUNT("title") FROM table_204_471 WHERE "artist" = 'willy deville' AND NOT "peak chart positions\nger" IS NULL |
When 3rd, sedgemoor division 1 is the ladies 1st xi what is the mens 3rd xi? | CREATE TABLE table_21576644_2 (mens_3rd_xi VARCHAR,ladies_1st_xi VARCHAR) | SELECT mens_3rd_xi FROM table_21576644_2 WHERE ladies_1st_xi = "3rd, Sedgemoor Division 1" |
Which heat, semifinal or final has a time of 48.97? | CREATE TABLE table_name_41 (heat_semifinal_final VARCHAR,time VARCHAR) | SELECT heat_semifinal_final FROM table_name_41 WHERE time = "48.97" |
Which County has an IHSAA Class of aaaa, and a Mascot of cardinals? | CREATE TABLE table_64064 ("School" text,"City" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"County" text) | SELECT "County" FROM table_64064 WHERE "IHSAA Class" = 'aaaa' AND "Mascot" = 'cardinals' |
for the robot black nickname, what framed size is used | CREATE TABLE table_15070195_1 (framed_size VARCHAR,nickname VARCHAR) | SELECT framed_size FROM table_15070195_1 WHERE nickname = "Robot Black" |
Are there many lecture sections offered for JAZZ 467 next semester ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqna... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'JAZZ' AND course.number = 467 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
what would be final four mvp maximum when first team is 1 | CREATE TABLE table_3466 ("Player" text,"Number Of Selections" real,"First Team" real,"Second Team" real,"Season MVP" real,"Final Four MVP" real) | SELECT MAX("Final Four MVP") FROM table_3466 WHERE "First Team" = '1' |
Draw a bar chart for what is the average high temperature for each day of week?, and list in descending by the X. | CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE route (train_id int,station_id int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE train (id int,train_number int,name t... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC |
Return a bar chart about the distribution of All_Road and ACC_Percent , and rank in desc by the X-axis. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC |
What was the name that had a starting price of 11/1 and a jockey named Garrett Cotter? | CREATE TABLE table_73218 ("Starting price" text,"Number" real,"Name" text,"Age" real,"Weight (st,lb)" text,"Jockey" text,"Trainer" text,"Owner" text,"Colours" text) | SELECT "Name" FROM table_73218 WHERE "Starting price" = '11/1' AND "Jockey" = 'Garrett Cotter' |
Find the number of products with category 'Spices' and typically sold above 1000. | CREATE TABLE ref_characteristic_types (characteristic_type_code text,characteristic_type_description text)CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteristic_data_type text,characteristic_name text,other_characteristic_details text)CREATE TABLE products (product_id number... | SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000 |
name a racer that had at least 20 points . | CREATE TABLE table_204_214 (id number,"pos" text,"no." number,"rider" text,"manufacturer" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT "rider" FROM table_204_214 WHERE "points" > 20 |
Questions which no longer have the given tag (including the editor). | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment ... | WITH revisions_cte AS (SELECT DISTINCT p.Id AS pid, ph1.Id AS phId FROM PostHistory AS ph1 INNER JOIN Posts AS p ON ph1.PostId = p.Id WHERE ph1.PostHistoryTypeId IN (3, 6, 9) AND ph1.Text LIKE '%<##tagName##>%' AND NOT (p.Tags LIKE '%<##tagName##>%')), firstrev_cte AS (SELECT pid, MIN(ph2.Id) AS MinId FROM revisions_ct... |
what flights leave from PHOENIX to anywhere | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (per... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHOENIX' AND flight.from_airport = airport_service.airport_code |
what city has the largest density recorded ? | CREATE TABLE table_204_381 (id number,"sum" number,"mongolian" number,"population\n(2005)" number,"population\n(2008)" number,"population\n(2009)" number,"area\nkm2" number,"density\n/km2" number,"sum centre\npopulation" number) | SELECT "sum" FROM table_204_381 ORDER BY "density\n/km2" DESC LIMIT 1 |
What was the away team score at Hawthorn's home game? | CREATE TABLE table_name_28 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_28 WHERE home_team = "hawthorn" |
return me the number of papers by ' H. V. Jagadish ' on PVLDB after 2000 . | CREATE TABLE domain_journal (did int,jid int)CREATE TABLE domain_author (aid int,did int)CREATE TABLE domain (did int,name varchar)CREATE TABLE journal (homepage varchar,jid int,name varchar)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varchar,year int)CREA... | SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND journal.name = 'PVLDB' AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of code , and group by attribute founder in a bar chart, display in ascending by the X please. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder |
Show all distinct building descriptions. | CREATE TABLE apartment_buildings (building_id number,building_short_name text,building_full_name text,building_description text,building_address text,building_manager text,building_phone text)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count... | SELECT DISTINCT building_description FROM apartment_buildings |
what is the least laps when the grid is 5? | CREATE TABLE table_name_94 (laps INTEGER,grid VARCHAR) | SELECT MIN(laps) FROM table_name_94 WHERE grid = 5 |
What is every production code for episode # 13? | CREATE TABLE table_2342078_2 (production_code__order_they_were_made___number VARCHAR,episode__number VARCHAR) | SELECT production_code__order_they_were_made___number FROM table_2342078_2 WHERE episode__number = 13 |
Name the successor for pennsylvania 15th | CREATE TABLE table_1958768_3 (successor VARCHAR,district VARCHAR) | SELECT successor FROM table_1958768_3 WHERE district = "Pennsylvania 15th" |
Show aircraft names and number of flights for each aircraft, and show from low to high by the X. | CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE T... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name |
provide the number of patients whose drug name is neo*iv*clindamycin? | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NEO*IV*Clindamycin" |
What is Player Kenny Williams' Height? | CREATE TABLE table_name_53 (height VARCHAR,player VARCHAR) | SELECT height FROM table_name_53 WHERE player = "kenny williams" |
Show the number of documents for different document name in a bar chart. | CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Documents (Document_ID INTE... | SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name |
Select doubts from mobile test tools appium. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBase... | SELECT p.Id, p.Title, p.Tags, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate >= '2015-01-01 23:59:00.000' AND t.TagName IN ('appium', 'monkey', 'android') |
how many patients who had (aorto)coronary bypass of two coronary arteries were hospitalized for more than 6 days? | 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 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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries" |
which players are not part of the united states ? | CREATE TABLE table_204_263 (id number,"pick" number,"player" text,"country of origin" text,"pba team" text,"college" text) | SELECT "player" FROM table_204_263 WHERE "country of origin" <> 'united states' |
who came in first place ? | CREATE TABLE table_204_14 (id number,"rank" number,"bib" number,"athlete" text,"country" text,"time" text,"deficit" text,"note" text) | SELECT "athlete" FROM table_204_14 WHERE "rank" = 1 |
What is the title of the episode with production code 406? | CREATE TABLE table_2453243_5 (title VARCHAR,production_code VARCHAR) | SELECT title FROM table_2453243_5 WHERE production_code = "406" |
What is the Date of the game with a Score of 3 1 and Record of 1 1 0? | CREATE TABLE table_name_70 (date VARCHAR,score VARCHAR,record VARCHAR) | SELECT date FROM table_name_70 WHERE score = "3–1" AND record = "1–1–0" |
Name the least attendance | CREATE TABLE table_1192 ("Tie No." real,"Home team" text,"Score" text,"Away team" text,"Report" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_1192 |
what is the count of patients who were diagnosed with nausea within 2 months after having been diagnosed with atrial fibrillation until 2104? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,orga... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nausea' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, diagnos... |
resting heart rate > 100 bpm; | CREATE TABLE table_train_147 ("id" int,"pregnancy_or_lactation" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"obesity" bool,"fasting_blood_glucose_fbg" float,"heart_rate" int,"body_mass_index_bmi" float,"underweight" bool,"NOUSE" float) | SELECT * FROM table_train_147 WHERE heart_rate > 100 |
Which Special the Social Sciences classes have 13 credits ? | 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_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Special the Social Sciences%' OR name LIKE '%Special the Social Sciences%') AND credits = 13 |
Rough Average Number of Characters in an Answer. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body te... | SELECT AVG(LENGTH(ph.Text)) FROM Posts AS p LEFT JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE p.PostTypeId = 1 AND ph.PostHistoryTypeId IN (2, 5) |
the arterial bp [diastolic] of patient 15447 second measured on the current intensive care unit visit is less than the value first measured on the current intensive care unit visit? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to order Name from low to high order. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name |
how many patients whose admission location is transfer from hosp/extram and lab test fluid is joint fluid? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.fluid = "Joint Fluid" |
What was the date of the week 9 game? | CREATE TABLE table_name_76 (date VARCHAR,week VARCHAR) | SELECT date FROM table_name_76 WHERE week = 9 |
what laboratory test was given to patient 70206 for the first time until 25 months ago? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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_diagn... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70206) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-25 month') ORDER BY labevents.charttime LI... |
how many days have elapsed since the first time that patient 3929 received a anion gap laboratory test on this hospital encounter? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto 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_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions... |
When did Collingwood play an away game? | CREATE TABLE table_name_53 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_53 WHERE away_team = "collingwood" |
What is the emissions CO2 with a max speed of km/h (mph) of the car model Panamera 4s? | CREATE TABLE table_46530 ("car model" text,"displacement & configuration" text,"max. motive power @ rpm" text,"max. torque @ rpm" text,"max. speed" text,"emissions CO2" text) | SELECT "emissions CO2" FROM table_46530 WHERE "max. speed" = 'km/h (mph)' AND "car model" = 'panamera 4s' |
What is Date, when Team is Holden Racing Team, and when Circuit is Eastern Creek Raceway? | CREATE TABLE table_name_40 (date VARCHAR,team VARCHAR,circuit VARCHAR) | SELECT date FROM table_name_40 WHERE team = "holden racing team" AND circuit = "eastern creek raceway" |
Show the number of customer address history for each city in a bar chart, and order Y-axis in desc order please. | CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_date DATETIME,order_status_code VARCHAR(15))CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(15),customer_number VARCHAR(20),customer_name VARCHAR(80),customer_address VARCHAR(255),customer_phone VARCHAR(80),customer_email V... | SELECT T3.city, COUNT(T3.city) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T3.city ORDER BY COUNT(T3.city) DESC |
how many stops are on all flights from BOSTON to SAN FRANCISCO that depart before 1200 | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE equipment_sequen... | SELECT DISTINCT flight.stops FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.air... |
give me the number of patients whose primary disease is abdominal abscess and days of hospital stay is greater than 8? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.days_stay > "8" |
Which party was the incumbent from when the cadidates were henry e. barbour (r) 52.1% henry hawson (d) 47.9%? Answer: Democratic | CREATE TABLE table_1346118_5 (party VARCHAR,candidates VARCHAR) | SELECT COUNT(party) FROM table_1346118_5 WHERE candidates = "Henry E. Barbour (R) 52.1% Henry Hawson (D) 47.9%" |
How many tasks does each project have? List the task count and the project detail. | CREATE TABLE Projects (project_details VARCHAR,project_id VARCHAR)CREATE TABLE Tasks (project_id VARCHAR) | SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id |
What Country is Catalogue # ASW 50248 (724385024825) from? | CREATE TABLE table_name_77 (country VARCHAR,catalogue__number VARCHAR) | SELECT country FROM table_name_77 WHERE catalogue__number = "asw 50248 (724385024825)" |
how many premieres had the episode that had 12.68 millions of north american viewers? | CREATE TABLE table_2791668_1 (original_air_date VARCHAR,us_viewers__millions_ VARCHAR) | SELECT COUNT(original_air_date) FROM table_2791668_1 WHERE us_viewers__millions_ = "12.68" |
When Prof. Michelle Kees teaches UKRAINE 451 , does it have a lab ? | 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 COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'UKRA... |
When was series premiere on the pilot episode | CREATE TABLE table_20313 ("Series" text,"Episodes" real,"Series premiere" text,"Series finale" text,"Region 1" text,"Region 2" text,"Region 4" text) | SELECT "Series premiere" FROM table_20313 WHERE "Series" = 'Pilot' |
What was the tv time for the game on week 12? | CREATE TABLE table_name_76 (tv_time VARCHAR,week VARCHAR) | SELECT tv_time FROM table_name_76 WHERE week = 12 |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the first_name by a bar chart, and could you show X-axis in descending order? | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varc... | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC |
What school is in hillsboro city? | CREATE TABLE table_36468 ("School" text,"Team" text,"City" text,"State" text,"Conference" text) | SELECT "School" FROM table_36468 WHERE "City" = 'hillsboro' |
What is the Score of the match on August 23, 2004? | CREATE TABLE table_50157 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Score" FROM table_50157 WHERE "Date" = 'august 23, 2004' |
What is the highest Current Branch Opened, when Neighborhood is W. Portland Park? | CREATE TABLE table_name_79 (current_branch_opened INTEGER,neighborhood VARCHAR) | SELECT MAX(current_branch_opened) FROM table_name_79 WHERE neighborhood = "w. portland park" |
Tell me the lowest wins for class of 50cc and team of tomos for year less than 1969 | CREATE TABLE table_31757 ("Year" real,"Class" text,"Team" text,"Points" real,"Rank" text,"Wins" real) | SELECT MIN("Wins") FROM table_31757 WHERE "Class" = '50cc' AND "Team" = 'tomos' AND "Year" < '1969' |
Rank 6 has what notes? | CREATE TABLE table_name_10 (notes VARCHAR,rank VARCHAR) | SELECT notes FROM table_name_10 WHERE rank = 6 |
Tell me the lowest Laps with a time/retired of +2 Laps and Grid of 20 | CREATE TABLE table_53100 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MIN("Laps") FROM table_53100 WHERE "Time/Retired" = '+2 laps' AND "Grid" = '20' |
Among married patients, how many were born before the year 2052? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dob_year < "2052" |
What is the smallest Satu Mare value associated with Baia Mare over 523? | CREATE TABLE table_name_37 (satu_mare INTEGER,baia_mare INTEGER) | SELECT MIN(satu_mare) FROM table_name_37 WHERE baia_mare > 523 |
What is the highest goals against when points are larger than 31, the goal difference is smaller than 9, wins are 13, and draws are larger than 6? | CREATE TABLE table_name_12 (goals_against INTEGER,draws VARCHAR,wins VARCHAR,points VARCHAR,goal_difference VARCHAR) | SELECT MAX(goals_against) FROM table_name_12 WHERE points > 31 AND goal_difference < 9 AND wins = 13 AND draws > 6 |
With 1 Gold, more than 2 Bronze and Total greater than 1, what is the Silver? | CREATE TABLE table_55382 ("Sport" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Silver") FROM table_55382 WHERE "Total" > '1' AND "Gold" = '1' AND "Bronze" > '2' |
What is the average capacity for the farm at Gortahile having more than 8 turbines? | CREATE TABLE table_36344 ("Wind Farm" text,"Scheduled" text,"Capacity (MW)" real,"Turbines" real,"Type" text,"Location" text) | SELECT AVG("Capacity (MW)") FROM table_36344 WHERE "Wind Farm" = 'gortahile' AND "Turbines" > '8' |
What is the avg start that starts at 30? | CREATE TABLE table_1458412_1 (avg_start VARCHAR,starts VARCHAR) | SELECT avg_start FROM table_1458412_1 WHERE starts = 30 |
Who had the fastest lap when the winning driver is giorgio sanna? | CREATE TABLE table_26920192_5 (fastest_lap VARCHAR,winning_driver VARCHAR) | SELECT fastest_lap FROM table_26920192_5 WHERE winning_driver = "Giorgio Sanna" |
What is the score of the away team who played home team Hawthorn? | CREATE TABLE table_name_21 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_21 WHERE home_team = "hawthorn" |
SELECT CreationDate FROM Posts WHERE Id BETWEEN 20 AND 30. | CREATE TABLE PostsWithDeleted (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,Ta... | SELECT CreationDate FROM Posts WHERE Id BETWEEN 20 AND 30 |
how do i get downtown from the TORONTO airport | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_interval (period text,begin_time int,end_time i... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'TORONTO' AND ground_service.airport_code = airport.airport_code |
Which catalogue has essential, castle music as it's label? | CREATE TABLE table_name_46 (catalogue VARCHAR,label VARCHAR) | SELECT catalogue FROM table_name_46 WHERE label = "essential, castle music" |
Total DTD (Range) 'google-classroom' Tag + 'classroom' in Title. | 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 Id AS "post_link", CreationDate, Tags FROM Posts WHERE Title LIKE '%classroom%' AND Posts.Tags COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%google-classroom%' AND CreationDate BETWEEN @StartDate AND @EndDate ORDER BY CreationDate |
Name the most total with to par more than 16 | CREATE TABLE table_6196 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text) | SELECT MAX("Total") FROM table_6196 WHERE "To par" > '16' |
How many assists does David Tomlinson have? | CREATE TABLE table_name_71 (assists INTEGER,player VARCHAR) | SELECT SUM(assists) FROM table_name_71 WHERE player = "david tomlinson" |
how many patients were prescribed the drug sodium chloride 0.9 % iv soln bolus within 2 months after being diagnosed with esrd (end stage renal disease), since 1 year ago? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'esrd (end stage renal disease)' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year')... |
How many PATAs does an nForce Professional 3400 MCP have? | CREATE TABLE table_name_38 (pata INTEGER,model VARCHAR) | SELECT SUM(pata) FROM table_name_38 WHERE model = "nforce professional 3400 mcp" |
count the number of times patient 15209 had had a gastric tube output in 09/2105. | 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_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob ... | SELECT COUNT(*) 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 = 15209)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric tube' AND ... |
did patient 1114 have any microbiology test results for his stool during this hospital encounter? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_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... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114 AND admissions.dischtime IS NULL) AND microbiologyevents.spec_type_desc = 'stool' |
What is the date of the game where Dipietro earned a decision and Carolina was the visiting team? | CREATE TABLE table_name_28 (date VARCHAR,decision VARCHAR,visitor VARCHAR) | SELECT date FROM table_name_28 WHERE decision = "dipietro" AND visitor = "carolina" |
How much did the away team b3 score on August 12, 2014? | CREATE TABLE table_name_17 (score VARCHAR,away_team VARCHAR,date VARCHAR) | SELECT score FROM table_name_17 WHERE away_team = "b3" AND date = "august 12, 2014" |
Use a group line chart to show how many competitions are held in each year, group by official name and bin by year, and order x axis in descending order. | CREATE TABLE farm_competition (Competition_ID int,Year int,Theme text,Host_city_ID int,Hosts text)CREATE TABLE competition_record (Competition_ID int,Farm_ID int,Rank int)CREATE TABLE farm (Farm_ID int,Year int,Total_Horses real,Working_Horses real,Total_Cattle real,Oxen real,Bulls real,Cows real,Pigs real,Sheep_and_Go... | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY Official_Name ORDER BY Year DESC |
provide the number of patients whose age is less than 45 and admission year is less than 2131? | 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 WHERE demographic.age < "45" AND demographic.admityear < "2131" |
What Game had a Score of 129 105? | CREATE TABLE table_76275 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text) | SELECT MIN("Game") FROM table_76275 WHERE "Score" = '129–105' |
How many laps did Nick Heidfeld drive on grids larger than 4? | CREATE TABLE table_name_77 (laps INTEGER,grid VARCHAR,driver VARCHAR) | SELECT SUM(laps) FROM table_name_77 WHERE grid > 4 AND driver = "nick heidfeld" |
Show me maximal stu gpa by dept code in a histogram, and display in desc by the bars. | 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 STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varcha... | SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC |
What is the total for 3rd place on season 9? | CREATE TABLE table_40465 ("Rank by average" text,"Place" text,"Perfect 40s" text,"Total" text,"Number of dances" text,"Season" text,"Average" text) | SELECT "Total" FROM table_40465 WHERE "Place" = '3rd' AND "Season" = '9' |
Plot a scatter chart, count(*) by constructorid. | CREATE TABLE circuits (circuitId INTEGER,circuitRef TEXT,name TEXT,location TEXT,country TEXT,lat REAL,lng REAL,alt TEXT,url TEXT)CREATE TABLE status (statusId INTEGER,status TEXT)CREATE TABLE constructors (constructorId INTEGER,constructorRef TEXT,name TEXT,nationality TEXT,url TEXT)CREATE TABLE constructorResults (co... | SELECT COUNT(*), constructorId FROM constructorStandings GROUP BY constructorId |
What are the number of the dates of the assessment notes?, sort by the x-axis from high to low please. | CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Assessment_Notes (notes_id INTEGER,student_id INTEGER,teacher_id INTEGER,date_of_notes DATETIME,text_of_notes VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY date_of_notes DESC |
what is the ground transportation in SAN DIEGO | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_interval (period text,begin_time int,end_time i... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN DIEGO' AND ground_service.city_code = city.city_code |
WHich Tournament has a Partnering of diego p rez and a Opponents in the final of christer allgardh carl limberger? | CREATE TABLE table_5790 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponents in the final" text,"Score" text) | SELECT "Tournament" FROM table_5790 WHERE "Partnering" = 'diego pérez' AND "Opponents in the final" = 'christer allgardh carl limberger' |
give me the number of patients whose primary disease is rash and the procedure icd9 code is 5091. | 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 (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "RASH" AND procedures.icd9_code = "5091" |
What was Emma Bunton's score for the performance with a total score of 22? | CREATE TABLE table_28352386_1 (emma_bunton VARCHAR,total VARCHAR) | SELECT emma_bunton FROM table_28352386_1 WHERE total = "22" |
What is the total number of appearances in the premier league when there were 10 appearances at UEFA and less than 4 at league cup? | CREATE TABLE table_45017 ("Player" text,"Position" text,"Premier League" real,"FA Cup" real,"League Cup" real,"UEFA Cup" real,"Total" real) | SELECT COUNT("Premier League") FROM table_45017 WHERE "UEFA Cup" = '10' AND "League Cup" < '4' |
What is the transfer window for Christian Nerlinger? | CREATE TABLE table_name_23 (transfer_window VARCHAR,name VARCHAR) | SELECT transfer_window FROM table_name_23 WHERE name = "christian nerlinger" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.