instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
who is the the mixed doubles with year being 1972 | CREATE TABLE table_19029 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text) | SELECT "Mixed doubles" FROM table_19029 WHERE "Year" = '1972' |
On what date was Tie #26 played? | CREATE TABLE table_name_90 (date VARCHAR,tie_no VARCHAR) | SELECT date FROM table_name_90 WHERE tie_no = "26" |
What is the region for the date November 18, 2002? | CREATE TABLE table_name_76 (region VARCHAR,date VARCHAR) | SELECT region FROM table_name_76 WHERE date = "november 18, 2002" |
how many nations received silver medals ? | CREATE TABLE table_203_739 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_203_739 WHERE "silver" <> 0 |
Who had the most points in games over 59? | CREATE TABLE table_name_12 (high_points VARCHAR,game INTEGER) | SELECT high_points FROM table_name_12 WHERE game > 59 |
How many laps led when the Grid was 15? | CREATE TABLE table_46057 ("Fin. Pos" text,"Car No." text,"Driver" text,"Team" text,"Laps" text,"Time/Retired" text,"Grid" text,"Laps Led" text,"Points" text) | SELECT "Laps Led" FROM table_46057 WHERE "Grid" = '15' |
Count the number of patients admitted before the year 2175 whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi. | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2175" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" |
Find the ids of the students who participate in Canoeing and Kayaking. | CREATE TABLE participates_in (stuid VARCHAR)CREATE TABLE activity (actid VARCHAR,activity_name VARCHAR) | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' |
Are there any morning sessions for MENAS 334 ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MENAS' AND course.number = 334 AND semester.semester = 'WN' AND semester.semester_id = course_of... |
Who is the third alternate for Germany? | CREATE TABLE table_name_56 (third VARCHAR,nation VARCHAR) | SELECT third FROM table_name_56 WHERE nation = "germany" |
which country is listed last on the chart ? | CREATE TABLE table_203_803 (id number,"draw" number,"country" text,"language" text,"artist" text,"song" text,"english translation" text,"place" number,"points" number) | SELECT "country" FROM table_203_803 ORDER BY id DESC LIMIT 1 |
What was the time when his opponent was Rudy Martin? | CREATE TABLE table_50475 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_50475 WHERE "Opponent" = 'rudy martin' |
how mnay greek designation in tampa | CREATE TABLE table_18159601_1 (greek_designation VARCHAR,city VARCHAR) | SELECT COUNT(greek_designation) FROM table_18159601_1 WHERE city = "Tampa" |
tell me the total dose of phenytoin sodium patient 15209 has been prescribed on the current 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id numb... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15209 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'phenytoin sodium' |
What are the names of all the games that have been played for at least 1000 hours? | CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE plays_games (s... | SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 |
What is the result/games of Sun 11/28/10 as the date/year? | CREATE TABLE table_21436373_6 (result_games VARCHAR,date_year VARCHAR) | SELECT result_games FROM table_21436373_6 WHERE date_year = "Sun 11/28/10" |
Who was Margaret Court's opponent on clay in 1975? | CREATE TABLE table_61113 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Opponents" FROM table_61113 WHERE "Surface" = 'clay' AND "Partner" = 'margaret court' AND "Year" = '1975' |
Which masthead ends on oct 69? | CREATE TABLE table_name_15 (masthead VARCHAR,end_month VARCHAR) | SELECT masthead FROM table_name_15 WHERE end_month = "oct–69" |
The sun of total that has a tour of 7 and a Giro smaller than 3 is 12. | CREATE TABLE table_69161 ("Name" text,"Tour" real,"Giro" real,"Vuelta" real,"Total" real) | SELECT SUM("Total") FROM table_69161 WHERE "Tour" = '7' AND "Giro" < '3' |
Which team lost 0-3 and 0-5? | CREATE TABLE table_79785 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "Team 1" FROM table_79785 WHERE "2nd leg" = '0-3' AND "1st leg" = '0-5' |
Display a bar chart for what are the ids and names of the web accelerators that are compatible with two or more browsers?, and could you rank by the bars in desc please? | CREATE TABLE browser (id int,name text,market_share real)CREATE TABLE accelerator_compatible_browser (accelerator_id int,browser_id int,compatible_since_year int)CREATE TABLE Web_client_accelerator (id int,name text,Operating_system text,Client text,Connection text) | SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY name DESC |
List the name of all products along with the number of complaints that they have received, sort by the the total number from low to high please. | CREATE TABLE Complaints (complaint_id INTEGER,product_id INTEGER,customer_id INTEGER,complaint_outcome_code VARCHAR(20),complaint_status_code VARCHAR(20),complaint_type_code VARCHAR(20),date_complaint_raised DATETIME,date_complaint_closed DATETIME,staff_id INTEGER)CREATE TABLE Products (product_id INTEGER,parent_produc... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) |
What date were Romania at Home at the Bucharest Venue with a Score of 13-19? | CREATE TABLE table_7706 ("Year" real,"Date" text,"Home" text,"Score" text,"Away" text,"Venue" text) | SELECT "Date" FROM table_7706 WHERE "Home" = 'romania' AND "Venue" = 'bucharest' AND "Score" = '13-19' |
A bar chart for what are the number of the titles of all movies that have rating star is between 3 and 5?, and display in asc by the X-axis. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text) | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title |
count the number of patients whose death status is 1 and admission location is emergency room admit? | 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.expire_flag = "1" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" |
What is the 3 most common cloud cover rates in the region of zip code 94107? | CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,end_date text,end_station_name text,end_station_id number,bike_id number,subscription_type text,zip_code number)CREATE TABLE weather (date text,max_temperature_f number,mean_temperature_f number,min_temperature_... | SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT(*) DESC LIMIT 3 |
What did the Dallara chassis with a 5 start in 2006 finish? | CREATE TABLE table_name_91 (finish VARCHAR,year VARCHAR,chassis VARCHAR,start VARCHAR) | SELECT finish FROM table_name_91 WHERE chassis = "dallara" AND start = "5" AND year = 2006 |
In what Tournament was Janet Young a Partner? | CREATE TABLE table_35164 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Tournament" FROM table_35164 WHERE "Partner" = 'janet young' |
How many patients are of divorced marital status and with black/african american ethnicity? | 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.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" |
What position did the Saskatchewan player get drafted as? | CREATE TABLE table_51299 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_51299 WHERE "College" = 'saskatchewan' |
what circuit is listed below autodromo di pergusa , enna ? | CREATE TABLE table_204_63 (id number,"round" number,"circuit" text,"date" text,"pole position" text,"winning driver" text,"winning team" text,"trophy winner" text) | SELECT "circuit" FROM table_204_63 WHERE id = (SELECT id FROM table_204_63 WHERE "circuit" = 'autodromo di pergusa, enna') + 1 |
What first appeared in 1966 in the comic X-2-Y? | CREATE TABLE table_name_60 (first_appearance VARCHAR,year VARCHAR,name VARCHAR) | SELECT first_appearance FROM table_name_60 WHERE year = 1966 AND name = "x-2-y" |
Name the model number for usf46 | CREATE TABLE table_24451 ("Chassis code" text,"Model no." text,"Production years" text,"Drivetrain" text,"Transmission" text,"Engine type" text,"Engine code" text,"Region(s)" text) | SELECT "Model no." FROM table_24451 WHERE "Chassis code" = 'USF46' |
What is the fewest games lost by Paulistano with more than 39 points? | CREATE TABLE table_40873 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MIN("Lost") FROM table_40873 WHERE "Team" = 'paulistano' AND "Points" > '39' |
What is every entry for 1982-83 for rank 1? | CREATE TABLE table_22606461_10 (rank VARCHAR) | SELECT 1982 AS _83 FROM table_22606461_10 WHERE rank = 1 |
What is the Opponent on Week 11? | CREATE TABLE table_name_28 (opponent VARCHAR,week VARCHAR) | SELECT opponent FROM table_name_28 WHERE week = 11 |
what is the number of patients whose insurance is government and procedure short title is abdominal wall incision? | 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 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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Abdominal wall incision" |
what platform was used for the last title on this chart ? | CREATE TABLE table_203_836 (id number,"title" text,"year" number,"platforms" text,"developer" text,"publisher" text,"notes" text) | SELECT "platforms" FROM table_203_836 ORDER BY id DESC LIMIT 1 |
Of all the schools that left before 2003, what is the average year joined? | CREATE TABLE table_name_22 (year_joined INTEGER,year_left INTEGER) | SELECT AVG(year_joined) FROM table_name_22 WHERE year_left < 2003 |
What is the entry name of the most expensive catalog (in USD)? | CREATE TABLE catalog_contents (catalog_entry_name VARCHAR,price_in_dollars VARCHAR) | SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1 |
Math posts with votes before they were created. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,... | SELECT pv.age AS "post_age", pv.VoteId AS "vote_id", pv.VoteTypeId AS "vote_type", pv.UserId AS "vote_user", pv.UserId AS "user_link", pv.Id AS "post_link" FROM (SELECT DATEDIFF(day, CAST(p.CreationDate AS DATE), CreationDate) AS age, p.Id, v.Id AS VoteId, v.VoteTypeId, v.UserId FROM Posts AS p LEFT JOIN Votes AS v ON ... |
Name the transfer fee for damia | CREATE TABLE table_55808 ("Name" text,"Country" text,"Status" text,"Moving to" text,"Transfer window" text,"Transfer fee" text) | SELECT "Transfer fee" FROM table_55808 WHERE "Name" = 'damia' |
How many customers did not have any event? | CREATE TABLE residents (resident_id number,property_id number,date_moved_in time,date_moved_out time,other_details text)CREATE TABLE timed_status_of_things (thing_id number,date_and_date time,status_of_thing_code text)CREATE TABLE residents_services (resident_id number,service_id number,date_moved_in time,property_id n... | SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events) |
What day did he play on hard with tom mercer? | CREATE TABLE table_name_69 (date VARCHAR,surface VARCHAR,partner VARCHAR) | SELECT date FROM table_name_69 WHERE surface = "hard" AND partner = "tom mercer" |
What is the name of the department with an instructure who has a name like 'Soisalon'? | CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min num... | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' |
What score did Seve Ballesteros have when he was in T3 place? | CREATE TABLE table_8189 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text) | SELECT "Score" FROM table_8189 WHERE "Place" = 't3' AND "Player" = 'seve ballesteros' |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and code , and group by attribute name, and order in descending by the Y. | 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC |
Name the number of road record for team ole miss | CREATE TABLE table_22825679_1 (road_record VARCHAR,team VARCHAR) | SELECT COUNT(road_record) FROM table_22825679_1 WHERE team = "Ole Miss" |
Show the minimum, average, maximum order quantity of all invoices. | CREATE TABLE INVOICES (Order_Quantity INTEGER) | SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES |
Visualize a bar chart, count and group by nationality from the journalist table, show x-axis in ascending order. | CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text) | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality |
what is the daily maximum amount of foley cath in patient 021-111547 in 12/this year? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND intakeoutput.celllabel = 'fole... |
What's greatest attendance on May 7? | CREATE TABLE table_35455 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT MAX("Attendance") FROM table_35455 WHERE "Date" = 'may 7' |
How many wins when there are 4 losses and against are fewer than 1281? | CREATE TABLE table_61117 ("Central Murray" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT AVG("Wins") FROM table_61117 WHERE "Losses" = '4' AND "Against" < '1281' |
You can return a bar chart with employees' first names and their salaries, display by the Y in ascending. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25)... | SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY |
give me the number of patients whose drug code is levo750 and lab test category is chemistry? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | 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.formulary_drug_cd = "LEVO750" AND lab."CATEGORY" = "Chemistry" |
how many female patients are aged below 36 years? | 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.gender = "F" AND demographic.age < "36" |
A bar chart for finding the number of the parties associated with the delegates from district 1. Who served as governors of the parties? | CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroll... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor |
When atsv erlangen is the mittelfranken nord and alemannia haibach is the unterfranken west what is the mittelfranken s d? | CREATE TABLE table_2806 ("Season" text,"Mittelfranken Nord" text,"Mittelfranken S\u00fcd" text,"Unterfranken West" text,"Unterfranken Ost" text,"Oberfranken West" text,"Oberfranken Ost" text) | SELECT "Mittelfranken S\u00fcd" FROM table_2806 WHERE "Unterfranken West" = 'Alemannia Haibach' AND "Mittelfranken Nord" = 'ATSV Erlangen' |
Who had a transfer fee of released and played the position of DF? | CREATE TABLE table_name_30 (player VARCHAR,transfer_fee VARCHAR,pos VARCHAR) | SELECT player FROM table_name_30 WHERE transfer_fee = "released" AND pos = "df" |
find the number of patients who are male and their admission location is clinic referral/premature. | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" |
Who is the crew chief of team Joe Gibbs Racing, which has a Chevrolet Monte Carlo and Fedex as the primary sponsor? | CREATE TABLE table_37456 ("Team" text,"Car(s)" text,"Driver(s)" text,"Primary Sponsor(s)" text,"Crew Chief" text) | SELECT "Crew Chief" FROM table_37456 WHERE "Car(s)" = 'chevrolet monte carlo' AND "Team" = 'joe gibbs racing' AND "Primary Sponsor(s)" = 'fedex' |
is captopril prescribed since 2103 to patient 2518? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)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,... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518) AND prescriptions.drug = 'captopril' AND STRFTIME('%y', prescriptions.startdate) >= '2103' |
What language did the word mahjong originate from? | CREATE TABLE table_45722 ("Japanese" text,"R\u014dmaji" text,"Meaning" text,"Chinese" text,"Romanization" text,"Source language" text) | SELECT "Source language" FROM table_45722 WHERE "Meaning" = 'mahjong' |
What is the ICAO for Air Busan? | CREATE TABLE table_name_63 (icao VARCHAR,callsign VARCHAR) | SELECT icao FROM table_name_63 WHERE callsign = "air busan" |
When did the country that produced 1,213,000 (21st) bbl/day join Opec? | CREATE TABLE table_166346_1 (joined_opec VARCHAR,production___bbl__day_ VARCHAR) | SELECT joined_opec FROM table_166346_1 WHERE production___bbl__day_ = "1,213,000 (21st)" |
Who were the opponents that had an attendance of exactly 16115? | CREATE TABLE table_27145 ("Week" real,"Date" text,"Kickoff" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real) | SELECT "Opponent" FROM table_27145 WHERE "Attendance" = '16115' |
What is the population (2008) when the capital was Sanniquellie, created later than 1964? | CREATE TABLE table_60425 ("map#" real,"County" text,"Capital" text,"Population (2008)" real,"Area" text,"Created" real) | SELECT SUM("Population (2008)") FROM table_60425 WHERE "Capital" = 'sanniquellie' AND "Created" > '1964' |
What is the average value of Bronze when silver is 0 and the total is less than 1? | CREATE TABLE table_name_18 (bronze INTEGER,silver VARCHAR,total VARCHAR) | SELECT AVG(bronze) FROM table_name_18 WHERE silver = 0 AND total < 1 |
What was the score when the Tie no was 9? | CREATE TABLE table_58813 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_58813 WHERE "Tie no" = '9' |
what is the sum of the b score when the a score is 6.6 and the total is 15.6? | CREATE TABLE table_13451 ("Position" text,"Gymnast" text,"A Score" real,"B Score" real,"Total" real) | SELECT SUM("B Score") FROM table_13451 WHERE "A Score" = '6.6' AND "Total" = '15.6' |
How many teams drew the widnes vikings? | CREATE TABLE table_17924 ("Position" real,"Club" text,"Played" real,"Won" real,"Drawn" real,"Lost" real,"Pts For" real,"Pts Agst" real,"B.P." real,"Points" real) | SELECT COUNT("Drawn") FROM table_17924 WHERE "Club" = 'Widnes Vikings' |
What is the Genre when the Artist is Prince? | CREATE TABLE table_name_7 (genre VARCHAR,artist VARCHAR) | SELECT genre FROM table_name_7 WHERE artist = "prince" |
how many of the patients aged below 24 had a hospital stay of more than 15 days? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "15" |
the only year with 10 conservative councillors was when ? | CREATE TABLE table_204_349 (id number,"year" number,"conservative\ncouncillors" number,"labour\ncouncillors" number,"independent\ncouncillors" number,"liberal\ncouncillors" number) | SELECT "year" FROM table_204_349 WHERE "conservative\ncouncillors" = 10 |
which denomination has the highest margin ? | CREATE TABLE table_203_857 (id number,"denomination" text,"1870" text,"1880" text,"1890" text,"1900" text,"1910" text,"1920" text,"1930" text,"1941" text,"1949" text,"2001" text,"2011" text) | SELECT "denomination" FROM table_203_857 ORDER BY "1870" DESC LIMIT 1 |
Which Record has Points larger than 0, and a Score of 7 3? | CREATE TABLE table_name_96 (record VARCHAR,points VARCHAR,score VARCHAR) | SELECT record FROM table_name_96 WHERE points > 0 AND score = "7–3" |
what is the total number of times mckoy placed in the top 3 ? | CREATE TABLE table_204_813 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT COUNT(*) FROM table_204_813 WHERE "position" <= 3 |
Count the number of patients whose admission locations is clinic referral/premature and admission year is before 2112. | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2112" |
Which Chassis has 0 points? | CREATE TABLE table_70883 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Chassis" FROM table_70883 WHERE "Points" = '0' |
find the drug code of subject id 3343. | 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 FROM prescriptions WHERE prescriptions.subject_id = "3343" |
what is the difference in volts between the eestor eesu barium titanate supercapacitor and the act premlis lithium ion capacitor ? | CREATE TABLE table_204_583 (id number,"capacitor type" text,"capacity" text,"volts" text,"temp." text,"energy-to-weight ratio" text,"power-to-weight ratio" text) | SELECT ABS((SELECT "volts" FROM table_204_583 WHERE "capacitor type" = 'eestor eesu barium titanate supercapacitor') - (SELECT "volts" FROM table_204_583 WHERE "capacitor type" = 'act premlis lithium ion capacitor')) |
How many Goals have Games smaller than 6, and a Debut year of 1939, and Years at club of 1939, 1941? | CREATE TABLE table_name_48 (goals VARCHAR,years_at_club VARCHAR,games VARCHAR,debut_year VARCHAR) | SELECT COUNT(goals) FROM table_name_48 WHERE games < 6 AND debut_year = 1939 AND years_at_club = "1939, 1941" |
Who is the player from a round larger than 5 and the college/junior/club team of Leningrad SKA (russia)? | CREATE TABLE table_name_94 (player VARCHAR,round VARCHAR,college_junior_club_team VARCHAR) | SELECT player FROM table_name_94 WHERE round > 5 AND college_junior_club_team = "leningrad ska (russia)" |
Which CPU chip(s) is used in the Classic type hardware? | CREATE TABLE table_name_71 (cpu_chip VARCHAR,type VARCHAR) | SELECT cpu_chip FROM table_name_71 WHERE type = "classic" |
Who is the head coach for the club from Aveiro? | CREATE TABLE table_60068 ("Club" text,"Head Coach" text,"City" text,"Stadium" text,"2003\u20132004 season" text) | SELECT "Head Coach" FROM table_60068 WHERE "City" = 'aveiro' |
How many players played each position Plot them as bar chart, and could you display y axis from high to low order? | CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE team (Team_id int,Name text)CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE country ... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) DESC |
Tell me the WL doubles with a debut of 1999 | CREATE TABLE table_74488 ("Player" text,"W-L (Total)" text,"W-L (Singles)" text,"W-L (Doubles)" text,"Ties" real,"Debut" real,"Years Played" real) | SELECT "W-L (Doubles)" FROM table_74488 WHERE "Debut" = '1999' |
Which round was the winning constructor was Benetton - Ford and in the Pole Position was Damon Hill? | CREATE TABLE table_196 ("Round" real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text) | SELECT "Round" FROM table_196 WHERE "Winning Constructor" = 'Benetton - Ford' AND "Pole Position" = 'Damon Hill' |
What is Power, when City of License is Sioux Lookout? | CREATE TABLE table_42412 ("City of license" text,"Identifier" text,"Frequency" text,"Power" text,"Class" text,"RECNet" text) | SELECT "Power" FROM table_42412 WHERE "City of license" = 'sioux lookout' |
A bar chart shows the distribution of Team_Name and Team_ID , and order from low to high by the Y please. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID |
What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels? | CREATE TABLE table_name_71 (year VARCHAR,venue VARCHAR,opponent VARCHAR) | SELECT COUNT(year) FROM table_name_71 WHERE venue = "sydney cricket ground" AND opponent = "parramatta eels" |
In what Year was Labyrinth nominated? | CREATE TABLE table_43409 ("Year (Ceremony)" text,"Film title used in nomination" text,"Serbian title" text,"Director" text,"Result" text) | SELECT "Year (Ceremony)" FROM table_43409 WHERE "Film title used in nomination" = 'labyrinth' |
What was the record when the game was at the Rose Garden? | CREATE TABLE table_47037 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_47037 WHERE "Location" = 'rose garden' |
What was the overall pick for the player who was a guard and had a round less than 9? | CREATE TABLE table_32227 ("Round" real,"Overall" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT AVG("Overall") FROM table_32227 WHERE "Position" = 'guard' AND "Round" < '9' |
how was patient 004-32341 admitted to the hospital since 2 years ago for the first time? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid numbe... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '004-32341' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1 |
Which model has a frequency of 750 mhz and a socket of bga2 pga2? | CREATE TABLE table_77189 ("Model number" text,"Frequency" text,"L2 cache" text,"Mult." text,"Voltage" text,"Socket" text,"Release date" text) | SELECT "Model number" FROM table_77189 WHERE "Frequency" = '750 mhz' AND "Socket" = 'bga2μpga2' |
What is the listed crowd at junction oval? | CREATE TABLE table_33151 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Crowd" FROM table_33151 WHERE "Venue" = 'junction oval' |
What team was the opponent when there was a score of 5 4 (11)? | CREATE TABLE table_name_38 (opponent VARCHAR,score VARCHAR) | SELECT opponent FROM table_name_38 WHERE score = "5–4 (11)" |
On what date did the Suns have high points with a record of 33 13? | CREATE TABLE table_name_8 (date VARCHAR,high_points VARCHAR,record VARCHAR) | SELECT date FROM table_name_8 WHERE high_points = "suns" AND record = "33–13" |
how many films were there in 1990 ? | CREATE TABLE table_203_98 (id number,"title" text,"year" number,"director" text,"budget" text,"gross (worldwide)" text,"notes" text) | SELECT COUNT("title") FROM table_203_98 WHERE "year" = 1990 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.