instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the amount of laps for the vehicle manufactured by honda with a grid of 9?
CREATE TABLE table_76654 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Laps" FROM table_76654 WHERE "Manufacturer" = 'honda' AND "Grid" = '9'
what is the least tournaments played when the year is 1998?
CREATE TABLE table_name_62 (tournaments_played INTEGER,year VARCHAR)
SELECT MIN(tournaments_played) FROM table_name_62 WHERE year = 1998
show me the cities served by CP
CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE equi...
SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'CP' AND flight.from_airport = airport_service.airport_code
Who directed 'Fever'?
CREATE TABLE table_22860 ("#" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (in millions)" text)
SELECT "Directed by" FROM table_22860 WHERE "Title" = 'Fever'
give me the best restaurant in bay area for american food ?
CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
What number of upper level classes have labs ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
When was the Partido radical party in Madrid registered?
CREATE TABLE table_name_38 (date_of_registration VARCHAR,province VARCHAR,party VARCHAR)
SELECT date_of_registration FROM table_name_38 WHERE province = "madrid" AND party = "partido radical"
Name the howard baker for ronald reagan of 72%
CREATE TABLE table_name_46 (howard_baker VARCHAR,ronald_reagan VARCHAR)
SELECT howard_baker FROM table_name_46 WHERE ronald_reagan = "72%"
how much is dextrose 50 % in water (d50w) injection 15 ml costing?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dextrose 50 % in water (d50w) injection 15 ml')
what was the drug that patient 5905 had been prescribed two times until 10/2101.
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id ...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5905) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-10' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1...
What is the name of the Malta vessel built after 2010 that is a GL class Panamax vessel?
CREATE TABLE table_33409 ("Vessel Name" text,"Type" text,"Built" real,"Class" text,"Flag" text)
SELECT "Vessel Name" FROM table_33409 WHERE "Flag" = 'malta' AND "Type" = 'panamax' AND "Class" = 'gl' AND "Built" > '2010'
Next semester , is HHCR 700 available on days that are not Monday ?
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,predicted_graduation_semester int,degree varchar,minor varchar,...
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'HHCR' AND course.number = 700 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y...
What is the position for player Blue Edwards?
CREATE TABLE table_11545282_5 (position VARCHAR,player VARCHAR)
SELECT position FROM table_11545282_5 WHERE player = "Blue Edwards"
let me know the drug code and route of administration of metronidazole.
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 prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Metronidazole"
Find the name and revenue of the company that earns the highest revenue in each city.
CREATE TABLE manufacturers (name VARCHAR,Headquarter VARCHAR,revenue INTEGER)
SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter
How many patients with item id 50862 were admitted before 2162?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2162" AND lab.itemid = "50862"
What team was the home team when Manchester City was the away team?
CREATE TABLE table_50487 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Home team" FROM table_50487 WHERE "Away team" = 'manchester city'
After 1983, what was the Position in Seoul, South Korea?
CREATE TABLE table_36009 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text)
SELECT "Position" FROM table_36009 WHERE "Year" > '1983' AND "Venue" = 'seoul, south korea'
Which Total has a Set 1 of 25 22?
CREATE TABLE table_37921 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Total" FROM table_37921 WHERE "Set 1" = '25–22'
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, display by the Y from high to low.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
return me the number of papers in ' University of Michigan ' in Databases area .
CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varchar,year int)CREATE TABLE domain_journal (did int,jid int)CREATE TABLE domain_publication (did int,pid int)CREATE TABLE domain (did int,name varchar)CREATE TABLE journal (homepage varchar,jid int,name varchar...
SELECT COUNT(DISTINCT (publication.title)) FROM author, domain, domain_author, domain_publication, organization, publication WHERE domain_author.aid = author.aid AND domain.did = domain_author.did AND domain.did = domain_publication.did AND domain.name = 'Databases' AND organization.name = 'University of Michigan' AND ...
Can you tell me the Record that has the Points larger than 23, and the Attendance larger than 4,017, and the Date of january 18?
CREATE TABLE table_48762 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Record" FROM table_48762 WHERE "Points" > '23' AND "Attendance" > '4,017' AND "Date" = 'january 18'
When did the rank 9 building got completed?
CREATE TABLE table_67459 ("Rank" text,"Building Name" text,"Street address" text,"Height feet (meters)" text,"Floors" real,"Completed" real)
SELECT "Completed" FROM table_67459 WHERE "Rank" = '9'
What is the population density for the city of lubang?
CREATE TABLE table_261951_1 (pop_density__per_km²_ VARCHAR,municipality VARCHAR)
SELECT COUNT(pop_density__per_km²_) FROM table_261951_1 WHERE municipality = "Lubang"
When and in what zip code did max temperature reach 80?
CREATE TABLE weather (date VARCHAR,zip_code VARCHAR,max_temperature_f VARCHAR)
SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80
What highest Year has Wins 15 and Losses less than 5?
CREATE TABLE table_80277 ("Year" real,"Competition" text,"Wins" real,"Draws" real,"Loses" real)
SELECT MAX("Year") FROM table_80277 WHERE "Wins" = '15' AND "Loses" < '5'
WHEN has a Opponent of miami dolphins?
CREATE TABLE table_name_94 (date VARCHAR,opponent VARCHAR)
SELECT date FROM table_name_94 WHERE opponent = "miami dolphins"
Which Goals have Ends of 30 june 2010, and Since larger than 2007?
CREATE TABLE table_44067 ("Nat." text,"Name" text,"Since" real,"Goals" real,"Ends" text,"Transfer fee" text)
SELECT "Goals" FROM table_44067 WHERE "Ends" = '30 june 2010' AND "Since" > '2007'
Which Year has the Orginal title of La C r monie?
CREATE TABLE table_name_13 (year VARCHAR,original_title VARCHAR)
SELECT year FROM table_name_13 WHERE original_title = "la cérémonie"
What are the names of all the Japanese constructors that have earned more than 5 points?
CREATE TABLE circuits (circuitid number,circuitref text,name text,location text,country text,lat number,lng number,alt number,url text)CREATE TABLE status (statusid number,status text)CREATE TABLE qualifying (qualifyid number,raceid number,driverid number,constructorid number,number number,position number,q1 text,q2 te...
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
What is the nationality of the Team Purdue?
CREATE TABLE table_48318 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text)
SELECT "Nationality" FROM table_48318 WHERE "School/Club Team" = 'purdue'
Which poll source determined undecided of 5% and Jim DeMint (R) of 58%?
CREATE TABLE table_76980 ("Poll source" text,"Dates administered" text,"Jim DeMint (R)" text,"Alvin Greene (D)" text,"Tom Clements (G)" text,"Other" text,"Undecided" text)
SELECT "Poll source" FROM table_76980 WHERE "Undecided" = '5%' AND "Jim DeMint (R)" = '58%'
What date did Lanny Wadkins (6) win?
CREATE TABLE table_36073 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" text)
SELECT "Date" FROM table_36073 WHERE "Winner" = 'lanny wadkins (6)'
With a 2008 result of 153 what is the result for 2007?
CREATE TABLE table_50387 ("Tournament" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2007" FROM table_50387 WHERE "2008" = '153'
WHich Frequency has a Format of country / news / sports?
CREATE TABLE table_name_67 (frequency VARCHAR,format VARCHAR)
SELECT frequency FROM table_name_67 WHERE format = "country / news / sports"
count the number of patients whose marital status is married and procedure short title is inject ca chemother nec?
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Inject ca chemother NEC"
what was patient 6170's insurance plan during this hospital visit.
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)C...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 6170 AND admissions.dischtime IS NULL
how many patients who have been prescribed base drug type had other cell lab test in the lab?
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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Other Cell"
who was the only member of the country party to be elected in 1919 ?
CREATE TABLE table_203_484 (id number,"member" text,"party" text,"electorate" text,"state" text,"first elected" text)
SELECT "member" FROM table_203_484 WHERE "first elected" = 1919 AND "party" = 'country'
How many bronze medals for the nation with less than 1 total?
CREATE TABLE table_name_79 (bronze INTEGER,total INTEGER)
SELECT MAX(bronze) FROM table_name_79 WHERE total < 1
what is the location for the date (to) 8 october 1922?
CREATE TABLE table_17716 ("Name of System" text,"Location" text,"Traction Type" text,"Date (From)" text,"Date (To)" text,"Notes" text)
SELECT "Location" FROM table_17716 WHERE "Date (To)" = '8 October 1922'
Which Social Democratic Party has a Green smaller than 0?
CREATE TABLE table_name_10 (social_democratic_party INTEGER,green INTEGER)
SELECT AVG(social_democratic_party) FROM table_name_10 WHERE green < 0
What kind of Week 1 has a Week 8 of not eligible, and a Week 9 of no nominations, and a Week 3 of cyril? Question 3
CREATE TABLE table_name_24 (week_1 VARCHAR,week_3 VARCHAR,week_8 VARCHAR,week_9 VARCHAR)
SELECT week_1 FROM table_name_24 WHERE week_8 = "not eligible" AND week_9 = "no nominations" AND week_3 = "cyril"
What was the date when the away team was the leeds united?
CREATE TABLE table_76175 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_76175 WHERE "Away team" = 'leeds united'
Which frequency has 40kw power?
CREATE TABLE table_name_5 (frequency VARCHAR,power__kw_ VARCHAR)
SELECT frequency FROM table_name_5 WHERE power__kw_ = "40kw"
How many losses did the 1943 MLB have?
CREATE TABLE table_name_61 (losses INTEGER,mlb_season VARCHAR)
SELECT AVG(losses) FROM table_name_61 WHERE mlb_season = "1943"
what does the airline code DL stand for
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant i...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL'
On what date was a friendly competition and a result of 3 0?
CREATE TABLE table_name_69 (date VARCHAR,competition VARCHAR,result VARCHAR)
SELECT date FROM table_name_69 WHERE competition = "friendly" AND result = "3–0"
What is the Date of the game where the Cavaliers have a Record of 15-27?
CREATE TABLE table_name_57 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_57 WHERE record = "15-27"
How many different locations does each school have?
CREATE TABLE department (school_code VARCHAR,dept_address VARCHAR)
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code
Which artist release the most CDs?
CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text)
SELECT artist FROM torrents GROUP BY artist ORDER BY COUNT(groupname) DESC LIMIT 1
how many patients whose age is less than 47 and lab test fluid is joint fluid?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Joint Fluid"
What is the rank of Greg Norman who earned more than $12,507,322?
CREATE TABLE table_35332 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Wins" real)
SELECT AVG("Rank") FROM table_35332 WHERE "Player" = 'greg norman' AND "Earnings ( $ )" > '12,507,322'
, I want to list by the bars from low to high please.
CREATE TABLE festival_detail (Festival_ID int,Festival_Name text,Chair_Name text,Location text,Year int,Num_of_Audience int)CREATE TABLE nomination (Artwork_ID int,Festival_ID int,Result text)CREATE TABLE artwork (Artwork_ID int,Type text,Name text)
SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY Type
The displacement(s) 466 cubic inches (7.6L), has what engine family?
CREATE TABLE table_28593 ("Engine Family" text,"Cylinder Layout" text,"Displacement(s)" text,"Injection type" text,"Years produced" text)
SELECT "Engine Family" FROM table_28593 WHERE "Displacement(s)" = '466 cubic inches (7.6L)'
What is the total number of 2nd place finishes for riders active in years 2009-2010 and more than 0 wins?
CREATE TABLE table_name_83 (years_active VARCHAR,wins VARCHAR)
SELECT SUM(2 AS nd_pl) FROM table_name_83 WHERE years_active = "2009-2010" AND wins > 0
What is the low week from october 15, 1961?
CREATE TABLE table_name_82 (week INTEGER,date VARCHAR)
SELECT MIN(week) FROM table_name_82 WHERE date = "october 15, 1961"
how many patients are below 27 years of age and admitted before the year 2123?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "27" AND demographic.admityear < "2123"
What was the studio for The Hard Way in 1943?
CREATE TABLE table_name_77 (studio VARCHAR,year VARCHAR,title VARCHAR)
SELECT studio FROM table_name_77 WHERE year = 1943 AND title = "the hard way"
What is the web thickness if the flange width is 100?
CREATE TABLE table_2287 ("Type" text,"Beam height (mm)" real,"Flange width (mm)" real,"Web thickness (mm)" text,"Flange thickness (mm)" text,"Weight (kg/m)" text,"Cross-section area (cm 2)" text,"Moment of inertia in torsion (J) (cm 4)" text)
SELECT "Web thickness (mm)" FROM table_2287 WHERE "Flange width (mm)" = '100'
What Country has a Player of nick faldo?
CREATE TABLE table_60005 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_60005 WHERE "Player" = 'nick faldo'
What is the release date of 'New Worlds for Old'?
CREATE TABLE table_27932399_1 (release_date VARCHAR,release_title VARCHAR)
SELECT release_date FROM table_27932399_1 WHERE release_title = "New Worlds For Old"
how many patients are single and tested in lab for hyaline casts?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Hyaline Casts"
how many consecutive escorts were in 1943 ?
CREATE TABLE table_203_764 (id number,"name" text,"date" number,"nation" text,"displacement" text,"speed" text,"number" number,"notes" text)
SELECT COUNT(*) FROM table_203_764 WHERE "date" = '1943'
list each date represented by locomotives at the museum .
CREATE TABLE table_203_223 (id number,"name" text,"gauge" text,"builder" text,"type" text,"date" number,"works number" number,"notes" text)
SELECT "date" FROM table_203_223
What position does Zack Torquato play?
CREATE TABLE table_77734 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club team (League)" text)
SELECT "Position" FROM table_77734 WHERE "Player" = 'zack torquato'
WHAT ROUND WAS FORWARD ANDRE PETERSSON SELECTED?
CREATE TABLE table_11803648_17 (round INTEGER,position VARCHAR)
SELECT MIN(round) FROM table_11803648_17 WHERE position = "Forward"
How many positions had a difference of - 4 and an against of less than 24?
CREATE TABLE table_34591 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT COUNT("Position") FROM table_34591 WHERE "Difference" = '- 4' AND "Against" < '24'
How many league cups associated with under 10 championships and a total of under 3?
CREATE TABLE table_name_36 (league_cup INTEGER,championship VARCHAR,total VARCHAR)
SELECT SUM(league_cup) FROM table_name_36 WHERE championship < 10 AND total < 3
What is Primary Language(s), when Director is 'Ilgar Safat Category:Articles With hCards'?
CREATE TABLE table_47579 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Primary Language(s)" text,"Director" text,"Result" text)
SELECT "Primary Language(s)" FROM table_47579 WHERE "Director" = 'ilgar safat category:articles with hcards'
Which republican ticket has stanley h. fuld as the Democratic ticket?
CREATE TABLE table_42137 ("Office" text,"Republican ticket" text,"Democratic ticket" text,"Conservative ticket" text,"Liberal ticket" text,"Socialist Labor ticket" text,"Socialist Workers ticket" text)
SELECT "Republican ticket" FROM table_42137 WHERE "Democratic ticket" = 'stanley h. fuld'
until 2104, what was the yearly minimum weight of patient 25523?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_i...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
Which Competition has a Year smaller than 2009, and Notes of 56.16 m?
CREATE TABLE table_name_13 (competition VARCHAR,year VARCHAR,notes VARCHAR)
SELECT competition FROM table_name_13 WHERE year < 2009 AND notes = "56.16 m"
give me return flights from PHILADELPHIA to SAN FRANCISCO for 12 3
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 3 AND date_day.month_number = 12...
What was the date that a player went to the club Doncaster Rovers?
CREATE TABLE table_49708 ("Exit Date" text,"Pos." text,"Player" text,"To club" text,"Transfer fee" text)
SELECT "Exit Date" FROM table_49708 WHERE "To club" = 'doncaster rovers'
What are the total goals against the winner with less than 5 wins, and less than 5 plays?
CREATE TABLE table_50598 ("Rank" real,"Team" text,"Played" real,"Wins" real,"Ties" real,"Losses" real,"Goals For" real,"Goals Against" real,"Points" real)
SELECT COUNT("Goals Against") FROM table_50598 WHERE "Wins" < '5' AND "Played" < '5'
how many patients whose admission year is less than 2198 and drug name is gentamicin sulfate?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2198" AND prescriptions.drug = "Gentamicin Sulfate"
Which award is in the category of best music video?
CREATE TABLE table_40637 ("Year" real,"Award" text,"Category" text,"Nomination" text,"Result" text)
SELECT "Award" FROM table_40637 WHERE "Category" = 'best music video'
For those records from the products and each product's manufacturer, give me the comparison about revenue over the name , and group by attribute name, and rank from low to high by the Name please.
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
what's the number of patients who have had hearing loss nos diagnosed in the last year?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE pres...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hearing loss nos') AND DATETIME(diagnoses_icd.charttime, '...
What is Television Service, when Content is Presentazione?
CREATE TABLE table_40714 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "Television service" FROM table_40714 WHERE "Content" = 'presentazione'
Which Torque has a Model of s63 amg ('01)?
CREATE TABLE table_78579 ("Model" text,"Engine" text,"Cyl." text,"Power" text,"Torque" text)
SELECT "Torque" FROM table_78579 WHERE "Model" = 's63 amg (''01)'
in a game against st kilda, what was the away team's score?
CREATE TABLE table_52363 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_52363 WHERE "Home team" = 'st kilda'
What date was the tie number of 32?
CREATE TABLE table_65181 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_65181 WHERE "Tie no" = '32'
Show ids, customer ids, names for all accounts.
CREATE TABLE Accounts (account_id VARCHAR,customer_id VARCHAR,account_name VARCHAR)
SELECT account_id, customer_id, account_name FROM Accounts
What is the title of the episode with production code 40811-002?
CREATE TABLE table_name_87 (title VARCHAR,prod_code VARCHAR)
SELECT title FROM table_name_87 WHERE prod_code = "40811-002"
What province does the Ruhuna Royals team come from?
CREATE TABLE table_23426 ("Team" text,"Province" text,"Owner(s)" text,"Price" text,"Captain" text,"Head coach" text,"Icon Player" text)
SELECT "Province" FROM table_23426 WHERE "Team" = 'Ruhuna Royals'
Show the different headquarters and number of companies at each headquarter.
CREATE TABLE company (company_id number,name text,headquarters text,industry text,sales_in_billion number,profits_in_billion number,assets_in_billion number,market_value_in_billion number)CREATE TABLE people (people_id number,age number,name text,nationality text,graduation_college text)CREATE TABLE employment (company...
SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
Which episode has ulrika jonsson and michael mcintyre on sean's team?
CREATE TABLE table_23292220_4 (episode VARCHAR,seans_team VARCHAR)
SELECT episode FROM table_23292220_4 WHERE seans_team = "Ulrika Jonsson and Michael McIntyre"
Roslinda Samsu has what nationality?
CREATE TABLE table_64710 ("Group" text,"Name" text,"Nationality" text,"4.00" text,"Result" text)
SELECT "Nationality" FROM table_64710 WHERE "Name" = 'roslinda samsu'
how many patients whose admission year is less than 2146 and lab test name is ptt?
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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "PTT"
What is the highest number of draws with 6 losses and less than 15 points?
CREATE TABLE table_42392 ("Team" text,"Match" real,"Points" real,"Draw" real,"Lost" real)
SELECT MAX("Draw") FROM table_42392 WHERE "Lost" = '6' AND "Points" < '15'
how many hours have elapsed since patient 93078 last received a laboratory phosphate test on this hospital visit?
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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 93078 AND admissio...
how many representatives were appointed by theodore roosevelt ?
CREATE TABLE table_203_778 (id number,"representative" text,"title" text,"presentation\nof credentials" text,"termination\nof mission" text,"appointed by" text)
SELECT COUNT("title") FROM table_203_778 WHERE "appointed by" = 'theodore roosevelt'
How many years is ur sulcus listed with a diameter less than 1,145.0?
CREATE TABLE table_name_68 (year_named VARCHAR,name VARCHAR,diameter VARCHAR)
SELECT COUNT(year_named) FROM table_name_68 WHERE name = "ur sulcus" AND diameter < 1 OFFSET 145.0
Draw a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to display by the total number in ascending.
CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)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 Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100)
What is Date Sent, when Signal Power ( kW ) is less than 126, when Arrival Date is 'January 2059', and when HD Designation is 'HD193664'?
CREATE TABLE table_name_75 (date_sent VARCHAR,hd_designation VARCHAR,signal_power___kw__ VARCHAR,arrival_date VARCHAR)
SELECT date_sent FROM table_name_75 WHERE signal_power___kw__ < 126 AND arrival_date = "january 2059" AND hd_designation = "hd193664"
how many times did patient 022-187132 do a output (ml)-chest tube #2 mediastinal lower;anterior on the current intensive care unit visit?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellp...
Find those years for all exhibitions with ticket prices lower than 15, group by year, and count year, and display by the the number of year from high to low.
CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)
SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Year ORDER BY COUNT(Year) DESC
are there any LIMOUSINE or TAXI services available at the BOS airport
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE fare (fare_id in...
SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE (ground_service.transport_type = 'LIMOUSINE' OR ground_service.transport_type = 'TAXI') AND airport.airport_code = 'BOS' AND ground_service.airport_code = airport.airport_code