table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_204_105 ( id number, "#" number, "name" text, "height" text, "weight (lbs.)" number, "position" text, "class" text, "hometown" text, "previous team(s)" text )
what is the number of players who weight over 200 pounds ?
SELECT COUNT("name") FROM table_204_105 WHERE "weight (lbs.)" > 200
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
how many days has it been since patient 013-33898 was admitted into icu?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-33898' AND patient.unitdischargetime IS NULL
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
so what's the average urea nitrogen, urine value of patient 12775 on this hospital encounter?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen, urine')
CREATE TABLE table_name_44 ( silver VARCHAR, nation VARCHAR, total VARCHAR )
how many times is the nation listed as united states with the total more than 1?
SELECT COUNT(silver) FROM table_name_44 WHERE nation = "united states" AND total > 1
CREATE TABLE table_name_42 ( format VARCHAR, conference VARCHAR )
What format has conference iii as the conference?
SELECT format FROM table_name_42 WHERE conference = "conference iii"
CREATE TABLE table_name_3 ( erp_w INTEGER, call_sign VARCHAR )
Which ERP W is the highest one that has a Call sign of w255bi?
SELECT MAX(erp_w) FROM table_name_3 WHERE call_sign = "w255bi"
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
Top 30 Users with most upvotes. Top 20 Users with most upvotes/day to their answers to non-CW posts in the last 30 days
SELECT SUM(UpVotes) AS upv, SUM(DownVotes) AS downv FROM Users ORDER BY upv DESC LIMIT 30
CREATE TABLE table_16799784_3 ( latitude VARCHAR, longitude VARCHAR )
At a longitude of 321.9e, what is the latitude of the features found?
SELECT latitude FROM table_16799784_3 WHERE longitude = "321.9E"
CREATE TABLE table_name_52 ( year VARCHAR, distance VARCHAR )
In what year saw a total distance of 1,870.23 km?
SELECT year FROM table_name_52 WHERE distance = "1,870.23 km"
CREATE TABLE table_name_52 ( date VARCHAR, home_team VARCHAR )
When did the Wolverhampton Wanderers play at home?
SELECT date FROM table_name_52 WHERE home_team = "wolverhampton wanderers"
CREATE TABLE table_933 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real )
what is the minimum attendance with record being 4 6
SELECT MIN("Attendance") FROM table_933 WHERE "Record" = '4–6'
CREATE TABLE table_63139 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws P.K. Wins / P.K. Losses" text, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How many Points have a Position larger than 4, and Losses larger than 5, and a Conceded of 15, and a Scored larger than 11?
SELECT COUNT("Points") FROM table_63139 WHERE "Position" > '4' AND "Losses" > '5' AND "Conceded" = '15' AND "Scored" > '11'
CREATE TABLE table_name_92 ( points VARCHAR, tries_against VARCHAR )
When the tries against is 90 how many points are there?
SELECT points FROM table_name_92 WHERE tries_against = "90"
CREATE TABLE table_10665 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the Time/Retired for Grid 6?
SELECT "Time/Retired" FROM table_10665 WHERE "Grid" = '6'
CREATE TABLE table_37259 ( "Name" text, "Number" real, "From" text, "Length (km)" real, "Length (mi)" real )
What's the shortest length from north klondike highway that has a length less than 326?
SELECT MIN("Length (km)") FROM table_37259 WHERE "Name" = 'north klondike highway' AND "Length (mi)" < '326'
CREATE TABLE table_9582 ( "Year" real, "Lijsttrekker" text, "Fractievoorzitter" text, "Cabinet" text, "Chair" text )
What is Fractievoorzitter, when Lijsttrekker is 'No Elections', and when Year is after 2005?
SELECT "Fractievoorzitter" FROM table_9582 WHERE "Lijsttrekker" = 'no elections' AND "Year" > '2005'
CREATE TABLE table_23486853_7 ( score VARCHAR, date VARCHAR )
What scores happened on February 9?
SELECT score FROM table_23486853_7 WHERE date = "February 9"
CREATE TABLE table_25529 ( "Name" text, "Platform" text, "License" text, "Windows builders" text, "Java builders" text, "Other builders" text, "SCM system" text, "Notification" text, "IDE Integration" text, "Other Integration" text )
Name the windows builders for apache gump
SELECT "Windows builders" FROM table_25529 WHERE "Name" = 'Apache Gump'
CREATE TABLE table_203_420 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "home team" text )
which stadium can hold more people than ballymena showgrounds , but less than windsor park ?
SELECT "stadium" FROM table_203_420 WHERE "capacity" > (SELECT "capacity" FROM table_203_420 WHERE "stadium" = 'ballymena showgrounds') AND "capacity" < (SELECT "capacity" FROM table_203_420 WHERE "stadium" = 'windsor park')
CREATE TABLE table_name_90 ( college VARCHAR, name VARCHAR, round VARCHAR, overall VARCHAR )
Which college's round is more than 4, when the overall is less than 237 and Ted Cottrell was the name?
SELECT college FROM table_name_90 WHERE round > 4 AND overall < 237 AND name = "ted cottrell"
CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area number ) CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, int...
What city is the headquarter of the store Blackville?
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville"
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...
what is the name of the allergy which patient 003-17096 has in 12/this year?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIM...
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 t...
How many of the patients with icd9 code 3761 have an unspecified death status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3761"
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, what is the relationship between code and manufacturer , and group by attribute name?
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
CREATE TABLE table_name_21 ( place VARCHAR, money___$__ VARCHAR )
What place did the player that took won $350 finish in?
SELECT place FROM table_name_21 WHERE money___$__ = 350
CREATE TABLE table_name_68 ( result VARCHAR, date VARCHAR )
Tell me the result of july 16, 2000
SELECT result FROM table_name_68 WHERE date = "july 16, 2000"
CREATE TABLE table_name_53 ( name VARCHAR, games VARCHAR )
Which Name has Games of 105?
SELECT name FROM table_name_53 WHERE games = 105
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
Top 300 users from Romania.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%arad%romania%' ORDER BY Reputation DESC LIMIT 300
CREATE TABLE table_35859 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Name the top-10 with top-5 less than 1
SELECT "Top-10" FROM table_35859 WHERE "Top-5" < '1'
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 t...
give me the number of patients whose admission location is emergency room admit and diagnoses icd9 code is 52809?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "52809"
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
For all storms with at least 1 death, compare the number of deaths by name.
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1
CREATE TABLE table_41253 ( "Class" text, "Quantity" real, "Manufacturer" text, "Motor" text, "Seats" real )
Which motor's class was bs 1910?
SELECT "Motor" FROM table_41253 WHERE "Class" = 'bs 1910'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
provide the number of patients whose procedure icd9 code is 4610 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4610" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE table_name_96 ( safari VARCHAR, firefox VARCHAR )
What percentage of users were using Safari during the period in which 30.82% were using Firefox?
SELECT safari FROM table_name_96 WHERE firefox = "30.82%"
CREATE TABLE table_25942 ( "SF Round" real, "Country" text, "Location" text, "Date" text, "Driver" text, "Race 1(pts)" real, "Race 2(pts)" real, "Race Total(pts)" real )
Who is every driver for the location of Estoril Circuit?
SELECT "Driver" FROM table_25942 WHERE "Location" = 'Estoril Circuit'
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_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Create a bar chart showing all_games_percent across all neutral, sort by the y axis from high to low.
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
what are the three most frequently given diagnoses for patients who have been diagnosed with cellulitis - abdomen/pelvis before in the same month, since 2105?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - abdomen/pelvis' AND STRFTIM...
CREATE TABLE table_71177 ( "Player" text, "Country" text, "Caps" real, "Goals" text, "Years Active" text, "Years at Club" text )
What is the greatest number of caps for Bruce Djite?
SELECT MAX("Caps") FROM table_71177 WHERE "Player" = 'bruce djite'
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 t...
how many patients whose admission type is emergency and ethnicity is american indian/alaska native?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
CREATE TABLE table_26411 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text )
Who was promoted to the league when Coventry was relegated to the league?
SELECT "Promoted to league" FROM table_26411 WHERE "Relegated to league" = 'Coventry'
CREATE TABLE table_59758 ( "Player" text, "Draft" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text )
Which NFL Club has a Player of sam tidmore, and a Pick of 81?
SELECT "NFL Club" FROM table_59758 WHERE "Player" = 'sam tidmore' AND "Pick" = '81'
CREATE TABLE table_43572 ( "Result" text, "TUF Competitor" text, "Opponent" text, "Method" text, "Event" text, "Date" text )
when is the opponent lyoto machida?
SELECT "Date" FROM table_43572 WHERE "Opponent" = 'lyoto machida'
CREATE TABLE table_38756 ( "Couple" text, "Score" text, "Style" text, "Music" text, "Result" text )
Which music is jive?
SELECT "Music" FROM table_38756 WHERE "Style" = 'jive'
CREATE TABLE table_name_79 ( frequency VARCHAR, sspec_number VARCHAR )
What is the frequency of the processor with an sSpec number of sl3bn(kc0)sl3e9(kc0)?
SELECT frequency FROM table_name_79 WHERE sspec_number = "sl3bn(kc0)sl3e9(kc0)"
CREATE TABLE table_22638 ( "Years covered" text, "All bills sponsored" real, "All amendments sponsored" real, "All bills cosponsored" real, "All amendments cosponsored" real, "Bills originally cosponsored" real, "Amendments originally cosponsored" real )
How many bill cosponsored during those years where bills originally cosponsored is 113?
SELECT "All bills cosponsored" FROM table_22638 WHERE "Bills originally cosponsored" = '113'
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
What is the number of countries in the artist table?, and I want to rank how many country in descending order.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) DESC
CREATE TABLE table_name_82 ( year_signed VARCHAR, year_separated VARCHAR, chinese_name VARCHAR )
What was the signed year for the Chinese name who separated in 1987?
SELECT year_signed FROM table_name_82 WHERE year_separated = "1987" AND chinese_name = "蘇永康"
CREATE TABLE table_2026548_1 ( explanation VARCHAR, vice_president VARCHAR )
Name the explanation for alben w. barkley
SELECT explanation FROM table_2026548_1 WHERE vice_president = "Alben W. Barkley"
CREATE TABLE table_204_451 ( id number, "component" text, "model 01" text, "model 01+" text, "model 02" text, "model e2" text, "model 2+ (pre-production)" text, "model 03 (china copy)" text )
what component comes after bluetooth ?
SELECT "component" FROM table_204_451 WHERE id = (SELECT id FROM table_204_451 WHERE "component" = 'bluetooth') + 1
CREATE TABLE table_71392 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the lowest rank of Jens Kruppa in a lane larger than 2?
SELECT MIN("Rank") FROM table_71392 WHERE "Name" = 'jens kruppa' AND "Lane" > '2'
CREATE TABLE table_18516 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
For the Republican party what are the names of the incumbents?
SELECT "Incumbent" FROM table_18516 WHERE "Party" = 'Republican'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
when they visited the hospital last time, has patient 033-250 received any medication?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-250' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
Are there any courses on UM Chemistry Program at Peking University , Beijing for 17 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%UM Chemistry Program at Peking University , Beijing%' OR name LIKE '%UM Chemistry Program at Peking University , Beijing%') AND credits = 17
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, find founder and the sum of price , and group by attribute founder, and visualize them by a bar chart, and order by the y-axis in descending.
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Price) DESC
CREATE TABLE table_46821 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the to par of player john buczek, who has a t9 place and is from the United States?
SELECT "To par" FROM table_46821 WHERE "Place" = 't9' AND "Country" = 'united states' AND "Player" = 'john buczek'
CREATE TABLE table_37185 ( "Ship" text, "Hull No." text, "Builder" text, "Home Port" text, "Commissioned\u2013 Decommissioned" text, "NVR page" text )
Name the ship with hull number of aor-6
SELECT "Ship" FROM table_37185 WHERE "Hull No." = 'aor-6'
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 prescription...
how many patients whose admission type is newborn and admission location is transfer from hosp/extram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
List the Human Physiology-Laboratory courses worth 3 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Human Physiology-Laboratory%' OR name LIKE '%Human Physiology-Laboratory%') AND credits = 3
CREATE TABLE table_76607 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is stanford's average overall?
SELECT AVG("Overall") FROM table_76607 WHERE "College" = 'stanford'
CREATE TABLE table_name_90 ( venue VARCHAR, winner VARCHAR )
where did marie-laure taya win?
SELECT venue FROM table_name_90 WHERE winner = "marie-laure taya"
CREATE TABLE table_25276528_2 ( title VARCHAR, directed_by VARCHAR )
What title did Bill Foster direct ?
SELECT title FROM table_25276528_2 WHERE directed_by = "Bill Foster"
CREATE TABLE table_75454 ( "Round" text, "Date" text, "Matches" real, "Clubs" text, "New entries this round" text, "Prize money" text )
How many new entries this round have clubs 2 1?
SELECT "New entries this round" FROM table_75454 WHERE "Clubs" = '2 → 1'
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 ) ...
what is the number of patients whose ethnicity is american indian/alaska native and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE table_204_582 ( id number, "model" text, "launch" text, "code name" text, "fab (nm)" number, "bus interface" text, "memory (mib)" text, "core clock (mhz)" number, "memory clock (mhz)" number, "config core1" text, "fillrate\nmoperations/s" number, "fillrate\nm...
what is the last model ?
SELECT "model" FROM table_204_582 ORDER BY id DESC LIMIT 1
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
list the top four most frequent medications that patients have been prescribed in the same hospital encounter after being diagnosed with upper urinary tract infection since 2100.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'upper urinary t...
CREATE TABLE actor ( last_name VARCHAR )
How many different last names do the actors and actresses have?
SELECT COUNT(DISTINCT last_name) FROM actor
CREATE TABLE table_204_111 ( id number, "name" text, "animal type" text, "introduced" number, "reintroduced" text, "retired" number, "beanie baby resembled" text )
how many total pillow pals were both reintroduced and retired in 1999 ?
SELECT COUNT("name") FROM table_204_111 WHERE "reintroduced" = 1999 AND "retired" = 1999
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, m...
what LIMOUSINE service in TORONTO
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'TORONTO' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE'
CREATE TABLE table_68544 ( "2001" text, "2004" text, "2009" text, "2013" text, "Total" real )
What is the year 2001 with a total larger than 1, and 2009 with 8?
SELECT "2001" FROM table_68544 WHERE "Total" > '1' AND "2009" = '8'
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
How much reputation would we get in commie SO?.
SELECT SUM(Reputation) / COUNT(*) AS Average_rep FROM Users WHERE Reputation > 100
CREATE TABLE table_name_87 ( country VARCHAR, finish VARCHAR )
Which country has a finish of t22?
SELECT country FROM table_name_87 WHERE finish = "t22"
CREATE TABLE table_29583818_3 ( place VARCHAR, couple VARCHAR )
How many times is the couple laura and colin?
SELECT COUNT(place) FROM table_29583818_3 WHERE couple = "Laura and Colin"
CREATE TABLE table_name_29 ( draws INTEGER, losses VARCHAR, club VARCHAR, against VARCHAR, wins VARCHAR )
What's the smallest draw of Warrnambool when the against was less than 1299, more than 7 wins, and less than 2 losses?
SELECT MIN(draws) FROM table_name_29 WHERE against < 1299 AND wins > 7 AND club = "warrnambool" AND losses < 2
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 t...
what is date of birth and admission time of subject name fernando wontor?
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Fernando Wontor"
CREATE TABLE table_79722 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What are the most bronze medals in a rank more than 1 with a total larger than 3?
SELECT MAX("Bronze") FROM table_79722 WHERE "Total" > '3' AND "Rank" > '1'
CREATE TABLE table_52239 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method for the resolution of nc where the fight lasted less than 3 rounds?
SELECT "Method" FROM table_52239 WHERE "Round" < '3' AND "Res." = 'nc'
CREATE TABLE table_name_98 ( score VARCHAR, date VARCHAR )
What is the score on december 10?
SELECT score FROM table_name_98 WHERE date = "december 10"
CREATE TABLE table_28914 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Which party experienced a result of lost re-election democratic-republican hold?
SELECT "Party" FROM table_28914 WHERE "Result" = 'Lost re-election Democratic-Republican hold'
CREATE TABLE table_44157 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
Which player went to Wake Forest and was selected with a pick after 145?
SELECT "Player" FROM table_44157 WHERE "Pick" > '145' AND "College" = 'wake forest'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
How many of the patients with colangitis as their primary disease died in or before the year 2186?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.dod_year <= "2186.0"
CREATE TABLE table_16185956_1 ( district VARCHAR )
Who are the candidates in Washington 1 district?
SELECT 2008 AS _candidates FROM table_16185956_1 WHERE district = "Washington 1"
CREATE TABLE table_15463188_7 ( name VARCHAR, school_club_team VARCHAR )
Name the name of the state
SELECT name FROM table_15463188_7 WHERE school_club_team = "State"
CREATE TABLE table_name_26 ( venue VARCHAR, home_team VARCHAR )
What is the venue where the melbourne tigers play their home games?
SELECT venue FROM table_name_26 WHERE home_team = "melbourne tigers"
CREATE TABLE table_name_54 ( front_side_bus VARCHAR, model_number VARCHAR )
What is the Front Side Bus for Model Number c3 850?
SELECT front_side_bus FROM table_name_54 WHERE model_number = "c3 850"
CREATE TABLE table_name_35 ( score INTEGER, country VARCHAR, player VARCHAR )
What was Craig Stadler's lowest score for United states?
SELECT MIN(score) FROM table_name_35 WHERE country = "united states" AND player = "craig stadler"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
count the number of patients whose discharge location is disc-tran cancer/chldrn h and procedure icd9 code is 8604?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "8604"
CREATE TABLE screen_mode ( graphics_mode number, char_cells text, pixels text, hardware_colours number, used_kb number, map text, type text ) CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, blu...
What is maximum and minimum RAM size of phone produced by company named 'Nokia Corporation'?
SELECT MAX(T1.ram_mib), MIN(T1.ram_mib) FROM chip_model AS T1 JOIN phone AS T2 ON T1.model_name = T2.chip_model WHERE T2.company_name = "Nokia Corporation"
CREATE TABLE table_16078390_2 ( primary_conference VARCHAR, institution VARCHAR )
What conference does Gonzaga University play in?
SELECT primary_conference FROM table_16078390_2 WHERE institution = "Gonzaga University"
CREATE TABLE table_35183 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
March of 26 has what lowest game?
SELECT MIN("Game") FROM table_35183 WHERE "March" = '26'
CREATE TABLE table_20704243_6 ( title VARCHAR, original_air_date VARCHAR )
Which episode aired on august19,2012?
SELECT title FROM table_20704243_6 WHERE original_air_date = "August19,2012"
CREATE TABLE table_27721131_2 ( high_rebounds VARCHAR, location_attendance VARCHAR )
Who's in the high rebounds in the verizon center 9,263 location attendance?
SELECT high_rebounds FROM table_27721131_2 WHERE location_attendance = "Verizon Center 9,263"
CREATE TABLE table_train_26 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "allergy_to_penicillin" bool, "active_infection" bool, "allergy_to_cephalosporin" bool, "receiving_anticoagulants" bool, "age" float, "NOUSE" float )
known allergy or sensitivity to penicillin or cephalosporin
SELECT * FROM table_train_26 WHERE allergy_to_penicillin = 1 OR allergy_to_cephalosporin = 1
CREATE TABLE table_35291 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What is the winning score of the tournament on 16 May 1993?
SELECT "Winning score" FROM table_35291 WHERE "Date" = '16 may 1993'
CREATE TABLE table_27756164_2 ( date VARCHAR, high_points VARCHAR )
When did the Roy Hibbert (27) did the high points?
SELECT date FROM table_27756164_2 WHERE high_points = "Roy Hibbert (27)"
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, and list in ascending by the bar please.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
which is the only team that had more than 21 losses ?
SELECT "club" FROM table_204_135 WHERE "losses" > 21
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, ...
how many divorced patients had the drug route iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IV"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
how much is patient 016-6134's weight for the last time until 07/2103?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-07' ORDER BY patient.unitadmittime DESC LIMIT ...
CREATE TABLE table_48972 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" real )
What player has a total of 158/
SELECT "Player" FROM table_48972 WHERE "Total" = '158'
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
when was the first time since 06/16/2105 patient 28443 arterial bp [systolic] was measured/taken?
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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...