answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT circuit FROM table_24732149_2 WHERE round = 5
What is the circuit of round 5?
CREATE TABLE table_24732149_2 (circuit VARCHAR, round VARCHAR)
SELECT team__number2 FROM table_27603010_14 WHERE team__number1 = "Atlético La Sabana"
Who was the team 2 that played against team 1 Atlético la Sabana?
CREATE TABLE table_27603010_14 (team__number2 VARCHAR, team__number1 VARCHAR)
SELECT MIN(width) FROM table_name_18 WHERE frame_size = "5k" AND height < 2700
What is the smallest width for a frame size of 5k and a height shorter than 2700?
CREATE TABLE table_name_18 ( width INTEGER, frame_size VARCHAR, height VARCHAR )
SELECT date FROM table_24732149_2 WHERE fastest_lap = "Mike Rockenfeller"
What date did Mike Rockenfeller have the fastest lap?
CREATE TABLE table_24732149_2 (date VARCHAR, fastest_lap VARCHAR)
SELECT new_points FROM table_27615896_18 WHERE rk = 26
How many new points were earned by rk 26?
CREATE TABLE table_27615896_18 (new_points VARCHAR, rk VARCHAR)
SELECT MIN("Total") FROM table_63918 WHERE "Bronze" < '7' AND "Silver" = '1' AND "Rank" > '9'
What is the Total number of medals for the Nation with 7 or less Bronze medals and 1 Silver medal with a Rank of 9 or larger?
CREATE TABLE table_63918 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT points FROM table_24735155_1 WHERE seasons = "2006 – 2007 , 2009"
How many points for the driver who raced in seasons 2006 – 2007 , 2009?
CREATE TABLE table_24735155_1 (points VARCHAR, seasons VARCHAR)
SELECT MIN(points) AS won FROM table_27615896_18 WHERE new_points = 1680
How many points were won where new points was 1680?
CREATE TABLE table_27615896_18 (points INTEGER, new_points VARCHAR)
SELECT Height, Weight FROM people GROUP BY Sex
Visualize the relationship between Height and Weight , and group by attribute Sex.
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real )
SELECT competition FROM table_24765815_2 WHERE vote_percentage = "N/A" AND nationality = "Brazil"
What's the name of the competition where the nationality is Brazil and the voting percentage is n/a?
CREATE TABLE table_24765815_2 (competition VARCHAR, vote_percentage VARCHAR, nationality VARCHAR)
SELECT MAX(points) FROM table_27615896_18 WHERE sd = 15
What are the total points for sd 15?
CREATE TABLE table_27615896_18 (points INTEGER, sd VARCHAR)
SELECT "Class" FROM table_65441 WHERE "Laps" = '66'
For what class is the laps 66?
CREATE TABLE table_65441 ( "Position" text, "Drivers" text, "Entrant" text, "Class" text, "Laps" real )
SELECT player FROM table_24765815_2 WHERE nationality = "Netherlands" AND team = "Netherlands"
What's the player's name whose nationality and team are Netherlands?
CREATE TABLE table_24765815_2 (player VARCHAR, nationality VARCHAR, team VARCHAR)
SELECT COUNT(sd) FROM table_27615896_18 WHERE status = "Quarterfinals lost to Novak Djokovic [1]"
What is the total number of sd listings where the status is quarterfinals lost to Novak Djokovic [1]?
CREATE TABLE table_27615896_18 (sd VARCHAR, status VARCHAR)
SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')
Find number of products which Sony does not make.
CREATE TABLE manufacturers ( code VARCHAR, name VARCHAR ) CREATE TABLE products ( name VARCHAR )
SELECT score FROM table_24765815_2 WHERE player = "Samir Nasri"
What was the score for the game in which Samir Nasri played?
CREATE TABLE table_24765815_2 (score VARCHAR, player VARCHAR)
SELECT COUNT(points) AS won FROM table_27615896_20 WHERE player = "Flavia Pennetta"
How many different counts for won points does Flavia Pennetta have?
CREATE TABLE table_27615896_20 (points VARCHAR, player VARCHAR)
SELECT "opponent" FROM table_203_506 WHERE "played" >= 30
name two countries that the england women 's rfu have played above thirty games against .
CREATE TABLE table_203_506 ( id number, "opponent" text, "played" number, "won" number, "lost" number, "drawn" number, "% won overall" text )
SELECT player FROM table_24765815_2 WHERE competition = "UEFA Euro 2012 qualifying Group A"
Who is the player that played in the UEFA Euro 2012 qualifying Group A competition?
CREATE TABLE table_24765815_2 (player VARCHAR, competition VARCHAR)
SELECT MIN(sd) FROM table_27615896_20 WHERE player = "Kaia Kanepi"
What's Kaia Kanepi's Sd?
CREATE TABLE table_27615896_20 (sd INTEGER, player VARCHAR)
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
during this month has patient 012-4131 received a potassium test?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
SELECT rank FROM table_24765815_2 WHERE competition = "UEFA Euro 2012 qualifying Group A"
What is the ranking of the UEFA Euro 2012 qualifying Group A competition?
CREATE TABLE table_24765815_2 (rank VARCHAR, competition VARCHAR)
SELECT status FROM table_27615896_20 WHERE points = 3041
What's the status of the player with 3041 points?
CREATE TABLE table_27615896_20 (status VARCHAR, points VARCHAR)
SELECT "Movie/Album" FROM table_73783 WHERE "Co-Stars" = 'Bela Bose'
What movie did Bela Bose co-star in?
CREATE TABLE table_73783 ( "Song" text, "Singer" text, "Co-Singers" text, "Music Director" text, "Lyricist" text, "Co-Stars" text, "Movie/Album" text, "Year" real, "Additional Info" text )
SELECT production FROM table_2477085_1 WHERE alpina_model = "B10 4,6"
Name the production for alpina model being b10 4,6
CREATE TABLE table_2477085_1 (production VARCHAR, alpina_model VARCHAR)
SELECT written_by FROM table_27657925_1 WHERE no_in_series = "62"
When 62 is the number in series who is the writer?
CREATE TABLE table_27657925_1 (written_by VARCHAR, no_in_series VARCHAR)
SELECT "Incumbent" FROM table_36730 WHERE "District" = 'ohio 13'
Who is the Incumbent that has a District of ohio 13 in Democratic Party?
CREATE TABLE table_36730 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
SELECT COUNT(final_score) FROM table_24776075_2 WHERE date = "Sunday, May 12"
How many final score datas are there on Sunday, May 12?
CREATE TABLE table_24776075_2 (final_score VARCHAR, date VARCHAR)
SELECT original_air_date FROM table_27657925_1 WHERE written_by = "Steve Holland"
When steve holland is the writer what is the air date?
CREATE TABLE table_27657925_1 (original_air_date VARCHAR, written_by VARCHAR)
SELECT "3rd place" FROM table_69011 WHERE "Runner-up" = 'runner-up'
What shows for 3rd place when Runner-up shows as runner-up?
CREATE TABLE table_69011 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text )
SELECT MIN(week) FROM table_24776075_2 WHERE date = "Saturday, May 25"
The game on Saturday, May 25 took place on which week?
CREATE TABLE table_24776075_2 (week INTEGER, date VARCHAR)
SELECT title FROM table_27657925_1 WHERE production_code = "231"
When 231 is the production code what is the title?
CREATE TABLE table_27657925_1 (title VARCHAR, production_code VARCHAR)
SELECT fifth FROM table_name_96 WHERE second = "victoria" AND first = "tasmania" AND sixth = "south australia"
What team placed fifth during the season where Victoria placed second, Tasmania placed first, and South Australia placed sixth?
CREATE TABLE table_name_96 ( fifth VARCHAR, sixth VARCHAR, second VARCHAR, first VARCHAR )
SELECT final_score FROM table_24776075_2 WHERE date = "Saturday, May 25"
What was the final score on Saturday, May 25?
CREATE TABLE table_24776075_2 (final_score VARCHAR, date VARCHAR)
SELECT COUNT(no_in_series) FROM table_27657925_1 WHERE us_viewers__millions_ = "5.2"
When there are 5.2 million u.s. viewers how many numbers in series are there?
CREATE TABLE table_27657925_1 (no_in_series VARCHAR, us_viewers__millions_ VARCHAR)
SELECT "First elected" FROM table_18620 WHERE "Candidates" = 'Joe Starnes (D) 100.0% George Bogus ( W/I ) 0.003%'
what's the first elected with candidates being joe starnes (d) 100.0% george bogus ( w/i ) 0.003%
CREATE TABLE table_18620 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT writer_s_ FROM table_24781886_2 WHERE _number = 10
When 10 is the number who is the writer?
CREATE TABLE table_24781886_2 (writer_s_ VARCHAR, _number VARCHAR)
SELECT COUNT(outgoing_manager) FROM table_27666856_3 WHERE team = "Villarreal B"
Name the total number of outgoing manager for villarreal b
CREATE TABLE table_27666856_3 (outgoing_manager VARCHAR, team VARCHAR)
SELECT "2009" FROM table_67936 WHERE "2012" = '1r' AND "2007" = '2r'
What was the 2009 result associated with a 2012 of 1R and a 2007 of 2R?
CREATE TABLE table_67936 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT MIN(production_code) FROM table_24781886_2 WHERE viewers = "6.66"
When 6.66 is the amount of viewers what is the lowest production code?
CREATE TABLE table_24781886_2 (production_code INTEGER, viewers VARCHAR)
SELECT COUNT(date_of_appointment) FROM table_27666856_3 WHERE date_of_vacancy = "26 May 2011"
Name the date of appointment for 26 may 2011
CREATE TABLE table_27666856_3 (date_of_appointment VARCHAR, date_of_vacancy VARCHAR)
SELECT away_team FROM table_name_24 WHERE venue = "kardinia park"
What away team played at Kardinia Park?
CREATE TABLE table_name_24 ( away_team VARCHAR, venue VARCHAR )
SELECT MIN(_number) FROM table_24781886_2 WHERE viewers = "7.55"
When 7.55 is the amount of viewers what is the lowest number?
CREATE TABLE table_24781886_2 (_number INTEGER, viewers VARCHAR)
SELECT COUNT(outgoing_manager) FROM table_27666856_3 WHERE replaced_by = "Esteban Vigo"
Name the outgoing manager for esteban vigo
CREATE TABLE table_27666856_3 (outgoing_manager VARCHAR, replaced_by VARCHAR)
SELECT margin_of_victory FROM table_1602858_1 WHERE winning_score = 63 - 68 - 68 - 68 = 267
What was the margin of victory with the winning score '63-68-68-68=267'?
CREATE TABLE table_1602858_1 ( margin_of_victory VARCHAR, winning_score VARCHAR )
SELECT COUNT(new_democratic) FROM table_24778847_2 WHERE date_of_polling = "May 11–31, 2010"
How many figures are given for the New Democratic for the polling range May 11–31, 2010?
CREATE TABLE table_24778847_2 (new_democratic VARCHAR, date_of_polling VARCHAR)
SELECT COUNT(team) FROM table_27666856_3 WHERE position_in_table = "19th"
Name the number of team for 19th position
CREATE TABLE table_27666856_3 (team VARCHAR, position_in_table VARCHAR)
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id DESC
Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, and could you order in desc by the id please?
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text )
SELECT link FROM table_24778847_2 WHERE date_of_polling = "February 10–28, 2011"
What format is the link for the polling data for February 10–28, 2011?
CREATE TABLE table_24778847_2 (link VARCHAR, date_of_polling VARCHAR)
SELECT manner_of_departure FROM table_27666856_3 WHERE outgoing_manager = "Luis Enrique"
Name the manner of departure for luis enrique
CREATE TABLE table_27666856_3 (manner_of_departure VARCHAR, outgoing_manager VARCHAR)
SELECT "College" FROM table_54857 WHERE "Player" = 'paul davis'
Tell me the college that paul davis went to
CREATE TABLE table_54857 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
SELECT title FROM table_24781886_3 WHERE _number = 9
When 9 is the number what is the title?
CREATE TABLE table_24781886_3 (title VARCHAR, _number VARCHAR)
SELECT opponent FROM table_27654988_1 WHERE competition = "Women's Cup 0 0" AND scorers = "Brancão Couto 0"
Who was the opponent in the Women's Cup 0 0 where Brancão Couto 0 is the scorer?
CREATE TABLE table_27654988_1 (opponent VARCHAR, competition VARCHAR, scorers VARCHAR)
SELECT "Team" FROM table_76671 WHERE "Race 1" = '4'
Which team received 4 in race 1?
CREATE TABLE table_76671 ( "Driver" text, "Team" text, "Race 1" text, "Race 2" text, "Points" real )
SELECT MAX(total) FROM table_24781886_3 WHERE _number = 3
When 3 is the number what is the highest total?
CREATE TABLE table_24781886_3 (total INTEGER, _number VARCHAR)
SELECT result FROM table_27654988_1 WHERE opponent = "Innsbrucker Kilmarnock CSK VVS Samara"
What is the result of the game where the opponent is Innsbrucker Kilmarnock CSK VVS Samara?
CREATE TABLE table_27654988_1 (result VARCHAR, opponent VARCHAR)
SELECT MIN("Year") FROM table_44781 WHERE "Album" = 'united we stand' AND "Single" = 'where are you going to my love'
What's the earliest year listed for 'where are you going to my love' from the album united we stand?
CREATE TABLE table_44781 ( "Year" real, "Month" text, "Single" text, "Album" text, "Record label" text )
SELECT air_date FROM table_24781886_3 WHERE viewers = "7.08"
When 7.08 is the amount of viewers what is the air date?
CREATE TABLE table_24781886_3 (air_date VARCHAR, viewers VARCHAR)
SELECT COUNT(season) FROM table_27654988_1 WHERE opponent = "Vamos Idaliou Krka Novo Mesto SV Neulengbach"
How many seasons was the opponent Vamos Idaliou Krka Novo Mesto SV Neulengbach?
CREATE TABLE table_27654988_1 (season VARCHAR, opponent VARCHAR)
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code
Find the number of male students (with sex M) from each city in a bar chart.
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) 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 Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) )
SELECT COUNT(director) FROM table_24781886_3 WHERE viewers = "7.08"
When 7.08 is the amount of viewers how many directors are there?
CREATE TABLE table_24781886_3 (director VARCHAR, viewers VARCHAR)
SELECT scorers FROM table_27654988_1 WHERE result = "0–4 7–1 0–3"
Who were the scorers in the game with final score 0–4 7–1 0–3?
CREATE TABLE table_27654988_1 (scorers VARCHAR, result VARCHAR)
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'COMM' AND course.number = 311 AND semester.semester = 'semester0' AND semester.semester_id = course_offering.semester AND semester.year = year0
For the COMM 311 course , what are the morning times ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) 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_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
SELECT location FROM table_24798489_2 WHERE original_airdate = "August 26, 2009"
What location did the episode that aired originally on August 26, 2009 take place at?
CREATE TABLE table_24798489_2 (location VARCHAR, original_airdate VARCHAR)
SELECT kickoff FROM table_27690037_2 WHERE game_site = "Rheinstadion"
Name the kickoff for rheinstadion
CREATE TABLE table_27690037_2 (kickoff VARCHAR, game_site VARCHAR)
SELECT member FROM table_name_16 WHERE electorate = "cook"
Which member has Cook as the electorate?
CREATE TABLE table_name_16 ( member VARCHAR, electorate VARCHAR )
SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE location = "Philadelphia, Pennsylvania"
How many dates originally aired episodes located in Philadelphia, pennsylvania?
CREATE TABLE table_24798489_2 (original_airdate VARCHAR, location VARCHAR)
SELECT high_points FROM table_27700530_5 WHERE date = "October 20"
Who had the high point total on october 20?
CREATE TABLE table_27700530_5 (high_points VARCHAR, date VARCHAR)
SELECT soap_opera FROM table_name_4 WHERE duration = "18 years" AND character = "miley byrne"
what is the soap opera when the duration is 18 years and the character is miley byrne?
CREATE TABLE table_name_4 ( soap_opera VARCHAR, duration VARCHAR, character VARCHAR )
SELECT challenge FROM table_24798489_2 WHERE episode_number = 28
What was the challenge for episode 28?
CREATE TABLE table_24798489_2 (challenge VARCHAR, episode_number VARCHAR)
SELECT series FROM table_27700530_15 WHERE game = 3
What was the series record at after game 3?
CREATE TABLE table_27700530_15 (series VARCHAR, game VARCHAR)
SELECT t_fed_rev FROM finrev_fed_17 WHERE school_district LIKE "%Pecatonia Area%"
How much federal funding does Pecatonia Area School district get?
CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text )
SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE episode_number = 22
How many original air dates were there for episode 22?
CREATE TABLE table_24798489_2 (original_airdate VARCHAR, episode_number VARCHAR)
SELECT location_attendance FROM table_27700530_15 WHERE game = 2
What was the location and attendance for game 2?
CREATE TABLE table_27700530_15 (location_attendance VARCHAR, game VARCHAR)
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, sort by the JOB_ID from low to high.
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE 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 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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
SELECT MIN(goals) FROM table_24807406_3
What was the lowest goals ever achieved?
CREATE TABLE table_24807406_3 (goals INTEGER)
SELECT high_points FROM table_27700530_15 WHERE date = "April 22"
Who had the most points and how many did they have on April 22?
CREATE TABLE table_27700530_15 (high_points VARCHAR, date VARCHAR)
SELECT "Against" FROM table_12496 WHERE "Losses" = '14'
Which against has 14 losses?
CREATE TABLE table_12496 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
SELECT afghan FROM table_24807774_1 WHERE arabic = "Scottish"
how many arabic scottish is afghan
CREATE TABLE table_24807774_1 (afghan VARCHAR, arabic VARCHAR)
SELECT high_assists FROM table_27704187_2 WHERE date = "October 5"
Who had the most assists and how many did they have on October 5?
CREATE TABLE table_27704187_2 (high_assists VARCHAR, date VARCHAR)
SELECT "HDTV" FROM table_7184 WHERE "Content" = 'cinema' AND "Package/Option" = 'sky cinema + sky hd' AND "Television service" = 'sky cinema passion hd'
What is HDTV, when Content is Cinema, when Package/Option is Sky Cinema + Sky HD, and when Television Service is Sky Cinema Passion HD?
CREATE TABLE table_7184 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
SELECT COUNT(cook_islands) FROM table_24807774_1 WHERE bosnian = "Macedonian"
how many bosnian in cook islands is macedonian
CREATE TABLE table_24807774_1 (cook_islands VARCHAR, bosnian VARCHAR)
SELECT artist FROM table_27711947_1 WHERE choreographer = "Marcos Aguirre" AND rating = "Simple"
List all artists with choreographer Marcos Aguirre and a simple rating.
CREATE TABLE table_27711947_1 (artist VARCHAR, choreographer VARCHAR, rating VARCHAR)
SELECT MIN("Score") FROM table_59052 WHERE "To Par" = '–1'
Which Score has a To Par of 1?
CREATE TABLE table_59052 ( "Place" text, "Player" text, "Country" text, "Score" real, "To Par" text )
SELECT colombian FROM table_24807774_1 WHERE bangladeshi = "Serbian"
how many colombia in bangladesh is serbian
CREATE TABLE table_24807774_1 (colombian VARCHAR, bangladeshi VARCHAR)
SELECT COUNT(overall_attendance) FROM table_2771237_1 WHERE average_attendance = 17807
How many times was the overall attendance 17807?
CREATE TABLE table_2771237_1 (overall_attendance VARCHAR, average_attendance VARCHAR)
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551'))
what has been patient 027-120551's allergies?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT arabic FROM table_24807774_1 WHERE colombian = "Finnish"
how many arabic in colobians is finnish
CREATE TABLE table_24807774_1 (arabic VARCHAR, colombian VARCHAR)
SELECT overall_attendance FROM table_2771237_1 WHERE average_attendance = 17148
What is the overall attendance in the places where the average attendance was 17148?
CREATE TABLE table_2771237_1 (overall_attendance VARCHAR, average_attendance VARCHAR)
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-100195' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) = '2105'
did patient 015-100195 come into an er in 2105?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 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 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 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT bosnian FROM table_24807774_1 WHERE cook_islands = "Sri Lankan"
how many bosnian in cook islands is sri lankan
CREATE TABLE table_24807774_1 (bosnian VARCHAR, cook_islands VARCHAR)
SELECT season FROM table_2771237_1 WHERE average_attendance = 16043
What season was the average attendance is 16043?
CREATE TABLE table_2771237_1 (season VARCHAR, average_attendance VARCHAR)
SELECT COUNT(fumble_force) FROM table_name_20 WHERE solo < 2 AND player = "jim laney"
How many forced fumbles for jim laney with under 2 solo tackles?
CREATE TABLE table_name_20 ( fumble_force VARCHAR, solo VARCHAR, player VARCHAR )
SELECT afghan FROM table_24807774_1 WHERE bangladeshi = "Hungarian"
how many afghan in banglash is hungarian
CREATE TABLE table_24807774_1 (afghan VARCHAR, bangladeshi VARCHAR)
SELECT overall_record FROM table_2771237_1 WHERE average_attendance = 16720
What was the overall record in the season where average attendance was 16720?
CREATE TABLE table_2771237_1 (overall_record VARCHAR, average_attendance VARCHAR)
SELECT "trainer" FROM table_204_13 ORDER BY "finished" LIMIT 1
what is the name of the top horse 's trainer ?
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text )
SELECT name FROM table_24807406_1 WHERE position = "FW" AND appearances = 2
What is the name if the appearance is 2 and the position is FW?
CREATE TABLE table_24807406_1 (name VARCHAR, position VARCHAR, appearances VARCHAR)
SELECT high_assists FROM table_27712451_9 WHERE date = "March 14"
Name the high assists for march 14
CREATE TABLE table_27712451_9 (high_assists VARCHAR, date VARCHAR)
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name
Who has friends that are older than the average age? Print their name and their ages as well using a bar chart, and list by the X in ascending.
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT COUNT(assists) FROM table_24807406_1 WHERE minutes = 1
What is the assists total number if the minutes is 1?
CREATE TABLE table_24807406_1 (assists VARCHAR, minutes VARCHAR)