table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
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 t...
what are the four most commonly ordered microbiology tests for patients who had received external pacemaker before within the same month since 2105?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'external pacemaker' AND STRFTIME('%y', treat...
CREATE TABLE table_62133 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
What is the party affiliation of Virginia Foxx?
SELECT "Party" FROM table_62133 WHERE "Incumbent" = 'virginia foxx'
CREATE TABLE table_51963 ( "Train No." text, "Train Name" text, "Origin" text, "Destination" text, "Frequency" text )
What is the frequency of the Chennai Egmore Dibrugarh Express to Dibrugarh?
SELECT "Frequency" FROM table_51963 WHERE "Destination" = 'dibrugarh' AND "Train Name" = 'chennai egmore dibrugarh express'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
when was patient 030-21071's first maximum mch a month before?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of mont...
CREATE TABLE table_224837_4 ( date_successor_seated VARCHAR, reason_for_change VARCHAR )
Name the date successor seated for contested election; served until february 14, 1794
SELECT date_successor_seated FROM table_224837_4 WHERE reason_for_change = "Contested election; served until February 14, 1794"
CREATE TABLE table_73518 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the team for january 4
SELECT "Team" FROM table_73518 WHERE "Date" = 'January 4'
CREATE TABLE table ( h VARCHAR, c__max_ VARCHAR )
Name the h when c max is 99
SELECT h FROM table WHERE c__max_ = 99
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 T...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time, and display by the y axis in descending.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
CREATE TABLE table_28000 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real )
Who were the guests for the episode with an original airdate of december 07?
SELECT "Guest" FROM table_28000 WHERE "Original airdate" = 'December 07'
CREATE TABLE table_name_51 ( position VARCHAR, pick VARCHAR, round VARCHAR )
What is position of the player with a pick number greater than 315 and a round of 30?
SELECT position FROM table_name_51 WHERE pick > 315 AND round = 30
CREATE TABLE table_name_6 ( player VARCHAR, college VARCHAR )
What Player is from Iowa State?
SELECT player FROM table_name_6 WHERE college = "iowa state"
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
Can you name for me the classes that can be taken as MDE next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_i...
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
which airlines fly from BOSTON to WASHINGTON but stopover in some other city
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTO...
CREATE TABLE table_7139 ( "Model number" text, "Frequency" text, "L2 cache" text, "Multi 1" text, "Voltage" real, "Socket" text, "Release date" text, "Order part number" text )
Which model number has an order part number of TMDML44BKX5LD?
SELECT "Model number" FROM table_7139 WHERE "Order part number" = 'tmdml44bkx5ld'
CREATE TABLE table_name_43 ( medal VARCHAR, name VARCHAR, games VARCHAR )
Which Medal had a Name of f lix s nchez, and a Games of 2012 london?
SELECT medal FROM table_name_43 WHERE name = "félix sánchez" AND games = "2012 london"
CREATE TABLE table_65434 ( "Date" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text )
What date was the result 3-1 in Hague?
SELECT "Date" FROM table_65434 WHERE "Result" = '3-1' AND "Location" = 'hague'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what number of patients under the age of 27 underwent the lab test for creatine kinase (ck)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "27" AND lab.label = "Creatine Kinase (CK)"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose discharge location is snf and diagnoses long title is schizoaffective disorder, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Schizoaffective disorder, unspecified"
CREATE TABLE table_43793 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
Name the No. 10 which has a No. 8 of jackson, and a No. 9 of jayden?
SELECT "No. 10" FROM table_43793 WHERE "No. 8" = 'jackson' AND "No. 9" = 'jayden'
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 SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, ...
Return a scatter chart showing the relationship between major id and minimum age.
SELECT Major, MIN(Age) FROM Student GROUP BY Major
CREATE TABLE table_name_3 ( team_2 VARCHAR )
What was the 1st leg when Team 2 was Aurora?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_2 = "aurora"
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40...
Show the average transaction amount for different transaction types.
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code
CREATE TABLE table_name_39 ( losses INTEGER, byes VARCHAR, wins VARCHAR, against VARCHAR )
How many losses for the team with less than 4 wins, more than 0 byes and 2510 against?
SELECT AVG(losses) FROM table_name_39 WHERE wins < 4 AND against = 2510 AND byes > 0
CREATE TABLE table_225093_4 ( district VARCHAR, vacator VARCHAR )
Which district has John Culpepper (f) as the vacator?
SELECT district FROM table_225093_4 WHERE vacator = "John Culpepper (F)"
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
please list all the flights from BOSTON to SAN FRANCISCO leaving before 1000
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND flight.to_airport = AIRPORT_SERVICE_1...
CREATE TABLE table_2379 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Name the original title for not nominated result with report on death
SELECT "Original title" FROM table_2379 WHERE "Result" = 'Not Nominated' AND "Film title used in nomination" = 'Report on Death'
CREATE TABLE table_1274 ( "School" text, "Nickname" text, "Colors" text, "League" text, "Class" text, "Division" text )
What league does Delaware Military Academy belong to
SELECT "League" FROM table_1274 WHERE "School" = 'Delaware Military Academy'
CREATE TABLE table_name_50 ( artist VARCHAR, place VARCHAR, percentage VARCHAR )
What Artist has a Place of 3 or less with a Percentage of 38.60%?
SELECT artist FROM table_name_50 WHERE place < 3 AND percentage = "38.60%"
CREATE TABLE table_name_31 ( position INTEGER, drawn VARCHAR, points_1 VARCHAR, goals_for VARCHAR )
what is the position when the points 1 is less than 36, goals for is less than 40 and drawn is less than 9?
SELECT SUM(position) FROM table_name_31 WHERE points_1 < 36 AND goals_for < 40 AND drawn < 9
CREATE TABLE table_name_7 ( school_club_team VARCHAR, pick VARCHAR )
Which School/Club Team has a Pick of 198?
SELECT school_club_team FROM table_name_7 WHERE pick = 198
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE faculty ( facid number, lname text, fname text, ...
Find the name of the department that has the biggest number of students minored in?
SELECT T1.dname FROM department AS T1 JOIN minor_in AS T2 ON T1.dno = T2.dno GROUP BY T2.dno ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_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, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, I want to display in desc by the sum department id.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
CREATE TABLE table_name_75 ( visitor VARCHAR, date VARCHAR )
Who was the visitor on October 31?
SELECT visitor FROM table_name_75 WHERE date = "october 31"
CREATE TABLE table_name_10 ( party VARCHAR, member VARCHAR )
Which party is sydney sampson a member of?
SELECT party FROM table_name_10 WHERE member = "sydney sampson"
CREATE TABLE table_42279 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" real, "Team" text )
What did the Dallara chassis with a 5 start in 2006 finish?
SELECT "Finish" FROM table_42279 WHERE "Chassis" = 'dallara' AND "Start" = '5' AND "Year" = '2006'
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of job_id and salary , rank by the X-axis in asc.
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 JOB_ID
CREATE TABLE table_31381 ( "Value" text, "Dimensions" text, "Main Color" text, "Obverse" text, "Reverse" text, "Watermark" text, "Date of issue" text )
How many different dates of issue are the for the coin with kumsusan memorial palace on the obverse?
SELECT COUNT("Date of issue") FROM table_31381 WHERE "Obverse" = 'Kumsusan Memorial Palace'
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Draw a bar chart for what are the different ship flags, and how many ships have each?, rank by the X-axis in desc.
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag DESC
CREATE TABLE table_name_62 ( years VARCHAR, character VARCHAR )
What years have joyce couwenberg as the character?
SELECT years FROM table_name_62 WHERE character = "joyce couwenberg"
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, ...
when was the last measuring of respiration of patient 004-64091 yesterday?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND NOT vitalperiodic.respiration IS N...
CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, time text ) CREATE TABLE record ( id number, result text, swimmer_id number, event...
Find the country that has the most stadiums.
SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_2651755_1 ( independent_regional_force VARCHAR, democratic_coalition VARCHAR )
Who is the independent regional force when democratic coalition is (r) jorge tarud ( ppd )?
SELECT independent_regional_force FROM table_2651755_1 WHERE democratic_coalition = "(R) Jorge Tarud ( PPD )"
CREATE TABLE table_48778 ( "Title" text, "Season" real, "Director" text, "Teleplay" text, "First Broadcast" text )
What is Teleplay, when Director is 'George McCowan', when Season is less than 1.1400000000000001, and when First Broadcast is April 3, 1981?
SELECT "Teleplay" FROM table_48778 WHERE "Director" = 'george mccowan' AND "Season" < '1.1400000000000001' AND "First Broadcast" = 'april 3, 1981'
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
For each director, how many reviews have they received Visualize by bar chart, and order in asc by the names.
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director
CREATE TABLE table_name_38 ( airport VARCHAR )
Which 2011 has an Airport of bole international airport?
SELECT MAX(2011) FROM table_name_38 WHERE airport = "bole international airport"
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of All_Road and All_Games_Percent in a bar chart, and rank by the Y in asc.
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
CREATE TABLE table_60085 ( "Year" real, "Round" real, "Pick" real, "Overall" real, "Player name" text, "Position" text, "AFL team" text )
What is the smallest Pick with Overall larger than 17, a Player name of dave adams category:articles with hcards, and a Year larger than 1963?
SELECT MIN("Pick") FROM table_60085 WHERE "Overall" > '17' AND "Player name" = 'dave adams category:articles with hcards' AND "Year" > '1963'
CREATE TABLE table_9826 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text )
What is GPU Frequency, when Model Number is Atom N435?
SELECT "GPU frequency" FROM table_9826 WHERE "Model number" = 'atom n435'
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CRE...
What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?
SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'
CREATE TABLE table_name_23 ( number INTEGER, player VARCHAR, yards VARCHAR )
What is Larry Centers' average number when there were less than 600 yards?
SELECT AVG(number) FROM table_name_23 WHERE player = "larry centers" AND yards < 600
CREATE TABLE table_name_3 ( penanced VARCHAR, number_of_autos_da_fé_with_known_sentences VARCHAR )
How many were penanced when the number with known sentences was 71 (1600 1773)?
SELECT penanced FROM table_name_3 WHERE number_of_autos_da_fé_with_known_sentences = "71 (1600–1773)"
CREATE TABLE table_40501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What is the Team with a Score that is w 101 97 (2ot)?
SELECT "Team" FROM table_40501 WHERE "Score" = 'w 101–97 (2ot)'
CREATE TABLE table_52601 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Trofeo Fast Team" text )
Which General classification has a Stage of 7?
SELECT "General classification" FROM table_52601 WHERE "Stage" = '7'
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id numbe...
in 2105, patient 28600 has made an admission?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 28600 AND STRFTIME('%y', admissions.admittime) = '2105'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
since 37 months ago, what was the last drug patient 005-77687 was prescribed via the imv route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.routeadmin = 'imv' AND DATETIME(medicat...
CREATE TABLE table_43940 ( "Rank" text, "Event" text, "Place" text, "Name" text, "Prize" text )
What is Prize, when Name is 'Valdemar Kwaysser'?
SELECT "Prize" FROM table_43940 WHERE "Name" = 'valdemar kwaysser'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients on pb route of drug administration who are diagnosed with hypothyroidism nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypothyroidism NOS" AND prescriptions.route = "PB"
CREATE TABLE table_10416 ( "7:00 PM" text, "8:00 PM" text, "8:30 PM" text, "9:00 PM" text, "9:30 PM" text, "10:00 PM" text )
9:30 PM when the 8:00 PM is l'auberge du chien noir?
SELECT "9:30 PM" FROM table_10416 WHERE "8:00 PM" = 'l''auberge du chien noir'
CREATE TABLE table_1341604_39 ( candidates VARCHAR, incumbent VARCHAR )
What are the candidates in the district whose incumbent is Gus Yatron?
SELECT candidates FROM table_1341604_39 WHERE incumbent = "Gus Yatron"
CREATE TABLE table_name_97 ( outcome VARCHAR, opponent_in_final VARCHAR )
Name the outcome for aliz cornet janette hus rov being opponent in final
SELECT outcome FROM table_name_97 WHERE opponent_in_final = "alizé cornet janette husárová"
CREATE TABLE table_24955 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
Name the most rank for 2 gold
SELECT MIN("Rank") FROM table_24955 WHERE "Gold" = '2'
CREATE TABLE table_204_161 ( id number, "name" text, "1968 cf\ndesignator" text, "place of\nmanufacture" text, "primary\nrole(s)" text, "service\nperiod" text, "#\nused" number )
number of models manufactured in france
SELECT COUNT("name") FROM table_204_161 WHERE "place of\nmanufacture" = 'france'
CREATE TABLE table_name_84 ( yacht VARCHAR, syndicate VARCHAR )
Which Yacht Club is part of the America 3 Foundation syndicate on the America 3 yacht?
SELECT yacht AS Club FROM table_name_84 WHERE syndicate = "america 3 foundation" AND yacht = "america 3"
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 re...
Show weight from each date of birth, list X in desc order.
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC
CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE batting_postseason ( year INTEGER, r...
I want to see trend of the number of yearid by yearid, and display x-axis in ascending order.
SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid
CREATE TABLE table_74668 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team for punt road oval?
SELECT "Home team" FROM table_74668 WHERE "Venue" = 'punt road oval'
CREATE TABLE table_name_4 ( district_residence VARCHAR, name VARCHAR )
Name of choice b. Randell is the name of which District Residence?
SELECT district_residence FROM table_name_4 WHERE name = "choice b. randell"
CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id...
What is the famous release date of the artist with the oldest age?
SELECT famous_release_date FROM artist ORDER BY age DESC LIMIT 1
CREATE TABLE table_41386 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" text )
Which rank has canada as the country?
SELECT "Rank" FROM table_41386 WHERE "Country" = 'canada'
CREATE TABLE table_5427 ( "Locale" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What's Ontario's highest Ends Lost?
SELECT MAX("Ends Lost") FROM table_5427 WHERE "Locale" = 'ontario'
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Find the Unikitties!(For The Bridge). Made to annoy nobody!
SELECT Users.Id AS "user_link", Reputation, Views AS "profile_views" FROM Users WHERE NOT AccountId IS NULL AND Users.DisplayName LIKE 'Uni%' ORDER BY DisplayName DESC LIMIT 1000
CREATE TABLE table_name_30 ( runner_up VARCHAR, tournament VARCHAR )
Tell me the runner-up for majorca
SELECT runner_up FROM table_name_30 WHERE tournament = "majorca"
CREATE TABLE table_27514362_7 ( pos VARCHAR, car_make VARCHAR, driver VARCHAR )
What is the finish position for cars by Pontiac driven by Bobby Hamilton?
SELECT pos FROM table_27514362_7 WHERE car_make = "Pontiac" AND driver = "Bobby Hamilton"
CREATE TABLE table_38012 ( "Name" text, "Life" text, "Age at death" text, "First contact with Hitler" text, "Relationship" text )
When did the woman who died at 31 first contact Hitlers?
SELECT "First contact with Hitler" FROM table_38012 WHERE "Age at death" = '31'
CREATE TABLE table_204_997 ( id number, "#" text, "title" text, "celebrity guest(s)" text, "directed by" text, "written by" text, "original airdate" text )
which episode aired after marion the superfluous feed character ?
SELECT "title" FROM table_204_997 WHERE id = (SELECT id FROM table_204_997 WHERE "title" = '"marion the superfluous feed character"') + 1
CREATE TABLE table_name_67 ( lost VARCHAR, points VARCHAR )
What lost has 86 points?
SELECT lost FROM table_name_67 WHERE points = "86"
CREATE TABLE table_name_75 ( silver INTEGER, rank VARCHAR, gold VARCHAR )
What is the hioghest amount of silver medals for a nation ranked higher than 19 and less than 2 gold medals?
SELECT MAX(silver) FROM table_name_75 WHERE rank = "19" AND gold < 2
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of All_Neutral and ACC_Percent in a bar chart.
SELECT All_Neutral, ACC_Percent FROM basketball_match
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
what are the three year survival rates of patients who had been prescribed lisinopril 2.5 mg po tabs after having been diagnosed with valvular insufficiency - tricuspid valve?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
CREATE TABLE table_name_27 ( winner_nominee_s_ VARCHAR, year VARCHAR )
Who were the winner and nominees in 2001?
SELECT winner_nominee_s_ FROM table_name_27 WHERE year = 2001
CREATE TABLE table_68750 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the total attendance at games with a score of 4-2?
SELECT COUNT("Attendance") FROM table_68750 WHERE "Score" = '4-2'
CREATE TABLE table_2774 ( "Episode" text, "Location" text, "Headliner" text, "Comedians" text, "Airdate" text )
Who were the comedians during the episode located in Birmingham Hippodrome?
SELECT "Comedians" FROM table_2774 WHERE "Location" = 'Birmingham Hippodrome'
CREATE TABLE table_33636 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
What was the Browns record after they played the game at the Paul Brown stadium?
SELECT "Record" FROM table_33636 WHERE "Stadium" = 'paul brown stadium'
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a bar chart on what is the average age for each gender?, and rank by the y-axis from low to high.
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age)
CREATE TABLE table_43741 ( "Season" real, "Overall" real, "Slalom" text, "Giant Slalom" real, "Super G" text, "Downhill" text, "Combined" text )
What season had a downhill of 35 and overall greater than 21?
SELECT COUNT("Season") FROM table_43741 WHERE "Downhill" = '35' AND "Overall" > '21'
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
Top 100 users from Bangladesh.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR UPPER(Location) LIKE '%bd' ORDER BY Reputation DESC LIMIT 100
CREATE TABLE table_67422 ( "Company" text, "Type" text, "Principal activities" text, "Incorporated in" text, "Group's Equity Shareholding (10 March 2010)" text )
Name the incorporated for principal activites of travel agency
SELECT "Incorporated in" FROM table_67422 WHERE "Principal activities" = 'travel agency'
CREATE TABLE table_18734298_1 ( no_in_series VARCHAR, directed_by VARCHAR )
How many series were directed by Rob Renzetti?
SELECT COUNT(no_in_series) FROM table_18734298_1 WHERE directed_by = "Rob Renzetti"
CREATE TABLE film ( Film_ID VARCHAR ) CREATE TABLE film_market_estimation ( Film_ID VARCHAR )
What is the title of the film that has the highest high market estimation.
SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
CREATE TABLE table_38607 ( "Team" text, "Recopa 1995" text, "Supercopa 1995" text, "CONMEBOL 1995" text, "Copa Libertadores 1996" text )
Which Team has a round 1 CONMEBOL 1995?
SELECT "Team" FROM table_38607 WHERE "CONMEBOL 1995" = 'round 1'
CREATE TABLE table_46084 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Score on January 23?
SELECT "Score" FROM table_46084 WHERE "Date" = 'january 23'
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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 employees ( EMPLOYE...
Bar chart of department_id from each first name, and show in ascending by the y-axis.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID
CREATE TABLE table_41525 ( "Outcome" text, "Year" text, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
In what year was Xavier Malisse the runner-up with scores of 4 6, 6 4, [8 10]?
SELECT "Year" FROM table_41525 WHERE "Outcome" = 'runner-up' AND "Score" = '4–6, 6–4, [8–10]'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
when was the last time that patient 022-199074 was prescribed a medication via the oral mucosa route in their current hospital visit?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL)) AND me...
CREATE TABLE table_name_47 ( venue VARCHAR, home_team VARCHAR )
Which Venue was used when the Home team was geelong?
SELECT venue FROM table_name_47 WHERE home_team = "geelong"
CREATE TABLE table_name_13 ( game_modes VARCHAR, pinyin VARCHAR )
Which game modes have Pinyin of ch oj m l u sh ji ?
SELECT game_modes FROM table_name_13 WHERE pinyin = "chāojí mǎlìōu shìjiè"
CREATE TABLE table_74203 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "U.S. viewers (millions)" text )
how man episodes in the season were titled 'that's so sonny'?
SELECT COUNT("No. in season") FROM table_74203 WHERE "Title" = 'That''s So Sonny'
CREATE TABLE table_36661 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real )
What is total amount of points for the 2007 season?
SELECT SUM("Points") FROM table_36661 WHERE "Season" = '2007'
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
where is jamerican cuisine in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.id = location.restaurant_id AND restaurant.name = 'jamerican cuisine'
CREATE TABLE table_name_12 ( nationality VARCHAR, pick VARCHAR )
Name the nationality for pick of 16
SELECT nationality FROM table_name_12 WHERE pick = 16