instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Name the start date with party of pd | CREATE TABLE table_name_28 (start_date VARCHAR,party VARCHAR) | SELECT start_date FROM table_name_28 WHERE party = "pd" |
What is the location and attendance of game 1? | CREATE TABLE table_name_95 (location_attendance VARCHAR,game VARCHAR) | SELECT location_attendance FROM table_name_95 WHERE game = 1 |
Core requires what classes ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id |
how many bronze medals did russia earn ? | CREATE TABLE table_204_107 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "bronze" FROM table_204_107 WHERE "nation" = 'russia' |
Find the total balance across checking accounts. | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT SUM(balance) FROM checking |
Name the date for l 89 92 (ot) | CREATE TABLE table_25856 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "Date" FROM table_25856 WHERE "Score" = 'L 89–92 (OT)' |
What is the average money for a to par of 15, and is from the United States? | CREATE TABLE table_58766 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" real) | SELECT AVG("Money ( $ )") FROM table_58766 WHERE "To par" = '15' AND "Country" = 'united states' |
count the number of patients who are admitted to hospital until 2101. | 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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid numb... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) <= '2101' |
Name the least matches for not out being 44 | CREATE TABLE table_21486890_1 (matches INTEGER,not_out VARCHAR) | SELECT MIN(matches) FROM table_21486890_1 WHERE not_out = 44 |
What's the total amount of Bulgaria that has more than 13 bronze? | CREATE TABLE table_name_2 (total INTEGER,nation VARCHAR,bronze VARCHAR) | SELECT SUM(total) FROM table_name_2 WHERE nation = "bulgaria" AND bronze > 13 |
count the number of patients whose admission type is elective and primary disease is morbid obesity/sda. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "MORBID OBESITY/SDA" |
What is the team's record when vancouver was at home? | CREATE TABLE table_name_8 (record VARCHAR,home VARCHAR) | SELECT record FROM table_name_8 WHERE home = "vancouver" |
tell me the last specimen test given to patient 51177 in 10/2105? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-10' ORDER BY microbiologyevents.charttime DESC LIMIT 1 |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY dec... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
Which Surface has a Partner of jim thomas, and a Date of 2007? | CREATE TABLE table_39647 ("Outcome" text,"Date" real,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Surface" FROM table_39647 WHERE "Partner" = 'jim thomas' AND "Date" = '2007' |
how many times is the money list rank 221 and cuts more than 2? | CREATE TABLE table_name_97 (tournaments_played VARCHAR,money_list_rank VARCHAR,cuts_made VARCHAR) | SELECT COUNT(tournaments_played) FROM table_name_97 WHERE money_list_rank = "221" AND cuts_made > 2 |
which country has won more gold medals : china or mexico ? | CREATE TABLE table_204_75 (id number,"year" number,"place" text,"gold" text,"silver" text,"bronze" text) | SELECT "gold" FROM table_204_75 WHERE "gold" IN ('chn', 'mex') GROUP BY "gold" ORDER BY COUNT(*) DESC LIMIT 1 |
Show the number of documents in each day for all documents on project with details 'Graph Database project' and bin document date by weekday and group by document name with a stacked bar chart, and order y-axis from low to high order please. | CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR... | SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' GROUP BY Document_Name ORDER BY COUNT(Document_Date) |
When melbourne played as the home team, who did they play? | CREATE TABLE table_51260 ("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_51260 WHERE "Home team" = 'melbourne' |
What was the date of week 8? | CREATE TABLE table_name_27 (date VARCHAR,week VARCHAR) | SELECT date FROM table_name_27 WHERE week = 8 |
What is the year of the ceremony with a not nominated result and ni iji sin as the original title? | CREATE TABLE table_42598 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director(s)" text,"Result" text) | SELECT "Year (Ceremony)" FROM table_42598 WHERE "Result" = 'not nominated' AND "Original title" = 'ničiji sin' |
Name the total number of game sites for chicago bears | CREATE TABLE table_1153 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real) | SELECT COUNT("Game Site") FROM table_1153 WHERE "Opponent" = 'Chicago Bears' |
Create a bar chart showing how many class across class, and list from high to low by the x-axis please. | CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real)CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text) | SELECT Class, COUNT(Class) FROM race GROUP BY Class ORDER BY Class DESC |
What is the content of la7 television service? | CREATE TABLE table_20366 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"Package/Option" text) | SELECT "Content" FROM table_20366 WHERE "Television service" = 'LA7' |
i would like a flight from CINCINNATI to BURBANK on AA | CREATE TABLE month (month_number int,month_name text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type t... | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCI... |
Show the name of storms which don't have affected region in record. | CREATE TABLE affected_region (name VARCHAR,storm_id VARCHAR)CREATE TABLE storm (name VARCHAR,storm_id VARCHAR) | SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region) |
What pick was play Jason Webb? | CREATE TABLE table_name_31 (pick INTEGER,player VARCHAR) | SELECT MAX(pick) FROM table_name_31 WHERE player = "jason webb" |
list all flights on CO leaving DENVER on sunday after 2134 | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CRE... | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 2134 AND flight.flight_days = days.days_code) AND city.city_code = airport_service... |
How many patients are admitted in transfer within this facility and use the lab item id 51427? | 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 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.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "51427" |
Name the least lost with points more than 6 and games less than 5 | CREATE TABLE table_37134 ("Games" real,"Drawn" real,"Lost" real,"Goal difference" text,"Points" real) | SELECT MIN("Lost") FROM table_37134 WHERE "Points" > '6' AND "Games" < '5' |
Visualize a bar chart for simply show the department of the employee and the corresponding salary. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 departments (DEPARTMENT_ID decimal(... | SELECT DEPARTMENT_NAME, SALARY FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID |
Who reported the game played on 1 september? | CREATE TABLE table_78781 ("Date" text,"Venue" text,"Score" text,"Competition" text,"Report" text) | SELECT "Report" FROM table_78781 WHERE "Date" = '1 september' |
Who is the away team when the home team scored 14.14 (98)? | CREATE TABLE table_56653 ("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_56653 WHERE "Home team score" = '14.14 (98)' |
On which date were the 2003 Toronto Blue Jays 54-55? | CREATE TABLE table_14469 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_14469 WHERE "Record" = '54-55' |
Who won Women's doubles when Raina Tzvetkova won women's singles before 2000? | CREATE TABLE table_36705 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's doubles" FROM table_36705 WHERE "Year" < '2000' AND "Women's singles" = 'raina tzvetkova' |
Who were the producers in 1961? | CREATE TABLE table_name_60 (producer VARCHAR,year VARCHAR) | SELECT producer FROM table_name_60 WHERE year = 1961 |
What is the national change where crude birth rate is less than 11.4, crude death rate is more than 12.1 and deaths are 4 376? | CREATE TABLE table_name_96 (natural_change VARCHAR,deaths VARCHAR,crude_birth_rate__per_1000_ VARCHAR,crude_death_rate__per_1000_ VARCHAR) | SELECT natural_change FROM table_name_96 WHERE crude_birth_rate__per_1000_ < 11.4 AND crude_death_rate__per_1000_ > 12.1 AND deaths = "4 376" |
What school is in Brechin? | CREATE TABLE table_24466 ("School" text,"Location" text,"Catchment" text,"Roll" real,"Gender" text,"External link" text) | SELECT "External link" FROM table_24466 WHERE "Location" = 'Brechin' |
What was the scoring rank for Angela Stanford in 2009? | CREATE TABLE table_19595 ("Year" real,"Tournaments played" real,"Cuts made*" real,"Wins" real,"2nd" real,"3rd" real,"Top 10s" real,"Best finish" text,"Earnings ($)" real,"Money list rank" real,"Scoring average" text,"Scoring rank" text) | SELECT "Scoring rank" FROM table_19595 WHERE "Year" = '2009' |
What year was ike skelton first elected? | CREATE TABLE table_1341604_26 (first_elected INTEGER,incumbent VARCHAR) | SELECT MIN(first_elected) FROM table_1341604_26 WHERE incumbent = "Ike Skelton" |
until 2104 how many patients have undergone infectious disease consultation within the same month after mechanical ventilation? | 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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.un... |
What 20-29 was in season 2008? | CREATE TABLE table_41470 ("Season" text,"PAT Pct." text,"20-29" text,"30-39" text,"40-49" text,"FG-FGA" text,"FG Pct." text,"Long" real,"Points" real) | SELECT "20-29" FROM table_41470 WHERE "Season" = '2008' |
until 1 year ago what were the five most commonly prescribed drugs for patients who had previously received oth perc proc bil trct within 2 months? | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE diagnoses_icd ... | SELECT t3.drug FROM (SELECT t2.drug, 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 FROM d_icd_procedures ... |
tell me the monthly minimum amount of po in patient 027-22704's body until 37 months ago? | 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 treatment (treatmentid number,patientunitstayid ... | SELECT MIN(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 = '027-22704')) AND intakeoutput.celllabel = 'po' A... |
Of all the French Phonetics courses , show me those worth 12 credits . | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%French Phonetics%' OR name LIKE '%French Phonetics%') AND credits = 12 |
when was patient 030-16826 prescribed a medication until 06/2105 for the first time via the per ng tube route? | 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 microlab (microlabid number,patientunitstayid number,... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-16826')) AND medication.routeadmin = 'per ng tube' AND STR... |
authors of ACL 2014 papers | CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int... | SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid |
What is the error that has a size (steps) more than 5 and a just (cents) value 536.95 | CREATE TABLE table_name_65 (error VARCHAR,size__steps_ VARCHAR,just__cents_ VARCHAR) | SELECT error FROM table_name_65 WHERE size__steps_ > 5 AND just__cents_ = 536.95 |
What is the Season with a Big Ten that is 2nd (386)? | CREATE TABLE table_name_6 (season VARCHAR,big_ten VARCHAR) | SELECT season FROM table_name_6 WHERE big_ten = "2nd (386)" |
What is Score, when Game is less than 61, when February is less than 11, and when Opponent is '@ Buffalo Sabres'? | CREATE TABLE table_8176 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text) | SELECT "Score" FROM table_8176 WHERE "Game" < '61' AND "February" < '11' AND "Opponent" = '@ buffalo sabres' |
what date is patient 83038's birthday? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime ... | SELECT patients.dob FROM patients WHERE patients.subject_id = 83038 |
Team Estudantes Paulista with a position less than 4 has what average against? | CREATE TABLE table_42173 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT AVG("Against") FROM table_42173 WHERE "Team" = 'estudantes paulista' AND "Position" < '4' |
Which label has a year older than 2004 and a 2xcd detail as well as the sonic seducer cold hands seduction vol. 69 title? | CREATE TABLE table_name_88 (label VARCHAR,title VARCHAR,year VARCHAR,details VARCHAR) | SELECT label FROM table_name_88 WHERE year > 2004 AND details = "2xcd" AND title = "sonic seducer cold hands seduction vol. 69" |
Name the upper index kcal/nm3 for 62.47 | CREATE TABLE table_1868929_1 (upper_index_kcal__nm_3 VARCHAR,lower_index_mj__nm_3 VARCHAR) | SELECT upper_index_kcal__nm_3 FROM table_1868929_1 WHERE lower_index_mj__nm_3 = "62.47" |
what is the game when the opponent is @ chicago stags? | CREATE TABLE table_8875 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT SUM("Game") FROM table_8875 WHERE "Opponent" = '@ chicago stags' |
Show all game ids and the number of hours played. | CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE video_games (gameid number,gname text,gtype 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 gameid, SUM(hours_played) FROM plays_games GROUP BY gameid |
what is the name of the battleship with the battle listed on May 13, 1915? | CREATE TABLE table_79838 ("Estimate" real,"Name" text,"Nat." text,"Ship Type" text,"Principal victims" text,"Date" text) | SELECT "Name" FROM table_79838 WHERE "Ship Type" = 'battleship' AND "Date" = 'may 13, 1915' |
i would like a nonstop flight from PHILADELPHIA to PITTSBURGH | CREATE TABLE time_interval (period text,begin_time int,end_time 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 ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
How many teams does Lee Sorochan play for? | CREATE TABLE table_2781227_2 (college_junior_club_team VARCHAR,player VARCHAR) | SELECT COUNT(college_junior_club_team) FROM table_2781227_2 WHERE player = "Lee Sorochan" |
What is the Label of the Original CD release? | CREATE TABLE table_8208 ("Region" text,"Date" text,"Label" text,"Format" text,"Version" text) | SELECT "Label" FROM table_8208 WHERE "Format" = 'cd' AND "Version" = 'original' |
What is the fewest number of silver medals received by a nation who received 40 bronze medals and more than 42 gold medals? | CREATE TABLE table_71625 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Silver") FROM table_71625 WHERE "Bronze" = '40' AND "Gold" > '42' |
Who was the home team at Kardinia Park? | CREATE TABLE table_56048 ("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_56048 WHERE "Venue" = 'kardinia park' |
Draw a scatter chart about the correlation between student_id and address_id , and group by attribute other_details. | CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Student_Addresses (student_id INTEGER,address_id INTEGER,date_address_from DATETIME,date_address_to DATETIME,monthly_rental DECIMAL(19,4),other_details VARCHAR(255))CREATE TABLE Addresses (address_id INTEGER,lin... | SELECT student_id, address_id FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter, rank total number from low to high order. | 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 Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Revenue) |
What is the median income for the region where 24.4% pf people make below 60% of the median income? | CREATE TABLE table_3207 ("Region" text,"Median income (Intl.$)" real,"Below 40% of median income" text,"Below 50% of median income" text,"Below 60% of median income" text) | SELECT MIN("Median income ( Intl.$ )") FROM table_3207 WHERE "Below 60% of median income" = '24.4%' |
What is the Final Four with a win percentage of .750? | CREATE TABLE table_32439 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" text,"Sweet Sixteen" text,"Elite Eight" text,"Final Four" text,"Championship Game" text) | SELECT "Final Four" FROM table_32439 WHERE "Win %" = '.750' |
Max reputation users of the same age as me. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,T... | SELECT DisplayName AS Name, Id AS "user_id", Reputation FROM Users WHERE Age = (SELECT Age FROM Users WHERE Id = @UserID) ORDER BY Reputation DESC |
Who was the finalist in Miami? | CREATE TABLE table_76172 ("Tournament" text,"Surface" text,"Week" text,"Winner" text,"Finalist" text,"Semifinalists" text) | SELECT "Finalist" FROM table_76172 WHERE "Tournament" = 'miami' |
What is Tournament, when 2000 is 'A'? | CREATE TABLE table_name_60 (tournament VARCHAR) | SELECT tournament FROM table_name_60 WHERE 2000 = "a" |
Who has 1 win, 1 loss, and has played 2 matches? | CREATE TABLE table_name_77 (name VARCHAR,matches VARCHAR,wins VARCHAR,losses VARCHAR) | SELECT name FROM table_name_77 WHERE wins = "1" AND losses = "1" AND matches = "2" |
What word in Hindi has the same meaning as the Lomavren word saj? | CREATE TABLE table_15130 ("Hindi" text,"Romani" text,"Domari" text,"Lomavren" text,"Persian" text) | SELECT "Hindi" FROM table_15130 WHERE "Lomavren" = 'saj' |
select all users from Sri Lanaka order by reputation. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask... | SELECT * FROM Users ORDER BY Reputation DESC |
After 1989, what was the score of the Grand Prix Passing Shot where the Runners-up were Jeff Tarango? | CREATE TABLE table_41816 ("Year" real,"Tournament Name" text,"Champions" text,"Runners-up" text,"Score" text) | SELECT "Score" FROM table_41816 WHERE "Year" > '1989' AND "Tournament Name" = 'grand prix passing shot' AND "Runners-up" = 'jeff tarango' |
What is the total number of Week(s), when Attendance is 61,603? | CREATE TABLE table_name_23 (week VARCHAR,attendance VARCHAR) | SELECT COUNT(week) FROM table_name_23 WHERE attendance = "61,603" |
On what date did the episode 'Petra-Gate' air? | CREATE TABLE table_10622 ("Episode #" real,"Title" text,"Airdate" text,"Rating (Millions)" text,"Rank" text) | SELECT "Airdate" FROM table_10622 WHERE "Title" = 'petra-gate' |
provide the number of patients whose primary disease is bladder cancer/sda and admission year is less than 2138? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND demographic.admityear < "2138" |
show me the fares from WASHINGTON to OAKLAND | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flig... | SELECT DISTINCT fare.fare_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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... |
what were the top three most common diagnosis until 2104? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)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 labevents (row_id number,subject_id number,hadm_id number,itemid ... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE ... |
What station has average ratings of 14.7%? | CREATE TABLE table_66109 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Episodes" real,"Average Ratings" text) | SELECT "TV Station" FROM table_66109 WHERE "Average Ratings" = '14.7%' |
Who won the Senior British Open when Hale Irwin (3/7) won the Senior PGA Championship? | CREATE TABLE table_name_57 (senior_british_open VARCHAR,senior_pga_championship VARCHAR) | SELECT senior_british_open FROM table_name_57 WHERE senior_pga_championship = "hale irwin (3/7)" |
how many patients whose death status is 1 and drug code is clin300l? | 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 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 WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "CLIN300L" |
triglycerides > 450 mg / dl | CREATE TABLE table_train_189 ("id" int,"alt" float,"hyperglycemia" bool,"liver_disease" bool,"smoking" bool,"alcohol_abuse" bool,"drug_abuse" bool,"triglyceride_tg" float,"NOUSE" float) | SELECT * FROM table_train_189 WHERE triglyceride_tg > 450 |
What's the score when Orient was home? | CREATE TABLE table_63327 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_63327 WHERE "Home team" = 'orient' |
How many books fall into each category, and rank y-axis in desc order. | 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 movie (movie_id int,Title text,Year int,Director text,Budget_million real,Gross_worldwide int)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) DESC |
Which Builder has a Pennant number of Q149? | CREATE TABLE table_name_63 (builder VARCHAR,pennant_number VARCHAR) | SELECT builder FROM table_name_63 WHERE pennant_number = "q149" |
For the Winter , what type of Other classes are available ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
what is the gdp ( bn ) where capital is capital? | CREATE TABLE table_72274 ("No." text,"Region" text,"Capital" text,"Area (km\u00b2)" text,"Area (sq. mi.)" text,"Population" text,"GDP (bn)" text) | SELECT "GDP ( bn )" FROM table_72274 WHERE "Capital" = 'Capital' |
let me know the number of patients less than 76 years who had hyaline casts lab test. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "76" AND lab.label = "Hyaline Casts" |
On what date was the venue at Brisbane Cricket Ground? | CREATE TABLE table_70554 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Date" FROM table_70554 WHERE "Venue" = 'brisbane cricket ground' |
what is the top five diagnosis that have the highest one year mortality rate? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... |
how many players tied for 4th place ? | CREATE TABLE table_203_507 (id number,"#" text,"player" text,"\u03c3 points" number,"qual." number,"final" number) | SELECT COUNT("player") FROM table_203_507 WHERE "#" = 4 |
give me the number of patients whose insurance is government and procedure long title is other percutaneous procedures on biliary tract? | 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.insurance = "Government" AND procedures.long_title = "Other percutaneous procedures on biliary tract" |
Name the date for score w 109 95 (ot) | CREATE TABLE table_23285761_8 (date VARCHAR,score VARCHAR) | SELECT date FROM table_23285761_8 WHERE score = "W 109–95 (OT)" |
In the race involving Billy Lee Evans as the seated Representative, was he elected again? | CREATE TABLE table_18314 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Result" FROM table_18314 WHERE "Incumbent" = 'Billy Lee Evans' |
Who is the bachelorette of the season that premiered on May 24, 2010? | CREATE TABLE table_name_37 (bachelorette VARCHAR,premiered VARCHAR) | SELECT bachelorette FROM table_name_37 WHERE premiered = "may 24, 2010" |
how many patients received packed cell transfusion during the same month since 5 years ago after having been diagnosed with renal & ureteral dis nos. | 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 chartevents (row_id number,subject_id number,hadm_id number,ic... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'renal & ureteral d... |
Who constructed Joe James car when his rank was more than 10? | CREATE TABLE table_name_12 (constructor VARCHAR,rank VARCHAR,driver VARCHAR) | SELECT constructor FROM table_name_12 WHERE rank > 10 AND driver = "joe james" |
explain restriction AP/57 | CREATE TABLE flight_fare (flight_id int,fare_id int)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 time_interval (period text,begin_time int,end_time i... | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' |
What is the highest earnings for Tom watson who had a ranking larger than 2? | CREATE TABLE table_36910 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Wins" real) | SELECT MAX("Earnings ( $ )") FROM table_36910 WHERE "Player" = 'tom watson' AND "Rank" > '2' |
What is the average rank for Hungary? | CREATE TABLE table_name_82 (rank INTEGER,country VARCHAR) | SELECT AVG(rank) FROM table_name_82 WHERE country = "hungary" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.