instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the apparent magnitude of NGC number 6027d?
CREATE TABLE table_name_14 (apparent_magnitude VARCHAR,ngc_number VARCHAR)
SELECT apparent_magnitude FROM table_name_14 WHERE ngc_number = "6027d"
What is listed as the highest ERP W with a Call sign of W262AC?
CREATE TABLE table_name_22 (erp_w INTEGER,call_sign VARCHAR)
SELECT MAX(erp_w) FROM table_name_22 WHERE call_sign = "w262ac"
For those employees who did not have any job in the past, show me about the distribution of job_id and the average of department_id , and group by attribute job_id in a bar chart, I want to list from high to low by the y axis.
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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID var...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC
What is the highest enrollment schools that joined the mac in 1997?
CREATE TABLE table_28395 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined MAC" real)
SELECT MAX("Enrollment") FROM table_28395 WHERE "Joined MAC" = '1997'
What is the Player in Round 5?
CREATE TABLE table_name_23 (player VARCHAR,round VARCHAR)
SELECT player FROM table_name_23 WHERE round = 5
How many countries got 796.7 points?
CREATE TABLE table_1059743_2 (rank VARCHAR,points VARCHAR)
SELECT COUNT(rank) FROM table_1059743_2 WHERE points = "796.7"
how many points did the team that scored 27 points in the 1987-88 season score?
CREATE TABLE table_19367 ("Team" text,"Average" text,"Points" real,"Played" real,"1986-87" text,"1987-88" text,"1988-89" real)
SELECT COUNT("Played") FROM table_19367 WHERE "1987-88" = '27'
Show the school name and type for schools without a school bus.
CREATE TABLE driver (driver_id number,name text,party text,home_city text,age number)CREATE TABLE school (school_id number,grade text,school text,location text,type text)CREATE TABLE school_bus (school_id number,driver_id number,years_working number,if_full_time others)
SELECT school, type FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)
Name the womens doubles when mixed doubles is potten ruth scott
CREATE TABLE table_14903881_1 (womens_doubles VARCHAR,mixed_doubles VARCHAR)
SELECT womens_doubles FROM table_14903881_1 WHERE mixed_doubles = "Potten Ruth Scott"
patients with positive results of any of the following serological tests: human immunodeficiency virus ( hiv ) _ 1 antibody, hepatitis b virus ( hbv ) surface antigen ( hbsag ) , anti _ hepatitis b core antibody ( hbcab ) , and anti _ hepatitis c virus ( hcv ) antibody ( hcv ab ) .
CREATE TABLE table_test_31 ("id" int,"ejection_fraction_ef" int,"macular_disease" bool,"systemic" bool,"alt" float,"iud" bool,"condom_with_spermicide" bool,"gender" string,"meropenem" bool,"non_q_wave_myocardial_infarction" bool,"hbcab" bool,"unstable_angina" bool,"birth_control_pills" bool,"cystic_fibrosis" bool,"hbv_...
SELECT * FROM table_test_31 WHERE serological_tests = 1 OR (hiv_infection = 1 OR hbv_surface_antigen_hbsag = 1 OR anti_hepatitis_b_core_antibody = 1 OR hbcab = 1 OR anti_hepatitis_c_virus_hcv_antibody = 1 OR hcv_ab = 1)
what is the number of patients whose age is less than 55 and drug code is phyt1l?
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 demographic.age < "55" AND prescriptions.formulary_drug_cd = "PHYT1L"
what was the first time that the arterial bp [diastolic] of patient 7400 was, on 01/15/last year, greater than 83.0?
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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,...
SELECT chartevents.charttime 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 = 7400)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
how many patients whose ethnicity is white and procedure short title is sm bowel exteriorization?
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 demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Sm bowel exteriorization"
Which Genre has a Game of donkey kong country?
CREATE TABLE table_79586 ("Year" real,"Game" text,"Genre" text,"Platform" text,"Publisher" text)
SELECT "Genre" FROM table_79586 WHERE "Game" = 'donkey kong country'
What is the Outcome of the jounieh tournament?
CREATE TABLE table_name_73 (outcome VARCHAR,tournament VARCHAR)
SELECT outcome FROM table_name_73 WHERE tournament = "jounieh"
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time.
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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25)...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
tell me the top three most common output events that were until 1 year ago?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyst...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
Create a bar chart showing manager_id across last name, and show by the X-axis in ascending please.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 locations (LOCAT...
SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY LAST_NAME
If the team is Billy Ballew Motorsports, what is the race time?
CREATE TABLE table_2260452_1 (race_time VARCHAR,team VARCHAR)
SELECT race_time FROM table_2260452_1 WHERE team = "Billy Ballew Motorsports"
How many millions of viewers watched the 'Throwing Heat' episode?
CREATE TABLE table_16538 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "U.S. viewers (millions)" FROM table_16538 WHERE "Title" = 'Throwing Heat'
what were the four most most common specimen tests in 2101?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_d...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) = '2101' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
Bar chart x axis away team y axis the number of away team, sort by the bars in asc.
CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team text,Score text,Competition text)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendan...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY Away_team
What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, sort y-axis from high to low order please.
CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name) DESC
On which circuit was the lites race two winning team #13 Inspire Motorsports?
CREATE TABLE table_28834 ("Rnd" real,"Circuit" text,"Lites 1 Race One Winning Team" text,"Lites 2 Race One Winning Team" text,"Lites 1 Race Two Winning Team" text,"Lites 2 Race Two Winning Team" text)
SELECT "Circuit" FROM table_28834 WHERE "Lites 1 Race Two Winning Team" = '#13 Inspire Motorsports'
Return a scatter on what are the low and high estimates of film markets?
CREATE TABLE market (Market_ID int,Country text,Number_cities int)CREATE TABLE film (Film_ID int,Title text,Studio text,Director text,Gross_in_dollar int)CREATE TABLE film_market_estimation (Estimation_ID int,Low_Estimate real,High_Estimate real,Film_ID int,Type text,Market_ID int,Year int)
SELECT Low_Estimate, High_Estimate FROM film_market_estimation
give me the number of patients whose primary disease is hemopytsis and days of hospital stay is greater than 3?
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 WHERE demographic.diagnosis = "HEMOPYTSIS" AND demographic.days_stay > "3"
what are commonly cited papers by tom mitchell and oren etzioni ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE field (fieldid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numcit...
SELECT DISTINCT author.authorname, cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname IN ('tom mitchell', 'oren etzioni') AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid, author.au...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the average of department_id , and group by attribute job_id, and visualize them by a bar chart.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))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,JO...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
since 2103 how many patients were diagnosed with atrial fibrillation within 2 months after the diagnosis of need prphyl vc vrl hepat?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)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...
SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'atrial fibrillatio...
What place did the golfer take whose country is South Africa?
CREATE TABLE table_58931 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_58931 WHERE "Country" = 'south africa'
Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.
CREATE TABLE film_actor (actor_id number,film_id number,last_update time)CREATE TABLE inventory (inventory_id number,film_id number,store_id number,last_update time)CREATE TABLE city (city_id number,city text,country_id number,last_update time)CREATE TABLE store (store_id number,manager_staff_id number,address_id numbe...
SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1
In the game with the venue of mcg, what was the attendance?
CREATE TABLE table_11515 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Crowd" FROM table_11515 WHERE "Venue" = 'mcg'
what are the five most commonly ordered lab tests for patients with age 60 or above until 1 year ago?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5
Bar chart x axis type y axis total number of enrollment, and could you sort bars in asc order?
CREATE TABLE building (building_id text,Name text,Street_address text,Years_as_tallest text,Height_feet int,Floors int)CREATE TABLE Institution (Institution_id text,Institution text,Location text,Founded real,Type text,Enrollment int,Team text,Primary_Conference text,building_id text)CREATE TABLE protein (common_name t...
SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY Type
What was the result of the game when they were 2-1?
CREATE TABLE table_20746062_1 (result VARCHAR,record VARCHAR)
SELECT result FROM table_20746062_1 WHERE record = "2-1"
how many patients whose age is less than 50 and lab test category is blood gas?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab."CATEGORY" = "Blood Gas"
What was the position (P) for Clapham?
CREATE TABLE table_17746 ("No." real,"P" text,"Name" text,"Country" text,"Age" real,"Loan Club" text,"Started" text,"Ended" text,"Start Source" text,"End Source" text)
SELECT "P" FROM table_17746 WHERE "Name" = 'Clapham'
What is the location for 2012?
CREATE TABLE table_13333 ("Location" text,"Year" real,"Champion" text,"Runner-up" text,"Score" text,"Name" text)
SELECT "Location" FROM table_13333 WHERE "Year" = '2012'
What is the total credit does each department offer.
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 TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE DEPARTMENT (DEPT_CODE var...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
what is the drug name and drug route of drug code nyst500t?
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NYST500T"
What is the total number of bronzes with totals under 4 and ranks of 10?
CREATE TABLE table_name_43 (bronze VARCHAR,total VARCHAR,rank VARCHAR)
SELECT COUNT(bronze) FROM table_name_43 WHERE total < 4 AND rank = "10"
What club has 536 points for?
CREATE TABLE table_18956 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Points" text)
SELECT "Club" FROM table_18956 WHERE "Points for" = '536'
What song is later than place 2 and has a draw number of 1?
CREATE TABLE table_53281 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" real)
SELECT "Song" FROM table_53281 WHERE "Place" > '2' AND "Draw" = '1'
Top users sorted by percentage of answers on closed questions.
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 "user_link", Reputation, (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = Users.Id AND PostTypeId = 2) AS TotalAnswers, (SELECT COUNT(*) FROM Posts AS aPosts LEFT JOIN Posts AS qPosts ON qPosts.PostTypeId = 1 AND qPosts.Id = aPosts.ParentId WHERE aPosts.OwnerUserId = Users.Id AND aPosts.PostTypeId = 2 AND N...
What is the 2005 that has a grand slam tournaments in 2007?
CREATE TABLE table_40486 ("Tournament" text,"2004" text,"2005" text,"2006" text,"2007" text)
SELECT "2005" FROM table_40486 WHERE "2007" = 'grand slam tournaments'
What Scores by each individual judge has a Status of eliminated, and a Date performed of august 13?
CREATE TABLE table_12293 ("Main contestant" text,"Co-contestant (Yaar vs. Pyaar)" text,"Date performed" text,"Scores by each individual judge" text,"Total score/week" text,"Position" text,"Status" text)
SELECT "Scores by each individual judge" FROM table_12293 WHERE "Status" = 'eliminated' AND "Date performed" = 'august 13'
Name the number of location attendance for l 141 143 (ot)
CREATE TABLE table_17102076_10 (location_attendance VARCHAR,score VARCHAR)
SELECT COUNT(location_attendance) FROM table_17102076_10 WHERE score = "L 141–143 (OT)"
count the number of patients whose diagnoses long title is other psoriasis?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other psoriasis"
If the place is smaller than 8 and they played more than 18, what is the total number of goals conceded?
CREATE TABLE table_name_54 (goals_conceded VARCHAR,place VARCHAR,played VARCHAR)
SELECT COUNT(goals_conceded) FROM table_name_54 WHERE place < 8 AND played > 18
What is the number of private insurance patients who have had red blood cells lab tests?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Red Blood Cells"
What is the date of the game at the Pro Player Stadium that had a score of 4-1?
CREATE TABLE table_11447 ("Date" text,"Winning Team" text,"Losing Team" text,"Score" text,"Venue" text)
SELECT "Date" FROM table_11447 WHERE "Venue" = 'pro player stadium' AND "Score" = '4-1'
What if the description of a ch-47d chinook?
CREATE TABLE table_10006830_1 (description VARCHAR,aircraft VARCHAR)
SELECT description FROM table_10006830_1 WHERE aircraft = "CH-47D Chinook"
Name the total number of series for april 26
CREATE TABLE table_17621978_11 (series VARCHAR,date VARCHAR)
SELECT COUNT(series) FROM table_17621978_11 WHERE date = "April 26"
What is the average Bronze for rank 3 and total is more than 8?
CREATE TABLE table_name_1 (bronze INTEGER,rank VARCHAR,total VARCHAR)
SELECT AVG(bronze) FROM table_name_1 WHERE rank = "3" AND total > 8
What are the name of pilots aged 25 or older?
CREATE TABLE pilot (Name VARCHAR,Age VARCHAR)
SELECT Name FROM pilot WHERE Age >= 25
Which Place has a Player of lee trevino?
CREATE TABLE table_9564 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_9564 WHERE "Player" = 'lee trevino'
Find employee with ID and name of the country presently where (s)he is working.
CREATE TABLE employees (employee_id VARCHAR,department_id VARCHAR)CREATE TABLE countries (country_name VARCHAR,country_id VARCHAR)CREATE TABLE locations (location_id VARCHAR,country_id VARCHAR)CREATE TABLE departments (department_id VARCHAR,location_id VARCHAR)
SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id
How many loses corresponded to giving up 714 points?
CREATE TABLE table_12792876_2 (lost VARCHAR,points_against VARCHAR)
SELECT lost FROM table_12792876_2 WHERE points_against = "714"
I want the fastest lap for round of 16
CREATE TABLE table_name_18 (fastest_lap VARCHAR,round VARCHAR)
SELECT fastest_lap FROM table_name_18 WHERE round = 16
WHAT IS THE GROSS WITH A DIRECTOR OF RICHARD TUGGLE?
CREATE TABLE table_7840 ("Rank" real,"Title" text,"Studio" text,"Director" text,"Gross" text)
SELECT "Gross" FROM table_7840 WHERE "Director" = 'richard tuggle'
What is the Judaism percentage associated with Buddhism at 0.01% and Other at 0.13%?
CREATE TABLE table_45944 ("Ethnicity" text,"Islam" text,"Christianity" text,"Judaism" text,"Buddhism" text,"Other" text,"Atheism" text)
SELECT "Judaism" FROM table_45944 WHERE "Other" = '0.13%' AND "Buddhism" = '0.01%'
What are the total points for the skier with 3.18 slalom points?
CREATE TABLE table_name_33 (total VARCHAR,slalom_points VARCHAR)
SELECT total FROM table_name_33 WHERE slalom_points = "3.18"
Visualize a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Road, order in asc by the y axis.
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_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID
Can you tell me the Position that has the CFL Team of toronto?
CREATE TABLE table_8951 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Position" FROM table_8951 WHERE "CFL Team" = 'toronto'
Calculate the number of patients with episodic mood disord nos, born before 1837.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "1837" AND diagnoses.short_title = "Episodic mood disord NOS"
what is insurance of subject name jerry deberry?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT demographic.insurance FROM demographic WHERE demographic.name = "Jerry Deberry"
what is discharge location of subject name jerry deberry?
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 demographic.discharge_location FROM demographic WHERE demographic.name = "Jerry Deberry"
How many games played catagories are there for Lauren McGee?
CREATE TABLE table_73791 ("Number" real,"Name" text,"Games Played" real,"Games Started" real,"Goals" real,"Assists" real,"Points" real,"Shots" real)
SELECT COUNT("Games Played") FROM table_73791 WHERE "Name" = 'Lauren McGee'
What is the average draws for the song 'Europe is My Home!'?
CREATE TABLE table_66636 ("Draw" real,"Artist" text,"Song" text,"Percentage" text,"Place" real)
SELECT AVG("Draw") FROM table_66636 WHERE "Song" = 'europe is my home!'
how many treaties had been introduced by 1986 ?
CREATE TABLE table_203_109 (id number,"treaty" text,"organization" text,"introduced" number,"signed" number,"ratified" number)
SELECT COUNT("treaty") FROM table_203_109 WHERE "ratified" >= 1986
provide the number of patients whose ethnicity is white and diagnoses short title is hyperlipidemia nec/nos?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Hyperlipidemia NEC/NOS"
Which years did the player from Providence play for the Grizzlies as small forward?
CREATE TABLE table_name_96 (years_for_grizzlies VARCHAR,position VARCHAR,school_club_team VARCHAR)
SELECT years_for_grizzlies FROM table_name_96 WHERE position = "small forward" AND school_club_team = "providence"
Who is the player from the United States with a t6 place and a 71-70-76-72=289 score?
CREATE TABLE table_name_67 (player VARCHAR,country VARCHAR,place VARCHAR,score VARCHAR)
SELECT player FROM table_name_67 WHERE country = "united states" AND place = "t6" AND score = 71 - 70 - 76 - 72 = 289
find a flight from SAN FRANCISCO to BOSTON on wednesday
CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion va...
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 = 'BOSTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da...
Draw a bar chart of first name versus manager_id, and list bar from high to low 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 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)...
SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY FIRST_NAME DESC
Where is pine valley?
CREATE TABLE table_name_23 (location VARCHAR,name VARCHAR)
SELECT location FROM table_name_23 WHERE name = "pine valley"
Which conference joined in 1954 with a beavers mascot?
CREATE TABLE table_66107 ("School (IHSAA ID#)" text,"Location" text,"Mascot" text,"# / County" text,"Year Joined" real,"Year Left" real,"Conference Joined" text)
SELECT "Conference Joined" FROM table_66107 WHERE "Year Joined" = '1954' AND "Mascot" = 'beavers'
give me the number of patients whose diagnoses long title is benign neoplasm of spinal meninges and drug type is base?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of spinal meninges" AND prescriptions.drug_type = "BASE"
for the first time in this month, when was patient 022-187132 prescribed ondansetron 4 mg po tbdp and famotidine 20 mg po tabs at the same time?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ondansetron 4 mg po tbdp' AND patient.uniquepid = '022-187132' AND DATETIME(medication.drugstarttime, 'start of month') =...
count the number of patients who had a vte prophylaxis - low molecular weight heparin within the same hospital visit after having been diagnosed with hyponatremia until 2100.
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, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyponatremia' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2100') AS t...
What was the Winning score when the Margin of victory is 5 strokes and the Date was 6 Sep 2009?
CREATE TABLE table_53825 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Winning score" FROM table_53825 WHERE "Margin of victory" = '5 strokes' AND "Date" = '6 sep 2009'
Which country has less than 4 votes?
CREATE TABLE table_name_99 (state VARCHAR,council_votes INTEGER)
SELECT state FROM table_name_99 WHERE council_votes < 4
what was the first type of the hospital admission of patient 025-23610 until 2 years 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 patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '025-23610' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1
What score has friendly as the competition?
CREATE TABLE table_61467 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Score" FROM table_61467 WHERE "Competition" = 'friendly'
Interesting questions, per comments on them.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE FlagTypes (Id number,Name text,Description t...
SELECT Id AS "comment_link" FROM Comments WHERE (LOWER(Text) LIKE 'interesting question%' OR LOWER(Text) LIKE 'an interesting question%') AND LENGTH(Text) <= 25 ORDER BY CreationDate DESC
flights from BALTIMORE to SAN FRANCISCO
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
SO Users with Gold Badges Related to a Given Tag. Does what it says on the tin. Enter a valid Tag, and if there is anyone with a Gold badge for that tag, get all the available info for them. Change: WHERE UPPER(b.name) LIKE UPPER('%' + ##Tag:string## + '%') AND b.TagBased = 1 AND b.Class = 1 to WHERE UPPER(b.n...
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Votes (Id number,PostId number,Vot...
SELECT * FROM Badges WHERE TagBased = 1
Which title has 147 as no. in series?
CREATE TABLE table_2818164_7 (title VARCHAR,no_in_series VARCHAR)
SELECT title FROM table_2818164_7 WHERE no_in_series = 147
did the value of mcv of patient 002-41152 last measured on the last hospital visit be greater than first measured on the last hospital visit?
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 treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
where catalog number is 81258 , what are all the studio ?
CREATE TABLE table_11222744_2 (studio VARCHAR,catalog_number VARCHAR)
SELECT studio FROM table_11222744_2 WHERE catalog_number = "81258"
What date is the release when the label was Parlophone and the catalog was 582 2912?
CREATE TABLE table_42463 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Date" FROM table_42463 WHERE "Label" = 'parlophone' AND "Catalog" = '582 2912'
What is the most losses for teams with under 2 wins, more than 6 points, and a position under 11?
CREATE TABLE table_name_19 (losses INTEGER,points VARCHAR,wins VARCHAR,position VARCHAR)
SELECT MAX(losses) FROM table_name_19 WHERE wins < 2 AND position < 11 AND points > 6
does any whitworth size have the same core diameter as the number drill 26 ?
CREATE TABLE table_204_828 (id number,"whitworth size (in)" number,"core diameter (in)" number,"threads per inch" number,"pitch (in)" number,"tapping drill size" text)
SELECT "whitworth size (in)" FROM table_204_828 WHERE "tapping drill size" = 'number drill 26 (3.7 mm)'
Which player is from Northern Ireland?
CREATE TABLE table_61125 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_61125 WHERE "Country" = 'northern ireland'
What were the notes in Toronto, Canada?
CREATE TABLE table_name_32 (notes VARCHAR,venue VARCHAR)
SELECT notes FROM table_name_32 WHERE venue = "toronto, canada"
When was the result 0 3?
CREATE TABLE table_name_48 (date VARCHAR,result VARCHAR)
SELECT date FROM table_name_48 WHERE result = "0–3"
What is the height of the cornerback position?
CREATE TABLE table_2362 ("Round" real,"Choice" real,"Player" text,"Position" text,"Height" text,"Weight" text,"College" text)
SELECT COUNT("Height") FROM table_2362 WHERE "Position" = 'Cornerback'
What's the total number of all divisions during the 2006/07 season where they scored more than 1 goal?
CREATE TABLE table_name_54 (division VARCHAR,season VARCHAR,goals VARCHAR)
SELECT COUNT(division) FROM table_name_54 WHERE season = "2006/07" AND goals > 1
What is the date of the Sydney, Australia tournament with a hard surface?
CREATE TABLE table_38732 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text)
SELECT "Date" FROM table_38732 WHERE "Surface" = 'hard' AND "Tournament" = 'sydney, australia'
what is the measure number for the init type?
CREATE TABLE table_256286_18 (meas_num VARCHAR,type VARCHAR)
SELECT meas_num FROM table_256286_18 WHERE type = "Init"