instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
four corners has 13 premierships listed , what was their nickname ? | CREATE TABLE table_204_198 (id number,"club" text,"nickname" text,"no. of premierships" number,"premiership years" text,"moved to" text) | SELECT "nickname" FROM table_204_198 WHERE "club" = 'four corners' |
Plot the average of age by grouped by home city as a bar graph, could you sort by the bar from high to low? | CREATE TABLE driver (Driver_ID int,Name text,Party text,Home_city text,Age int)CREATE TABLE school (School_ID int,Grade text,School text,Location text,Type text)CREATE TABLE school_bus (School_ID int,Driver_ID int,Years_Working int,If_full_time bool) | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY Home_city DESC |
Which person drove a Reynard 2ki with a Honda Hrk engine? | CREATE TABLE table_name_95 (races VARCHAR,chassis VARCHAR,engine VARCHAR) | SELECT races FROM table_name_95 WHERE chassis = "reynard 2ki" AND engine = "honda hrk" |
what is minimum age of patients whose insurance is self pay and primary disease is hypertension;rule out coronary artery disease\cardiac cath? | 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 MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" |
Draw a bar chart for what are the hometowns of gymnasts and the corresponding number of gymnasts?, could you show in asc by the X? | CREATE TABLE gymnast (Gymnast_ID int,Floor_Exercise_Points real,Pommel_Horse_Points real,Rings_Points real,Vault_Points real,Parallel_Bars_Points real,Horizontal_Bar_Points real,Total_Points real)CREATE TABLE people (People_ID int,Name text,Age real,Height real,Hometown text) | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown |
What was the score of the game that had a record of 52 103? | CREATE TABLE table_name_14 (score VARCHAR,record VARCHAR) | SELECT score FROM table_name_14 WHERE record = "52–103" |
Report all advisors that advise more than 2 students. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote nu... | SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2 |
What number was Rashad McCants? | CREATE TABLE table_43172 ("Name" text,"Position" text,"Number" text,"School/Club Team" text,"Season" text,"Acquisition via" text) | SELECT "Number" FROM table_43172 WHERE "Name" = 'rashad mccants' |
what is the number of patients whose admission location is transfer from hosp/extram and admission year is less than 2168? | 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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2168" |
Which episode has a Challenge Winner of berto? | CREATE TABLE table_9341 ("Episode" text,"7 Deadly Sin" text,"Challenge Winner" text,"Challenge Loser" text,"Voted In To 'El Duelo'" text,"Eliminated" text) | SELECT "Episode" FROM table_9341 WHERE "Challenge Winner" = 'berto' |
COunt the Year which has a Venue of latakia , syria? | CREATE TABLE table_59636 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT COUNT("Year") FROM table_59636 WHERE "Venue" = 'latakia , syria' |
tell me patient 004-17866's length of stay of the first stay in the icu. | 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 STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-17866') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
What visiting team played at 3com park on October 7? | CREATE TABLE table_71818 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Visiting Team" FROM table_71818 WHERE "Stadium" = '3com park' AND "Date" = 'october 7' |
Name the date of vacancy for 29 december 2008 being date of appointment | CREATE TABLE table_22422 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Date of vacancy" FROM table_22422 WHERE "Date of appointment" = '29 December 2008' |
Bar graph to show the number of directed by from different directed by, and I want to sort by the x axis from high to low. | CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY Directed_by DESC |
Which PFF NMCC has a AFC PC of dnq? | CREATE TABLE table_name_50 (pff_nmcc VARCHAR,afc_pc VARCHAR) | SELECT pff_nmcc FROM table_name_50 WHERE afc_pc = "dnq" |
get me the number of less than 30 year old patients with more than 6 days of hospital stay. | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "30" AND demographic.days_stay > "6" |
Which DOB has Bats of r, and Throws of r, and a Position of rhp, and a First of john? | CREATE TABLE table_name_58 (dob VARCHAR,first VARCHAR,position VARCHAR,bats VARCHAR,throws VARCHAR) | SELECT dob FROM table_name_58 WHERE bats = "r" AND throws = "r" AND position = "rhp" AND first = "john" |
What was the Opponent in the Tarragona Tournament? | CREATE TABLE table_name_9 (opponent VARCHAR,tournament VARCHAR) | SELECT opponent FROM table_name_9 WHERE tournament = "tarragona" |
The Catalog of ilps 9153 is from what region? | CREATE TABLE table_name_85 (region VARCHAR,catalog VARCHAR) | SELECT region FROM table_name_85 WHERE catalog = "ilps 9153" |
How many games were lost when the club got 34 points | CREATE TABLE table_22868 ("Position" real,"Club" text,"Played" real,"Won" real,"Drawn" real,"Lost" real,"Pts For" real,"Pts Agst" real,"Pts Diff" real,"B.P." real,"Points" real) | SELECT MIN("Lost") FROM table_22868 WHERE "Points" = '34' |
What is the team captain when the shirt sponser is quick? | CREATE TABLE table_29448 ("Club" text,"Chairman" text,"Current manager" text,"Team captain" text,"Kitmaker" text,"Shirt sponsor" text) | SELECT "Team captain" FROM table_29448 WHERE "Shirt sponsor" = 'Quick' |
give me patient 030-60126's total epoprostenol intake until 841 days ago. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT SUM(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 = '030-60126')) AND intakeoutput.celllabel = 'epopr... |
What is the Place of the couple with a Rank smaller than 7 and 514.55 Points? | CREATE TABLE table_48946 ("Rank" real,"Name" text,"Nation" text,"Points" real,"Placings" real) | SELECT SUM("Placings") FROM table_48946 WHERE "Rank" < '7' AND "Points" = '514.55' |
What was the highest number of goals for 1922 1935? | CREATE TABLE table_name_18 (goals INTEGER,years VARCHAR) | SELECT MAX(goals) FROM table_name_18 WHERE years = "1922–1935" |
What date has Liga 3rd of Dynamo Dresden? | CREATE TABLE table_39643 ("Date" text,"2nd Bundesliga 16th" text,"3rd Liga 3rd" text,"Game 1" text,"Game 2" text) | SELECT "Date" FROM table_39643 WHERE "3rd Liga 3rd" = 'dynamo dresden' |
What is the Continent that also has the United States listed as a country? | CREATE TABLE table_44131 ("Continent" text,"Structure" text,"Height" text,"Year" real,"Country" text) | SELECT "Continent" FROM table_44131 WHERE "Country" = 'united states' |
platelets > 100 | CREATE TABLE table_train_257 ("id" int,"serum_bicarbonate" int,"plasma_glucose_concentration" int,"hemoglobin_a1c_hba1c" float,"platelets" int,"visual_impairment" bool,"NOUSE" float) | SELECT * FROM table_train_257 WHERE platelets > 100 |
What team won after 2008? | CREATE TABLE table_name_9 (team VARCHAR,season INTEGER) | SELECT team FROM table_name_9 WHERE season > 2008 |
A bar chart shows the distribution of Name and Height . | CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real) | SELECT Name, Height FROM people |
serum potassium level > 5.5 meq / l for those not on ace inhibitors during baseline, or serum potassium level > 5.9 meq / l for those on ace inhibitors during baseline. | CREATE TABLE table_dev_38 ("id" int,"gender" string,"serum_potassium" float,"systolic_blood_pressure_sbp" int,"creatinine_clearance_cl" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"ace_inhibitors" bool,"serum_creatinine" float,"kidney_disease" bool,"NOUSE" float) | SELECT * FROM table_dev_38 WHERE (serum_potassium > 5.5 AND ace_inhibitors = 0) OR (serum_potassium > 5.9 AND ace_inhibitors = 1) |
What is the home team which plays at a venue called Win Entertainment Centre? | CREATE TABLE table_name_34 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_34 WHERE venue = "win entertainment centre" |
what are my meal options from BOSTON to DENVER | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE food_servi... | SELECT DISTINCT food_service.compartment, food_service.meal_code, food_service.meal_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1... |
Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, list by the bars in desc. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
Result of missed*, and a Game time of 2nd quarter (0:00), and a Kicker of mason crosby involves what date? | CREATE TABLE table_35081 ("Date" text,"Kicker" text,"Kicking team" text,"Opponent" text,"Yards" real,"Result" text,"Game time" text) | SELECT "Date" FROM table_35081 WHERE "Result" = 'missed*' AND "Game time" = '2nd quarter (0:00)' AND "Kicker" = 'mason crosby' |
What is Margin of Victory, when Tournament is 'Women's Kemper Open'? | CREATE TABLE table_49617 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Margin of victory" FROM table_49617 WHERE "Tournament" = 'women''s kemper open' |
what are the five most frequently prescribed drugs for female patients of the 30s within 2 months after they have been diagnosed with alcoh dep nec/nos-unspec during the previous year? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id number,subject_id numb... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 ... |
What was the score on October 31? | CREATE TABLE table_name_93 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_93 WHERE date = "october 31" |
For those employees who was hired before 2002-06-21, show me the trend about commission_pct over hire_date with a line chart, and could you display x-axis in ascending order? | 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),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE va... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE |
What are the dimensions of the amp with a 180W output? | CREATE TABLE table_name_96 (dimensions VARCHAR,output VARCHAR) | SELECT dimensions FROM table_name_96 WHERE output = "180w" |
how many patients have undergone a stool (received in transport system) test in 2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TAB... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'stool (received in transport system)' AND STRFTIME('%y', microbiologyevents.charttime) = '2105') |
What is the smallest bush# with 66.0% bush and less than 65 others#? | CREATE TABLE table_name_55 (bush_number INTEGER,bush_percentage VARCHAR,others_number VARCHAR) | SELECT MIN(bush_number) FROM table_name_55 WHERE bush_percentage = "66.0%" AND others_number < 65 |
what is days of hospital stay and death status of subject id 2560? | 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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560" |
Which payment method is used by most customers? | CREATE TABLE products (product_id number,product_details text)CREATE TABLE customer_orders (order_id number,customer_id number,order_status text,order_date time,order_details text)CREATE TABLE customers (customer_id number,payment_method text,customer_name text,date_became_customer time,other_customer_details text)CREA... | SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 |
I want the lowest points for tries of 39 and goals more than 0 | CREATE TABLE table_name_1 (points INTEGER,tries VARCHAR,goals VARCHAR) | SELECT MIN(points) FROM table_name_1 WHERE tries = 39 AND goals > 0 |
What is the sum number of evening gown stats for New Jersey when the interview was less than 9.344? | CREATE TABLE table_name_80 (evening_gown VARCHAR,state VARCHAR,interview VARCHAR) | SELECT COUNT(evening_gown) FROM table_name_80 WHERE state = "new jersey" AND interview < 9.344 |
Which LE-5 Model has an LE-5A of 130? | CREATE TABLE table_name_2 (le_5_model VARCHAR,le_5A VARCHAR) | SELECT le_5_model FROM table_name_2 WHERE le_5A = 130 |
Name the number of application for modeling, computer aided design, animation | CREATE TABLE table_23037 ("Application" text,"Latest release date and version" text,"Developed by" text,"Platforms" text,"Mainly Used For" text,"License" text) | SELECT COUNT("Application") FROM table_23037 WHERE "Mainly Used For" = 'Modeling, Computer Aided Design, Animation' |
What is the lowest Goals Against by a team with more than 5 wins? | CREATE TABLE table_name_18 (goals_against INTEGER,wins INTEGER) | SELECT MIN(goals_against) FROM table_name_18 WHERE wins > 5 |
What seasons in series 7 did David E. Kelley write ? | CREATE TABLE table_23279434_1 (season__number VARCHAR,written_by VARCHAR,series__number VARCHAR) | SELECT COUNT(season__number) FROM table_23279434_1 WHERE written_by = "David E. Kelley" AND series__number = 7 |
How many White-Russian patients speak Russian? | 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.language = "RUSS" AND demographic.ethnicity = "WHITE - RUSSIAN" |
Just show the first name and the manager id with a bar chart, and list by the bar in asc please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 dep... | SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY T1.FIRST_NAME |
which had more ger numbers , 1898 or 1893 ? | CREATE TABLE table_204_737 (id number,"year" number,"order" text,"quantity" number,"ger nos." text) | SELECT "year" FROM table_204_737 WHERE "year" IN ('1898', '1893') GROUP BY "year" ORDER BY SUM("ger nos." - "ger nos.") DESC LIMIT 1 |
What are total transaction amounts for each transaction type, could you show by the Y-axis from low to high? | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_order_item_details VARCHAR(255))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 DEC... | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) |
what is the number of patients whose primary disease is copd exacerbation and year of birth is less than 1837? | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dob_year < "1837" |
What day was the attendance 74,285? | CREATE TABLE table_name_98 (date VARCHAR,attendance VARCHAR) | SELECT date FROM table_name_98 WHERE attendance = "74,285" |
What is the Previous Cub/Team that has NHL rights of the Vancouver Canucks? | CREATE TABLE table_7534 ("Position" text,"Name" text,"Height (cm)" real,"Weight (kg)" real,"Birthdate" text,"Birthplace" text,"Previous Club/Team" text,"NHL rights,if any" text) | SELECT "Previous Club/Team" FROM table_7534 WHERE "NHL rights, if any" = 'vancouver canucks' |
How many clubs does 'Linda Smith' belong to? | CREATE TABLE member_of_club (stuid number,clubid number,position text)CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text) | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith" |
Calculate the number of patients with icd9 code 4041 who died in or before the year 2180. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.icd9_code = "4041" |
In 1990-2005 what is the lowest Start with Convs smaller than 2? | CREATE TABLE table_name_93 (start INTEGER,span VARCHAR,conv VARCHAR) | SELECT MIN(start) FROM table_name_93 WHERE span = "1990-2005" AND conv < 2 |
What is the percentage of others when McCain is at 57.7% | CREATE TABLE table_20573232_1 (others_percentage VARCHAR,mccain_percentage VARCHAR) | SELECT others_percentage FROM table_20573232_1 WHERE mccain_percentage = "57.7%" |
WHAT IS THE GROSS WITH A DIRECTOR OF RICHARD TUGGLE? | CREATE TABLE table_name_73 (gross VARCHAR,director VARCHAR) | SELECT gross FROM table_name_73 WHERE director = "richard tuggle" |
SELECT name FROM sys.databases. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,Targ... | SELECT name FROM sys.databases |
What is the average membership with 3.33% LDS and less than 47 branches? | CREATE TABLE table_name_15 (membership INTEGER,_percentage_lds VARCHAR,branches VARCHAR) | SELECT AVG(membership) FROM table_name_15 WHERE _percentage_lds = "3.33%" AND branches < 47 |
How many patients are of white-russian ethnicity and treated with drug epoetin alfa? | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Epoetin Alfa" |
what was the least points scored by the winning team ? | CREATE TABLE table_203_164 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT MIN("score") FROM table_203_164 |
What country is Tiger Woods from? | CREATE TABLE table_44927 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_44927 WHERE "Player" = 'tiger woods' |
Count of questions with kotlin tag over time. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostNoticeT... | SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", COUNT(DISTINCT Posts.Id) AS Count FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName LIKE '%pelican%' AND PostTypeId = 1 AND CreationDate > '2012-01-01' GROUP BY DATEADD(MONTH,... |
When has an Opposing Team of mid-districts? | CREATE TABLE table_name_72 (date VARCHAR,opposing_team VARCHAR) | SELECT date FROM table_name_72 WHERE opposing_team = "mid-districts" |
What is the name of Richmond's home venue? | CREATE TABLE table_name_45 (venue VARCHAR,home_team VARCHAR) | SELECT venue FROM table_name_45 WHERE home_team = "richmond" |
Specify the maximum age of patients admitted to phys referral (normal) with brain mass or intracranial hemorrhage as their primary disease | 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 MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" |
Give me the comparison about Team_ID over the All_Games by a bar chart. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT All_Games, Team_ID FROM basketball_match |
which record is faster , 50km race walk or marathon | CREATE TABLE table_203_102 (id number,"event" text,"performance" text,"athlete" text,"nation" text,"place" text,"date" text) | SELECT "event" FROM table_203_102 WHERE "event" IN ('50 km race walk', 'marathon') ORDER BY "performance" LIMIT 1 |
history of peptic ulcer disease and / or gastrointestinal bleeding / perforation | CREATE TABLE table_train_203 ("id" int,"gender" string,"perforation" bool,"hemoglobin_a1c_hba1c" float,"peptic_ulcer_disease" bool,"serum_c_peptide" float,"gastrointestinal_disease" bool,"serum_creatinine" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_203 WHERE peptic_ulcer_disease = 1 OR gastrointestinal_disease = 1 OR perforation = 1 |
what is the last total co2 value for patient 030-41709 during their first hospital encounter? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunits... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-41709' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit... |
Which Home Team has a Road Team of rochester, and a Result of 71-78? | CREATE TABLE table_77452 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Home Team" FROM table_77452 WHERE "Road Team" = 'rochester' AND "Result" = '71-78' |
Who has 0 points in 1974? | CREATE TABLE table_name_3 (entrant VARCHAR,points VARCHAR,year VARCHAR) | SELECT entrant FROM table_name_3 WHERE points = 0 AND year = 1974 |
What is the D42 associated with a D47 of d 27? | CREATE TABLE table_71560 ("D 48" text,"D 47" text,"D 46" text,"D 45" text,"D 44" text,"D 43" text,"D 42" text,"D 41" text) | SELECT "D 42" FROM table_71560 WHERE "D 47" = 'd 27' |
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and employee_id , and visualize them by a bar chart, and order by the Y in ascending please. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,J... | SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID |
Top User Of a Particular Tag in Israel. | 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... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", u.Reputation, TagName, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JO... |
specify procedural long title of icd9 code 12 | 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 procedures.long_title FROM procedures WHERE procedures.icd9_code = "12" |
what is the year when the note is supporting and the title is rokumeikan? | CREATE TABLE table_57910 ("Year" real,"Title" text,"Original channel" text,"Role" text,"Note" text) | SELECT "Year" FROM table_57910 WHERE "Note" = 'supporting' AND "Title" = 'rokumeikan' |
flights from ONTARIO to ORLANDO | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE restriction (restriction_code text,advance_purchase i... | 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 = 'ONTARIO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLAND... |
find the number of patients diagnosed with mitral valve disorders. | 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 diagnoses.long_title = "Mitral valve disorders" |
out of total number of patients on urgent admission, how many of them were asian? | 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 WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "ASIAN" |
How many deaths per year have 66.3 as the life expectancy females? | CREATE TABLE table_23423_2 (deaths_per_year VARCHAR,life_expectancy_females VARCHAR) | SELECT deaths_per_year FROM table_23423_2 WHERE life_expectancy_females = "66.3" |
In what League is Left Wing Yanick Dupre? | CREATE TABLE table_name_94 (college_junior_club_team__league_ VARCHAR,position VARCHAR,player VARCHAR) | SELECT college_junior_club_team__league_ FROM table_name_94 WHERE position = "left wing" AND player = "yanick dupre" |
What is average round of Auburn College? | CREATE TABLE table_38437 ("Round" real,"Pick" real,"Player" text,"Position" text,"College" text) | SELECT AVG("Round") FROM table_38437 WHERE "College" = 'auburn' |
How many Attendances have a H / A of h on 7 march 1903? | CREATE TABLE table_39362 ("Date" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_39362 WHERE "H / A" = 'h' AND "Date" = '7 march 1903' |
which political party party has had the most mayors of austevoll ? | CREATE TABLE table_201_10 (id number,"#" number,"name" text,"office" text,"political party" text,"occupation" text) | SELECT "political party" FROM table_201_10 GROUP BY "political party" ORDER BY COUNT("name") DESC LIMIT 1 |
can you RENTAL CAR at STAPLETON INTERNATIONAL airport in DENVER | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND airport.airport_name LIKE 'STAPLETON INTERNATIONAL' AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND ground_service.airport_code... |
please list all flights leaving on thursday morning from NEW YORK to TORONTO | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE days (days... | 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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_nam... |
how many russian speaking patients were discharged to snf? | 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.language = "RUSS" AND demographic.discharge_location = "SNF" |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, order bars from high to low order please. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STAT... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
Posts with an image and no TeX. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score nu... | SELECT CreationDate, Id AS "post_link", Score FROM Posts WHERE NOT Body LIKE '%$%' AND Body LIKE '%img%' AND ClosedDate IS NULL ORDER BY CreationDate DESC |
What is the average number played for place 2 and more than 4 lost? | CREATE TABLE table_7294 ("Place (Posici\u00f3n)" real,"Team (Equipo)" text,"Played (PJ)" real,"Won (PG)" real,"Draw (PE)" real,"Lost (PP)" real,"Goals Scored (GF)" real,"Goals Conceded (GC)" real,"+/- (Dif.)" real,"Points (Pts.)" real) | SELECT AVG("Played (PJ)") FROM table_7294 WHERE "Place (Posici\u00f3n)" = '2' AND "Lost (PP)" > '4' |
Who were the directors of the film with the original title o.k.? | CREATE TABLE table_16350 ("Year [e ] (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Director" FROM table_16350 WHERE "Original title" = 'o.k.' |
What is Date, when Championship is Mackay? | CREATE TABLE table_44607 ("Outcome" text,"Date" text,"Championship" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Date" FROM table_44607 WHERE "Championship" = 'mackay' |
what is the total when bronze is more than 1, nation is hong kong (hkg) and gold is less than 3? | CREATE TABLE table_name_37 (total INTEGER,gold VARCHAR,bronze VARCHAR,nation VARCHAR) | SELECT SUM(total) FROM table_name_37 WHERE bronze > 1 AND nation = "hong kong (hkg)" AND gold < 3 |
Which Block does Northamptonshire Area have? | CREATE TABLE table_74566 ("Area" text,"Advertisement date" text,"Block" text,"Winning applicant" text,"Ensemble name" text) | SELECT "Block" FROM table_74566 WHERE "Area" = 'northamptonshire' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.