instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which Opponents have a Year of 1998 99, and a Team of aston villa?
CREATE TABLE table_34558 ("Year" text,"Team" text,"Progress" text,"Score" text,"Opponents" text)
SELECT "Opponents" FROM table_34558 WHERE "Year" = '1998–99' AND "Team" = 'aston villa'
What is the lowest Place, when Televotes is 15424?
CREATE TABLE table_49986 ("Draw" real,"Song" text,"Artist" text,"Televotes" real,"Place" real)
SELECT MIN("Place") FROM table_49986 WHERE "Televotes" = '15424'
What is the highest numbered grid with a time or retired time of 52:52.1881?
CREATE TABLE table_name_91 (grid INTEGER,time_retired VARCHAR)
SELECT MAX(grid) FROM table_name_91 WHERE time_retired = "52:52.1881"
What was the area (km ) (per sqmi) of a country with a population density per km of 8.4/km (/sqmi)?
CREATE TABLE table_3646 ("Country or territory with flag" text,"Area (km\u00b2) (per sqmi)" text,"Population (July 2009 est.)" real,"Population density per km\u00b2" text,"Capital" text)
SELECT "Area (km\u00b2) (per sqmi)" FROM table_3646 WHERE "Population density per km\u00b2" = '8.4/km² (/sqmi)'
What is the total number for Seve Ballesteros?
CREATE TABLE table_60241 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT COUNT("Total") FROM table_60241 WHERE "Player" = 'seve ballesteros'
What were the original teams for the season that was won at-home by Mark Pinkhasovich?
CREATE TABLE table_name_15 (original_teams VARCHAR,at_home_winner VARCHAR)
SELECT original_teams FROM table_name_15 WHERE at_home_winner = "mark pinkhasovich"
How many villages are there in the Magway region?
CREATE TABLE table_23009 ("No." real,"State/Region" text,"Districts" real,"Town ships" real,"Cities/ Towns" real,"Wards" real,"Village groups" real,"Villages" real)
SELECT "Villages" FROM table_23009 WHERE "State/Region" = 'Magway Region'
Who is the teacher this semester for the Cell Cycle Control and Cancer class ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
What is the game number against the team Boston?
CREATE TABLE table_name_3 (game VARCHAR,team VARCHAR)
SELECT COUNT(game) FROM table_name_3 WHERE team = "boston"
Bar chart x axis participant details y axis participant_id, and sort by the y axis in ascending.
CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Eve...
SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID
What is the title when the series # is 7?
CREATE TABLE table_31327 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Title" FROM table_31327 WHERE "Series #" = '7'
What year had a record of 4-21?
CREATE TABLE table_56558 ("Year" text,"League" text,"Record" text,"Reg. Season" text,"Playoffs" text)
SELECT "Year" FROM table_56558 WHERE "Record" = '4-21'
tell me the long title of procedure for patient paul edwards.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Paul Edwards"
Which event shows Matt St. Louis in second and a skip of John Morris?
CREATE TABLE table_35315 ("Year" real,"Event" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Event" FROM table_35315 WHERE "Skip" = 'john morris' AND "Second" = 'matt st. louis'
What was the most recent race at Kyalami with Keke Rosberg competing?
CREATE TABLE table_name_41 (year INTEGER,venue VARCHAR,driver VARCHAR)
SELECT MAX(year) FROM table_name_41 WHERE venue = "kyalami" AND driver = "keke rosberg"
Top Algerian Comments on StackOverflow.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREAT...
SELECT CONCAT('https://stackoverflow.com/questions/', c.PostId, '/#comment', c.Id, '_', c.PostId) AS link, c.Score, u.DisplayName, u.Reputation, c.Text FROM Comments AS c, Users AS u WHERE c.UserId = u.Id AND u.Location LIKE '%Algeria%' ORDER BY c.Score DESC
Which Team has a Pick # of 148?
CREATE TABLE table_name_59 (team_from VARCHAR,pick__number VARCHAR)
SELECT team_from FROM table_name_59 WHERE pick__number = 148
WHAT IS THE SECOND WITH A TENTH OF DAN BLACK?
CREATE TABLE table_50985 ("Poll Year" text,"Winner" text,"Second" text,"Third" text,"Fourth" text,"Fifth" text,"Sixth" text,"Seventh" text,"Eighth" text,"Ninth" text,"Tenth" text)
SELECT "Second" FROM table_50985 WHERE "Tenth" = 'dan black'
What position did the team finish in with a Difference of - 6, 3 losses, and over 4 draws?
CREATE TABLE table_name_83 (position VARCHAR,drawn VARCHAR,difference VARCHAR,lost VARCHAR)
SELECT COUNT(position) FROM table_name_83 WHERE difference = "- 6" AND lost = 3 AND drawn > 4
What is the total for 34 matches with 111 rides, but no more than 15 bonus points?
CREATE TABLE table_70848 ("Rider" text,"Matches" real,"Rides" real,"Bonus Pts" real,"Total Points" real)
SELECT AVG("Total Points") FROM table_70848 WHERE "Matches" = '34' AND "Rides" = '111' AND "Bonus Pts" > '15'
which team was the last team that this team faced in the regular season ?
CREATE TABLE table_204_755 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number)
SELECT "opponent" FROM table_204_755 ORDER BY "date" DESC LIMIT 1
what is the lowest top 5 when the year is after 1995, team(s) is #15 billy ballew motorsports, and starts is more than 4?
CREATE TABLE table_9596 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text,"Team(s)" text)
SELECT MIN("Top 5") FROM table_9596 WHERE "Year" > '1995' AND "Team(s)" = '#15 billy ballew motorsports' AND "Starts" > '4'
Which Bleeding time has a Condition of factor x deficiency as seen in amyloid purpura?
CREATE TABLE table_name_31 (bleeding_time VARCHAR,condition VARCHAR)
SELECT bleeding_time FROM table_name_31 WHERE condition = "factor x deficiency as seen in amyloid purpura"
What company built the ship named excellent in 1998?
CREATE TABLE table_name_59 (company VARCHAR,built VARCHAR,ship VARCHAR)
SELECT company FROM table_name_59 WHERE built = 1998 AND ship = "excellent"
What is the Birthdate of raymond bonney?
CREATE TABLE table_name_20 (birthdate VARCHAR,name VARCHAR)
SELECT birthdate FROM table_name_20 WHERE name = "raymond bonney"
Before I take CSP 100 , which other courses must I complete ?
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 var...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
What is the to par for the winnings of 232500?
CREATE TABLE table_30547 ("#" text,"Player" text,"Country" text,"Score" text,"To par" text,"Winnings ($)" real,"After" real,"Before" real)
SELECT "To par" FROM table_30547 WHERE "Winnings ($)" = '232500'
What draw has a lost less than 6 with 28 as the points?
CREATE TABLE table_name_23 (draw VARCHAR,lost VARCHAR,points VARCHAR)
SELECT draw FROM table_name_23 WHERE lost < 6 AND points = 28
Name the old bulgarian name for number 4
CREATE TABLE table_19980 ("No." real,"English name" text,"Bulgarian name" text,"Bulgarian name (Transliteration)" text,"Old Bulgarian Names" text,"Old Bulgarian name (Transliteration)" text,"Old Bulgarian name - Meaning" text)
SELECT "Old Bulgarian name - Meaning" FROM table_19980 WHERE "No." = '4'
What is the custody level of the facility in Shelton?
CREATE TABLE table_27565 ("Facility" text,"Location" text,"Year Opened" text,"Major Facility" text,"Population Gender" text,"Capacity" real,"Custody Level(s)" text)
SELECT "Custody Level(s)" FROM table_27565 WHERE "Location" = 'Shelton'
provide the number of patients whose year of birth is less than 2089 and lab test fluid is joint fluid?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2089" AND lab.fluid = "Joint Fluid"
What is the total of yards when asst. is 19, totaltk is 60 and sack is more than 0?
CREATE TABLE table_name_60 (yards INTEGER,sack VARCHAR,asst VARCHAR,totaltk VARCHAR)
SELECT SUM(yards) FROM table_name_60 WHERE asst = 19 AND totaltk = 60 AND sack > 0
high risk trauma or orthopedic patients who cannot receive anticoagulation because of increased bleeding risk, and have one or more of the following injury patterns: severe closed head injury ( gcs < 8 ) ; incomplete spinal cord injury with para or quadriplegia; complex pelvic fractures with associated long _ bone frac...
CREATE TABLE table_test_30 ("id" int,"ejection_fraction_ef" int,"multiple_long_bone_fractures" bool,"extracellular_volume_expansion" bool,"pregnancy_or_lactation" bool,"bleeding" int,"serum_potassium" float,"prosthetic_heart_valve" bool,"hbg" int,"anticoagulation" bool,"incomplete_spinal_cord_injury" bool,"complex_pelv...
SELECT * FROM table_test_30 WHERE trauma = 1 OR orthopedic = 1 AND (anticoagulation = 0 OR bleeding = 0) AND (injury_patterns = 1 OR head_injury = 1 OR gcs < 8 OR (incomplete_spinal_cord_injury = 1 AND para = 1 OR quadriplegia = 1) OR (complex_pelvic_fractures = 1 AND associated_long_bone_fractures = 1) OR multiple_lon...
How many different people directed the episode titled 'Fail Fish'?
CREATE TABLE table_30334 ("No. in series" real,"Title" text,"Directed by" text,"Story & Storyboards by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT COUNT("Directed by") FROM table_30334 WHERE "Title" = 'Fail Fish'
What is the presentation of credentials date of ra l h. castro, who has a title of ambassador extraordinary and plenipotentiary?
CREATE TABLE table_71879 ("Representative" text,"Title" text,"Presentation of Credentials" text,"Termination of Mission" text,"Appointed by" text)
SELECT "Presentation of Credentials" FROM table_71879 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Representative" = 'raúl h. castro'
What is the Home team score for the Away team of North Melbourne?
CREATE TABLE table_78150 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_78150 WHERE "Away team" = 'north melbourne'
List the types of competition and the number of competitions of each type in a bar chart, sort Y-axis in descending order.
CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE club_rank (Rank real,Club_ID int...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC
in game that had a score of 7-6 what was the attendance?
CREATE TABLE table_name_73 (attendance VARCHAR,score VARCHAR)
SELECT attendance FROM table_name_73 WHERE score = "7-6"
What date was Grimsby Town the away team?
CREATE TABLE table_name_34 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_34 WHERE away_team = "grimsby town"
What are the number of the names of catalog entries with level number 8?, sort by the Y in ascending.
CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalog_Structure (catalog_level...
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY COUNT(catalog_entry_name)
What is the most popular first name of the actors?
CREATE TABLE actor (first_name VARCHAR)
SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
What is Moondancer's Primary Military Speciality?
CREATE TABLE table_name_39 (primary_military_speciality VARCHAR,code_name VARCHAR)
SELECT primary_military_speciality FROM table_name_39 WHERE code_name = "moondancer"
Which McIntosh has a Stuart of bass, and a Linda McCartney of keyboards or drum?
CREATE TABLE table_39559 ("Paul McCartney" text,"Stuart" text,"McIntosh" text,"Whitten" text,"Linda McCartney" text)
SELECT "McIntosh" FROM table_39559 WHERE "Stuart" = 'bass' AND "Linda McCartney" = 'keyboards or drum'
What is the name of the building listed on 1977-11-23?
CREATE TABLE table_47774 ("Name" text,"Built" text,"Listed" text,"Location" text,"Borough" text)
SELECT "Name" FROM table_47774 WHERE "Listed" = '1977-11-23'
Which Score has an Opponent of @ houston, and a Record of 2-0?
CREATE TABLE table_76491 ("Date" text,"Opponent" text,"Score" text,"Leading Scorer" text,"Attendance" real,"Record" text)
SELECT "Score" FROM table_76491 WHERE "Opponent" = '@ houston' AND "Record" = '2-0'
how many times patient 009-8833 has received a antiretrovirals (hiv) procedure.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosa...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-8833')) AND treatment.treatmentname = 'antiretrovirals (hiv)'
What are the student ids for students over 20 years old?
CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)
SELECT stuid FROM student WHERE age > 20
What are the names of the scientists, and how many projects are each of them working on?
CREATE TABLE assignedto (scientist number,project text)CREATE TABLE projects (code text,name text,hours number)CREATE TABLE scientists (ssn number,name text)
SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
Who had the fastest lap in the races won by Max Papis?
CREATE TABLE table_11056278_3 (fastest_lap VARCHAR,winning_driver VARCHAR)
SELECT fastest_lap FROM table_11056278_3 WHERE winning_driver = "Max Papis"
Who is the home side when the away side score is 8.8 (56)?
CREATE TABLE table_33741 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_33741 WHERE "Away team score" = '8.8 (56)'
What year has the vehicle of open wheel and a racing series of formula one with a Nation of citizenship in Germany.
CREATE TABLE table_name_90 (year VARCHAR,nation_of_citizenship VARCHAR,type_of_vehicle VARCHAR,racing_series VARCHAR)
SELECT year FROM table_name_90 WHERE type_of_vehicle = "open wheel" AND racing_series = "formula one" AND nation_of_citizenship = "germany"
Name the most join date
CREATE TABLE table_28738 ("School" text,"Nickname" text,"Location" text,"Colors" text,"Join Date" real)
SELECT MAX("Join Date") FROM table_28738
Bar chart x axis away team y axis the number of away team, and show by the X-axis in desc.
CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team ...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY Away_team DESC
how many patients whose age is less than 41 and lab test fluid is joint fluid?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Joint Fluid"
how many points did emerson fittipaldi receive ?
CREATE TABLE table_204_584 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "points" FROM table_204_584 WHERE "driver" = 'emerson fittipaldi'
what is the number of patients whose days of hospital stay is greater than 2 and lab test name is prostate specific antigen?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.label = "Prostate Specific Antigen"
who is at the top of the chart ?
CREATE TABLE table_204_287 (id number,"outcome" text,"no." number,"date" number,"championship" text,"surface" text,"opponent in the final" text,"score in the final" text)
SELECT "opponent in the final" FROM table_204_287 WHERE id = 1
What episode titles have 20.94 million U.S. viewers?
CREATE TABLE table_20918 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "Title" FROM table_20918 WHERE "U.S. viewers (millions)" = '20.94'
who danced 11 and finished at more than a 2.0
CREATE TABLE table_18806 ("Rank by average" real,"Competition finish" real,"Couple" text,"Total" real,"Number of dances" real,"Average" text)
SELECT "Couple" FROM table_18806 WHERE "Number of dances" = '11' AND "Competition finish" > '2.0'
What round on average was a defensive tackle selected?
CREATE TABLE table_38988 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT AVG("Round") FROM table_38988 WHERE "Position" = 'defensive tackle'
What is the position number of the club with more than 24 points and a w-l-d of 8-5-3?
CREATE TABLE table_34451 ("Position" real,"Club (City/Town)" text,"Games Played" real,"W-L-D" text,"Goals For/Against" text,"Points" real)
SELECT COUNT("Position") FROM table_34451 WHERE "Points" > '24' AND "W-L-D" = '8-5-3'
What is the shipping agent code of shipping agent UPS?
CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR,shipping_agent_name VARCHAR)
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum of department_id , and group by attribute job_id, rank by the total number from high to low.
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 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 departments (DEP...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
What is the sum of the cereals of the governorate with 20,753 vegetables and less than 123,304 fruit trees?
CREATE TABLE table_12851 ("Governorate" text,"Cereals" real,"Fruit Trees" real,"Olives" real,"Industrial crops" real,"Vegetables" real)
SELECT SUM("Cereals") FROM table_12851 WHERE "Vegetables" = '20,753' AND "Fruit Trees" < '123,304'
after sedan , which township has the next highest population ?
CREATE TABLE table_203_459 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n/km2 (/sq mi)" text,"land area\nkm2 (sq mi)" text,"water area\nkm2 (sq mi)" text,"water %" text,"geographic coordinates" text)
SELECT "township" FROM table_203_459 WHERE "population" < (SELECT "population" FROM table_203_459 WHERE "township" = 'sedan') ORDER BY "population" DESC LIMIT 1
What is the sum of Year opened when the span feet is more than 1247, and the spam metres is 384?
CREATE TABLE table_7205 ("Rank" real,"Name" text,"Span metres" real,"Span feet" real,"Material" text,"Year opened" real,"Location" text,"Country" text)
SELECT SUM("Year opened") FROM table_7205 WHERE "Span feet" > '1247' AND "Span metres" = '384'
what is the length where the time is 2009
CREATE TABLE table_2846320_4 (streak VARCHAR,last_meeting VARCHAR)
SELECT streak FROM table_2846320_4 WHERE last_meeting = 2009
What player weight 235?
CREATE TABLE table_42988 ("Pos." text,"Player" text,"Team" text,"Height" text,"Weight" real)
SELECT "Player" FROM table_42988 WHERE "Weight" = '235'
For those employees who do not work in departments with managers that have ids between 100 and 200, return a line chart about the change of manager_id over hire_date , order from low to high by the x-axis.
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 regions (REGION_ID decimal(5,0),REGIO...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
What percentage of users were using Firefox during the period in which *0.77% were using Netscape?
CREATE TABLE table_13304 ("Period" text,"Internet Explorer" text,"Firefox" text,"Safari" text,"Opera" text,"Netscape" text,"Other Mozilla" text)
SELECT "Firefox" FROM table_13304 WHERE "Netscape" = '*0.77%'
When were 668 units produced?
CREATE TABLE table_17690 ("Quattroporte IV" text,"Units Produced" real,"Production Period" text,"Engine Capacity" text,"Power" text,"Max Speed" text)
SELECT "Production Period" FROM table_17690 WHERE "Units Produced" = '668'
Select all questions with ONLY a specific tag..
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT Id AS "post_link" FROM Posts WHERE LOWER(Tags) = '<' + @Tag + '>'
how many hours has it been since the first time in this hospital visit that patient 027-85328 has been diagnosed with atrial fibrillation - with rapid ventricular response?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid numbe...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328...
How many tracks have the title let love be your energy?
CREATE TABLE table_74308 ("Track no." real,"Track" text,"Original Artist" text,"Soloist(s)" text,"Vocal Percussionist(s)" text,"Arranger(s)" text)
SELECT COUNT("Track no.") FROM table_74308 WHERE "Track" = 'Let Love Be Your Energy'
specify ethnic origin of patient id 2560
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = "2560"
How much Silver has a Rank of 1, and a Bronze smaller than 3?
CREATE TABLE table_79514 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Silver") FROM table_79514 WHERE "Rank" = '1' AND "Bronze" < '3'
What is the report status of Hockenheimring circuit?
CREATE TABLE table_53344 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text)
SELECT "Report" FROM table_53344 WHERE "Circuit" = 'hockenheimring'
What was the record when chicago was the visiting team?
CREATE TABLE table_name_98 (record VARCHAR,visitor VARCHAR)
SELECT record FROM table_name_98 WHERE visitor = "chicago"
For the Tie number of 14 who was the away team?
CREATE TABLE table_40375 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Away team" FROM table_40375 WHERE "Tie no" = '14'
What is the score at the 2010 FIFA World Cup Qualification that results in a win?
CREATE TABLE table_name_6 (score VARCHAR,competition VARCHAR,result VARCHAR)
SELECT score FROM table_name_6 WHERE competition = "2010 fifa world cup qualification" AND result = "win"
What is the date of game 3 with Boston as the road team?
CREATE TABLE table_name_56 (date VARCHAR,road_team VARCHAR,game VARCHAR)
SELECT date FROM table_name_56 WHERE road_team = "boston" AND game = "game 3"
What day was there a hard surface when the partner was Marc Gicquel?
CREATE TABLE table_62292 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Date" FROM table_62292 WHERE "Surface" = 'hard' AND "Partner" = 'marc gicquel'
Who are the studio analysts for the year 2008-09?
CREATE TABLE table_72592 ("Year" text,"Channel" text,"Play-by-play" text,"Color commentator(s)" text,"Courtside reporter" text,"Studio host" text,"Studio analysts" text)
SELECT "Studio analysts" FROM table_72592 WHERE "Year" = '2008-09'
Top 250 users from BD.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserD...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, LastAccessDate FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd%' ORDER BY Reputation DESC LIMIT 250
Who was the Home team in Tie #23?
CREATE TABLE table_62577 ("Tie no" real,"Home team" text,"Score" text,"Away team" text,"Attendance" real)
SELECT "Home team" FROM table_62577 WHERE "Tie no" = '23'
How many dams are there in the Lake and Peninsula area?
CREATE TABLE table_22054 ("# s Dam and GNIS query Link" real,"# s Lake and GNIS query Link" real,"# s Reservoir and GNIS query Link" real,"Borough or Census area" text,"Comment" text)
SELECT MAX("# s Dam and GNIS query Link") FROM table_22054 WHERE "Borough or Census area" = 'Lake and Peninsula'
Wich rank is given to the Canton of Schaffhausen?
CREATE TABLE table_63628 ("Rank" real,"Canton" text,"Highest point" text,"Highest elevation" text,"Lowest point" text,"Lowest elevation" text)
SELECT SUM("Rank") FROM table_63628 WHERE "Canton" = 'schaffhausen'
what is the latitude in the township where wate is 0.288
CREATE TABLE table_1915 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real)
SELECT "Latitude" FROM table_1915 WHERE "Water (sqmi)" = '0.288'
who lived longer evelyn irons or arturo islas ?
CREATE TABLE table_203_449 (id number,"name" text,"lifetime" text,"nationality" text,"notable as" text,"notes" text)
SELECT "name" FROM table_203_449 WHERE "name" IN ('evelyn irons', 'arturo islas') ORDER BY "lifetime" - "lifetime" DESC LIMIT 1
In how many counties did McCain get 65.72% of the votes?
CREATE TABLE table_20799587_1 (county VARCHAR,mccain_percentage VARCHAR)
SELECT COUNT(county) FROM table_20799587_1 WHERE mccain_percentage = "65.72%"
what is the death status and procedure for the patient id 3623?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "3623"
what is the average tie no when the home team is stamford a.f.c.?
CREATE TABLE table_10434 ("Tie no" real,"Home team" text,"Score" text,"Away team" text,"Attendance" real)
SELECT AVG("Tie no") FROM table_10434 WHERE "Home team" = 'stamford a.f.c.'
Group and count details for the events using a bar chart.
CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Ser...
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details
Which Byes have Losses larger than 0, and an Against larger than 3049?
CREATE TABLE table_name_7 (byes INTEGER,losses VARCHAR,against VARCHAR)
SELECT AVG(byes) FROM table_name_7 WHERE losses > 0 AND against > 3049
What is the average of all the wickets that were 27?
CREATE TABLE table_28797906_3 (average VARCHAR,wickets VARCHAR)
SELECT average FROM table_28797906_3 WHERE wickets = 27
show me the round trip flights between PHOENIX and SALT LAKE CITY
CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREAT...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LAKE CITY' AND NOT fare.round_trip_cost IS NULL AND flight_fare.f...
When did the episode with season number 10b air for the first time?
CREATE TABLE table_907 ("No. in series" text,"No. in season" text,"Title" text,"Directed by" text,"Written by" text,"Storyboarded by" text,"Original air date" text,"Production code" text)
SELECT "Original air date" FROM table_907 WHERE "No. in season" = '10b'
Which event had the record of 18 5 (1)?
CREATE TABLE table_48562 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Time" text,"Location" text)
SELECT "Event" FROM table_48562 WHERE "Record" = '18–5 (1)'
select * from posts.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT * FROM Posts
What was the location and attendance when lebron james (10) had the high assists?
CREATE TABLE table_3845 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Location Attendance" FROM table_3845 WHERE "High assists" = 'LeBron James (10)'