answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT COUNT("Residence") FROM table_3477 WHERE "Representative" = 'Scott Oelslager'
How many times was Scott Oelslager a representative?
CREATE TABLE table_3477 ( "District" real, "Representative" text, "Party" text, "Residence" text, "First Elected" text, "Term Limited" real )
SELECT high_assists FROM table_27712702_11 WHERE team = "Detroit"
Who had the high assists against detroit?
CREATE TABLE table_27712702_11 (high_assists VARCHAR, team VARCHAR)
SELECT AVG(attendance) FROM table_name_31 WHERE date = "september 23, 1973" AND week > 2
What is the average attendance for the games after week 2 on September 23, 1973?
CREATE TABLE table_name_31 (attendance INTEGER, date VARCHAR, week VARCHAR)
SELECT COUNT(fall_08) FROM table_name_52 WHERE fall_06 = 57 AND fall_05 < 74
What number is Fall 08 from the state with 57 in Fall 06 and 74 or less in Fall 05?
CREATE TABLE table_name_52 ( fall_08 VARCHAR, fall_06 VARCHAR, fall_05 VARCHAR )
SELECT team FROM table_27712702_11 WHERE date = "March 27"
Who was the other team on march 27?
CREATE TABLE table_27712702_11 (team VARCHAR, date VARCHAR)
SELECT COUNT(week) FROM table_name_81 WHERE date = "november 5, 1973" AND attendance > 49 OFFSET 220
What is the total number of weeks where games were on November 5, 1973 and the attendance was larger than 49,220?
CREATE TABLE table_name_81 (week VARCHAR, date VARCHAR, attendance VARCHAR)
SELECT MAX(milliseconds), MIN(milliseconds) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Pop"
What are the duration of the longest and shortest pop tracks in milliseconds?
CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, city text, state text, country text, postalcode text, phone text, fax text, email text, supportrepid number ) CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, composer text, milliseconds number, bytes number, unitprice number ) CREATE TABLE mediatype ( mediatypeid number, name text ) CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number ) CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE artist ( artistid number, name text )
SELECT MIN(game) FROM table_27712702_11 WHERE record = "46–24"
what was the game number where the record was 46–24?
CREATE TABLE table_27712702_11 (game INTEGER, record VARCHAR)
SELECT game_site FROM table_name_70 WHERE record = "9–1"
Record of 9–1 had what game site?
CREATE TABLE table_name_70 (game_site VARCHAR, record VARCHAR)
SELECT COUNT(pommel_horse) FROM table_name_16 WHERE rings = 37.461 AND total < 229.507
How many pommel Horses have Rings of 37.461, and a Total smaller than 229.507?
CREATE TABLE table_name_16 ( pommel_horse VARCHAR, rings VARCHAR, total VARCHAR )
SELECT MIN(game) FROM table_27712702_11 WHERE date = "March 27"
What was the game number on march 27?
CREATE TABLE table_27712702_11 (game INTEGER, date VARCHAR)
SELECT MAX(attendance) FROM table_name_18 WHERE record = "8–1" AND week > 9
Record of 8–1, and a Week larger than 9 had what highest attendance?
CREATE TABLE table_name_18 (attendance INTEGER, record VARCHAR, week VARCHAR)
SELECT "RAtt" FROM table_40270 WHERE "Long" = '73'
What is the RAtt when the long is 73?
CREATE TABLE table_40270 ( "Year" text, "Team" text, "Comp" text, "Long" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text, "Lost" text )
SELECT MAX(game) FROM table_27712702_11
What is the largest game number?
CREATE TABLE table_27712702_11 (game INTEGER)
SELECT SUM(attendance) FROM table_name_9 WHERE result = "w 24–21" AND week < 6
Result of w 24–21, and a Week smaller than 6 had what sum of attendance?
CREATE TABLE table_name_9 (attendance INTEGER, result VARCHAR, week VARCHAR)
SELECT MIN("Rank") FROM table_32004 WHERE "Bronze" > '1' AND "Gold" < '4'
What is the rank of the nation that has more than 1 Bronze medals and fewer than 4 Gold medals?
CREATE TABLE table_32004 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT(high_rebounds) FROM table_27712451_6 WHERE date = "December 8"
How many high rebounds took place on December 8?
CREATE TABLE table_27712451_6 (high_rebounds VARCHAR, date VARCHAR)
SELECT record FROM table_name_1 WHERE date = "october 25, 1964"
Date of October 25, 1964 involves what record?
CREATE TABLE table_name_1 (record VARCHAR, date VARCHAR)
SELECT "Launched" FROM table_4476 WHERE "Name" = 'garibaldets (Π³Π°Ρ€ΠΈΠ±Π°Π»ΡŒΠ΄ΠΈΠ΅Ρ†)'
when was garibaldets ( ) launched?
CREATE TABLE table_4476 ( "Number" text, "Name" text, "Meaning" text, "Fleet" text, "Launched" text )
SELECT high_points FROM table_27712451_6 WHERE date = "December 10"
What are December 10's high points?
CREATE TABLE table_27712451_6 (high_points VARCHAR, date VARCHAR)
SELECT MAX(total) FROM table_name_82 WHERE nation = "algeria" AND bronze > 2
What is the high total for algeria with over 2 bronzes?
CREATE TABLE table_name_82 (total INTEGER, nation VARCHAR, bronze VARCHAR)
SELECT nfl_club FROM table_name_51 WHERE player = "robert gallery"
What club is robert gallery a part of
CREATE TABLE table_name_51 ( nfl_club VARCHAR, player VARCHAR )
SELECT COUNT(high_rebounds) FROM table_27713030_11 WHERE location_attendance = "Philips Arena 20,024"
How many entries are shown for high rebounds for the philips arena 20,024 game?
CREATE TABLE table_27713030_11 (high_rebounds VARCHAR, location_attendance VARCHAR)
SELECT MAX(silver) FROM table_name_9 WHERE total < 8 AND gold = 0 AND nation = "qatar" AND bronze > 2
What is the highest number of silvers for qatar with under 8 total, 0 golds, and over 2 bronzes?
CREATE TABLE table_name_9 (silver INTEGER, bronze VARCHAR, nation VARCHAR, total VARCHAR, gold VARCHAR)
SELECT year_built FROM table_name_74 WHERE venue = "john m. belk arena"
What year was John m. Belk Arena built?
CREATE TABLE table_name_74 ( year_built VARCHAR, venue VARCHAR )
SELECT team FROM table_27713030_11 WHERE score = "W 94–88 (OT)"
Who was the opponent for the game with a score of w 94–88 (ot)?
CREATE TABLE table_27713030_11 (team VARCHAR, score VARCHAR)
SELECT COUNT(bronze) FROM table_name_81 WHERE silver > 0 AND total > 20 AND gold < 26
How many bronzes for the nation with over 20 total, under 26 golds, and over 0 silvers?
CREATE TABLE table_name_81 (bronze VARCHAR, gold VARCHAR, silver VARCHAR, total VARCHAR)
SELECT "100 m" FROM table_13410 WHERE "110 m H" = '0 dnf'
What is the 100 m time when the 110 m H number is 0 dnf?
CREATE TABLE table_13410 ( "Overall points" text, "100 m" text, "400 m" text, "110 m H" text, "1500 m" text )
SELECT record FROM table_27713030_11 WHERE location_attendance = "American Airlines Arena 19,825"
What was the record for the location and attendance of american airlines arena 19,825?
CREATE TABLE table_27713030_11 (record VARCHAR, location_attendance VARCHAR)
SELECT bronze FROM table_name_27 WHERE gold = "choi jun-sang" AND silver = "suh jung-kyun"
Who one bronze in the event where Choi Jun-Sang won gold, and Suh Jung-Kyun won silver?
CREATE TABLE table_name_27 (bronze VARCHAR, gold VARCHAR, silver VARCHAR)
SELECT playoffs FROM table_name_70 WHERE year = "2007-08"
What Playoffs were held during the years of 2007-08?
CREATE TABLE table_name_70 ( playoffs VARCHAR, year VARCHAR )
SELECT high_points FROM table_27713030_12 WHERE date = "April 8"
What were the high points on April 8?
CREATE TABLE table_27713030_12 (high_points VARCHAR, date VARCHAR)
SELECT bronze FROM table_name_20 WHERE location = "seoul"
Who won bronze in Seoul?
CREATE TABLE table_name_20 (bronze VARCHAR, location VARCHAR)
SELECT AVG("Rank") FROM table_52205 WHERE "Studio(s)" = 'dharma productions' AND "Year" < '2013'
Tell me the average rank for dharma productions before 2013
CREATE TABLE table_52205 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Third Week Nett. Gross" real )
SELECT COUNT(high_rebounds) FROM table_27713030_12 WHERE game = 80
How many different items appear in the high rebounds column in game 80?
CREATE TABLE table_27713030_12 (high_rebounds VARCHAR, game VARCHAR)
SELECT bronze FROM table_name_7 WHERE year = 2006
Who won bronze is 2006?
CREATE TABLE table_name_7 (bronze VARCHAR, year VARCHAR)
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result
Group by the result and count them by a bar chart.
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
SELECT date FROM table_27713030_12 WHERE team = "Boston"
What was the date when Boston was the team?
CREATE TABLE table_27713030_12 (date VARCHAR, team VARCHAR)
SELECT COUNT(year) FROM table_name_70 WHERE location = "hiroshima"
What year did the event in Hiroshima take place?
CREATE TABLE table_name_70 (year VARCHAR, location VARCHAR)
SELECT affiliation FROM table_1847523_2 WHERE station = "KMGH-TV"
What station is affiliated with kmgh-tv?
CREATE TABLE table_1847523_2 ( affiliation VARCHAR, station VARCHAR )
SELECT MAX(game) FROM table_27713030_3 WHERE date = "October 13"
Which game was played on October 13?
CREATE TABLE table_27713030_3 (game INTEGER, date VARCHAR)
SELECT bronze FROM table_name_35 WHERE year = 2002
Who won bronze in 2002?
CREATE TABLE table_name_35 (bronze VARCHAR, year VARCHAR)
SELECT COUNT(fa_cup) FROM table_name_64 WHERE play_offs = 3 AND name = "mitch cook category:articles with hcards" AND total < 11
What's the total number of FA Cup with a Play-offs of 3, and the Name of Mitch Cook Category:Articles with hCards and has a Total thats less than 11?
CREATE TABLE table_name_64 ( fa_cup VARCHAR, total VARCHAR, play_offs VARCHAR, name VARCHAR )
SELECT location_attendance FROM table_27713030_3 WHERE date = "October 18"
What is the location and attendance on October 18?
CREATE TABLE table_27713030_3 (location_attendance VARCHAR, date VARCHAR)
SELECT COUNT(game) FROM table_name_74 WHERE opponent = "edmonton oilers" AND february > 12
What is the game number of the game with the Edmonton Oilers as the opponent after February 12?
CREATE TABLE table_name_74 (game VARCHAR, opponent VARCHAR, february VARCHAR)
SELECT "Score" FROM table_40385 WHERE "Opponent in the final" = 'iroda tulyaganova'
What was the score when the opponent in the final was iroda tulyaganova?
CREATE TABLE table_40385 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
SELECT team FROM table_27713030_3 WHERE game = 6
Who was the opposing team in game 6?
CREATE TABLE table_27713030_3 (team VARCHAR, game VARCHAR)
SELECT COUNT(seasons) FROM table_name_1 WHERE years = "1976–1977"
How many Seasons that has Years of 1976–1977?
CREATE TABLE table_name_1 (seasons VARCHAR, years VARCHAR)
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pituitary cushing syndrome' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year'))
retrieve the patient identifications who have been diagnosed with pituitary cushing syndrome until 1 year ago.
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 time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT MIN(game) FROM table_27713030_7
What game in the season does this list start?
CREATE TABLE table_27713030_7 (game INTEGER)
SELECT MIN(week) FROM table_name_24 WHERE date = "october 5, 1975"
What week of the season had a date of october 5, 1975?
CREATE TABLE table_name_24 (week INTEGER, date VARCHAR)
SELECT post_season_record_ AS "e_" FROM table_name_55 WHERE mlb_affiliate = "kansas city"
Tell me the post-season record for kansas city
CREATE TABLE table_name_55 ( post_season_record_ VARCHAR, e_ VARCHAR, mlb_affiliate VARCHAR )
SELECT score FROM table_27713030_8 WHERE team = "Detroit"
What was the team's score against detroit?
CREATE TABLE table_27713030_8 (score VARCHAR, team VARCHAR)
SELECT COUNT(events) FROM table_name_80 WHERE top_10 > 6 AND top_5 < 8
How many Events have a Top-10 larger than 6, and a Top-5 smaller than 8?
CREATE TABLE table_name_80 (events VARCHAR, top_10 VARCHAR, top_5 VARCHAR)
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'hdl')
what is the cost of the hdl lab test?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) 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 time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
SELECT COUNT(game) FROM table_27715173_10 WHERE date = "March 12"
How many games were held on March 12?
CREATE TABLE table_27715173_10 (game VARCHAR, date VARCHAR)
SELECT COUNT(wins) FROM table_name_57 WHERE top_10 < 6 AND cuts_made > 7 AND top_5 = 0
How many Wins have a Top-10 smaller than 6, and Cuts made larger than 7, and a Top-5 of 0?
CREATE TABLE table_name_57 (wins VARCHAR, top_5 VARCHAR, top_10 VARCHAR, cuts_made VARCHAR)
SELECT COUNT(team__a_) FROM table_22384475_1 WHERE margin = "131 runs"
How many games were won by a margin of 131 runs?
CREATE TABLE table_22384475_1 ( team__a_ VARCHAR, margin VARCHAR )
SELECT score FROM table_27715173_10 WHERE high_rebounds = "Tim Duncan (12)"
What was the team score when Tim Duncan (12) got the high rebounds?
CREATE TABLE table_27715173_10 (score VARCHAR, high_rebounds VARCHAR)
SELECT result FROM table_name_49 WHERE date = "may 14"
What is the result of the game on May 14?
CREATE TABLE table_name_49 (result VARCHAR, date VARCHAR)
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and salary , and could you order Y-axis in ascending order?
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,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE 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 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) )
SELECT high_rebounds FROM table_27715173_12 WHERE game = 1
Who was the high rebounder on game 1?
CREATE TABLE table_27715173_12 (high_rebounds VARCHAR, game VARCHAR)
SELECT result FROM table_name_48 WHERE road_team = "philadelphia" AND date = "may 14"
What is the result of the game on May 14 with Philadelphia as the road team?
CREATE TABLE table_name_48 (result VARCHAR, road_team VARCHAR, date VARCHAR)
SELECT COUNT(roll) FROM table_name_69 WHERE decile > 1 AND authority = "integrated" AND name = "bishop viard college"
What is the roll of Bishop Viard College (An Integrated College), which has a decile larger than 1?
CREATE TABLE table_name_69 ( roll VARCHAR, name VARCHAR, decile VARCHAR, authority VARCHAR )
SELECT score FROM table_27715173_12 WHERE series = "2–3"
What was the score for series 2–3?
CREATE TABLE table_27715173_12 (score VARCHAR, series VARCHAR)
SELECT result FROM table_name_48 WHERE road_team = "philadelphia" AND date = "may 4"
What is the result of the game on May 4 with Philadelphia as the road team?
CREATE TABLE table_name_48 (result VARCHAR, road_team VARCHAR, date VARCHAR)
SELECT "Result" FROM table_9761 WHERE "Venue" = 'afg arena, st. gallen' AND "Score" = '1–0'
What is the Result of the AFG Arena, St. Gallen Competition with a Score of 1 0?
CREATE TABLE table_9761 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT directed_by FROM table_27714573_1 WHERE us_viewers__millions_ = "20.5"
who are the directors of the episode that had 20.5 millions of north american viewers?
CREATE TABLE table_27714573_1 (directed_by VARCHAR, us_viewers__millions_ VARCHAR)
SELECT road_team FROM table_name_56 WHERE home_team = "philadelphia" AND game = "game 6"
What is the road team of game 6 with Philadelphia as the home team?
CREATE TABLE table_name_56 (road_team VARCHAR, home_team VARCHAR, game VARCHAR)
SELECT structure FROM table_name_88 WHERE country = "chile"
What structure is in Chile?
CREATE TABLE table_name_88 ( structure VARCHAR, country VARCHAR )
SELECT us_viewers__millions_ FROM table_27714573_1 WHERE directed_by = "Michael Lembeck"
how many millions of north american viewers had the episode whose director was Michael Lembeck?
CREATE TABLE table_27714573_1 (us_viewers__millions_ VARCHAR, directed_by VARCHAR)
SELECT result FROM table_name_26 WHERE home_team = "los angeles" AND game = "game 5"
What is the result of game 5 with Los Angeles as the home team?
CREATE TABLE table_name_26 (result VARCHAR, home_team VARCHAR, game VARCHAR)
SELECT SUM(pop__2004_) FROM table_name_48 WHERE governorate = "al mahwit"
How many Pop (2004) has a Governorate of al mahwit?
CREATE TABLE table_name_48 ( pop__2004_ INTEGER, governorate VARCHAR )
SELECT written_by FROM table_27714573_1 WHERE production_code_s_ = 225560
who are the writers of the episode whose production code(s) is 225560?
CREATE TABLE table_27714573_1 (written_by VARCHAR, production_code_s_ VARCHAR)
SELECT road_team FROM table_name_53 WHERE home_team = "philadelphia" AND result = "105-102"
What is the road team of the game with Philadelphia as the home team with a result of 105-102?
CREATE TABLE table_name_53 (road_team VARCHAR, home_team VARCHAR, result VARCHAR)
SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10
A list of the top 10 countries by average invoice size. List country name and average invoice size.
CREATE TABLE invoices ( billing_country VARCHAR, total INTEGER )
SELECT MAX(no_s__in_series) FROM table_27714985_1 WHERE written_by = "Gregory S. Malins"
What is the last episode in the series written by Gregory S. Malins?
CREATE TABLE table_27714985_1 (no_s__in_series INTEGER, written_by VARCHAR)
SELECT result FROM table_name_26 WHERE party = "republican" AND first_elected < 1856
Which Result has a Party of republican, and a First elected smaller than 1856?
CREATE TABLE table_name_26 (result VARCHAR, party VARCHAR, first_elected VARCHAR)
SELECT result FROM table_name_52 WHERE goals = "deacon 6/6"
I want the result for goals which has goals of deacon 6/6
CREATE TABLE table_name_52 ( result VARCHAR, goals VARCHAR )
SELECT original_air_date FROM table_27714985_1 WHERE us_viewers__millions_ = "23.2"
What was the broadcast date of episodes that were watched by 23.2 million viewers?
CREATE TABLE table_27714985_1 (original_air_date VARCHAR, us_viewers__millions_ VARCHAR)
SELECT district FROM table_name_20 WHERE first_elected = 1856 AND incumbent = "william kellogg"
Which District has a First elected of 1856, and an Incumbent of william kellogg?
CREATE TABLE table_name_20 (district VARCHAR, first_elected VARCHAR, incumbent VARCHAR)
SELECT COUNT(no) FROM table_26202940_6 WHERE score_in_the_final = "6–3, 6–4, 7–6 (13–11)"
How many numbers correspond to the score in the final of 6 3, 6 4, 7 6 (13 11)?
CREATE TABLE table_26202940_6 ( no VARCHAR, score_in_the_final VARCHAR )
SELECT MAX(production_code_s_) FROM table_27714985_1 WHERE written_by = "Patty Lin"
What is the maximum production code of an episode written by Patty Lin?
CREATE TABLE table_27714985_1 (production_code_s_ INTEGER, written_by VARCHAR)
SELECT MAX(first_elected) FROM table_name_52 WHERE district = "illinois 3"
Which First elected has a District of illinois 3?
CREATE TABLE table_name_52 (first_elected INTEGER, district VARCHAR)
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
Show me about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by weekday in a bar chart.
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) 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 Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR(255) )
SELECT MIN(no_s__in_season) FROM table_27714985_1 WHERE production_code_s_ = 226407
What is the episode number of the episode whose production code is 226407?
CREATE TABLE table_27714985_1 (no_s__in_season INTEGER, production_code_s_ VARCHAR)
SELECT COUNT(first_elected) FROM table_name_76 WHERE result = "re-elected" AND party = "republican" AND district = "illinois 4"
How much First elected has a Result of re-elected, and a Party of republican, and a District of illinois 4?
CREATE TABLE table_name_76 (first_elected VARCHAR, district VARCHAR, result VARCHAR, party VARCHAR)
SELECT T1.Theme, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Theme DESC
Give me a bar chart to show the theme and their sales of the journal which did not have any of the listed editors serving on the committee, rank in descending by the x axis.
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int )
SELECT MIN(no_in_series) FROM table_27713890_1 WHERE us_viewers__millions_ = "24.8"
Wha episode number in the series had 24.8 million u.s. viewers?
CREATE TABLE table_27713890_1 (no_in_series INTEGER, us_viewers__millions_ VARCHAR)
SELECT home FROM table_name_33 WHERE date = "january 7"
on january 7 what is home?
CREATE TABLE table_name_33 (home VARCHAR, date VARCHAR)
SELECT COUNT("Seats") FROM table_38250 WHERE "D\u00e1il" = '6th'
How many seats does the 6th Dail have?
CREATE TABLE table_38250 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Government" text )
SELECT MAX(production_code) FROM table_27713890_1 WHERE us_viewers__millions_ = "24.8"
What is the production code that had 24.8 million u.s. viewers?
CREATE TABLE table_27713890_1 (production_code INTEGER, us_viewers__millions_ VARCHAR)
SELECT visitor FROM table_name_16 WHERE date = "january 12"
on january 12 who was the visitor?
CREATE TABLE table_name_16 (visitor VARCHAR, date VARCHAR)
SELECT bats FROM table_name_23 WHERE first = "mitchell"
Which bats did mitchell play first?
CREATE TABLE table_name_23 ( bats VARCHAR, first VARCHAR )
SELECT production_code FROM table_27713890_1 WHERE us_viewers__millions_ = "23.9"
What is the production code for the episode that had 23.9 million u.s. viewers?
CREATE TABLE table_27713890_1 (production_code VARCHAR, us_viewers__millions_ VARCHAR)
SELECT record FROM table_name_63 WHERE date = "january 7"
on january 7 what is the record?
CREATE TABLE table_name_63 (record VARCHAR, date VARCHAR)
SELECT "Score" FROM table_45843 WHERE "Home team" = 'sheffield wednesday'
What was the score of the game when Sheffield Wednesday was the home team?
CREATE TABLE table_45843 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT location_attendance FROM table_27715173_6 WHERE record = "10-1"
Where was the game played where the record was 10-1?
CREATE TABLE table_27715173_6 (location_attendance VARCHAR, record VARCHAR)
SELECT COUNT(silver) FROM table_name_13 WHERE gold < 2 AND bronze = 1 AND total > 2
What is the total number of silver medals of the team with less than 2 gold, 1 bronze, and more than 2 total medals?
CREATE TABLE table_name_13 (silver VARCHAR, total VARCHAR, gold VARCHAR, bronze VARCHAR)
SELECT "team" FROM table_203_450 WHERE id = (SELECT id FROM table_203_450 WHERE "team" = 'manchester city') + 1
what team is listed after manchester city ?
CREATE TABLE table_203_450 ( id number, "team" text, "outgoing manager" text, "manner of departure" text, "date of vacancy" text, "replaced by" text, "date of appointment" text, "position in table" text )