table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
CREATE TABLE table_31729 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "Estimated distribution (2000)*" real )
Tell me the revised of mccune reischauer of y n (s) ry n (n)
SELECT "Revised" FROM table_31729 WHERE "McCune-Reischauer" = 'yŏn (s) ryŏn (n)'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what was the top four most frequent diagnosis in a year before?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
CREATE TABLE table_291768_1 ( launched VARCHAR, commissioned VARCHAR )
when was the first start date that actually began on august 6, 1969
SELECT launched FROM table_291768_1 WHERE commissioned = "August 6, 1969"
CREATE TABLE table_7922 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text )
What are the gregorian months for the season in Tamil?
SELECT "Gregorian Months" FROM table_7922 WHERE "Season in Tamil" = 'குளிர்'
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, ...
Specify the number of elective admissions before the year 2148
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2148"
CREATE TABLE table_13564702_4 ( tries_against VARCHAR, tries_for VARCHAR )
How many tries against got the club with 62 tries for?
SELECT tries_against FROM table_13564702_4 WHERE tries_for = "62"
CREATE TABLE table_11545282_7 ( no VARCHAR, years_for_jazz VARCHAR )
How many players only played for the Jazz in only 2010?
SELECT COUNT(no) FROM table_11545282_7 WHERE years_for_jazz = "2010"
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 ) C...
count the number of patients whose procedure icd9 code is 3799 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3799" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_co...
what are the four most frequent drugs that were prescribed in the same hospital encounter to patients aged 60 or above after they had been diagnosed with ac posthemorrhag anemia, until 2104?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_...
CREATE TABLE table_1341522_38 ( opponent VARCHAR, district VARCHAR )
who is the the opponent with district being ohio12
SELECT opponent FROM table_1341522_38 WHERE district = "Ohio12"
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE...
How many flights in each destination city? Return a bar chart, and list in descending by the y axis please.
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination) DESC
CREATE TABLE table_58531 ( "Pick" real, "Round" real, "Player" text, "Position" text, "School" text )
What player is picked 302 in round 11?
SELECT "Player" FROM table_58531 WHERE "Round" = '11' AND "Pick" = '302'
CREATE TABLE table_204_155 ( id number, "rank" number, "heat" number, "athlete" text, "nationality" text, "time" number, "notes" text )
which athlete from poland had the lowest time ?
SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'poland' ORDER BY "time" LIMIT 1
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
among patients of age 50s during the previous year, what were the top four most frequent lab tests?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')...
CREATE TABLE table_name_41 ( compression_ratio VARCHAR, engine VARCHAR )
What is the compression ratio for the 302-2v Windsor v8 engine?
SELECT compression_ratio FROM table_name_41 WHERE engine = "302-2v windsor v8"
CREATE TABLE table_5055 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
On what date was Portland on the road for Game 2?
SELECT "Date" FROM table_5055 WHERE "Road Team" = 'portland' AND "Game" = 'game 2'
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
What is on the list of the Spring MKT upper-level classes ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring'...
CREATE TABLE table_18004 ( "Year" real, "Dates" text, "Champion" text, "Score" real, "To par" text, "Margin of victory" text, "Purse ( $ )" real, "Winners share ($)" real )
What year is Jiyai Shin the champion?
SELECT COUNT("Year") FROM table_18004 WHERE "Champion" = 'Jiyai Shin'
CREATE TABLE table_53593 ( "Date" text, "Tournament" text, "Round" text, "Ground" text, "Opponent" text, "Score 1" text )
Which opponent had round 1?
SELECT "Opponent" FROM table_53593 WHERE "Round" = '1'
CREATE TABLE table_77725 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text )
What were the winnings for the Chevrolet with a number larger than 29 and scored 102 points?
SELECT "Winnings" FROM table_77725 WHERE "Make" = 'chevrolet' AND "Car #" > '29' AND "Points" = '102'
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 ) C...
what is the icu stay id and drug code of subject id 65652?
SELECT prescriptions.icustay_id, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "65652"
CREATE TABLE table_11629 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Career Win\u2013Loss" text )
What was the 2010 result for a 2008 result of LQ and 2011 result of 2R?
SELECT "2010" FROM table_11629 WHERE "2008" = 'lq' AND "2011" = '2r'
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, ...
how many people have had microbiological tests in their urine, voided specimen in 2105?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y', microlab.culturetakentime) = '2105')
CREATE TABLE song ( song_name VARCHAR, f_id VARCHAR ) CREATE TABLE files ( f_id VARCHAR, duration VARCHAR )
List the names of all songs that have 4 minute duration or are in English.
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) ...
show me the flights from SAN FRANCISCO to NEWARK that leave after 2300
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.departure_time > 2300 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
CREATE TABLE table_37171 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What club has tries for in the category tries for?
SELECT "Club" FROM table_37171 WHERE "Tries for" = 'tries for'
CREATE TABLE table_30328 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
Who was the womens double winner when the womens singles winner was Ding Ning?
SELECT "Womens Doubles" FROM table_30328 WHERE "Womens Singles" = 'Ding Ning'
CREATE TABLE table_11570261_6 ( cuts_made VARCHAR )
How many times did Tiger get second in the year where there were 11 cuts?
SELECT MAX(2 AS nd) FROM table_11570261_6 WHERE cuts_made = "11"
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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...
Return a bar chart about the distribution of meter_600 and meter_100 , and could you order by the x-axis from high to low please?
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC
CREATE TABLE table_name_40 ( lost VARCHAR, try_bonus VARCHAR, points_against VARCHAR )
What is the lost when the try bonus is 5, and points against is 298?
SELECT lost FROM table_name_40 WHERE try_bonus = "5" AND points_against = "298"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
how many days have passed since patient 19428 had a d 12.5 w intake for the last time on the current intensive care unit visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND icustays.outtime IS NULL) ...
CREATE TABLE table_45758 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
WHAT IS THE TEAM FOR DECEMBER 30?
SELECT "Team" FROM table_45758 WHERE "Date" = 'december 30'
CREATE TABLE table_17593 ( "Season" text, "Serbian League Belgrade" text, "Serbian League East" text, "Serbian League Vojvodina" text, "Serbian League West" text )
What team was promoted in the Serbian League East in the same season when Kolubara was promoted in the Serbian League Belgrade?
SELECT "Serbian League East" FROM table_17593 WHERE "Serbian League Belgrade" = 'Kolubara'
CREATE TABLE table_2102714_1 ( archive VARCHAR, run_time VARCHAR )
What is he archive for the episode with a run time of 24:05?
SELECT archive FROM table_2102714_1 WHERE run_time = "24:05"
CREATE TABLE table_66228 ( "!Event" real, "Round" text, "Surface" text, "Winner" text, "Opponent" text, "Result" text )
How many events did clay win?
SELECT COUNT("!Event") FROM table_66228 WHERE "Winner" = 'clay'
CREATE TABLE table_17456 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How many teams did Bob Peppler play for?
SELECT COUNT("NHL team") FROM table_17456 WHERE "Player" = 'Bob Peppler'
CREATE TABLE table_22076 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real )
HOw many points where there when the number of goals scored was 47?
SELECT MAX("Points") FROM table_22076 WHERE "Goals scored" = '47'
CREATE TABLE table_40581 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text )
What is the Writer with a Date that is january 1975?
SELECT "Writer" FROM table_40581 WHERE "Date" = 'january 1975'
CREATE TABLE table_47310 ( "Year" text, "Indians admitted" real, "Pakistanis admitted" real, "Sri Lankans admitted" real, "Bangladeshis admitted" real, "Nepalis admitted" real )
What was the most Nepalis admitted when the number of Sri Lankans was more than 5,520, Bangladeshis was more than 2,715, and Pakistanis more than 139,574?
SELECT MAX("Nepalis admitted") FROM table_47310 WHERE "Sri Lankans admitted" > '5,520' AND "Bangladeshis admitted" > '2,715' AND "Pakistanis admitted" > '139,574'
CREATE TABLE table_16136 ( "Sepal length" text, "Sepal width" text, "Petal length" text, "Petal width" text, "Species" text )
Name the number of species with sepal width of 3.4 and sepal length of 5.4
SELECT COUNT("Species") FROM table_16136 WHERE "Sepal width" = '3.4' AND "Sepal length" = '5.4'
CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER, skill_id INTEGER ) CRE...
List the number of enginners and group by last name in a bar chart, and order bar in descending order.
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY last_name DESC
CREATE TABLE Allergy_type ( allergytype VARCHAR )
How many different allergy types exist?
SELECT COUNT(DISTINCT allergytype) FROM Allergy_type
CREATE TABLE table_name_6 ( attendance INTEGER, away VARCHAR )
What was the average attendance when marathon was the away team?
SELECT AVG(attendance) FROM table_name_6 WHERE away = "marathon"
CREATE TABLE table_53800 ( "Conference" text, "Division" text, "Appearances" real, "Wins" real, "Losses" real )
How many losses did the division who appeared less than 16 times have?
SELECT "Losses" FROM table_53800 WHERE "Appearances" < '16'
CREATE TABLE table_1658 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the location and the crowd attendance on December 9?
SELECT "Location Attendance" FROM table_1658 WHERE "Date" = 'December 9'
CREATE TABLE table_name_46 ( title VARCHAR, artist VARCHAR, cat__number VARCHAR )
What is the title of the record with an artist of Tangorodrim, category number FSR006?
SELECT title FROM table_name_46 WHERE artist = "tangorodrim" AND cat__number = "fsr006"
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
Bar chart x axis nationality y axis the total number, rank in desc by the x axis.
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC
CREATE TABLE table_name_40 ( result VARCHAR, record VARCHAR, game VARCHAR, streak VARCHAR )
Which Result has a Game smaller than 37, and a Streak of lost 1, and a Record of 4-9?
SELECT result FROM table_name_40 WHERE game < 37 AND streak = "lost 1" AND record = "4-9"
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
when was the first microbiology test of patient 031-23724,?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) ORDER BY microlab.culturetakentime LIMIT 1
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
find users with about me text like.
SELECT Id AS "user_link", Reputation, CreationDate, LastAccessDate FROM Users WHERE AboutMe LIKE '%##text##%'
CREATE TABLE table_19870086_24 ( rank VARCHAR, player VARCHAR )
what is the rank of adam gilchrist
SELECT COUNT(rank) FROM table_19870086_24 WHERE player = "Adam Gilchrist"
CREATE TABLE table_20545 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written By" text, "Originalairdate" text, "TV Broadcast" text )
Which title was No. 4 in season?
SELECT "Title" FROM table_20545 WHERE "No. in season" = '4'
CREATE TABLE table_61653 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
WHAT IS THE 2011 WITH 2007 AT A AND2 008 AT 3R?
SELECT "2011" FROM table_61653 WHERE "2007" = 'a' AND "2008" = '3r'
CREATE TABLE table_11654169_1 ( area_in_1000km²__1930_ VARCHAR, voivodeship_separate_city VARCHAR )
List all areas within 1000 km in the city of Lubelskie?
SELECT area_in_1000km²__1930_ FROM table_11654169_1 WHERE voivodeship_separate_city = "lubelskie"
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and employee_id , and visualize them by a bar chart.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
Closed questions on which you COMMENTED (and whether they were edited after close).
SELECT Id AS "post_link", Score, ViewCount AS "views", OwnerUserId AS "asker", CreationDate AS "asked", ClosedDate AS "closed", LastEditDate AS "edited", CASE WHEN LastEditDate > ClosedDate THEN 'yes' ELSE 'no' END AS "edited_after_close?" FROM Posts WHERE NOT ClosedDate IS NULL AND Id IN (SELECT DISTINCT PostId FROM C...
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS...
Give me a histogram for what is the first name and GPA of every student that has a GPA lower than average?, could you rank by the y-axis from high to low?
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY SUM(STU_GPA) DESC
CREATE TABLE table_203_61 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
the total number of medals won by south africa was how many ?
SELECT "total" FROM table_203_61 WHERE "nation" = 'south africa'
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_Per...
Show me about the correlation between School_ID and ACC_Percent , and group by attribute All_Road in a scatter chart.
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
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 ( Scho...
Visualize a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home, list ACC_Road in ascending order please.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
CREATE TABLE table_name_19 ( silver INTEGER, nation VARCHAR, total VARCHAR, rank VARCHAR )
What is the sum of Silver when the total is less than 6, the rank is 6 and the Bulgaria is the nation?
SELECT SUM(silver) FROM table_name_19 WHERE total < "6" AND rank = "6" AND nation = "bulgaria"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is primary disease and procedure icd9 code of subject id 18077?
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077"
CREATE TABLE table_3563 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
how many seasons did he race in team Carlin?
SELECT COUNT("Podiums") FROM table_3563 WHERE "Team" = 'Carlin'
CREATE TABLE table_53835 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance" text, "Time" text, "Purse" text )
Who is the owner of the Raglan Road winner?
SELECT "Owner" FROM table_53835 WHERE "Winner" = 'raglan road'
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
A bar chart about what are the average ages for male and female students?, and could you rank by the bars in desc?
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC
CREATE TABLE table_name_18 ( code__iata_icao_ VARCHAR, rank VARCHAR )
What is the code for rank 10?
SELECT code__iata_icao_ FROM table_name_18 WHERE rank = 10
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
Images linked rather than displayed.
SELECT p.Id, p.Body FROM Posts AS p WHERE p.Body LIKE '%http://%.jpg%' AND (NOT p.Body LIKE '%]: http://%' AND NOT p.Body LIKE '%<img src=%')
CREATE TABLE table_24208 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Scoreboard" text, "Song" text, "Public Vote %" text, "Result" text )
Name the jason for public vote being 19.20%
SELECT "Jason" FROM table_24208 WHERE "Public Vote %" = '19.20%'
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 ) ...
give me the number of patients whose ethnicity is black/cape verdean and age is less than 89?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "89"
CREATE TABLE table_10757 ( "Year" real, "Location" text, "Champion" text, "Second" text, "Third" text )
In Winterberg, who was 3rd the year that Monique Riekewald was 2nd?
SELECT "Third" FROM table_10757 WHERE "Location" = 'winterberg' AND "Second" = 'monique riekewald'
CREATE TABLE airports ( city VARCHAR )
List the cities which have more than one airport and number of airports.
SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1
CREATE TABLE table_72258 ( "Year" real, "Premier One" text, "Premier Two" text, "Bristol & Somerset" text, "Glos & Wilts" text, "Bristol & N. Som" text, "Somerset" text, "Gloucestershire" text, "Wiltshire" text )
what is the bristol & n. som where the somerset is ashcott and shapwick?
SELECT "Bristol & N. Som" FROM table_72258 WHERE "Somerset" = 'Ashcott and Shapwick'
CREATE TABLE table_19160 ( "Year" real, "1st District" text, "2nd District" text, "3rd District" text, "4th District" text, "5th District" text )
What is the last year that Howard A. Wassum was in the 5th district?
SELECT MAX("Year") FROM table_19160 WHERE "5th District" = 'Howard A. Wassum'
CREATE TABLE table_name_69 ( margin_of_victory VARCHAR, date VARCHAR )
What was the margin of victory on Mar 18, 1979?
SELECT margin_of_victory FROM table_name_69 WHERE date = "mar 18, 1979"
CREATE TABLE HOTELS ( price_range INTEGER, star_rating_code VARCHAR, pets_allowed_yn VARCHAR )
Show the average price range of hotels that have 5 star ratings and allow pets.
SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1
CREATE TABLE table_25561560_3 ( yacht VARCHAR, skipper VARCHAR )
What yacht did Andrew Saies sail on?
SELECT yacht FROM table_25561560_3 WHERE skipper = "Andrew Saies"
CREATE TABLE table_65323 ( "Year" real, "Record" text, "Finish" text, "Manager" text, "Playoffs" text )
Which Record has a Year larger than 1974, and a Finish of 3rd?
SELECT "Record" FROM table_65323 WHERE "Year" > '1974' AND "Finish" = '3rd'
CREATE TABLE table_743 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the result of the election of the incumbent clyde doyle?
SELECT "Result" FROM table_743 WHERE "Incumbent" = 'Clyde Doyle'
CREATE TABLE table_53089 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
Name the home team score when the away team is south melbourne
SELECT "Home team score" FROM table_53089 WHERE "Away team" = 'south melbourne'
CREATE TABLE table_8228 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
What is the whole of Drawn that has a Played larger than 14?
SELECT SUM("Drawn") FROM table_8228 WHERE "Played" > '14'
CREATE TABLE table_203_330 ( id number, "year of election" number, "candidates elected" number, "# of seats available" number, "# of votes" number, "% of popular vote" text )
year with largest number of candidates selected
SELECT "year of election" FROM table_203_330 ORDER BY "candidates elected" DESC LIMIT 1
CREATE TABLE table_train_178 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "hiv_infection" bool, "hepatitis_c" bool, "renal_disease" bool, "hypoglycemia" bool, "serum_creatinine" float, "seizure_disorder" bool, "body_mass_index_bmi" float, "NOUSE" float )
history of severe hypoglycemia ( seizure )
SELECT * FROM table_train_178 WHERE hypoglycemia = 1 OR seizure_disorder = 1
CREATE TABLE table_name_13 ( tournament VARCHAR, score VARCHAR )
What Tournament had a Score of 6 3, 2 6, 6 3?
SELECT tournament FROM table_name_13 WHERE score = "6–3, 2–6, 6–3"
CREATE TABLE table_54887 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Which tournament in 2013 had a 2010 finish of 1R?
SELECT "2013" FROM table_54887 WHERE "2006" = 'a' AND "2010" = '1r'
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What classes are offered next Winter for PreMajor ?
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...
CREATE TABLE table_name_33 ( band INTEGER, power__w_ INTEGER )
What Band's Power (W) is 400 or less?
SELECT MAX(band) FROM table_name_33 WHERE power__w_ > 400
CREATE TABLE table_name_47 ( drawn VARCHAR, club VARCHAR )
What is the drawn value for furnace united rfc?
SELECT drawn FROM table_name_47 WHERE club = "furnace united rfc"
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 t...
specify age and icd9 code of patient id 52118
SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "52118"
CREATE TABLE table_39299 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text )
Which Date has Opponents in the final of valeria casillo lilly raffa?
SELECT "Date" FROM table_39299 WHERE "Opponents in the final" = 'valeria casillo lilly raffa'
CREATE TABLE table_name_16 ( money___ INTEGER, score VARCHAR )
What is the most money for the score 75-74-72-67=288?
SELECT MAX(money___) AS $__ FROM table_name_16 WHERE score = 75 - 74 - 72 - 67 = 288
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) C...
give me a combination of CO flights from CHICAGO to SEATTLE that have meals early saturday morning
SELECT DISTINCT flight_id FROM flight WHERE (((((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYalias0.year = 1991)) AND ...
CREATE TABLE table_name_73 ( team__number1 VARCHAR )
What was the team Unics Kazan's 1st leg score?
SELECT 1 AS st_leg FROM table_name_73 WHERE team__number1 = "unics kazan"
CREATE TABLE table_name_62 ( bronze INTEGER, total VARCHAR, gold VARCHAR, silver VARCHAR )
What is the sum of the Bronze medals when the Gold medals are larger than 0, Silver medals are smaller than 1, and the total is smaller than 1?
SELECT SUM(bronze) FROM table_name_62 WHERE gold > 0 AND silver < 1 AND total < 1
CREATE TABLE table_15717093_1 ( title VARCHAR, us_viewers__millions_ VARCHAR )
What was the title when there were 14.39 million viewers?
SELECT title FROM table_15717093_1 WHERE us_viewers__millions_ = "14.39"
CREATE TABLE table_name_98 ( league_cup_goals INTEGER, total_apps VARCHAR, fa_cup_apps VARCHAR, league_cup_apps VARCHAR, league_goals VARCHAR )
what is the average league cup goals when the league cup apps is 4, league goals is less than 4, fa cup apps is 1 and total apps is 35?
SELECT AVG(league_cup_goals) FROM table_name_98 WHERE league_cup_apps = 4 AND league_goals < 4 AND fa_cup_apps = "1" AND total_apps = "35"
CREATE TABLE table_69607 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which tournament has a 2007 of 2r, and a 2011 of 2r?
SELECT "Tournament" FROM table_69607 WHERE "2007" = '2r' AND "2011" = '2r'
CREATE TABLE table_name_69 ( position VARCHAR, team_from VARCHAR )
What is the position of the team player from Aik?
SELECT position FROM table_name_69 WHERE team_from = "aik"
CREATE TABLE table_name_93 ( year_born__age_ VARCHAR, height VARCHAR, current_club VARCHAR )
What is the Year born (Age) for the player who is taller than 2.04 and currently plays for the Los Angeles Clippers?
SELECT year_born__age_ FROM table_name_93 WHERE height > 2.04 AND current_club = "los angeles clippers"
CREATE TABLE table_name_70 ( games VARCHAR, name VARCHAR )
Which game is named tsegay kebede category:articles with hcards?
SELECT games FROM table_name_70 WHERE name = "tsegay kebede category:articles with hcards"