table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
Give me the number of patients less than 76 years who have a norepinephrine prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.drug = "NORepinephrine"
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,...
provide the age and death status of robert hyden.
SELECT demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Robert Hyden"
CREATE TABLE table_train_197 ( "id" int, "dyscrasia" bool, "gender" string, "bleeding" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
subject's bmi is > 18.5 kg / m2 and < 35 kg / m2
SELECT * FROM table_train_197 WHERE body_mass_index_bmi > 18.5 AND body_mass_index_bmi < 35
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, ...
How many female patients had t5 fracture as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "T5 FRACTURE"
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Average Reputation for Users With Reputation > 1.
SELECT Reputation, COUNT(*) FROM Users WHERE Reputation IN (99, 100, 101, 102, 103) GROUP BY Reputation
CREATE TABLE table_name_65 ( date_sent VARCHAR, constellation VARCHAR, designation_hd VARCHAR )
What date sent has cygnus as a constellation, and hd 190360 as a designation HD?
SELECT date_sent FROM table_name_65 WHERE constellation = "cygnus" AND designation_hd = "hd 190360"
CREATE TABLE table_204_79 ( id number, "season" text, "tier" number, "division" text, "place" text )
what was the difference in placing between the 1988/89 season and the last season before it ?
SELECT ABS((SELECT "place" FROM table_204_79 WHERE "season" = '1988/89') - (SELECT "place" FROM table_204_79 WHERE "season" < '1988/89' ORDER BY "season" DESC LIMIT 1))
CREATE TABLE table_26957063_3 ( common_name VARCHAR, length__aa_ VARCHAR )
What is the common name of the animal whose length (AA) is 1323?
SELECT common_name FROM table_26957063_3 WHERE length__aa_ = 1323
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ...
select title, tags from Posts where (ParentId is null) and (len(title) > 0).
SELECT Title, Tags FROM Posts WHERE (ParentId IS NULL) AND (LENGTH(Title) > 0)
CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Maintenance_Engineers ( engin...
Give me a pie chart showing the number of engineers for different skill description, display by the total number in asc please.
SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY COUNT(skill_description)
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, ...
was the -eos value of patient 035-11731 last measured on the first hospital visit less than the value second to last measured on the first hospital visit?
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 = '035-11731' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE table_71866 ( "Team" text, "1st Match" text, "Matches" text, "Lost" text, "% Won" text )
Name the lost for matches of 1 928
SELECT "Lost" FROM table_71866 WHERE "Matches" = '1 928'
CREATE TABLE table_name_20 ( nationality VARCHAR, college_junior_club_team__league_ VARCHAR )
What is the nationality of the player from the Ohio State University (NCAA) Team?
SELECT nationality FROM table_name_20 WHERE college_junior_club_team__league_ = "ohio state university (ncaa)"
CREATE TABLE table_63121 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What lane did the barbados swimmer compete in before heat 3?
SELECT "Lane" FROM table_63121 WHERE "Heat" < '3' AND "Nationality" = 'barbados'
CREATE TABLE table_38116 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponent in the Final" text, "Score" text )
What was the Partner on June 17, 2012?
SELECT "Partner" FROM table_38116 WHERE "Date" = 'june 17, 2012'
CREATE TABLE table_203_551 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
in what year did d m szalai make his next international goal after 2010 ?
SELECT "date" FROM table_203_551 WHERE "date" > 2010 ORDER BY "date" LIMIT 1
CREATE TABLE table_name_41 ( scorers VARCHAR, venue VARCHAR, opponent VARCHAR )
Which Scorers have a Venue of A, and an Opponent of arsenal?
SELECT scorers FROM table_name_41 WHERE venue = "a" AND opponent = "arsenal"
CREATE TABLE table_22385461_8 ( end__utc_ VARCHAR, duration VARCHAR )
What is the end (UTC) if the duration is 6 hours, 55 minutes?
SELECT end__utc_ FROM table_22385461_8 WHERE duration = "6 hours, 55 minutes"
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
Longest Average Poster (ie., avg length of Q&A's).
SELECT OwnerUserId, COUNT(Id) AS "numposts", AVG(LENGTH(Body)) AS "avglength" FROM Posts WHERE PostTypeId IN (1, 2) AND YEAR(CreationDate) >= 2018 GROUP BY OwnerUserId HAVING COUNT(Id) > 10 ORDER BY AVG(LENGTH(Body)) DESC
CREATE TABLE table_20453681_1 ( county VARCHAR, mccain_percentage VARCHAR, obama_percentage VARCHAR )
What's the county where McCain got 60.6% and Obama got 37.3%?
SELECT county FROM table_20453681_1 WHERE mccain_percentage = "60.6%" AND obama_percentage = "37.3%"
CREATE TABLE table_74844 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which result's venue was in Rotterdam, Netherlands?
SELECT "Result" FROM table_74844 WHERE "Venue" = 'rotterdam, netherlands'
CREATE TABLE table_54809 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Who was the leading scorer in the game where the visiting team was the Pistons?
SELECT "Leading scorer" FROM table_54809 WHERE "Visitor" = 'pistons'
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
how many patients were treated with a injection oxazolidinone during the same month after being diagnosed with dmii ophth nt st uncntrl until 2100?
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 = 'dmii ophth nt st u...
CREATE TABLE customers ( customer_id number, coupon_id number, good_or_bad_customer text, first_name text, last_name text, gender_mf text, date_became_customer time, date_last_hire time ) CREATE TABLE payments ( payment_id number, booking_id number, customer_id number, p...
What are the start date and end date of the booking that has booked the product named 'Book collection A'?
SELECT T3.booking_start_date, T3.booking_end_date FROM products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'
CREATE TABLE table_17304308_1 ( fin_pos VARCHAR, points VARCHAR, time_retired VARCHAR )
Name the total number of fin pos for 12 points of accident
SELECT COUNT(fin_pos) FROM table_17304308_1 WHERE points = "12" AND time_retired = "Accident"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
list the four most frequent drugs that were prescribed to patients within the same month after having been prescribed with rocuronium bromide until 2104?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'rocuronium bromide' AND STRFTIME('%y', medication.d...
CREATE TABLE table_13619135_8 ( game INTEGER, date VARCHAR )
What number game of the season was played on April 12?
SELECT MAX(game) FROM table_13619135_8 WHERE date = "April 12"
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), ...
Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart.
SELECT HIRE_DATE, SUM(SALARY) FROM employees
CREATE TABLE table_39774 ( "Date" text, "Cover model" text, "Centerfold model" text, "20 Questions" text, "Pictorials" text )
Which over model has a 20 Questions of edward burns?
SELECT "Cover model" FROM table_39774 WHERE "20 Questions" = 'edward burns'
CREATE TABLE table_name_67 ( capacity__thousands_of_metric_tons_ VARCHAR, county VARCHAR, mine VARCHAR )
What is the capacity of the Pinto Valley mine in Gila county?
SELECT capacity__thousands_of_metric_tons_ FROM table_name_67 WHERE county = "gila" AND mine = "pinto valley"
CREATE TABLE table_name_90 ( laws_against_homosexuality VARCHAR, penalty VARCHAR, country VARCHAR )
What law has a penalty of in Iraq?
SELECT laws_against_homosexuality FROM table_name_90 WHERE penalty = "—" AND country = "iraq"
CREATE TABLE table_26561506_1 ( written_by VARCHAR, no VARCHAR )
Who wrote episode number 28?
SELECT written_by FROM table_26561506_1 WHERE no = 28
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 ) ...
Count the number of patients with complete heart block primary disease who died in or before 2138.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2138.0"
CREATE TABLE table_48791 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What NFL team did the Tight End position belong to?
SELECT "NFL Team" FROM table_48791 WHERE "Position" = 'tight end'
CREATE TABLE table_17941032_3 ( tries_against VARCHAR, tries_for VARCHAR )
Name the tries against when tries for is 30
SELECT tries_against FROM table_17941032_3 WHERE tries_for = "30"
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text )
what race name comes in last ?
SELECT "race name" FROM table_204_137 ORDER BY id DESC LIMIT 1
CREATE TABLE table_39840 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2008 Candidates" text, "Results" text )
What was the year Elected of Republican Incumbent Dave Reichert?
SELECT "Elected" FROM table_39840 WHERE "Party" = 'republican' AND "Incumbent" = 'dave reichert'
CREATE TABLE table_59654 ( "Year recorded" text, "Title" text, "Genre" text, "Label" text, "Year inducted" text )
What's the genre of the song recorded in 1929?
SELECT "Genre" FROM table_59654 WHERE "Year recorded" = '1929'
CREATE TABLE table_49151 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
what is the pick # for william loftus?
SELECT "Pick #" FROM table_49151 WHERE "Player" = 'william loftus'
CREATE TABLE table_79269 ( "Driver" text, "Navigator" text, "Vehicle" text, "Class" text, "Capacity" real, "Total Time" text, "Margin" text )
Which vehicle has a class 6c3g?
SELECT "Vehicle" FROM table_79269 WHERE "Class" = '6c3g'
CREATE TABLE table_60149 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
How many weeks had an Attendance of 43,272?
SELECT COUNT("Week") FROM table_60149 WHERE "Attendance" = '43,272'
CREATE TABLE table_name_45 ( opponent VARCHAR, record VARCHAR )
Who was the opponent with the 20-12 record?
SELECT opponent FROM table_name_45 WHERE record = "20-12"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
which lab test did bessie giordano undergo and what was her discharge time?
SELECT demographic.dischtime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Bessie Giordano"
CREATE TABLE table_26682 ( "Region/Country" text, "Local name" text, "Main presenter" text, "Network" text, "Year premiered" real )
What is every year premiered when Behzat Uighur is main presenter?
SELECT "Year premiered" FROM table_26682 WHERE "Main presenter" = 'Behzat Uighur'
CREATE TABLE table_name_89 ( name VARCHAR )
What is the 2005-2006 team for player Phil Kessel?
SELECT 2005 AS _2006_team FROM table_name_89 WHERE name = "phil kessel"
CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE prereq ( course_id text, p...
Give the name of the highest paid instructor.
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
CREATE TABLE table_name_41 ( games INTEGER, rank VARCHAR, points VARCHAR, team VARCHAR )
What is the highest game that has 32 points and a team rank larger than 4 named montepaschi siena
SELECT MAX(games) FROM table_name_41 WHERE points = 32 AND team = "montepaschi siena" AND rank > 4
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 admissions ( row_id number, subject_id number, hadm...
when did patient 24364 first receive a diagnosis of hypovolemia when they came to the hospital first time?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypovolemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24364 AND NOT admissions.disch...
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time...
i'd like to see all the economy fares from BALTIMORE to PHILADELPHIA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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 A...
CREATE TABLE airport ( name VARCHAR, country VARCHAR )
What are the names of the airports which are not in the country 'Iceland'?
SELECT name FROM airport WHERE country <> 'Iceland'
CREATE TABLE table_65706 ( "Score" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What 2008 has 14.2% as the 2009?
SELECT "2008" FROM table_65706 WHERE "2009" = '14.2%'
CREATE TABLE table_name_26 ( date VARCHAR, week VARCHAR, result VARCHAR )
When was the game before week 15 with the result of bye?
SELECT date FROM table_name_26 WHERE week < 15 AND result = "bye"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( trea...
how many times does patient 032-754 receive an pt test until 2104?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND lab.labname = 'pt' AND STRFTIME('%y', lab.labresulttime) <= '2104'
CREATE TABLE table_203_300 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "extra" text )
what is the total number of tournaments in the year 2006 ?
SELECT COUNT("tournament") FROM table_203_300 WHERE "year" = 2006
CREATE TABLE table_18672 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the result with district being kansas 1
SELECT "Result" FROM table_18672 WHERE "District" = 'Kansas 1'
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, ...
Group and count the years played to draw a bar chart, could you sort X in descending order?
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY Years_Played DESC
CREATE TABLE table_204_625 ( id number, "model" text, "availability" text, "introduced" text, "length of use" text, "last of whiteness" text )
which discontinued product was introduced the same year as crest whitestrips 3d vivid ?
SELECT "model" FROM table_204_625 WHERE "model" <> 'crest whitestrips 3d vivid' AND "introduced" = (SELECT "introduced" FROM table_204_625 WHERE "model" = 'crest whitestrips 3d vivid')
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 ) ...
what is the number of patients whose year of birth is less than 2066?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2066"
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 te...
find the number of medicaid insurance patients who had combined right and left heart angiocardiography.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Combined right and left heart angiocardiography"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, list X-axis from high to low order please.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
CREATE TABLE table_name_81 ( name VARCHAR, moving_to VARCHAR, type VARCHAR, nat VARCHAR )
What is the name of the person with a type of end of contract, nat of sco, and the Moving to is cardiff city?
SELECT name FROM table_name_81 WHERE type = "end of contract" AND nat = "sco" AND moving_to = "cardiff city"
CREATE TABLE table_name_18 ( points INTEGER, chassis VARCHAR, year VARCHAR )
What is the average points of the Ferrari 1512 Chassis after 1965?
SELECT AVG(points) FROM table_name_18 WHERE chassis = "ferrari 1512" AND year > 1965
CREATE TABLE table_15547 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Name the years with authority of state and decile more than 6 with roll less than 33
SELECT "Years" FROM table_15547 WHERE "Authority" = 'state' AND "Decile" > '6' AND "Roll" < '33'
CREATE TABLE table_2102945_1 ( viewers__in_millions_ VARCHAR, run_time VARCHAR )
When 24:31 is the run time how many measurements of viewers (in millions) are there?
SELECT COUNT(viewers__in_millions_) FROM table_2102945_1 WHERE run_time = "24:31"
CREATE TABLE table_23619212_1 ( _percentage_of_all_immigrants_2004 VARCHAR, _percentage_of_all_immigrants_2006 VARCHAR )
What's the percentage of immigrants in 2004 in the country with 2.1% of the immigrants in 2006?
SELECT _percentage_of_all_immigrants_2004 FROM table_23619212_1 WHERE _percentage_of_all_immigrants_2006 = "2.1%"
CREATE TABLE table_53651 ( "Rank" real, "Player" text, "Goals" real, "Apps" real, "Avg/Game" real )
What is the average avg/game of the player with 97 goals and a rank above 7?
SELECT AVG("Avg/Game") FROM table_53651 WHERE "Goals" = '97' AND "Rank" < '7'
CREATE TABLE table_name_42 ( last_win VARCHAR, club VARCHAR, wins VARCHAR )
How many Last wins have a Club of mansfield town, and Wins smaller than 1?
SELECT COUNT(last_win) FROM table_name_42 WHERE club = "mansfield town" AND wins < 1
CREATE TABLE table_name_20 ( play VARCHAR, year VARCHAR )
Name the play for 1976
SELECT play FROM table_name_20 WHERE year = 1976
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
vent rate,whats the cost of it?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vent rate')
CREATE TABLE table_40210 ( "Event" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text )
What is the 2008 09 when the 2009 10 shows q?
SELECT "2008\u201309" FROM table_40210 WHERE "2009\u201310" = 'q'
CREATE TABLE table_80211 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What engine did the porsche 718 chassis use?
SELECT "Engine" FROM table_80211 WHERE "Chassis" = 'porsche 718'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
was there any organism found during the first other microbiology test of patient 031-3355 during the current hospital visit?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite...
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
What are the names of customers who have taken both Mortgage and Auto loans?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'
CREATE TABLE table_140968_1 ( copies_per_particle VARCHAR, function VARCHAR )
How many copies per particle are created by the enterotoxin?
SELECT copies_per_particle FROM table_140968_1 WHERE function = "Enterotoxin"
CREATE TABLE table_name_57 ( place VARCHAR, player VARCHAR )
What place was Corey Pavin in?
SELECT place FROM table_name_57 WHERE player = "corey pavin"
CREATE TABLE EVENTS ( service_id VARCHAR, event_details VARCHAR )
List the service id and details for the events.
SELECT service_id, event_details FROM EVENTS
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id I...
Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and display y-axis in asc order.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY COUNT(date_test_taken)
CREATE TABLE table_name_6 ( losses INTEGER, conceded VARCHAR, wins VARCHAR )
How many loses does the team have that conceded 25 and won more than 6 games?
SELECT SUM(losses) FROM table_name_6 WHERE conceded = 25 AND wins > 6
CREATE TABLE table_name_70 ( jockey VARCHAR, year VARCHAR, owner VARCHAR )
What jockey rode for Michael House before 2012
SELECT jockey FROM table_name_70 WHERE year < 2012 AND owner = "michael house"
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
How can the PreMajor requirement be satisfied with American Board of Orthodontics Phase II Review Course courses ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%American Board of Orthodontics Phase II Review Course%' OR course.description LIKE '%American Bo...
CREATE TABLE table_22917 ( "Version" text, "Code name" text, "Release date" text, "Desktops" text, "Servers" text, "Kernel Version" text )
When was the release date of the operating system with kernel version 2.6.31?
SELECT "Release date" FROM table_22917 WHERE "Kernel Version" = '2.6.31'
CREATE TABLE table_34364 ( "Surname" text, "First" text, "D.O.B." text, "Uni#" real, "Bats" text, "Throws" text, "Position" text )
Which does the lhp player with the first name lachlan bat?
SELECT "Bats" FROM table_34364 WHERE "Position" = 'lhp' AND "First" = 'lachlan'
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, ...
give the minimum age of patients whose marital status is single and admission location is emergency room .
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
CREATE TABLE table_47859 ( "Date" text, "Time" text, "Opponent" text, "Site" text, "City" text )
What team was the opponent on 03/18/08?
SELECT "Opponent" FROM table_47859 WHERE "Date" = '03/18/08'
CREATE TABLE table_name_30 ( year VARCHAR, venue VARCHAR, opposition VARCHAR )
Which number of Years has a Venue of old trafford, and an Opposition of yorkshire?
SELECT COUNT(year) FROM table_name_30 WHERE venue = "old trafford" AND opposition = "yorkshire"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
since 11/29/2105, list the yearly maximum sao2 of patient 012-63986.
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT...
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_20...
Draw a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, list meter_200 in asc order please.
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
CREATE TABLE table_204_612 ( id number, "draft order\nround" number, "draft order\nchoice" number, "player" text, "position" text, "height" text, "weight" text, "college" text )
is brandon pettigrew above 250 pounds
SELECT (SELECT "weight" FROM table_204_612 WHERE "player" = 'brandon pettigrew') > 250
CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text )
Which papers have the substring 'ML' in their titles? Return the titles of the papers.
SELECT title FROM papers WHERE title LIKE "%ML%"
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 VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id nu...
My Answers Most Upvoted Without selfie-Answers.
SELECT answers.Id AS "post_link", answers.Score AS pontuacao, answers.OwnerUserId AS "user_link" FROM Posts AS answers INNER JOIN Posts AS all_posts ON all_posts.AcceptedAnswerId = answers.Id WHERE answers.OwnerUserId = @UserId AND answers.PostTypeId = 2 AND answers.ClosedDate IS NULL AND answers.DeletionDate IS NULL A...
CREATE TABLE table_79970 ( "Season" text, "Tier" real, "League" text, "Turkish Cup" text, "European Competitions" text )
Tier of 2, and a Season of 2004 05 is what European competitions?
SELECT "European Competitions" FROM table_79970 WHERE "Tier" = '2' AND "Season" = '2004–05'
CREATE TABLE table_name_14 ( tries_against VARCHAR, tries_for VARCHAR )
What was the tries against when they had 32 tries for?
SELECT tries_against FROM table_name_14 WHERE tries_for = "32"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, u...
when did patient 031-22988 first have a microbiological test until 41 months ago?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(...
CREATE TABLE table_75892 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text )
What is the total number of draws for songs performed by Miranda with fewer than 48 points?
SELECT COUNT("Draw") FROM table_75892 WHERE "Performer" = 'miranda' AND "Points" < '48'
CREATE TABLE table_204_741 ( id number, "rank" number, "name" text, "nationality" text, "1,62" text, "1,67" text, "1,72" text, "1,75" text, "notes" text )
what name is at the top of the list ?
SELECT "name" FROM table_204_741 WHERE id = 1
CREATE TABLE table_17841 ( "Colt model no." text, "Name" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Case deflector" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, ...
Name the forward assist for a2 barrel profile
SELECT "Forward assist" FROM table_17841 WHERE "Barrel profile" = 'A2'
CREATE TABLE table_1628792_1 ( champion VARCHAR, tournament_location VARCHAR )
Name the champion for london hunt and country club ( london , on )
SELECT champion FROM table_1628792_1 WHERE tournament_location = "London Hunt and country Club ( London , ON )"
CREATE TABLE table_70629 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries against were there with 520 points against?
SELECT "Tries against" FROM table_70629 WHERE "Points against" = '520'
CREATE TABLE table_72597 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text )
What year was the tournament first held in Italy?
SELECT MIN("Began") FROM table_72597 WHERE "Country" = 'Italy'
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Questions tagged with iOS development related tags.
SELECT TagName, COUNT(*) AS frequency FROM Posts JOIN PostTags AS pt ON pt.PostId = Posts.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE UPPER(TagName) LIKE '%LDAP%' OR UPPER(TagName) LIKE '%UNBOUNDID%' GROUP BY TagName ORDER BY frequency DESC