instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
How many patients receiving inhalation therapy were born before the year 2167?
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.dob_year < "2167" AND prescriptions.route = "INHALATION"
Is there a Venus that's a year later than 2002, with an Event of 4x400m relay in 4th Position?
CREATE TABLE table_15729 ("Year" real,"Venue" text,"Position" text,"Event" text,"Notes" text)
SELECT "Venue" FROM table_15729 WHERE "Event" = '4x400m relay' AND "Year" > '2002' AND "Position" = '4th'
Return a bar chart about the distribution of other_details and the amount of other_details , and group by attribute other_details.
CREATE TABLE Teachers (teacher_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARCHAR(80),last_name VARCHAR(80),gender VARCHAR(1),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),other_details VARCHAR(255))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id ...
SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
Bring me the number of patients diagnosed with benign neoplasm of pituitary gland who had a blood test.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Benign neo pituitary" AND lab.fluid = "Blood"
How many different C_{high} values are there for the good category?
CREATE TABLE table_1942366_9 (high VARCHAR,category VARCHAR)
SELECT STRUCT(high) FROM table_1942366_9 WHERE category = "Good"
i'd like to go from BOSTON to SAN FRANCISCO stopping in PITTSBURGH
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_stop ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
Which school did the player then go to Auburn?
CREATE TABLE table_11677691_7 (school VARCHAR,college VARCHAR)
SELECT school FROM table_11677691_7 WHERE college = "Auburn"
which team picked directly after the detroit lions chose gary steele ?
CREATE TABLE table_203_229 (id number,"pick #" number,"nfl team" text,"player" text,"position" text,"college" text)
SELECT "nfl team" FROM table_203_229 WHERE "pick #" = (SELECT "pick #" FROM table_203_229 WHERE "nfl team" = 'detroit lions' AND "player" = 'gary steele') + 1
What is the format for the MHCP-66 Catalog?
CREATE TABLE table_name_24 (format VARCHAR,catalog VARCHAR)
SELECT format FROM table_name_24 WHERE catalog = "mhcp-66"
Provide the number of american indian/alaska native ethnic background patients who had a pco2 lab test.
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "pCO2"
Top users in Khorasan province in Iran.
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.Id AS "user_link", 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 v.VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.CommunityOwnedDate IS NULL AND LOWER(t.TagName) ...
What was the Outcome of the match played on Hard (i) Surface?
CREATE TABLE table_name_16 (outcome VARCHAR,surface VARCHAR)
SELECT outcome FROM table_name_16 WHERE surface = "hard (i)"
which airline has the highest license #
CREATE TABLE table_203_58 (id number,"airline" text,"airline (in russian)" text,"licence #" number,"icao" text,"iata" text,"domestic code" text,"callsign" text,"photo" text)
SELECT "airline" FROM table_203_58 ORDER BY "licence #" DESC LIMIT 1
What score has Toronto Eagles as the home?
CREATE TABLE table_name_57 (score VARCHAR,home VARCHAR)
SELECT score FROM table_name_57 WHERE home = "toronto eagles"
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the last_name by a bar chart, I want to display in descending by the X please.
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LO...
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 LAST_NAME DESC
Name the mens doubles for dimitrij ovtcharov
CREATE TABLE table_30325 ("Year Location" text,"Mens Singles" text,"Womens Singles" text,"Mens Doubles" text,"Womens Doubles" text)
SELECT "Mens Doubles" FROM table_30325 WHERE "Mens Singles" = 'Dimitrij Ovtcharov'
What is the amount of marginal ordinary income tax rate for single in which the range is $8,351 $33,950?
CREATE TABLE table_11647327_2 (marginal_ordinary_income_tax_rate VARCHAR,single VARCHAR)
SELECT COUNT(marginal_ordinary_income_tax_rate) FROM table_11647327_2 WHERE single = "$8,351– $33,950"
how much is the change of arterial bp [diastolic] of patient 28443 last measured on the current intensive care unit visit compared to the value second to last measured on the current intensive care unit visit?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE patients (row_id number,...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
Deleted users by their posts.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivileg...
SELECT OwnerDisplayName, MAX(CreationDate), COUNT(*) AS Count FROM Posts WHERE OwnerUserId IS NULL GROUP BY OwnerDisplayName ORDER BY Count DESC, OwnerDisplayName LIMIT 100
A line chart shows how many churches open each year?
CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text)CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int)
SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date
allergy to sulfa;
CREATE TABLE table_train_182 ("id" int,"allergy_to_sulfa" bool,"creatinine_clearance_cl" float,"liver_disease" bool,"allergy_to_glyburide" bool,"allergy_to_metformin" bool,"NOUSE" float)
SELECT * FROM table_train_182 WHERE allergy_to_sulfa = 1
what is drug type of drug code simv10?
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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.formulary_drug_cd = "SIMV10"
Name the total number of high rebounds for february 10
CREATE TABLE table_21237 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("High rebounds") FROM table_21237 WHERE "Date" = 'February 10'
what was the name of the lab test that in 11/2104 patient 004-54892 received for the first time?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-54892')) AND STRFTIME('%y-%m', lab.labresulttime) = '2104-11' ORDER BY lab.labresultt...
What is the average frequency in MHz for stations with an ERP W of 170?
CREATE TABLE table_name_54 (frequency_mhz INTEGER,erp_w VARCHAR)
SELECT AVG(frequency_mhz) FROM table_name_54 WHERE erp_w = 170
Which Award Ceremony has a Nominee of sarah travis, and a Category of the best orchestrations?
CREATE TABLE table_name_87 (award_ceremony VARCHAR,nominee VARCHAR,category VARCHAR)
SELECT award_ceremony FROM table_name_87 WHERE nominee = "sarah travis" AND category = "best orchestrations"
what is the largest number of births recorded ?
CREATE TABLE table_203_117 (id number,"region/country" text,"1882-\n1918" number,"1919-\n1948" number,"1948-\n1951" number,"1952-\n1960" number,"1961-\n1971" number,"1972-\n1979" number,"1980-\n1989" number,"1990-\n2001" number,"2002-\n2010" number,"2011-\n2013" number,"total" number)
SELECT MAX("total") FROM table_203_117
what is the average cost in a hospital involving a laboratory test for gentamicin - random?
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 AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'gentamicin - random')) GROUP BY cost.patienthealthsystemstayid) AS t...
what is the average gold when rank is total and silver is more than 20?
CREATE TABLE table_name_32 (gold INTEGER,rank VARCHAR,silver VARCHAR)
SELECT AVG(gold) FROM table_name_32 WHERE rank = "total" AND silver > 20
Where is the place that has a Callsign of DWRJ-FM?
CREATE TABLE table_71397 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Station Type" text,"Location" text)
SELECT "Location" FROM table_71397 WHERE "Callsign" = 'dwrj-fm'
What is the Rank of the Nation with 0 Silver and more than 1 Bronze?
CREATE TABLE table_name_24 (rank INTEGER,silver VARCHAR,bronze VARCHAR)
SELECT MAX(rank) FROM table_name_24 WHERE silver < 1 AND bronze > 1
How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1?
CREATE TABLE table_name_85 (goals_against VARCHAR,drawn VARCHAR,lost VARCHAR,goals_for VARCHAR)
SELECT COUNT(goals_against) FROM table_name_85 WHERE lost > 7 AND goals_for < 27 AND drawn > 1
where did mark mulder go to school
CREATE TABLE table_203_618 (id number,"pick" number,"player" text,"team" text,"position" text,"school" text)
SELECT "school" FROM table_203_618 WHERE "player" = 'mark mulder'
how many patients died in the same hospital encounter after having been diagnosed the previous year with grand mal status?
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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid numb...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_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 FRO...
Which Lost has Drawn larger than 1, and a Played larger than 14?
CREATE TABLE table_63549 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real)
SELECT MIN("Lost") FROM table_63549 WHERE "Drawn" > '1' AND "Played" > '14'
Find the distinct names of all songs that have a higher resolution than some songs in English.
CREATE TABLE song (song_name VARCHAR,resolution INTEGER,languages VARCHAR)
SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = "english")
What brakes for the 4-speed automatic gearbox?
CREATE TABLE table_250230_2 (brakes VARCHAR,gearbox VARCHAR)
SELECT brakes FROM table_250230_2 WHERE gearbox = "4-speed automatic"
Who had the fastest lap in round 15?
CREATE TABLE table_30950 ("Rd." real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Constructor" text,"Report" text)
SELECT "Fastest Lap" FROM table_30950 WHERE "Rd." = '15'
What school has the Kansas City Royals for a team?
CREATE TABLE table_64580 ("Pick" real,"Player" text,"Team" text,"Position" text,"School" text)
SELECT "School" FROM table_64580 WHERE "Team" = 'kansas city royals'
Which game had an attendance of 56,271?
CREATE TABLE table_name_12 (date VARCHAR,attendance VARCHAR)
SELECT date FROM table_name_12 WHERE attendance = "56,271"
How many Wins have a Top-10 smaller than 6, and Cuts made larger than 7, and a Top-5 of 0?
CREATE TABLE table_6547 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT COUNT("Wins") FROM table_6547 WHERE "Top-10" < '6' AND "Cuts made" > '7' AND "Top-5" = '0'
Who was the Team that was played against on February 24 and a game after game 55?
CREATE TABLE table_name_61 (team VARCHAR,game VARCHAR,date VARCHAR)
SELECT team FROM table_name_61 WHERE game > 55 AND date = "february 24"
How many songs appear in studio albums?
CREATE TABLE albums (aid number,title text,year number,label text,type text)CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE performance (songid number,bandmate number...
SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = "Studio"
What is the least amount of total medals won?
CREATE TABLE table_73378 ("Rank" real,"Athlete" text,"Nation" text,"Olympics" text,"Gold" real,"Silver" real,"Bronze" real,"Total(min. 2 medals)" real)
SELECT MIN("Total(min. 2 medals)") FROM table_73378
How many points did the opponents with a 6-2 record against the Spartans score?
CREATE TABLE table_22860990_3 (opp_points INTEGER,record VARCHAR)
SELECT MIN(opp_points) FROM table_22860990_3 WHERE record = "6-2"
What is the Tonnage that has builder AG Vulcan, and the original operator NDL, and the ship, Prinzess Irene?
CREATE TABLE table_name_9 (tonnage VARCHAR,ship VARCHAR,builder VARCHAR,original_operator VARCHAR)
SELECT tonnage FROM table_name_9 WHERE builder = "ag vulcan" AND original_operator = "ndl" AND ship = "prinzess irene"
What was the maximum round where Marc Lieb Richard Lietz was on the GT2 Winning Team?
CREATE TABLE table_27151 ("Rnd." real,"Circuit" text,"LMP1 Winning Team" text,"LMP2 Winning Team" text,"FLM Winning Team" text,"GT1 Winning Team" text,"GT2 Winning Team" text,"Results" text)
SELECT MAX("Rnd.") FROM table_27151 WHERE "GT2 Winning Team" = 'Marc Lieb Richard Lietz'
what is the least expensive BUSINESS class flight between ATLANTA and DALLAS
CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE class_of_service (boo...
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, fare AS FARE_0, fare AS FARE_1, fare_basis, flight, flight_fare AS FLIGHT_FARE_0, flight_fare AS FLIGHT_FARE_1 WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY...
Which tag is used for which release title?
CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text)
SELECT T1.tag, T2.groupname FROM torrents AS T2 JOIN tags AS T1 ON T1.id = T2.id
How many years has Japan won silver?
CREATE TABLE table_name_4 (year INTEGER,silver VARCHAR)
SELECT SUM(year) FROM table_name_4 WHERE silver = "japan"
Users with highest average viewcount of their questions.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean...
SELECT RANK() OVER (ORDER BY AVG(CAST(p.ViewCount AS FLOAT)) DESC) AS "rank", p.OwnerUserId AS "user_link", p.OwnerDisplayName, AVG(CAST(p.ViewCount AS FLOAT)) AS "average_viewcount", SUM(p.ViewCount) AS "total_views", SUM(CASE WHEN p.CommunityOwnedDate IS NULL THEN p.ViewCount ELSE 0 END) AS "noncw_views", COUNT(p.Id)...
Which Seatshave a Share of votes of 18%, and a Share of seats of 3%, and a General election smaller than 1992?
CREATE TABLE table_name_6 (seats INTEGER,general_election VARCHAR,share_of_votes VARCHAR,share_of_seats VARCHAR)
SELECT MIN(seats) FROM table_name_6 WHERE share_of_votes = "18%" AND share_of_seats = "3%" AND general_election < 1992
What is the total for the year (s) won in 1977?
CREATE TABLE table_name_99 (total VARCHAR,year_s__won VARCHAR)
SELECT total FROM table_name_99 WHERE year_s__won = "1977"
What is the lowest number of blocks for players with height of 206 and more than 356 spikes?
CREATE TABLE table_name_69 (block INTEGER,height VARCHAR,spike VARCHAR)
SELECT MIN(block) FROM table_name_69 WHERE height = 206 AND spike > 356
Which organisation hired the most number of research staff? List the organisation id, type and detail.
CREATE TABLE tasks (task_id number,project_id number,task_details text,eg agree objectives text)CREATE TABLE research_staff (staff_id number,employer_organisation_id number,staff_details text)CREATE TABLE grants (grant_id number,organisation_id number,grant_amount number,grant_start_date time,grant_end_date time,other_...
SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM organisations AS T1 JOIN research_staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
What is the preliminary score associated with the interview score of 8.488?
CREATE TABLE table_12338595_1 (preliminaries VARCHAR,interview VARCHAR)
SELECT COUNT(preliminaries) FROM table_12338595_1 WHERE interview = "8.488"
Count the number of markets that have a number of cities lower than 300.
CREATE TABLE film_market_estimation (estimation_id number,low_estimate number,high_estimate number,film_id number,type text,market_id number,year number)CREATE TABLE film (film_id number,title text,studio text,director text,gross_in_dollar number)CREATE TABLE market (market_id number,country text,number_cities number)
SELECT COUNT(*) FROM market WHERE number_cities < 300
What is the rank of the gatchaman Jinpei?
CREATE TABLE table_name_38 (rank VARCHAR,gatchaman VARCHAR)
SELECT rank FROM table_name_38 WHERE gatchaman = "jinpei"
What is the ship in the Cunard line from Liverpool 19 29 July?
CREATE TABLE table_66009 ("Ship" text,"Year" real,"Dates" text,"Line" text,"From" text,"Distance" text,"Days,hours,minutes" text,"Speed" text)
SELECT "Ship" FROM table_66009 WHERE "Line" = 'cunard' AND "From" = 'liverpool' AND "Dates" = '19 – 29 july'
Which player is an offensive tackle for the New York Jets?
CREATE TABLE table_name_37 (player VARCHAR,position VARCHAR,afl_team VARCHAR)
SELECT player FROM table_name_37 WHERE position = "offensive tackle" AND afl_team = "new york jets"
Which Rank is the lowest one that has a Nation of switzerland, and a Bronze smaller than 0?
CREATE TABLE table_6363 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Rank") FROM table_6363 WHERE "Nation" = 'switzerland' AND "Bronze" < '0'
When the duration was 11 min, 34 sec, what was the feathered (Fxx)?
CREATE TABLE table_name_37 (feathered__fxx_ VARCHAR,duration VARCHAR)
SELECT feathered__fxx_ FROM table_name_37 WHERE duration = "11 min, 34 sec"
Name the total number of roll for st joseph's school when decile is less than 5
CREATE TABLE table_name_19 (roll VARCHAR,name VARCHAR,decile VARCHAR)
SELECT COUNT(roll) FROM table_name_19 WHERE name = "st joseph's school" AND decile < 5
How much Money is requested by BassToneSlap?
CREATE TABLE table_name_10 (money_requested__£_ VARCHAR,company_or_product_name VARCHAR)
SELECT money_requested__£_ FROM table_name_10 WHERE company_or_product_name = "basstoneslap"
A Pick # larger than 339 and the College that has a Round of 14 is what?
CREATE TABLE table_name_52 (college VARCHAR,round VARCHAR,pick__number VARCHAR)
SELECT college FROM table_name_52 WHERE round = 14 AND pick__number > 339
What is the Albedo name for Neruda?
CREATE TABLE table_36682 ("Name" text,"Number" text,"Namesake" text,"Albedo feature name" text,"Area" text,"Current map" text)
SELECT "Albedo feature name" FROM table_36682 WHERE "Name" = 'neruda'
What religion has a para of 56.5%?
CREATE TABLE table_name_65 (religion VARCHAR,para VARCHAR)
SELECT religion FROM table_name_65 WHERE para = "56.5%"
High scoring non-CW posts per month.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Posts (Id number,PostTypeId number,Accepted...
SELECT LAST_DATE_OF_MONTH(CreationDate), COUNT(Id) AS Posts, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE (Score >= '##min?50##') AND (CommunityOwnedDate IS NULL) GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_...
Longest custom edit rejection reasons.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerU...
SELECT COUNT(*) AS num, LENGTH(Comment) AS length, Comment FROM ReviewTaskResults GROUP BY Comment ORDER BY LENGTH(Comment) DESC LIMIT 200
How many assets can each parts be used in? List the part name and the number with a bar chart, sort from high to low by the Y.
CREATE TABLE Fault_Log_Parts (fault_log_entry_id INTEGER,part_fault_id INTEGER,fault_status VARCHAR(10))CREATE TABLE Engineer_Visits (engineer_visit_id INTEGER,contact_staff_id INTEGER,engineer_id INTEGER,fault_log_entry_id INTEGER,fault_status VARCHAR(10),visit_start_datetime DATETIME,visit_end_datetime DATETIME,other...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) DESC
Which builder completed after 1889?
CREATE TABLE table_name_93 (builder VARCHAR,completed INTEGER)
SELECT builder FROM table_name_93 WHERE completed > 1889
Who played against TSV bayer 04 leverkusen when they were team #1?
CREATE TABLE table_name_9 (team__number1 VARCHAR)
SELECT 2 AS nd_leg FROM table_name_9 WHERE team__number1 = "tsv bayer 04 leverkusen"
What was the winning score when the margin of victory was 2 strokes and the runner-up was Pat Bradley?
CREATE TABLE table_name_69 (winning_score VARCHAR,margin_of_victory VARCHAR,runner_s__up VARCHAR)
SELECT winning_score FROM table_name_69 WHERE margin_of_victory = "2 strokes" AND runner_s__up = "pat bradley"
What was the gtc winning team when lmp winning team was #8 drayson racing?
CREATE TABLE table_24037660_2 (gtc_winning_team VARCHAR,lmp_winning_team VARCHAR)
SELECT gtc_winning_team FROM table_24037660_2 WHERE lmp_winning_team = "#8 Drayson Racing"
What state is Knoxville and the mideast region located in?
CREATE TABLE table_name_76 (state VARCHAR,region VARCHAR,city VARCHAR)
SELECT state FROM table_name_76 WHERE region = "mideast" AND city = "knoxville"
What are the most points scored in a game where the score was 1-2?
CREATE TABLE table_29621 ("Game" real,"January" real,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Points" real)
SELECT MAX("Points") FROM table_29621 WHERE "Score" = '1-2'
In regards to SW 556 , how many times has it been offered ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (...
SELECT COUNT(DISTINCT course_offering.offering_id) FROM course, course_offering WHERE course.course_id = course_offering.course_id AND course.department = 'SW' AND course.number = 556
What is the ratio of Republicans to Democrats in South Carolina?
CREATE TABLE table_name_91 (republican__democratic VARCHAR,state_ranked_in_partisan_order VARCHAR)
SELECT republican__democratic FROM table_name_91 WHERE state_ranked_in_partisan_order = "south carolina"
What is the San Antonio's team score?
CREATE TABLE table_17288825_5 (score VARCHAR,team VARCHAR)
SELECT score FROM table_17288825_5 WHERE team = "San Antonio"
how many patients had received a esophagogastroduodenoscopy - with peg insertion procedure two or more times in a year before?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,pat...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'esophagogastroduodenoscopy - with peg insertion' AND DATETIME(treatment.treatmenttime, 'start of year') = ...
What is the reserved for (ST/ST/None) when it was Uklana?
CREATE TABLE table_62678 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real)
SELECT "Reserved for ( SC / ST /None)" FROM table_62678 WHERE "Name" = 'uklana'
How many students taking a course who received an A or C? Group by students' last name with a bar chart.
CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar...
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME
which african country had more total medal wins then nigeria ?
CREATE TABLE table_203_61 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_61 WHERE "total" > (SELECT "total" FROM table_203_61 WHERE "nation" = 'nigeria')
How many were in attendance when the game was held in Arrowhead Stadium?
CREATE TABLE table_17972193_1 (attendance INTEGER,game_site VARCHAR)
SELECT MIN(attendance) FROM table_17972193_1 WHERE game_site = "Arrowhead Stadium"
What is the date of return for the program for the program 'Big Brother'?
CREATE TABLE table_31239 ("Programme" text,"Date(s) of original removal" text,"Original channel(s)" text,"Date of return" text,"New channel(s)" text)
SELECT "Date of return" FROM table_31239 WHERE "Programme" = 'Big Brother'
Which Format has a Catalog of 61298, and a Date of september 1984?
CREATE TABLE table_name_51 (format VARCHAR,catalog VARCHAR,date VARCHAR)
SELECT format FROM table_name_51 WHERE catalog = 61298 AND date = "september 1984"
Who was Class AAA during the same year that Class A was (tie) Apple Springs/Texline?
CREATE TABLE table_16092 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text)
SELECT "Class AAA" FROM table_16092 WHERE "Class A" = '(tie) Apple Springs/Texline'
A bar chart showing how many debates are held for each venue, and show by the X in desc.
CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY Venue DESC
What is Prize, when Runner-Up is 'Simon Ehne', and when Winner is 'David Tighe'?
CREATE TABLE table_9736 ("Season" text,"Winner" text,"Prize" text,"Runner-Up" text,"3rd place" text)
SELECT "Prize" FROM table_9736 WHERE "Runner-Up" = 'simon ehne' AND "Winner" = 'david tighe'
How many titles for the production code of NABF07?
CREATE TABLE table_20942925_1 (title VARCHAR,production_code VARCHAR)
SELECT COUNT(title) FROM table_20942925_1 WHERE production_code = "NABF07"
what is the number of patients whose age is less than 77 and diagnoses icd9 code is 5570?
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 WHERE demographic.age < "77" AND diagnoses.icd9_code = "5570"
Which nationality is kitchener rangers (ohl) college/junior/club team?
CREATE TABLE table_21721351_18 (nationality VARCHAR,college_junior_club_team VARCHAR)
SELECT nationality FROM table_21721351_18 WHERE college_junior_club_team = "Kitchener Rangers (OHL)"
What's the heat in the lane less than 3 with a time of 14:48.39?
CREATE TABLE table_name_99 (heat INTEGER,lane VARCHAR,time VARCHAR)
SELECT AVG(heat) FROM table_name_99 WHERE lane < 3 AND time = "14:48.39"
What years did Tom Lehman win?
CREATE TABLE table_60744 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT "Year(s) won" FROM table_60744 WHERE "Player" = 'tom lehman'
Downvoted posts belonging to user.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE ...
SELECT p.Id AS "post_link", SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS Down, p.Score FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.OwnerUserId = '##UserId##' GROUP BY p.Id, p.Score HAVING SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) > 0
when did patient 021-25408 in this year for the last time leave the hospital?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '021-25408' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1
Show the number of customer address history for each city in a bar chart, and could you order from low to high by the Y?
CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50))CREATE TABLE Customer_Address_History (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Products (product_i...
SELECT T3.city, COUNT(T3.city) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T3.city ORDER BY COUNT(T3.city)
creatinine clearance should be > 60 ml / min )
CREATE TABLE table_dev_4 ("id" int,"hypothyroidism" bool,"serum_bicarbonate" int,"c_peptide_level" float,"autoimmune_disease" bool,"hemoglobin_a1c_hba1c" float,"positive_serum" bool,"inhaled_steroids" bool,"diabetic_ketoacidosis" bool,"creatinine_clearance_cl" float,"urinary_ketones" bool,"admission_blood_glucose" int,...
SELECT * FROM table_dev_4 WHERE creatinine_clearance_cl > 60
For all employees who have the letters D or S in their first name, visualize the relationship between salary and department_id .
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar...
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
indicate the monthly average arterial bp mean of patient 19175 since 1113 days ago.
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREA...
SELECT AVG(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 = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...