instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Who was the winning team for circuit zolder? | CREATE TABLE table_name_46 (winning_team VARCHAR,circuit VARCHAR) | SELECT winning_team FROM table_name_46 WHERE circuit = "circuit zolder" |
What's the average year for the good things happening album's single 'lady lady lay'? | CREATE TABLE table_44779 ("Year" real,"Month" text,"Single" text,"Album" text,"Record label" text) | SELECT AVG("Year") FROM table_44779 WHERE "Album" = 'good things happening' AND "Single" = 'lady lady lay' |
Find the id and color description of the products with at least 2 characteristics. | CREATE TABLE products (product_id number,color_code text,product_category_code text,product_name text,typical_buying_price text,typical_selling_price text,product_description text,other_product_details text)CREATE TABLE ref_product_categories (product_category_code text,product_category_description text,unit_of_measure... | SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2 |
How many reg GP for nathan barrett in a round less than 8? | CREATE TABLE table_77745 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real) | SELECT COUNT("Reg GP") FROM table_77745 WHERE "Player" = 'nathan barrett' AND "Rd #" < '8' |
Who took office under the government of Matthew E. Welsh? | CREATE TABLE table_name_8 (took_office VARCHAR,governor VARCHAR) | SELECT took_office FROM table_name_8 WHERE governor = "matthew e. welsh" |
Who scored highest rebounds high points is charlie villanueva (32) | CREATE TABLE table_21230 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_21230 WHERE "High points" = 'Charlie Villanueva (32)' |
provide the number of patients whose days of hospital stay is greater than 15 and lab test name is creatinine? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Creatinine" |
What is Letter, when Example Spelled Checked is 'tin /t n/ ('tin')'? | CREATE TABLE table_78605 ("Letter" text,"Pronunciation spelled free" text,"Pronunciation spelled checked" text,"Example spelled free" text,"Example spelled checked" text) | SELECT "Letter" FROM table_78605 WHERE "Example spelled checked" = 'tin /tɪn/ ("tin")' |
What's the site of the recap at qualcomm stadium? | CREATE TABLE table_name_81 (nflcom_recap VARCHAR,game_site VARCHAR) | SELECT nflcom_recap FROM table_name_81 WHERE game_site = "qualcomm stadium" |
In what constituency was the result labour hold and Liberal democrat Elizabeth Newton won? | CREATE TABLE table_name_12 (constituency VARCHAR,result VARCHAR,liberal_democrats VARCHAR) | SELECT constituency FROM table_name_12 WHERE result = "labour hold" AND liberal_democrats = "elizabeth newton" |
What is the Postion, when the Name is Rod Paavola? | CREATE TABLE table_name_27 (position VARCHAR,name VARCHAR) | SELECT position FROM table_name_27 WHERE name = "rod paavola" |
what is the highest laps when the grid is 1? | CREATE TABLE table_57142 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_57142 WHERE "Grid" = '1' |
Which advisor has most number of students? | CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE allergy_type (allergy text,allergytype text) | SELECT advisor FROM student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1 |
What was the score between Marseille and Manchester United on the second leg of the Champions League Round of 16? | CREATE TABLE table_74043 ("Team" text,"Contest and round" text,"Opponent" text,"1st leg score*" text,"2nd leg score**" text,"Aggregate score" text) | SELECT "2nd leg score**" FROM table_74043 WHERE "Opponent" = 'Marseille' |
Which country is the airport that has the highest altitude located in? | CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,elevation number,iata text,icao text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airlines (alid number,name text,iata text,icao text,call... | SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 |
What nationality is keith carney? | CREATE TABLE table_74351 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Nationality" FROM table_74351 WHERE "Player" = 'Keith Carney' |
Who had the highest assists on November 4 | CREATE TABLE table_11959669_3 (high_assists VARCHAR,date VARCHAR) | SELECT high_assists FROM table_11959669_3 WHERE date = "November 4" |
how many patients are procedured with icd9 code 5187? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id 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,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5187" |
has there ever been any .9% normal saline given to patient 5395 in 09/this year? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu... | SELECT COUNT(*) > 0 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 = 5395)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.9% norma... |
which patients have drug code bactss? | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BACTSS" |
how many patients are suggested with the procedure colonoscopy? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (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 procedures.short_title = "Colonoscopy" |
Which opponent has a record of 78-60? | CREATE TABLE table_name_62 (opponent VARCHAR,record VARCHAR) | SELECT opponent FROM table_name_62 WHERE record = "78-60" |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, and order by the Name in asc. | 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.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
Which party belongs to district 41, and is delegated by Jill P. Carter? | CREATE TABLE table_name_61 (party VARCHAR,district VARCHAR,delegate VARCHAR) | SELECT party FROM table_name_61 WHERE district = 41 AND delegate = "jill p. carter" |
Top Users of SO From Bangladesh. | 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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd' OR LOWER(Location) LIKE '%dhaka%' ORDER BY Reputation DESC |
how many patients whose marital status is married and ethnicity is black/cape verdean? | 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 WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "BLACK/CAPE VERDEAN" |
WHAT IS THE TO PAR FOR GEOFF OGILVY WITH A PLACE OF T3? | CREATE TABLE table_name_94 (to_par VARCHAR,place VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_94 WHERE place = "t3" AND player = "geoff ogilvy" |
give me the number of patients whose days of hospital stay is greater than 17 and lab test name is fibrinogen, functional? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "17" AND lab.label = "Fibrinogen, Functional" |
Who was the opponent at the game with a score of 6 5 (10)? | CREATE TABLE table_34501 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Opponent" FROM table_34501 WHERE "Score" = '6–5 (10)' |
What team did gonzalo arconada manage? | CREATE TABLE table_name_90 (team VARCHAR,outgoing_manager VARCHAR) | SELECT team FROM table_name_90 WHERE outgoing_manager = "gonzalo arconada" |
Give the proportion of how many credits does the department offer? | CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TAB... | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE |
What player has a score of 67-70-77=214? | CREATE TABLE table_50570 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_50570 WHERE "Score" = '67-70-77=214' |
Who was on Jason's team for the 12 June 2009 episode? | CREATE TABLE table_23292220_8 (jasons_team VARCHAR,first_broadcast VARCHAR) | SELECT jasons_team FROM table_23292220_8 WHERE first_broadcast = "12 June 2009" |
How many people attended on 2 may 2007? | CREATE TABLE table_name_14 (attendance INTEGER,date VARCHAR) | SELECT SUM(attendance) FROM table_name_14 WHERE date = "2 may 2007" |
What was the ranking of episode #19? | CREATE TABLE table_26200084_1 (rank__week_ VARCHAR,_number VARCHAR) | SELECT rank__week_ FROM table_26200084_1 WHERE _number = 19 |
People with the gold spring-batch badge. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Sco... | SELECT u.DisplayName FROM Badges AS b INNER JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'spring-batch' AND b.Class = 1 ORDER BY u.DisplayName |
What Gauthier had a 15 Liscumb? | CREATE TABLE table_name_65 (gauthier VARCHAR,liscumb VARCHAR) | SELECT gauthier FROM table_name_65 WHERE liscumb = "15" |
have patient 23070 received lab tests in this month? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value 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 inp... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') |
What was the score where Olga Lugina played in the Tournament of poitiers , france itf $25,000? | CREATE TABLE table_name_84 (score_in_the_final VARCHAR,partner VARCHAR,tournament VARCHAR) | SELECT score_in_the_final FROM table_name_84 WHERE partner = "olga lugina" AND tournament = "poitiers , france itf $25,000" |
WHO WAS THE COVER MODEL OF PLAYBOY WHERE THE CENTERFOLD MODEL WAS SHALLAN MEIERS? | CREATE TABLE table_1566852_3 (cover_model VARCHAR,centerfold_model VARCHAR) | SELECT cover_model FROM table_1566852_3 WHERE centerfold_model = "Shallan Meiers" |
How many problems are there for product voluptatem? | CREATE TABLE problem_category_codes (problem_category_code text,problem_category_description text)CREATE TABLE problem_status_codes (problem_status_code text,problem_status_description text)CREATE TABLE problems (problem_id number,product_id number,closure_authorised_by_staff_id number,reported_by_staff_id number,date_... | SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem" |
get me the number of patients with gast30l drug code who were categorized under chemistry lab test. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "GAST30L" AND lab."CATEGORY" = "Chemistry" |
what is age and drug code of subject id 2560? | 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 (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT demographic.age, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" |
The time of 8:34.27 was set by what athlete? | CREATE TABLE table_13943 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Athlete" FROM table_13943 WHERE "Time" = '8:34.27' |
The color diamond is assigned to which Terminus? | CREATE TABLE table_4615 ("Line" text,"Color" text,"Terminus" text,"Length" text,"Stations" text,"Daily Ridership" real) | SELECT "Terminus" FROM table_4615 WHERE "Color" = 'diamond' |
what is the maximum age of patients whose admission type is elective and year of death is before 2183? | 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 MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dod_year < "2183.0" |
What's the winning score on Feb 12, 1978? | CREATE TABLE table_13423 ("Date" text,"Tournament" text,"Winning Score" text,"Margin of Victory" text,"Runner(s)-up" text) | SELECT "Winning Score" FROM table_13423 WHERE "Date" = 'feb 12, 1978' |
What is the most used instrument? | CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE albums (aid number,title text,year number,label text,type text)CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE vocals (song... | SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1 |
What is the difference of the team with 12 points? | CREATE TABLE table_39124 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT "Difference" FROM table_39124 WHERE "Points" = '12' |
Who is the visitor from the game with 7,000 in attendance on January 1? | CREATE TABLE table_9958 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" text,"Record" text,"Points" real) | SELECT "Visitor" FROM table_9958 WHERE "Attendance" = '7,000' AND "Date" = 'january 1' |
How many tenants are there in the city of Samsun? | CREATE TABLE table_78 ("Stadium" text,"Capacity" real,"City" text,"Country" text,"Tenant" text,"Opening" real) | SELECT COUNT("Tenant") FROM table_78 WHERE "City" = 'Samsun' |
Which % 'A' or 'B' Aggregates has a Year of 2009? | CREATE TABLE table_7270 ("Year" real,"Pass Rate" text,"% 'A' Aggregates" text,"% 'B' Aggregates" text,"% 'A' or 'B' Aggregates" text,"Average A's per learner" real) | SELECT "% 'A' or 'B' Aggregates" FROM table_7270 WHERE "Year" = '2009' |
What is the birth date for Mervyn Dillon? | CREATE TABLE table_58421 ("Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text) | SELECT "Date of Birth" FROM table_58421 WHERE "Player" = 'mervyn dillon' |
What was the position of the player from the college of Nevada with a round over 5? | CREATE TABLE table_43913 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "Position" FROM table_43913 WHERE "Round" > '5' AND "College" = 'nevada' |
Find which User IDs don't exist (deleted users). Enter the maximum user ID to retrieve up to and click 'Run Query. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time... | SELECT Id, DisplayName, Reputation, Age FROM Users WHERE Id > 4 AND Id < @id |
What is the Friday 4 June if the Wednesday 2 June is 20' 50.62 108.608mph? | CREATE TABLE table_25220821_3 (fri_4_june VARCHAR,wed_2_june VARCHAR) | SELECT fri_4_june FROM table_25220821_3 WHERE wed_2_june = "20' 50.62 108.608mph" |
What is the minimum salary in each department. Show scatter chart. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME... | SELECT MIN(SALARY), DEPARTMENT_ID FROM employees |
What is the total season number for episodes later than episode 30? | CREATE TABLE table_79492 ("Season" real,"Network" text,"Episodes" real,"Premiered" text,"Ended" text,"DVD set release date" text) | SELECT SUM("Season") FROM table_79492 WHERE "Episodes" > '30' |
WHich Club has a City of col n? | CREATE TABLE table_40191 ("Club" text,"City" text,"Stadium" text,"2009 season" text,"Group" text) | SELECT "Club" FROM table_40191 WHERE "City" = 'colón' |
how many office with department being department of justice kagawaran ng katarungan | CREATE TABLE table_1331313_1 (office VARCHAR,department VARCHAR) | SELECT COUNT(office) FROM table_1331313_1 WHERE department = "department of Justice Kagawaran ng Katarungan" |
what is the cost of a drug known as dextrose 5%/nacl 0.45%? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dextrose 5%/nacl 0.45%') |
leaving DENVER flying to SAN FRANCISCO before 1000 what type of aircraft is used | 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 state (state_cod... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND f... |
when was the first laboratory test patient 002-58884 received last month? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid ... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T... |
how many patients have undergone a circumcision within the same hospital visit after having been diagnosed with personal history of fall, last year? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id num... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... |
what is the daily minimum dose of d5ns ivf that patient 006-50368 takes since 20 months ago? | 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 MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-50368')) AND intakeoutput.celllabel = 'd5ns ... |
i would like an early morning nonstop flight from NEW YORK to LAS VEGAS on 2 28 | 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 dual_carrier (main_airline varchar,low_flight_number int,high_flight_n... | 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 = 'LAS VEGAS' AND date_day.day_number = 28 AND date_day.month_number = 2 ... |
Where was the game that the Indianapolis Colts lost 24-14? | CREATE TABLE table_69801 ("Year" real,"Date" text,"Winner" text,"Result" text,"Loser" text,"Location" text) | SELECT "Location" FROM table_69801 WHERE "Loser" = 'indianapolis colts' AND "Result" = '24-14' |
where is a restaurant in mountain view that serves good arabic food ? | CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar) | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
What is the broadband penetration where there are ~355,100 broadband subscribers? | CREATE TABLE table_15634 ("Year" real,"Number of Users" text,"Penetration" text,"Number of Broadband Subscribers" text,"Broadband Penetration" text,"Population" text,"Data provided by" text) | SELECT "Broadband Penetration" FROM table_15634 WHERE "Number of Broadband Subscribers" = '~355,100' |
What was the score on 26 July 1930? | CREATE TABLE table_name_62 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_62 WHERE date = "26 july 1930" |
What is the urban population for the city of Fuzhou? | CREATE TABLE table_name_7 (urban_population__2010_ INTEGER,city VARCHAR) | SELECT AVG(urban_population__2010_) FROM table_name_7 WHERE city = "fuzhou" |
When 23% scott mcadams (d) what are the dates administered? | CREATE TABLE table_20597634_3 (dates_administered VARCHAR,scott_mcadams__d_ VARCHAR) | SELECT dates_administered FROM table_20597634_3 WHERE scott_mcadams__d_ = "23%" |
what is drug code and drug dose of drug name acetaminophen iv? | 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 prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Acetaminophen IV" |
Name the production code for viewers for 1.69 | CREATE TABLE table_22904 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Production code" FROM table_22904 WHERE "U.S. viewers (million)" = '1.69' |
Can you tell me the average Total passengers that has the Code of mad, and the Cargo traffic smaller than 359,362,155? | CREATE TABLE table_7275 ("Rank" real,"Airport" text,"Location" text,"Code" text,"Total passengers" real,"% Change 2011-2012" real,"Aircraft movements" real,"Cargo traffic" real) | SELECT AVG("Total passengers") FROM table_7275 WHERE "Code" = 'mad' AND "Cargo traffic" < '359,362,155' |
what is the name when the lane is less than 4 and mark is 52.64? | CREATE TABLE table_43861 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text) | SELECT "Name" FROM table_43861 WHERE "Lane" < '4' AND "Mark" = '52.64' |
how many patients are diagnosed with primary disease sepsis and stayed in hospital for more than 43 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 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 WHERE demographic.diagnosis = "SEPSIS" AND demographic.days_stay > "43" |
What is the Country of the T8 Place Player with a Score of 68-74=142? | CREATE TABLE table_12716 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_12716 WHERE "Place" = 't8' AND "Score" = '68-74=142' |
What was the method when 4-2 was the record? | CREATE TABLE table_47712 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Method" FROM table_47712 WHERE "Record" = '4-2' |
how many hours has it been since patient 006-133605 was admitted into the hospital? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,tempe... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL |
as of october 25 , 2005 , what percentage of voters were unaffiliated ? | CREATE TABLE table_200_35 (id number,"party" text,"active voters" number,"inactive voters" number,"total voters" number,"percentage" text) | SELECT "percentage" FROM table_200_35 WHERE "party" = 'unaffiliated' |
For exams , does Prof. Firas Shalabi always set one ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)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 va... | 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.has_exams = 'N' AN... |
give me the number of patients whose ethnicity is white and diagnoses icd9 code is v4502? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "V4502" |
Who is the person that has no friend? | CREATE TABLE person (name VARCHAR)CREATE TABLE PersonFriend (name VARCHAR) | SELECT name FROM person EXCEPT SELECT name FROM PersonFriend |
What is Spandau 04 Player Jens Pohlmann's Pos.? | CREATE TABLE table_name_1 (pos VARCHAR,club VARCHAR,name VARCHAR) | SELECT pos FROM table_name_1 WHERE club = "spandau 04" AND name = "jens pohlmann" |
Find the number of activities available. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE participates_in (stuid number,actid number)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty (fac... | SELECT COUNT(*) FROM activity |
Which Location has a Home Ground of Mong kok stadium? | CREATE TABLE table_65506 ("Club" text,"League/Division" text,"Home Ground" text,"Location" text,"Position in 2012-13" text) | SELECT "Location" FROM table_65506 WHERE "Home Ground" = 'mong kok stadium' |
What are the first names of student who only took one course? | CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE class (class_code text,crs_code text,class_section text,class_time text,class_room text,prof_num number)CREATE TABLE department (dept_code text,dept_name text,school_code text,emp_num number,dept_address text,dept_extension text)CREATE T... | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1 |
What season has a number less than 90, Mitte as the league and spvgg ruhmannsfelden as the team? | CREATE TABLE table_name_95 (season VARCHAR,team VARCHAR,number VARCHAR,league VARCHAR) | SELECT season FROM table_name_95 WHERE number < 90 AND league = "mitte" AND team = "spvgg ruhmannsfelden" |
provide the number of patients whose ethnicity is white and drug name is soln.? | 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.ethnicity = "WHITE" AND prescriptions.drug = "Soln." |
At what event did he fight matt eckerle? | CREATE TABLE table_name_55 (event VARCHAR,opponent VARCHAR) | SELECT event FROM table_name_55 WHERE opponent = "matt eckerle" |
what is the yearly minimum of sao2 for patient 2004 since 91 months ago? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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 ch... | 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 = 2004)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... |
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and salary , and visualize them by a bar chart, and I want to order by the total number from high to low. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUM... | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC |
What City is the Jal hotel in? | CREATE TABLE table_4983 ("Rank" text,"Name" text,"Height m (ft)" text,"Floors" real,"Year" real,"City" text) | SELECT "City" FROM table_4983 WHERE "Name" = 'jal hotel' |
What are the descriptions of all the project outcomes, and count them by a bar chart, and rank bars from low to high order. | CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DECIMAL(19,4),grant_start_date DATETIME,grant_end_date DATETIME,other_details VARCHAR(255))CREATE TABLE Project_Outcomes (project_id INTEGER,outcome_code VARCHAR(10),outcome_details VARCHAR(255))CREATE TABLE Document_Types (document_type_code VA... | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description |
what is the number of patients whose age is less than 76 and diagnoses long title is transient neonatal thrombocytopenia? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.long_title = "Transient neonatal thrombocytopenia" |
What venue has an against over 14, an opposing team of scotland, and a status of five nations? | CREATE TABLE table_60672 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Venue" FROM table_60672 WHERE "Against" > '14' AND "Opposing Teams" = 'scotland' AND "Status" = 'five nations' |
What is the birthdate of Robert Esche? | CREATE TABLE table_name_39 (birthdate VARCHAR,name VARCHAR) | SELECT birthdate FROM table_name_39 WHERE name = "robert esche" |
What 's the number of credits for 540 ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varcha... | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 540 |
What was the SPA FEA when the LMS FEA was 5? | CREATE TABLE table_name_60 (spa_fea VARCHAR,lms_fea VARCHAR) | SELECT spa_fea FROM table_name_60 WHERE lms_fea = "5" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.