instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
List the number of vacators when successors were formally installed on June 22, 1868. | CREATE TABLE table_26650 ("State (class)" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date of successors formal installation" text) | SELECT COUNT("Vacator") FROM table_26650 WHERE "Date of successors formal installation" = 'June 22, 1868' |
What is the City, when the Prize is $1,859,000? | CREATE TABLE table_name_17 (city VARCHAR,prize VARCHAR) | SELECT city FROM table_name_17 WHERE prize = "$1,859,000" |
What is the opposing team with 11 against? | CREATE TABLE table_61682 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Opposing Teams" FROM table_61682 WHERE "Against" = '11' |
How many courses do the student whose id is 171 attend? | CREATE TABLE candidates (candidate_id number,candidate_details text)CREATE TABLE student_course_registrations (student_id number,course_id number,registration_date time)CREATE TABLE people_addresses (person_address_id number,person_id number,address_id number,date_from time,date_to time)CREATE TABLE courses (course_id ... | SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171 |
Name the goals with matches of 21 | CREATE TABLE table_67941 ("Country" text,"Player name" text,"Period" text,"Position" text,"Matches" text,"Goals" text) | SELECT "Goals" FROM table_67941 WHERE "Matches" = '21' |
Find the student ID and personal name of the student with at least two enrollments, order x axis in ascending order. | CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id... | SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T2.personal_name |
Which rank had the Labour party winning in 2003, a swing to gain that was larger than 2.13, a lab hold as a result, and which took place in the Linlithgow constituency? | CREATE TABLE table_53450 ("Rank" real,"Constituency" text,"Winning party 2003" text,"Swing to gain" real,"SNP's place 2003" text,"Result" text) | SELECT "Rank" FROM table_53450 WHERE "Winning party 2003" = 'labour' AND "Swing to gain" > '2.13' AND "Result" = 'lab hold' AND "Constituency" = 'linlithgow' |
What was the result in 2008? | CREATE TABLE table_name_99 (result VARCHAR,year VARCHAR) | SELECT result FROM table_name_99 WHERE year = "2008" |
What song was directed by Shankar Jaikishan? | CREATE TABLE table_name_13 (song VARCHAR,music_director_s_ VARCHAR) | SELECT song FROM table_name_13 WHERE music_director_s_ = "shankar jaikishan" |
Which competition was held in Arles, France? | CREATE TABLE table_61157 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text) | SELECT "Competition" FROM table_61157 WHERE "Venue" = 'arles, france' |
wendlinger finished 8th . who finished next ? | CREATE TABLE table_204_788 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT "driver" FROM table_204_788 WHERE "pos" = 8 + 1 |
Show the number of accounts for each customer in a bar chart grouping by customer's first name, and list names in asc order. | CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARCHAR(20),product_size VARCHAR(20))CREATE TABLE Orders (order_id INTEGER,customer_id INTEGER,date_order_placed DATETIME,order_details VARCHAR(255))CREATE... | SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_first_name |
If north melbourne played as the home team, who was the away team they played? | CREATE TABLE table_51262 ("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_51262 WHERE "Home team" = 'north melbourne' |
How many losses did the Golden rivers of hay have? | CREATE TABLE table_60464 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT AVG("Losses") FROM table_60464 WHERE "Golden Rivers" = 'hay' |
Name the location on june 10 | CREATE TABLE table_11965481_13 (location_attendance VARCHAR,date VARCHAR) | SELECT location_attendance FROM table_11965481_13 WHERE date = "June 10" |
What team did the Hornets play in game 4? | CREATE TABLE table_74178 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_74178 WHERE "Game" = '4' |
What is the highest pick of scott turner, who has a round greater than 2? | CREATE TABLE table_name_37 (pick INTEGER,round VARCHAR,name VARCHAR) | SELECT MAX(pick) FROM table_name_37 WHERE round > 2 AND name = "scott turner" |
For the teams that had more than 2 Byes, what was the highest number of Wins? | CREATE TABLE table_name_14 (wins INTEGER,byes INTEGER) | SELECT MAX(wins) FROM table_name_14 WHERE byes > 2 |
give me the CO flights from CHICAGO to SEATTLE on saturday morning | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_... | 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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND... |
what is drug route of drug name indomethacin? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Indomethacin" |
What is Top Par, when Country is Sweden? | CREATE TABLE table_50196 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "To par" FROM table_50196 WHERE "Country" = 'sweden' |
How many episodes directed by david carson? | CREATE TABLE table_25604014_5 (no_in_season VARCHAR,directed_by VARCHAR) | SELECT COUNT(no_in_season) FROM table_25604014_5 WHERE directed_by = "David Carson" |
provide the number of patients whose death status is 1 and primary disease is st elevated myocardial infarction\cardiac cath? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" |
When racing epsom is in division two how many seasons are there? | CREATE TABLE table_26980 ("Season" text,"Premier Division" text,"Division One" text,"Division Two" text,"Division Three" text,"Division Four" text,"Division Five" text) | SELECT COUNT("Season") FROM table_26980 WHERE "Division Two" = 'Racing Epsom' |
What is the highest tonnage of the ship from norway? | CREATE TABLE table_12241 ("Date" text,"Ship" text,"Nationality" text,"Tonnage" real,"Fate" text) | SELECT MAX("Tonnage") FROM table_12241 WHERE "Nationality" = 'norway' |
Do I have any credits so far , if yes how many ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credi... | SELECT DISTINCT total_credit FROM student WHERE student_id = 1 |
What is Bob Gilder in Place T3's To par? | CREATE TABLE table_name_43 (to_par VARCHAR,place VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_43 WHERE place = "t3" AND player = "bob gilder" |
Name the To par for leland gibson | CREATE TABLE table_name_59 (to_par VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_59 WHERE player = "leland gibson" |
Which position does John Starks play? | CREATE TABLE table_11545282_18 (position VARCHAR,player VARCHAR) | SELECT position FROM table_11545282_18 WHERE player = "John Starks" |
what material has a dispersion of .018 nm ? | CREATE TABLE table_203_385 (id number,"material" text,"formula" text,"refractive\nindex(es)\n589.3 nm" text,"dispersion\n431 - 687 nm" number,"hardness\n(mohs'\nscale)" text,"density\n(g/cm3)" text,"thermal\ncond." text,"state of\nthe art" text) | SELECT "material" FROM table_203_385 WHERE "dispersion\n431 - 687 nm" = '0.018' |
Which Tournament has an Opponent of susan sloane? | CREATE TABLE table_name_18 (tournament VARCHAR,opponent VARCHAR) | SELECT tournament FROM table_name_18 WHERE opponent = "susan sloane" |
what are the four most commonly given microbiological tests for patients who had previously received exc/dest hrt lesion open during the same month until 1 year ago? | 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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime ... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
When did the term end that began December 4, 1978? | CREATE TABLE table_224672_2 (term_ended VARCHAR,term_began VARCHAR) | SELECT term_ended FROM table_224672_2 WHERE term_began = "December 4, 1978" |
What is the thai name of the transcription wan chan? | CREATE TABLE table_180802_3 (thai_name VARCHAR,transcription VARCHAR) | SELECT thai_name FROM table_180802_3 WHERE transcription = "wan chan" |
Who replaced the previous manager of Altay? | CREATE TABLE table_29306 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text) | SELECT "Replaced by" FROM table_29306 WHERE "Team" = 'Altay' |
What episode in the series is TV broadcast s03e20? | CREATE TABLE table_15861776_1 (no_in_series VARCHAR,tv_broadcast VARCHAR) | SELECT no_in_series FROM table_15861776_1 WHERE tv_broadcast = "S03E20" |
What was the score and game outcome when High Points was andre miller (17)? | CREATE TABLE table_17323042_11 (score VARCHAR,high_points VARCHAR) | SELECT score FROM table_17323042_11 WHERE high_points = "Andre Miller (17)" |
which nation came in last place ? | CREATE TABLE table_204_383 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_383 ORDER BY "rank" DESC LIMIT 1 |
What are the original air date(s) for 'gunplay'? | CREATE TABLE table_28387 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. Viewers (millions)" text) | SELECT "Original air date" FROM table_28387 WHERE "Title" = 'Gunplay' |
had there been any organism found in the last mrsa screen microbiology test of patient 6374 in the last hospital encounter? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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 outputevents (row_id number,subject_id number,hadm_id number,icus... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6374 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents.... |
how many patients whose discharge location is home and days of hospital stay is greater than 14? | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "14" |
What is the status of the county that has a 14.7% poverty rate? | CREATE TABLE table_22815568_1 (status VARCHAR,poverty_rate VARCHAR) | SELECT status FROM table_22815568_1 WHERE poverty_rate = "14.7%" |
when did patient 016-18575 last come to the hospital since 1 year ago through the direct admit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunits... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-18575' AND patient.hospitaladmitsource = 'direct admit' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
when did armando armani 's term end ? | CREATE TABLE table_200_44 (id number,"name" text,"term start" text,"term end" text) | SELECT "term end" FROM table_200_44 WHERE "name" = 'armando armani' |
What was Dan Selznick best time? | CREATE TABLE table_name_63 (best VARCHAR,name VARCHAR) | SELECT best FROM table_name_63 WHERE name = "dan selznick" |
Which team played against North Melbourne as the home team? | CREATE TABLE table_55191 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_55191 WHERE "Away team" = 'north melbourne' |
What's the total loss for a GP-GS of 8-8 and a gain less than 416? | CREATE TABLE table_name_43 (loss INTEGER,gp_gs VARCHAR,gain VARCHAR) | SELECT SUM(loss) FROM table_name_43 WHERE gp_gs = "8-8" AND gain < 416 |
list the ids of patients who were diagnosed with dvt - related to vascular catheter in this year. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid num... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - related to vascular catheter' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
How many values for Germans occurs when value for Slovaks is 0.11%? | CREATE TABLE table_2374338_2 (germans VARCHAR,slovaks VARCHAR) | SELECT COUNT(germans) FROM table_2374338_2 WHERE slovaks = "0.11%" |
What competition was at pusk s ferenc stadium , budapest , hungary, and a Score of 1 0? | CREATE TABLE table_name_91 (competition VARCHAR,venue VARCHAR,score VARCHAR) | SELECT competition FROM table_name_91 WHERE venue = "puskás ferenc stadium , budapest , hungary" AND score = "1–0" |
What is the highest L of the tournament? | CREATE TABLE table_29542147_2 (l INTEGER) | SELECT MAX(l) FROM table_29542147_2 |
Find the name of songs that does not have a back vocal. | CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE albums (aid number,title text,... | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "back" |
What player has 1 as the place? | CREATE TABLE table_12217 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Player" FROM table_12217 WHERE "Place" = '1' |
What is the total time (s) for the horse Pinot Grigio? | CREATE TABLE table_53380 ("Rider" text,"Horse" text,"Time (s)" text,"Faults" text,"Total time (s)" text,"Points" real) | SELECT "Total time ( s )" FROM table_53380 WHERE "Horse" = 'pinot grigio' |
give me the number of patients whose death status is 0 and procedure short title is int insert lead in vent? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Int insert lead in vent" |
When the champion was Gay Brewer Category:Articles with hCards what was the total score? | CREATE TABLE table_7866 ("Year" real,"Country" text,"Champion" text,"Total score" text,"To Par [a ]" text) | SELECT "Total score" FROM table_7866 WHERE "Champion" = 'gay brewer category:articles with hcards' |
can you show me the cheapest round trip flights between DENVER and PITTSBURGH | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,c... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
how many first elected with incumbent being william c. lantaff | CREATE TABLE table_18501 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("First elected") FROM table_18501 WHERE "Incumbent" = 'William C. Lantaff' |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and department_id , and I want to show in asc by the LAST_NAME. | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN... | SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME |
What is the December game that led to an 11-13-5 record? | CREATE TABLE table_39367 ("Game" real,"December" real,"Opponent" text,"Score" text,"Record" text) | SELECT MAX("December") FROM table_39367 WHERE "Record" = '11-13-5' |
List the publication dates of publications with 3 lowest prices. | CREATE TABLE publication (Publication_Date VARCHAR,Price VARCHAR) | SELECT Publication_Date FROM publication ORDER BY Price LIMIT 3 |
Tell me the total number of Grid for Bob Evans and Laps less than 68 | CREATE TABLE table_name_86 (grid VARCHAR,driver VARCHAR,laps VARCHAR) | SELECT COUNT(grid) FROM table_name_86 WHERE driver = "bob evans" AND laps < 68 |
Show all book categories and the number of books in each category with a bar chart, and I want to sort by the X in asc. | CREATE TABLE culture_company (Company_name text,Type text,Incorporated_in text,Group_Equity_Shareholding real,book_club_id text,movie_id text)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text,Book_Title text,Publisher text,Category text,Result text)CREATE TABLE movie (movie_id int,Title text,Year ... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category |
Show names of technicians and the number of machines they are assigned to repair. | CREATE TABLE technician (Name VARCHAR,technician_ID VARCHAR)CREATE TABLE repair_assignment (technician_ID VARCHAR) | SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name |
name the episode that ha the same average as number 5 . | CREATE TABLE table_204_958 (id number,"episode" number,"original broadcast date" text,"average" number,"rank" number,"remarks" text) | SELECT "episode" FROM table_204_958 WHERE "episode" <> 5 AND "average" = (SELECT "average" FROM table_204_958 WHERE "episode" = 5) |
For those records from the products and each product's manufacturer, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, and sort from high to low by the names. | 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, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
What's the location of the team Peter Stuyvesant International Racing? | CREATE TABLE table_64631 ("Race Title" text,"Circuit" text,"City / State" text,"Date" text,"Winner" text,"Team" text) | SELECT "City / State" FROM table_64631 WHERE "Team" = 'peter stuyvesant international racing' |
What is the Total Finale of ? | CREATE TABLE table_name_64 (finale INTEGER,chinese_title VARCHAR) | SELECT SUM(finale) FROM table_name_64 WHERE chinese_title = "女人唔易做" |
What Gender are the schools that have a Roll of 135? | CREATE TABLE table_71669 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" text) | SELECT "Gender" FROM table_71669 WHERE "Roll" = '135' |
What is the record for december 3? | CREATE TABLE table_31460 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_31460 WHERE "Date" = 'December 3' |
how many patients were admitted before the year 2179 with 99591 as the diagnosis icd9 code? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2179" AND diagnoses.icd9_code = "99591" |
count the number of patients whose admission type is emergency and lab test name is rbc, pleural? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "RBC, Pleural" |
When Matt Ware won the mens singles, who won the mixed restricted? | CREATE TABLE table_28211674_3 (mixed_restricted VARCHAR,mens_singles VARCHAR) | SELECT mixed_restricted FROM table_28211674_3 WHERE mens_singles = "Matt Ware" |
What is the IATA when France was the country, and the ICAO was lfrn? | CREATE TABLE table_name_72 (iata VARCHAR,country VARCHAR,icao VARCHAR) | SELECT iata FROM table_name_72 WHERE country = "france" AND icao = "lfrn" |
Name the distance for stage of 2 | CREATE TABLE table_name_5 (distance VARCHAR,stage VARCHAR) | SELECT distance FROM table_name_5 WHERE stage = "2" |
when patient 002-17348 was first discharged from the hospital in 2100? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '002-17348' AND STRFTIME('%y', patient.hospitaldischargetime) = '2100' ORDER BY patient.hospitaldischargetime LIMIT 1 |
what is the number of patients whose diagnoses long title is osteoarthrosis, unspecified whether generalized or localized, site unspecified? | 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 diagnoses.long_title = "Osteoarthrosis, unspecified whether generalized or localized, site unspecified" |
what is the number of patients who received a antiemetic - serotonin antagonist procedure within 2 months after having received a neurosurgery consultation procedure until 4 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmen... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'neurosurgery consultation' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS ... |
what are the three most common diagnoses of patients in the age of 20s since 3 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 yea... |
I want the total number of people in the crowd for essendon home team | CREATE TABLE table_51845 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_51845 WHERE "Home team" = 'essendon' |
Show different types of ships and the number of ships of each type. Show bar chart. | CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text) | SELECT Type, COUNT(*) FROM ship GROUP BY Type |
What city was the event in when Patrik Antonius won? | CREATE TABLE table_79948 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text) | SELECT "City" FROM table_79948 WHERE "Winner" = 'patrik antonius' |
Give me the comparison about meter_100 over the meter_500 by a bar chart. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)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... | SELECT meter_500, meter_100 FROM swimmer |
if a man 's nationality was from belgium , how many medals total has his country won ? | CREATE TABLE table_203_374 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "total" FROM table_203_374 WHERE "nation" = 'belgium' |
Which platform was Red Dead Redemption for? | CREATE TABLE table_name_50 (platform_s_ VARCHAR,game VARCHAR) | SELECT platform_s_ FROM table_name_50 WHERE game = "red dead redemption" |
when was patient 029-8147 until 2103 last diagnosed with acute respiratory failure - drug related? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-8147')) AND diagnosis.diagnosisname = 'acute respiratory fail... |
For all employees who have the letters D or S in their first name, show me about the change of employee_id over hire_date in a line chart, and list by the x-axis from low to high. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE va... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE |
In the surface of clay who was the opponent in the game resulting in a score of 6 4, 6 4? | CREATE TABLE table_name_23 (opponent_in_the_final VARCHAR,surface VARCHAR,score VARCHAR) | SELECT opponent_in_the_final FROM table_name_23 WHERE surface = "clay" AND score = "6–4, 6–4" |
How many students taking a course who received an A or C? Group by students' last name with a bar chart, and sort in ascending by the x axis please. | CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE ENROLL ... | SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME |
From which country is the player that won in 1998? | CREATE TABLE table_name_78 (country VARCHAR,year_s__won VARCHAR) | SELECT country FROM table_name_78 WHERE year_s__won = "1998" |
What is origin country for a title that charted at 52? | CREATE TABLE table_name_84 (origin VARCHAR,chart_no VARCHAR) | SELECT origin FROM table_name_84 WHERE chart_no = 52 |
what was the last time patient 54825 received a prescription for aspirin ec, in 12/last year? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'aspirin ec' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIM... |
Please show the employee first names and ids of employees who serve at least 10 customers. | CREATE TABLE CUSTOMER (FirstName VARCHAR,SupportRepId VARCHAR)CREATE TABLE EMPLOYEE (EmployeeId VARCHAR) | SELECT T1.FirstName, T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 |
Users with ongoing suspension (fast). | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE CloseRea... | SELECT Id AS "user_link", * FROM Users WHERE DownVotes > 0 AND Reputation = 1 AND Id > 0 |
what is the original air date for the episoe written by vanessa reisen? | CREATE TABLE table_13336122_5 (original_air_date VARCHAR,written_by VARCHAR) | SELECT original_air_date FROM table_13336122_5 WHERE written_by = "Vanessa Reisen" |
How many deaths did the year with 10 hurricanes and exactly 1 major hurricane have? | CREATE TABLE table_2930244_4 (deaths VARCHAR,number_of_hurricanes VARCHAR,number_of_major_hurricanes VARCHAR) | SELECT deaths FROM table_2930244_4 WHERE number_of_hurricanes = 10 AND number_of_major_hurricanes = 1 |
Questions I've answered and closed. Questions that a user has both answered and successfully voted to close. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,... | SELECT DISTINCT Answer.ParentId AS "post_link" FROM Posts AS Answer JOIN Votes AS CloseVote ON CloseVote.PostId = Answer.ParentId WHERE Answer.PostTypeId = 2 AND CloseVote.VoteTypeId = 6 AND CloseVote.UserId = Answer.OwnerUserId |
Irish name of an d n (contae an d in) has what county town? | CREATE TABLE table_37790 ("County" text,"Irish name" text,"County town" text,"Most populous city/town" text,"Province" text,"Region" text) | SELECT "County town" FROM table_37790 WHERE "Irish name" = 'an dún (contae an dúin)' |
Which Torque has a Model of s63 amg ('01)? | CREATE TABLE table_name_91 (torque VARCHAR,model VARCHAR) | SELECT torque FROM table_name_91 WHERE model = "s63 amg ('01)" |
What is the first elected for Jo Bonner? | CREATE TABLE table_name_12 (first_elected INTEGER,incumbent VARCHAR) | SELECT MIN(first_elected) FROM table_name_12 WHERE incumbent = "jo bonner" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.