instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Find the id and name of the staff who has been assigned for the shortest period. | CREATE TABLE staff (staff_id VARCHAR,staff_name VARCHAR)CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR) | SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1 |
Which downhill has 7 overalls? | CREATE TABLE table_68184 ("Season" real,"Overall" text,"Slalom" text,"Giant Slalom" text,"Super G" text,"Downhill" text,"Combined" text) | SELECT "Downhill" FROM table_68184 WHERE "Overall" = '7' |
What's the lowest Position with a Conceded that's larger than 16, Draws of 3, and Losses that's larger than 3? | CREATE TABLE table_39043 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT MIN("Position") FROM table_39043 WHERE "Conceded" > '16' AND "Draws" = '3' AND "Losses" > '3' |
how many patients were diagnosed with chest pain - unlikely cardiac in origin and did not return to the hospital within 2 months during this year? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain - unlikely cardiac in origin' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DA... |
Using a pie chart to show the proportion of each type of bed. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT bedType, COUNT(bedType) FROM Rooms WHERE decor = "traditional" GROUP BY bedType |
who is batting 1st in game 8? | CREATE TABLE table_52981 ("Game" real,"Date" text,"Batting 1st" text,"Batting 2nd" text,"Result" text) | SELECT "Batting 1st" FROM table_52981 WHERE "Game" = '8' |
How many longitudes have a latitude of 9.9n? | CREATE TABLE table_21062 ("Name" text,"Latitude" text,"Longitude" text,"Diameter" text,"Year named" real,"Namesake" text) | SELECT COUNT("Longitude") FROM table_21062 WHERE "Latitude" = '9.9N' |
Draw a scatter chart about the correlation between Team_ID and School_ID , and group by attribute ACC_Road. | 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_ID, School_ID FROM basketball_match GROUP BY ACC_Road |
calculate the number of songs listed between 1994 and 2005 . | CREATE TABLE table_203_491 (id number,"year" number,"title" text,"us hot 100" number,"us modern rock" number,"us mainstream rock" number,"album" text) | SELECT COUNT("title") FROM table_203_491 WHERE "year" >= 1994 AND "year" <= 2005 |
how many hours it has been since patient 016-9636 was first diagnosed with alcohol withdrawal in their current hospital visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '016-9636'... |
what is the name of the medication that was first prescribed to patient 12775 in 12/this year? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label te... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '12' ORD... |
Name the percentage for georgia | CREATE TABLE table_25392 ("Team" text,"SEC Wins" real,"SEC Losses" real,"Percentage" text,"Home Record" text,"Road Record" text,"Overall Record" text) | SELECT "Percentage" FROM table_25392 WHERE "Team" = 'Georgia' |
What is the score from the 21-27 Record? | CREATE TABLE table_35349 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Score" FROM table_35349 WHERE "Record" = '21-27' |
Name the original air date for 9.16 viewers | CREATE TABLE table_21550870_1 (original_air_date VARCHAR,us_viewers__million_ VARCHAR) | SELECT original_air_date FROM table_21550870_1 WHERE us_viewers__million_ = "9.16" |
I want to see trend the number of season over season by Home_team, and order by the X-axis from high to low. | CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team text,Score text,Competition text)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendan... | SELECT Season, COUNT(Season) FROM game GROUP BY Home_team, Season ORDER BY Season DESC |
Which FA Cup has a Total smaller than 1? | CREATE TABLE table_62724 ("Name" text,"Premier League" real,"League Cup" real,"FA Cup" real,"UEFA Cup" real,"Total" real) | SELECT AVG("FA Cup") FROM table_62724 WHERE "Total" < '1' |
What is the minimum sum? | CREATE TABLE table_28068645_8 (total INTEGER) | SELECT MIN(total) FROM table_28068645_8 |
count the number of patients whose year of death is less than or equal to 2111 and lab test fluid is other body fluid? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Other Body Fluid" |
give the number of newborns who were born before the year 2168. | 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.admission_type = "NEWBORN" AND demographic.dob_year < "2168" |
When is the Monsters of Rock show with 12 bands? | CREATE TABLE table_name_74 (date VARCHAR,event VARCHAR,acts VARCHAR) | SELECT date FROM table_name_74 WHERE event = "monsters of rock" AND acts = "12 bands" |
What venue features geelong as the away side? | CREATE TABLE table_name_64 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_64 WHERE away_team = "geelong" |
Who constructed the I Italian Republic Grand Prix? | CREATE TABLE table_1140088_6 (constructor VARCHAR,race_name VARCHAR) | SELECT constructor FROM table_1140088_6 WHERE race_name = "I Italian Republic Grand Prix" |
What is shown for fri 26 aug when mon 22 aug is no time? | CREATE TABLE table_30058355_2 (fri_26_aug VARCHAR,mon_22_aug VARCHAR) | SELECT fri_26_aug FROM table_30058355_2 WHERE mon_22_aug = "—— No Time" |
Show me about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home in a bar chart, and sort by the X in descending. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC |
How tall is the building ranked #13? | CREATE TABLE table_62431 ("Rank" text,"Name" text,"Height ft (m)" text,"Floors" real,"Year" real) | SELECT "Height ft (m)" FROM table_62431 WHERE "Rank" = '13' |
Which Pavilion depth has a Crown angle of 34.0 34.7 ? | CREATE TABLE table_42669 ("Benchmark" text,"Crown height" text,"Pavilion depth" text,"Table diameter" text,"Girdle thickness" text,"Crown angle" text,"Pavilion angle" text,"Brilliance Grade" text) | SELECT "Pavilion depth" FROM table_42669 WHERE "Crown angle" = '34.0–34.7°' |
What is each customer's move in date, and the corresponding customer id and details? | CREATE TABLE Customers (customer_id VARCHAR,customer_details VARCHAR)CREATE TABLE Customer_Events (date_moved_in VARCHAR,customer_id VARCHAR) | SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id |
Which team played them when andray blatche , javale mcgee (20) had the high points? | CREATE TABLE table_27721131_6 (team VARCHAR,high_points VARCHAR) | SELECT team FROM table_27721131_6 WHERE high_points = "Andray Blatche , JaVale McGee (20)" |
What is the Week, when the Finalist is Carlos Moy (5)? | CREATE TABLE table_name_66 (week VARCHAR,finalist VARCHAR) | SELECT week FROM table_name_66 WHERE finalist = "carlos moyá (5)" |
What name was used for nomination for the film with an original title of 'The Black Tulip'? | CREATE TABLE table_17155250_1 (film_title_used_in_nomination VARCHAR,original_title VARCHAR) | SELECT film_title_used_in_nomination FROM table_17155250_1 WHERE original_title = "The Black Tulip" |
round trip flights from MINNEAPOLIS to SAN DIEGO COACH economy fare | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_spe... | 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, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.... |
What is the average muslim that has a druze less than 2,534, a year prior to 2005, and a jewish greater than 100,657? | CREATE TABLE table_35409 ("Year" real,"Jewish" real,"Muslim" real,"Christian" real,"Druze" real,"Total" real) | SELECT AVG("Muslim") FROM table_35409 WHERE "Druze" < '2,534' AND "Year" = '2005' AND "Jewish" > '100,657' |
What was the result of the 4:27 fight? | CREATE TABLE table_name_51 (res VARCHAR,time VARCHAR) | SELECT res FROM table_name_51 WHERE time = "4:27" |
what is the earliest flight from TAMPA to MILWAUKEE tomorrow | CREATE TABLE month (month_number int,month_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,lengt... | 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 = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN... |
What is the score of Australia? | CREATE TABLE table_67164 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_67164 WHERE "Country" = 'australia' |
What's the party elected in the district that first elected in 1990? | CREATE TABLE table_18153 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Results" text,"Candidates" text) | SELECT "Party" FROM table_18153 WHERE "First elected" = '1990' |
When total costs (2005) are $700,116, what is the cost per capita? | CREATE TABLE table_17626 ("Municipality" text,"Population" real,"Police officers" real,"Residents per officer" real,"Total costs (2005)" text,"Cost per capita" text,"Case burden" real,"Crime rate per 1,000 people" real,"Police force" text) | SELECT "Cost per capita" FROM table_17626 WHERE "Total costs (2005)" = '$700,116' |
tell me what are the top three most common intakes during a year before? | 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,do... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY inputevents_cv.it... |
count the number of patients whose year of death is less than or equal to 2155 and diagnoses icd9 code is 4240? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2155.0" AND diagnoses.icd9_code = "4240" |
what's the first elected with incumbent being joe starnes | CREATE TABLE table_1342270_3 (first_elected VARCHAR,incumbent VARCHAR) | SELECT first_elected FROM table_1342270_3 WHERE incumbent = "Joe Starnes" |
Find the number of customers that use email as the contact channel for each weekday Visualize with a bar chart, order from low to high by the Y-axis please. | CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_address_from DATETIME,address_type VARCHAR(15),date_address_to DATETIME)CREATE TABLE Products (product_id INTEGER,product_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),dat... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) |
provide the number of patients whose discharge location is snf and primary disease is upper gi bleed? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "UPPER GI BLEED" |
What are the candidates for noah m. mason? | CREATE TABLE table_18493 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("Candidates") FROM table_18493 WHERE "Incumbent" = 'Noah M. Mason' |
Which Meet has a Club of centro de natacon carabobo? | CREATE TABLE table_name_67 (meet VARCHAR,club VARCHAR) | SELECT meet FROM table_name_67 WHERE club = "centro de natacon carabobo" |
count the number of patients who had undergone a implt/repl carddefib tot procedure two or more times until 2103. | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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,ro... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 WHERE d_icd_procedures.short_title = 'implt/repl carddefib ... |
What was the lowest wins of Larry Nelson, who ranked less than 5? | CREATE TABLE table_42287 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real) | SELECT MIN("Wins") FROM table_42287 WHERE "Player" = 'larry nelson' AND "Rank" < '5' |
Amount of reputation from edits by Community. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe te... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%fremont%' OR UPPER(Location) LIKE '%FREMONT%' OR Location LIKE '%fremont%' AND Reputation >= 1000 ORDER BY Reputation DESC |
A bar chart for finding the number of the 'date became customers' of the customers whose ID is between 10 and 20, and display by the y-axis in descending. | CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),date_became_customer DATETIME,other_customer_details VARCHAR(255))CREATE TABLE Order_Items (order_id INTEGER,product_id INTEGER,order_quantity VARCHAR(15))CREATE TABLE Customer_Contact_Channels (customer_id INTEGER,channel_... | SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC |
How many losses did the Michigan State Spartans have? | CREATE TABLE table_1513 ("Institution" text,"Wins" real,"Loss" real,"Home Wins" real,"Home Losses" real,"Away Wins" real,"Away Losses" real,"Neutral Wins" real,"Neutral Losses" real,"Current Streak" text) | SELECT MAX("Loss") FROM table_1513 WHERE "Institution" = 'Michigan State Spartans' |
When was the date in 1786? | CREATE TABLE table_name_82 (date VARCHAR,year VARCHAR) | SELECT date FROM table_name_82 WHERE year = 1786 |
What was the outcome in 1975? | CREATE TABLE table_21891 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Outcome" FROM table_21891 WHERE "Year" = '1975' |
Name the captain for royal challengers bangalore for 5 | CREATE TABLE table_2746 ("Season" real,"Winner" text,"Captain" text,"Coach" text,"League finish" text,"Mat" real,"W" real,"L" real,"Win %" text,"Runner-up" text) | SELECT "Captain" FROM table_2746 WHERE "Runner-up" = 'Royal Challengers Bangalore' AND "L" = '5' |
What is the average age as of February 1, 2014 for the supercentenarians born in the United States? | CREATE TABLE table_name_23 (age_as_of_1_february_2014 VARCHAR,province_or_country_of_birth VARCHAR) | SELECT age_as_of_1_february_2014 FROM table_name_23 WHERE province_or_country_of_birth = "united states" |
Who directed the episode with a production code of 301? | CREATE TABLE table_18424435_4 (directed_by VARCHAR,production_code VARCHAR) | SELECT directed_by FROM table_18424435_4 WHERE production_code = 301 |
Which college did the player picked number 136 go to? | CREATE TABLE table_62998 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_62998 WHERE "Pick" = '136' |
which bishop served between the years of 1846 and 1866 ? | CREATE TABLE table_203_875 (id number,"#" number,"name" text,"birth and death" text,"office started" text,"office ended" text) | SELECT "name" FROM table_203_875 WHERE "office started" >= 1846 AND "office ended" <= 1866 |
What percent of others did ogm/news count when MARTIN had 9%? | CREATE TABLE table_name_33 (others VARCHAR,martin VARCHAR,source VARCHAR) | SELECT others FROM table_name_33 WHERE martin = "9%" AND source = "ogm/news" |
Which 2005 has a G zel aml s Lost Panther of the muse? | CREATE TABLE table_name_38 (güzelçamlı’s_lost_panther VARCHAR) | SELECT MAX(2005) FROM table_name_38 WHERE güzelçamlı’s_lost_panther = "the muse" |
What is the 2012 that has tournament played as the tournament? | CREATE TABLE table_name_4 (tournament VARCHAR) | SELECT 2012 FROM table_name_4 WHERE tournament = "tournament played" |
When did Shelia Lawrence join the series? | CREATE TABLE table_16787 ("Series #" real,"Episode title" text,"Writer(s)" text,"Director" text,"U.S. viewers (millions)" text,"Original air date" text) | SELECT MIN("Series #") FROM table_16787 WHERE "Writer(s)" = 'Shelia Lawrence' |
Which Silver has a Nation of total, and a Bronze smaller than 18? | CREATE TABLE table_name_1 (silver INTEGER,nation VARCHAR,bronze VARCHAR) | SELECT MAX(silver) FROM table_name_1 WHERE nation = "total" AND bronze < 18 |
Which bowl game has a season greater than 2008, with new orleans, Louisiana as the location? | CREATE TABLE table_name_47 (bowl_game VARCHAR,season VARCHAR,location VARCHAR) | SELECT bowl_game FROM table_name_47 WHERE season > 2008 AND location = "new orleans, louisiana" |
What is the place in 2007 for the song ' work your magic '? | CREATE TABLE table_59852 ("Year" real,"Song" text,"Artist" text,"Place" text,"Points" text,"Composer" text) | SELECT "Place" FROM table_59852 WHERE "Year" = '2007' AND "Song" = ' work your magic ' |
Which Class has a Weight of 203? | CREATE TABLE table_75683 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" real,"Class" text,"Hometown" text,"Games\u2191" real) | SELECT "Class" FROM table_75683 WHERE "Weight" = '203' |
What is the 1991 population for the urban settlement named Ba ki Jarak? | CREATE TABLE table_2562572_2 (population__1991_ VARCHAR,urban_settlement VARCHAR) | SELECT population__1991_ FROM table_2562572_2 WHERE urban_settlement = "Bački Jarak" |
Which Total has a Nation of united states, and a Bronze larger than 3? | CREATE TABLE table_name_4 (total INTEGER,nation VARCHAR,bronze VARCHAR) | SELECT MAX(total) FROM table_name_4 WHERE nation = "united states" AND bronze > 3 |
what is the last wager on the chart ? | CREATE TABLE table_204_212 (id number,"wager" text,"winner" text,"loser" text,"location" text,"date" text,"notes" text) | SELECT "wager" FROM table_204_212 ORDER BY id DESC LIMIT 1 |
Which BR number has an LMS number over 14768? | CREATE TABLE table_name_5 (br_number VARCHAR,lms_number INTEGER) | SELECT br_number FROM table_name_5 WHERE lms_number > 14768 |
how many hours have passed since patient 31482's last stay in careunit tsicu on their current hospital encounter? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 t... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1 |
Where was the game when Collingwood was the home team? | CREATE TABLE table_name_19 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_19 WHERE away_team = "collingwood" |
What is the total number of Gold, when Silver is 2, and when Total is less than 7? | CREATE TABLE table_77024 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Gold") FROM table_77024 WHERE "Silver" = '2' AND "Total" < '7' |
vernon cassel and reginald shaffer was sentenced how many years ? | CREATE TABLE table_204_479 (id number,"defendant" text,"arrested" text,"charge" text,"result" text,"sentence" text) | SELECT "sentence" FROM table_204_479 WHERE "defendant" IN ('vernon cassel', 'reginald shaffer') |
what 's the difference between fare code Q and fare code B | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE fare (fare_id in... | SELECT DISTINCT booking_class, class_description, rank FROM class_of_service WHERE booking_class = 'B' OR booking_class = 'Q' |
What are the largest Cars Entered with a Winning Driver of rodger ward, and a Season smaller than 1959? | CREATE TABLE table_67505 ("Season" real,"Cars Entered" real,"Winning Driver" text,"Second Driver" text,"Third Driver" text,"Race Report" text) | SELECT MAX("Cars Entered") FROM table_67505 WHERE "Winning Driver" = 'rodger ward' AND "Season" < '1959' |
Find Nationality and the average of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and I want to display in ascending by the the average of meter 100. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY AVG(meter_100) |
Which women's doubles has a Year of 1992? | CREATE TABLE table_69810 ("Year" text,"Men's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's doubles" FROM table_69810 WHERE "Year" = '1992' |
what are the four most commonly given microbiological tests for patients who had previously received antibacterials - macrolide in the same hospital encounter? | 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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacte... |
what is the total number of matches played by brazilians for melbourne ? | CREATE TABLE table_203_221 (id number,"name" text,"nationality" text,"matches played" number,"goals scored" number,"notes" text) | SELECT SUM("matches played") FROM table_203_221 WHERE "nationality" = 'brazil' |
Which title has the Translation of vesoul? | CREATE TABLE table_name_28 (title VARCHAR,translation VARCHAR) | SELECT title FROM table_name_28 WHERE translation = "vesoul" |
How many Total medals for the team with a Rank of 8, 1 Bronze and more than 1 Silver? | CREATE TABLE table_35249 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Total") FROM table_35249 WHERE "Bronze" = '1' AND "Rank" = '8' AND "Silver" > '1' |
list the three earliest flights from ATLANTA to PHILADELPHIA on wednesday | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport (airport_code varchar,airport_name... | 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 = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4... |
What is the number of the grid for Johnny Herbert with more than 52 laps? | CREATE TABLE table_name_28 (grid INTEGER,driver VARCHAR,laps VARCHAR) | SELECT SUM(grid) FROM table_name_28 WHERE driver = "johnny herbert" AND laps > 52 |
do you have any flights from PITTSBURGH to BOSTON on wednesday of next week in the morning | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_nam... |
Show me a scatter plot of account id and the total number for . | CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DOUBLE,transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Customers (customer_id INTE... | SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id |
How many millions of people watched the episode with a production code of icec483x? | CREATE TABLE table_2501754_4 (viewing_figures_millions VARCHAR,prod_code VARCHAR) | SELECT viewing_figures_millions FROM table_2501754_4 WHERE prod_code = "ICEC483X" |
Which position does the player from Muscle Shoals, Alabama play? | CREATE TABLE table_name_68 (position VARCHAR,hometown VARCHAR) | SELECT position FROM table_name_68 WHERE hometown = "muscle shoals, alabama" |
What is the 2nd leg that Team 1 is Union Berlin? | CREATE TABLE table_61203 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_61203 WHERE "Team 1" = 'union berlin' |
Which title has a Track of 3? | CREATE TABLE table_56970 ("Track" real,"Title" text,"Translation" text,"Composer" text,"Recorded" text) | SELECT "Title" FROM table_56970 WHERE "Track" = '3' |
Which Season has a Club of real madrid, and a Rank smaller than 6, and less than 121 goals? | CREATE TABLE table_60117 ("Rank" real,"Club" text,"Season" text,"Goals" real,"Apps" real) | SELECT "Season" FROM table_60117 WHERE "Club" = 'real madrid' AND "Rank" < '6' AND "Goals" < '121' |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE countries (COUNTRY_ID varchar(2),... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
yes what flights will be used on 7 7 in the morning from ATLANTA to BOSTON | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight 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 compartment_class (compartment varc... | 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 = 'BOSTON' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da... |
What was the margin of victory for Isao Aoki when he was a runner-up? | CREATE TABLE table_66971 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Margin of victory" FROM table_66971 WHERE "Runner(s)-up" = 'isao aoki' |
What Away team has a Home team score of 18.12 (120)? | CREATE TABLE table_51673 ("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_51673 WHERE "Home team score" = '18.12 (120)' |
What is the highest Total Medals that has 0 Gold Medal and a Ensemble of east 80 indoor percussion? | CREATE TABLE table_name_27 (total_medals INTEGER,gold_medals VARCHAR,ensemble VARCHAR) | SELECT MAX(total_medals) FROM table_name_27 WHERE gold_medals = 0 AND ensemble = "east 80 indoor percussion" |
What is the total sum of the goals at competitions with more than 10 draws? | CREATE TABLE table_name_84 (goals_for INTEGER,drawn INTEGER) | SELECT SUM(goals_for) FROM table_name_84 WHERE drawn > 10 |
What is the year that the Roughriders left the conference? | CREATE TABLE table_name_25 (year_left INTEGER,mascot VARCHAR) | SELECT MAX(year_left) FROM table_name_25 WHERE mascot = "roughriders" |
what was the name of the organism to be found in the last eye test of patient 23760 during the first hospital encounter? | 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 time,cost number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code tex... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23760 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'eye' AND NOT microbiologyeven... |
what was the procedure which during a month before had been given to patient 51200 two times? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 512... |
What Miss Maja Pilipinas has a Binibining Pilipinas-Tourism of not awarded, and a Binibining Pilipinas-Universe of anjanette abayari? | CREATE TABLE table_name_30 (miss_maja_pilipinas VARCHAR,binibining_pilipinas_tourism VARCHAR,binibining_pilipinas_universe VARCHAR) | SELECT miss_maja_pilipinas FROM table_name_30 WHERE binibining_pilipinas_tourism = "not awarded" AND binibining_pilipinas_universe = "anjanette abayari" |
When did Jos Luis S nchez Sol end his term of coaching? | CREATE TABLE table_name_76 (until VARCHAR,name VARCHAR) | SELECT until FROM table_name_76 WHERE name = "josé luis sánchez solá" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.