instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the total of overall values with a safety position in a round greater than 1?
CREATE TABLE table_name_26 (overall VARCHAR,position VARCHAR,round VARCHAR)
SELECT COUNT(overall) FROM table_name_26 WHERE position = "safety" AND round > 1
Name the irish points for 23-1 record
CREATE TABLE table_25477 ("Date" text,"Location" text,"Opponent" text,"Irish Points" real,"Opp. Points" real,"Record" text)
SELECT "Irish Points" FROM table_25477 WHERE "Record" = '23-1'
What is the ethernet ports of the u150 appliance?
CREATE TABLE table_43381 ("Name" text,"Processor" text,"Hard Drive" text,"Ethernet Ports" text,"Dimensions" text)
SELECT "Ethernet Ports" FROM table_43381 WHERE "Name" = 'u150'
What is the Country, when Place is 'T4', and when Player is 'Scott Simpson'?
CREATE TABLE table_48770 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Country" FROM table_48770 WHERE "Place" = 't4' AND "Player" = 'scott simpson'
What is the lowest Round with Overall of 247 and pick less than 41?
CREATE TABLE table_75536 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MIN("Round") FROM table_75536 WHERE "Overall" = '247' AND "Pick #" < '41'
how many patients died during the same month after having been diagnosed since 2101 with edema?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE d_labitems (row_id...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_di...
How many married patients are American Indian/Alaska native?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
what is the first procedure that patient 13837 received when they came to the hospital first time?
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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id numb...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13837 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit...
What time was the game during week 5?
CREATE TABLE table_38501 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Time (ET)" text,"Result" text,"Record" text)
SELECT "Time ( ET )" FROM table_38501 WHERE "Week" = '5'
tell me the number of summer olympics on the list .
CREATE TABLE table_204_266 (id number,"#" number,"event year" number,"season" text,"flag bearer" text)
SELECT COUNT(*) FROM table_204_266 WHERE "season" = 'summer'
Show me about the distribution of name and meter_100 in a bar chart, rank y axis in desc order please.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT name, meter_100 FROM swimmer ORDER BY meter_100 DESC
which airlines fly from TORONTO to SAN DIEGO and have a stopover in DENVER
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE state (state_code text,state_name text,country_name text...
SELECT DISTINCT airline.airline_code FROM airline, 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 DIEGO...
What is the average Number, when Position is Forward?
CREATE TABLE table_name_13 (number INTEGER,position VARCHAR)
SELECT AVG(number) FROM table_name_13 WHERE position = "forward"
Show the number of climbers for each mountain in a bar chart, and sort Name in descending order.
CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int)CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER BY T2.Name DESC
What Class has the Identifier fo CBFX-FM-2?
CREATE TABLE table_66624 ("City of license" text,"Identifier" text,"Frequency" text,"Power" text,"Class" text,"RECNet" text)
SELECT "Class" FROM table_66624 WHERE "Identifier" = 'cbfx-fm-2'
what is marital status of subject name joseph dillman?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Joseph Dillman"
How much #s have an Area in km larger than 13.5, and a Population Canada 2011 Census of 134,038?
CREATE TABLE table_33847 ("Number (map)" real,"Borough" text,"Population Canada 2011 Census" real,"Area in km\u00b2" real,"Density per km\u00b2" real)
SELECT COUNT("Number (map)") FROM table_33847 WHERE "Area in km\u00b2" > '13.5' AND "Population Canada 2011 Census" = '134,038'
what is the number of players who weight over 200 pounds ?
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)
SELECT COUNT("name") FROM table_204_105 WHERE "weight (lbs.)" > 200
how many days has it been since patient 013-33898 was admitted into icu?
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 number,chargetime time,cost number)CREATE TABLE intakeoutput (intak...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-33898' AND patient.unitdischargetime IS NULL
so what's the average urea nitrogen, urine value of patient 12775 on this hospital encounter?
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,value number)CREATE TABLE procedures_icd (row_id number,subject_id num...
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')
how many times is the nation listed as united states with the total more than 1?
CREATE TABLE table_name_44 (silver VARCHAR,nation VARCHAR,total VARCHAR)
SELECT COUNT(silver) FROM table_name_44 WHERE nation = "united states" AND total > 1
What format has conference iii as the conference?
CREATE TABLE table_name_42 (format VARCHAR,conference VARCHAR)
SELECT format FROM table_name_42 WHERE conference = "conference iii"
Which ERP W is the highest one that has a Call sign of w255bi?
CREATE TABLE table_name_3 (erp_w INTEGER,call_sign VARCHAR)
SELECT MAX(erp_w) FROM table_name_3 WHERE call_sign = "w255bi"
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
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 TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask...
SELECT SUM(UpVotes) AS upv, SUM(DownVotes) AS downv FROM Users ORDER BY upv DESC LIMIT 30
At a longitude of 321.9e, what is the latitude of the features found?
CREATE TABLE table_16799784_3 (latitude VARCHAR,longitude VARCHAR)
SELECT latitude FROM table_16799784_3 WHERE longitude = "321.9E"
In what year saw a total distance of 1,870.23 km?
CREATE TABLE table_name_52 (year VARCHAR,distance VARCHAR)
SELECT year FROM table_name_52 WHERE distance = "1,870.23 km"
When did the Wolverhampton Wanderers play at home?
CREATE TABLE table_name_52 (date VARCHAR,home_team VARCHAR)
SELECT date FROM table_name_52 WHERE home_team = "wolverhampton wanderers"
what is the minimum attendance with record being 4 6
CREATE TABLE table_933 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Stadium" text,"Record" text,"Attendance" real)
SELECT MIN("Attendance") FROM table_933 WHERE "Record" = '4–6'
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?
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)
SELECT COUNT("Points") FROM table_63139 WHERE "Position" > '4' AND "Losses" > '5' AND "Conceded" = '15' AND "Scored" > '11'
When the tries against is 90 how many points are there?
CREATE TABLE table_name_92 (points VARCHAR,tries_against VARCHAR)
SELECT points FROM table_name_92 WHERE tries_against = "90"
What is the Time/Retired for Grid 6?
CREATE TABLE table_10665 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Time/Retired" FROM table_10665 WHERE "Grid" = '6'
What's the shortest length from north klondike highway that has a length less than 326?
CREATE TABLE table_37259 ("Name" text,"Number" real,"From" text,"Length (km)" real,"Length (mi)" real)
SELECT MIN("Length (km)") FROM table_37259 WHERE "Name" = 'north klondike highway' AND "Length (mi)" < '326'
What is Fractievoorzitter, when Lijsttrekker is 'No Elections', and when Year is after 2005?
CREATE TABLE table_9582 ("Year" real,"Lijsttrekker" text,"Fractievoorzitter" text,"Cabinet" text,"Chair" text)
SELECT "Fractievoorzitter" FROM table_9582 WHERE "Lijsttrekker" = 'no elections' AND "Year" > '2005'
What scores happened on February 9?
CREATE TABLE table_23486853_7 (score VARCHAR,date VARCHAR)
SELECT score FROM table_23486853_7 WHERE date = "February 9"
Name the windows builders for apache gump
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)
SELECT "Windows builders" FROM table_25529 WHERE "Name" = 'Apache Gump'
which stadium can hold more people than ballymena showgrounds , but less than windsor park ?
CREATE TABLE table_203_420 (id number,"#" number,"stadium" text,"capacity" number,"city" text,"home team" text)
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')
Which college's round is more than 4, when the overall is less than 237 and Ted Cottrell was the name?
CREATE TABLE table_name_90 (college VARCHAR,name VARCHAR,round VARCHAR,overall VARCHAR)
SELECT college FROM table_name_90 WHERE round > 4 AND overall < 237 AND name = "ted cottrell"
What city is the headquarter of the store Blackville?
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,interface text)CREATE TABLE store_district (store_id number,distri...
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"
what is the name of the allergy which patient 003-17096 has in 12/this year?
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,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid num...
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...
How many of the patients with icd9 code 3761 have an unspecified death status?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3761"
For those records from the products and each product's manufacturer, what is the relationship between code and manufacturer , and group by attribute name?
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)
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
What place did the player that took won $350 finish in?
CREATE TABLE table_name_21 (place VARCHAR,money___$__ VARCHAR)
SELECT place FROM table_name_21 WHERE money___$__ = 350
Tell me the result of july 16, 2000
CREATE TABLE table_name_68 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_68 WHERE date = "july 16, 2000"
Which Name has Games of 105?
CREATE TABLE table_name_53 (name VARCHAR,games VARCHAR)
SELECT name FROM table_name_53 WHERE games = 105
Top 300 users from Romania.
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 text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,Use...
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
Name the top-10 with top-5 less than 1
CREATE TABLE table_35859 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT "Top-10" FROM table_35859 WHERE "Top-5" < '1'
give me the number of patients whose admission location is emergency room admit and diagnoses icd9 code is 52809?
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.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "52809"
For all storms with at least 1 death, compare the number of deaths by name.
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_city_affected real)
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1
Which motor's class was bs 1910?
CREATE TABLE table_41253 ("Class" text,"Quantity" real,"Manufacturer" text,"Motor" text,"Seats" real)
SELECT "Motor" FROM table_41253 WHERE "Class" = 'bs 1910'
provide the number of patients whose procedure icd9 code is 4610 and drug type is additive?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic 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"
What rank is Takat riki?
CREATE TABLE table_58735 ("Name" text,"Total" real,"First" text,"Last" text,"Highest rank" text)
SELECT "Highest rank" FROM table_58735 WHERE "Name" = 'takatōriki'
What percentage of users were using Safari during the period in which 30.82% were using Firefox?
CREATE TABLE table_name_96 (safari VARCHAR,firefox VARCHAR)
SELECT safari FROM table_name_96 WHERE firefox = "30.82%"
Who is every driver for the location of Estoril Circuit?
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)
SELECT "Driver" FROM table_25942 WHERE "Location" = 'Estoril Circuit'
Create a bar chart showing all_games_percent across all neutral, sort by the y axis from high to low.
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 (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
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?
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,patientunitstayid number,labname text,labresult number,labresul...
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...
What is the greatest number of caps for Bruce Djite?
CREATE TABLE table_71177 ("Player" text,"Country" text,"Caps" real,"Goals" text,"Years Active" text,"Years at Club" text)
SELECT MAX("Caps") FROM table_71177 WHERE "Player" = 'bruce djite'
how many patients whose admission type is emergency and ethnicity is american indian/alaska native?
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
Who was promoted to the league when Coventry was relegated to the league?
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)
SELECT "Promoted to league" FROM table_26411 WHERE "Relegated to league" = 'Coventry'
Which NFL Club has a Player of sam tidmore, and a Pick of 81?
CREATE TABLE table_59758 ("Player" text,"Draft" text,"Round" real,"Pick" real,"Position" text,"NFL Club" text)
SELECT "NFL Club" FROM table_59758 WHERE "Player" = 'sam tidmore' AND "Pick" = '81'
when is the opponent lyoto machida?
CREATE TABLE table_43572 ("Result" text,"TUF Competitor" text,"Opponent" text,"Method" text,"Event" text,"Date" text)
SELECT "Date" FROM table_43572 WHERE "Opponent" = 'lyoto machida'
Which music is jive?
CREATE TABLE table_38756 ("Couple" text,"Score" text,"Style" text,"Music" text,"Result" text)
SELECT "Music" FROM table_38756 WHERE "Style" = 'jive'
What is the frequency of the processor with an sSpec number of sl3bn(kc0)sl3e9(kc0)?
CREATE TABLE table_name_79 (frequency VARCHAR,sspec_number VARCHAR)
SELECT frequency FROM table_name_79 WHERE sspec_number = "sl3bn(kc0)sl3e9(kc0)"
How many bill cosponsored during those years where bills originally cosponsored is 113?
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)
SELECT "All bills cosponsored" FROM table_22638 WHERE "Bills originally cosponsored" = '113'
What is the number of countries in the artist table?, and I want to rank how many country in descending order.
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)
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) DESC
What was the signed year for the Chinese name who separated in 1987?
CREATE TABLE table_name_82 (year_signed VARCHAR,year_separated VARCHAR,chinese_name VARCHAR)
SELECT year_signed FROM table_name_82 WHERE year_separated = "1987" AND chinese_name = "蘇永康"
Name the explanation for alben w. barkley
CREATE TABLE table_2026548_1 (explanation VARCHAR,vice_president VARCHAR)
SELECT explanation FROM table_2026548_1 WHERE vice_president = "Alben W. Barkley"
what component comes after bluetooth ?
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)
SELECT "component" FROM table_204_451 WHERE id = (SELECT id FROM table_204_451 WHERE "component" = 'bluetooth') + 1
What is the lowest rank of Jens Kruppa in a lane larger than 2?
CREATE TABLE table_71392 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT MIN("Rank") FROM table_71392 WHERE "Name" = 'jens kruppa' AND "Lane" > '2'
For the Republican party what are the names of the incumbents?
CREATE TABLE table_18516 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Incumbent" FROM table_18516 WHERE "Party" = 'Republican'
when they visited the hospital last time, has patient 033-250 received any medication?
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,hospitalid number,wardid number,admissionheight number,admissionweight...
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...
Are there any courses on UM Chemistry Program at Peking University , Beijing for 17 credits ?
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 jobs (job_id int,job_title varchar,description varchar,r...
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
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.
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)
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
What is the to par of player john buczek, who has a t9 place and is from the United States?
CREATE TABLE table_46821 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "To par" FROM table_46821 WHERE "Place" = 't9' AND "Country" = 'united states' AND "Player" = 'john buczek'
Name the ship with hull number of aor-6
CREATE TABLE table_37185 ("Ship" text,"Hull No." text,"Builder" text,"Home Port" text,"Commissioned\u2013 Decommissioned" text,"NVR page" text)
SELECT "Ship" FROM table_37185 WHERE "Hull No." = 'aor-6'
how many patients whose admission type is newborn and admission location is transfer from hosp/extram?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
List the Human Physiology-Laboratory courses worth 3 credits .
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,student_id int,score int,comment_text varchar)CREATE TABLE ta (c...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Human Physiology-Laboratory%' OR name LIKE '%Human Physiology-Laboratory%') AND credits = 3
What is stanford's average overall?
CREATE TABLE table_76607 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT AVG("Overall") FROM table_76607 WHERE "College" = 'stanford'
where did marie-laure taya win?
CREATE TABLE table_name_90 (venue VARCHAR,winner VARCHAR)
SELECT venue FROM table_name_90 WHERE winner = "marie-laure taya"
What title did Bill Foster direct ?
CREATE TABLE table_25276528_2 (title VARCHAR,directed_by VARCHAR)
SELECT title FROM table_25276528_2 WHERE directed_by = "Bill Foster"
How many new entries this round have clubs 2 1?
CREATE TABLE table_75454 ("Round" text,"Date" text,"Matches" real,"Clubs" text,"New entries this round" text,"Prize money" text)
SELECT "New entries this round" FROM table_75454 WHERE "Clubs" = '2 → 1'
what is the number of patients whose ethnicity is american indian/alaska native and drug type is additive?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "ADDITIVE"
what is the last model ?
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\nmpixels/s" number,"fillrate\nmtextels/s" number,"fillrate\nmv...
SELECT "model" FROM table_204_582 ORDER BY id DESC LIMIT 1
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.
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,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
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...
How many different last names do the actors and actresses have?
CREATE TABLE actor (last_name VARCHAR)
SELECT COUNT(DISTINCT last_name) FROM actor
how many total pillow pals were both reintroduced and retired in 1999 ?
CREATE TABLE table_204_111 (id number,"name" text,"animal type" text,"introduced" number,"reintroduced" text,"retired" number,"beanie baby resembled" text)
SELECT COUNT("name") FROM table_204_111 WHERE "reintroduced" = 1999 AND "retired" = 1999
what LIMOUSINE service in TORONTO
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,maximum_stay int,application text,no_discounts text)CREATE ...
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'
What is the year 2001 with a total larger than 1, and 2009 with 8?
CREATE TABLE table_68544 ("2001" text,"2004" text,"2009" text,"2013" text,"Total" real)
SELECT "2001" FROM table_68544 WHERE "Total" > '1' AND "2009" = '8'
How much reputation would we get in commie SO?.
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)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId nu...
SELECT SUM(Reputation) / COUNT(*) AS Average_rep FROM Users WHERE Reputation > 100
Which country has a finish of t22?
CREATE TABLE table_name_87 (country VARCHAR,finish VARCHAR)
SELECT country FROM table_name_87 WHERE finish = "t22"
How many times is the couple laura and colin?
CREATE TABLE table_29583818_3 (place VARCHAR,couple VARCHAR)
SELECT COUNT(place) FROM table_29583818_3 WHERE couple = "Laura and Colin"
What's the smallest draw of Warrnambool when the against was less than 1299, more than 7 wins, and less than 2 losses?
CREATE TABLE table_name_29 (draws INTEGER,losses VARCHAR,club VARCHAR,against VARCHAR,wins VARCHAR)
SELECT MIN(draws) FROM table_name_29 WHERE against < 1299 AND wins > 7 AND club = "warrnambool" AND losses < 2
what is date of birth and admission time of subject name fernando wontor?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Fernando Wontor"
What are the most bronze medals in a rank more than 1 with a total larger than 3?
CREATE TABLE table_79722 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_79722 WHERE "Total" > '3' AND "Rank" > '1'
What was the method for the resolution of nc where the fight lasted less than 3 rounds?
CREATE TABLE table_52239 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Method" FROM table_52239 WHERE "Round" < '3' AND "Res." = 'nc'
What is the score on december 10?
CREATE TABLE table_name_98 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_98 WHERE date = "december 10"
Which party experienced a result of lost re-election democratic-republican hold?
CREATE TABLE table_28914 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Party" FROM table_28914 WHERE "Result" = 'Lost re-election Democratic-Republican hold'
Which player went to Wake Forest and was selected with a pick after 145?
CREATE TABLE table_44157 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College" text)
SELECT "Player" FROM table_44157 WHERE "Pick" > '145' AND "College" = 'wake forest'
How many of the patients with colangitis as their primary disease died in or before the year 2186?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.dod_year <= "2186.0"
Who are the candidates in Washington 1 district?
CREATE TABLE table_16185956_1 (district VARCHAR)
SELECT 2008 AS _candidates FROM table_16185956_1 WHERE district = "Washington 1"
Name the name of the state
CREATE TABLE table_15463188_7 (name VARCHAR,school_club_team VARCHAR)
SELECT name FROM table_15463188_7 WHERE school_club_team = "State"