table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_38581 ( "Designation HD" text, "Constellation" text, "Date sent" text, "Arrival date" text, "Message" text )
What date sent has cygnus as a constellation, and hd 190360 as a designation HD?
SELECT "Date sent" FROM table_38581 WHERE "Constellation" = 'cygnus' AND "Designation HD" = 'hd 190360'
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Group and count brand for each camera lens using a bar chart, list in desc by the total number.
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand) DESC
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, marital_status text, age text, dob te...
count the number of patients whose gender is f and primary disease is hypertension;rule out coronary artery disease\cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( Id number, Name text...
Answers with no links or blockquotes.
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate AS "Date Posted", Score, Body FROM Posts WHERE PostTypeId = 2 AND NOT Body LIKE '%http%' AND NOT Body LIKE '%blockquote%' ORDER BY CreationDate DESC
CREATE TABLE table_name_78 ( species VARCHAR, length__bp_aa_ VARCHAR )
Which Species has a Length (bp/aa) of 1154bp/358aa?
SELECT species FROM table_name_78 WHERE length__bp_aa_ = "1154bp/358aa"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what was the organism found in the first nasopharynx test of patient 031-4987 when they visited the hospital first time?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the correlation between ACC_Percent and All_Games_Percent , and group by attribute All_Home in a scatter chart.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Home
CREATE TABLE table_name_82 ( driver VARCHAR, sponsor VARCHAR )
Who drives for the sponsor w.h. bolin?
SELECT driver FROM table_name_82 WHERE sponsor = "w.h. bolin"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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,...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, rank in ascending by the total number.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY)
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
Find the top 3 artists who have the largest number of songs works whose language is Bangla.
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3
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_p...
What prerequisite courses fall before MCDB 415 ?
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...
CREATE TABLE web_client_accelerator ( name VARCHAR, operating_system VARCHAR, CONNECTION VARCHAR )
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband'
CREATE TABLE table_16799784_12 ( year_named INTEGER, name VARCHAR )
What is the highest year named for the name Tie Fluctus?
SELECT MAX(year_named) FROM table_16799784_12 WHERE name = "Tie Fluctus"
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
2018 Slowest Gun In The West.
SELECT A.Id AS "post_link", A.Score, U.DisplayName FROM Posts AS A JOIN Posts AS Q ON A.ParentId = Q.Id JOIN Users AS U ON A.OwnerUserId = U.Id WHERE YEAR(A.CreationDate) = 2018 AND NOT Q.Tags LIKE '%tips%' AND NOT EXISTS(SELECT * FROM Posts AS A2 WHERE A2.ParentId = Q.Id AND CAST((JULIANDAY(CreationDate) - JULIANDAY(Q...
CREATE TABLE table_60240 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the date of the 42 Against?
SELECT "Date" FROM table_60240 WHERE "Against" = '42'
CREATE TABLE table_73891 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
the first episode in this season had what number in the series?
SELECT MIN("No. in series") FROM table_73891
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 ( ...
out of total number of patients who had a lab test for other body fluid, how many of them remained admitted in hospital for more than 10 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "10" AND lab.fluid = "Other Body Fluid"
CREATE TABLE table_25468 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who did the high points in the game played on December 2?
SELECT "High points" FROM table_25468 WHERE "Date" = 'December 2'
CREATE TABLE table_name_74 ( high_rebounds VARCHAR, opponent VARCHAR )
Who had the most rebounds in the game against New York?
SELECT high_rebounds FROM table_name_74 WHERE opponent = "new york"
CREATE TABLE table_name_48 ( margin_of_victory VARCHAR, runner_s__up VARCHAR )
What was the margin of victory when the runner-up was Janet Coles?
SELECT margin_of_victory FROM table_name_48 WHERE runner_s__up = "janet coles"
CREATE TABLE table_48549 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the home team against the away team Norwich City?
SELECT "Home team" FROM table_48549 WHERE "Away team" = 'norwich city'
CREATE TABLE table_204_56 ( id number, "year" number, "song" text, "us r&b" number, "us rap" number, "album" text )
songs by del the funky homosapien that were within the top 30 rap singles chart -lrb- us -rrb-
SELECT "song" FROM table_204_56 WHERE "us rap" <= 30
CREATE TABLE table_43870 ( "Score" text, "Batsmen" text, "Against" text, "Location" text, "Year" text )
What is the score in 1929?
SELECT "Score" FROM table_43870 WHERE "Year" = '1929'
CREATE TABLE table_name_26 ( country VARCHAR, to_par VARCHAR, player VARCHAR )
What Country is Player Sam Snead with a To par of less than 5 from?
SELECT country FROM table_name_26 WHERE to_par < 5 AND player = "sam snead"
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
In CS-LSA courses can I see the hardness ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id
CREATE TABLE table_12995531_3 ( episode_number INTEGER, total_viewers VARCHAR )
what is the episode number where the total viewers is 614000?
SELECT MIN(episode_number) FROM table_12995531_3 WHERE total_viewers = 614000
CREATE TABLE table_name_32 ( total VARCHAR, nation VARCHAR, place VARCHAR )
What is the total of Greece, which is placed below 8?
SELECT COUNT(total) FROM table_name_32 WHERE nation = "greece" AND place > 8
CREATE TABLE table_26736342_1 ( directed_by VARCHAR, us_viewers__millions_ VARCHAR )
Who directed the eposide that was watched by 1.95 million US viewers?
SELECT directed_by FROM table_26736342_1 WHERE us_viewers__millions_ = "1.95"
CREATE TABLE table_name_19 ( elected INTEGER, incumbent VARCHAR, district VARCHAR )
What year was Incumbent Ed Towns elected with a district smaller than 10?
SELECT AVG(elected) FROM table_name_19 WHERE incumbent = "ed towns" AND district < 10
CREATE TABLE table_name_13 ( league VARCHAR, position VARCHAR, goals VARCHAR )
Position of 7th of 24, and a Goals smaller than 24 is what league?
SELECT league FROM table_name_13 WHERE position = "7th of 24" AND goals < 24
CREATE TABLE table_204_111 ( id number, "name" text, "animal type" text, "introduced" number, "reintroduced" text, "retired" number, "beanie baby resembled" text )
which animal type has the most pillow pals ?
SELECT "animal type" FROM table_204_111 GROUP BY "animal type" ORDER BY COUNT("name") DESC LIMIT 1
CREATE TABLE table_name_50 ( score VARCHAR, december INTEGER )
after december 29 what is the score?
SELECT score FROM table_name_50 WHERE december > 29
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 )
Show me a bar chart for how many captains with younger than 50 are in each rank?, and rank Y-axis in descending order.
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*) DESC
CREATE TABLE table_59139 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text )
With a statistic of most points, what is the stage?
SELECT "Stage" FROM table_59139 WHERE "Statistic" = 'most points'
CREATE TABLE table_2361911_2 ( regular_season VARCHAR, playoffs VARCHAR )
Name the regular season for final playoffs
SELECT regular_season FROM table_2361911_2 WHERE playoffs = "Final"
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Would RCIDIV 351 count towards ULCS ?
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'RCIDIV' AND course.number = 351 AND program_course.category LIKE '%ULCS%'
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
Return a histogram on how many professors have a PhD in each department?, and I want to rank by the X-axis in asc.
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY DEPT_CODE
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, ...
select count(id) from posts where tags contains 'golang' or 'go'.
SELECT COUNT(Id) FROM Posts WHERE (Tags LIKE '%c%' OR Tags LIKE '%c++%') AND Body LIKE '%<code>%'
CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real ) CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text )
Compute the total the total number across publisher as a pie chart.
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
what is the yearly minimum amount of cortisol patient 3267 has until 51 months ago?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cortisol') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-5...
CREATE TABLE county ( County_name VARCHAR, Population VARCHAR )
Return the names of all counties sorted by population in ascending order.
SELECT County_name FROM county ORDER BY Population
CREATE TABLE table_2764267_2 ( country VARCHAR, currency VARCHAR )
Name the country for the us dollar
SELECT country FROM table_2764267_2 WHERE currency = "US dollar"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is the minimum age of patients who got admitted in emergency and gangrene as the primary disease?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GANGRENE"
CREATE TABLE table_26748252_1 ( written_by VARCHAR, us_viewers__in_millions_ VARCHAR )
How many people wrote the episode with 3.40 million U.S viewers?
SELECT COUNT(written_by) FROM table_26748252_1 WHERE us_viewers__in_millions_ = "3.40"
CREATE TABLE film_text ( film_id number, title text, description text ) CREATE TABLE language ( language_id number, name text, last_update time ) CREATE TABLE film_category ( film_id number, category_id number, last_update time ) CREATE TABLE payment ( payment_id number, c...
Return the most common full name among all actors.
SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_name_19 ( film VARCHAR, winner_nominee_s_ VARCHAR, result VARCHAR )
Which film was Eddie Murphy nominated for?
SELECT film FROM table_name_19 WHERE winner_nominee_s_ = "eddie murphy" AND result = "nominated"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
what is minimum age of patients whose age is greater than or equal to 71 and days of hospital stay is 34?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "71" AND demographic.days_stay = "34"
CREATE TABLE table_203_775 ( id number, "week" number, "date" text, "opponent" text, "result" text, "game site" text, "attendance" number )
how many games had at least 10,000 people in attendance ?
SELECT COUNT(*) FROM table_203_775 WHERE "attendance" >= 10000
CREATE TABLE table_49380 ( "Result" text, "Race" text, "Distance" text, "Weight" real, "Winner or 2nd" text, "Pos'n" text )
What is the winner or 2nd of the race with a 2nd pos'n and a weight lighter than 8.1?
SELECT "Winner or 2nd" FROM table_49380 WHERE "Pos'n" = '2nd' AND "Weight" < '8.1'
CREATE TABLE table_38649 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which 2010 has a Tournament of australian open?
SELECT "2010" FROM table_38649 WHERE "Tournament" = 'australian open'
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the correlation between code and code , and group by attribute name in a scatter chart.
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
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, ...
Provide the number of patients that survived and have a diagnosis icd9 code of 99662.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "99662"
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
Show me the total number of the flag of ships that are not steered by any captain with Midshipman rank using a bar graph, and I want to rank total number in asc order please.
SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY COUNT(Flag)
CREATE TABLE table_name_41 ( votes VARCHAR, candidate VARCHAR )
Candidate of riikka manner has how many votes?
SELECT votes FROM table_name_41 WHERE candidate = "riikka manner"
CREATE TABLE table_37847 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What date has boston as the visitor?
SELECT "Date" FROM table_37847 WHERE "Visitor" = 'boston'
CREATE TABLE table_66278 ( "Date Released" text, "Polling institute" text, "Social Democratic" text, "Socialist" text, "Green-Communist" text, "People's Party" text, "Left Bloc" text, "Lead" text )
What is the date released when the Left Bloc had 3.2%?
SELECT "Date Released" FROM table_66278 WHERE "Left Bloc" = '3.2%'
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...
show me FIRST class flights one way TAMPA to ST. LOUIS
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, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1....
CREATE TABLE table_25708 ( "Date" text, "Location" text, "Opponent" text, "Cardinal Points" real, "Opp. Points" real, "Record" text )
Name the cardinal points for 19-4 record
SELECT MIN("Cardinal Points") FROM table_25708 WHERE "Record" = '19-4'
CREATE TABLE table_name_8 ( place VARCHAR, score VARCHAR )
What place had a score of 71-70=141?
SELECT place FROM table_name_8 WHERE score = 71 - 70 = 141
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
get the number of patients with diagnoses icd9 code 3970 who were hospitalized for more than a day.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "3970"
CREATE TABLE table_20332 ( "No." real, "Name" text, "Livery" text, "Locomotive type" text, "Wheel Arrangement" text, "Builder" text, "Year built" real, "Status" text )
Which locomotive type has a status in static display
SELECT "Locomotive type" FROM table_20332 WHERE "Status" = 'Static display'
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Tags that needs a wiki..
SELECT TagName, Count FROM Tags WHERE ExcerptPostId IS NULL AND WikiPostId IS NULL AND Count < 50 ORDER BY Count
CREATE TABLE table_19833 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text )
How many combination classifications have the winner as Erik Zabel and a points classification as Alessandro Petacchi
SELECT COUNT("Combination classification") FROM table_19833 WHERE "Points classification" = 'Alessandro Petacchi' AND "Winner" = 'Erik Zabel'
CREATE TABLE table_name_87 ( date VARCHAR, opponent VARCHAR, venue VARCHAR, result VARCHAR )
What was the date of the game held at the A venue with a result of 0-1 against the Rangers?
SELECT date FROM table_name_87 WHERE venue = "a" AND result = "0-1" AND opponent = "rangers"
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...
Well roundedness of users (WORK IN PROGRESS).
SELECT * FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE CAST(Users.Id AS TEXT) = '##UserId:string##' OR Users.DisplayName = '##UserId##'
CREATE TABLE payments ( payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR )
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
CREATE TABLE table_name_38 ( college_junior_club_team__league_ VARCHAR, position VARCHAR, round VARCHAR )
What League's Round is Sup and Position is Right Wing?
SELECT college_junior_club_team__league_ FROM table_name_38 WHERE position = "right wing" AND round = "sup"
CREATE TABLE table_39607 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which Tournament has a 2007 of wta premier 5 tournaments?
SELECT "Tournament" FROM table_39607 WHERE "2007" = 'wta premier 5 tournaments'
CREATE TABLE table_21977704_1 ( constructor VARCHAR, driver VARCHAR )
Name the constructor for alberto ascari
SELECT constructor FROM table_21977704_1 WHERE driver = "Alberto Ascari"
CREATE TABLE table_1990460_1 ( year VARCHAR, regular_season VARCHAR )
When did the 4th, Midwest season happen?
SELECT year FROM table_1990460_1 WHERE regular_season = "4th, Midwest"
CREATE TABLE table_59411 ( "Date" text, "Opponent" text, "Score" text, "Decision" text, "Attendance" real, "Record" text )
What is the score on April 5?
SELECT "Score" FROM table_59411 WHERE "Date" = 'april 5'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients admitted before 2146 had the lab test named mcv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "MCV"
CREATE TABLE table_name_78 ( year VARCHAR, title VARCHAR )
How many years have a Title of Magia Nuda?
SELECT COUNT(year) FROM table_name_78 WHERE title = "magia nuda"
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
which party had the greatest number of new seats in this election ?
SELECT "party" FROM table_204_223 ORDER BY "new council" DESC LIMIT 1
CREATE TABLE table_name_73 ( points INTEGER, game VARCHAR, record VARCHAR )
Which Points have a Game smaller than 8, and a Record of 1 0 0?
SELECT SUM(points) FROM table_name_73 WHERE game < 8 AND record = "1–0–0"
CREATE TABLE table_23406 ( "Season" text, "Player" text, "Junior college" text, "State" text, "Position" text, "Class" text, "University" text )
in which class is the position forward
SELECT "Class" FROM table_23406 WHERE "Position" = 'Forward'
CREATE TABLE table_name_1 ( last_aired INTEGER, returning VARCHAR )
What was the earliest aired show that's returning on September 13?
SELECT MIN(last_aired) FROM table_name_1 WHERE returning = "september 13"
CREATE TABLE table_804 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
tell who made the most scores on new jersey
SELECT "High points" FROM table_804 WHERE "Team" = 'New Jersey'
CREATE TABLE table_65208 ( "Period" text, "Team" text, "Player" text, "Penalty" text, "Time" text )
What time does Dustin Byfuglien have in 1st period?
SELECT "Time" FROM table_65208 WHERE "Period" = '1st' AND "Player" = 'dustin byfuglien'
CREATE TABLE table_72714 ( "City/town" text, "Municipality" text, "County" text, "City/town status" real, "Population" real )
Which municipalities located in the county of Finnmark have populations bigger than 6187.0?
SELECT "Municipality" FROM table_72714 WHERE "County" = 'Finnmark' AND "Population" > '6187.0'
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, ...
what is the monthly minimum value of prolactin in patient 022-47232 since 5 years ago?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47232')) AND lab.labname = 'prolactin' AND DATETIME(lab.labresulttime) >= DATE...
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE out...
what organism was found in patient 92788's first test of foot culture since 12/2105?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND microbiologyevents.spec_type_desc = 'foot culture' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.chart...
CREATE TABLE table_67450 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Who was the opponent in week 12?
SELECT "Opponent" FROM table_67450 WHERE "Week" = '12'
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 )...
count the number of times that patient 025-44842 received a laboratory test for total protein in 12/this year.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44842')) AND lab.labname = 'total protein' AND DATETIME(lab.labresulttime, 'start of yea...
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...
Scatterplot of weight vs people id by Sex
SELECT People_ID, Weight FROM people GROUP BY Sex
CREATE TABLE table_39901 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
When did they play at Candlestick Park?
SELECT "Date" FROM table_39901 WHERE "Game Site" = 'candlestick park'
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
Which of my posts have been downvoted?. Lets you see where you went wrong.
SELECT p.Id AS "post_link", (SELECT COUNT(1) FROM Votes AS v JOIN VoteTypes AS t ON v.VoteTypeId = t.Id WHERE v.PostId = p.Id AND t.Name = 'UpMod') AS Upvotes, (SELECT COUNT(1) FROM Votes AS v JOIN VoteTypes AS t ON v.VoteTypeId = t.Id WHERE v.PostId = p.Id AND t.Name = 'DownMod') AS Downvotes FROM Posts AS p WHERE p.O...
CREATE TABLE table_37841 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text )
What played has 247 as the points?
SELECT "Played" FROM table_37841 WHERE "Points for" = '247'
CREATE TABLE table_name_90 ( wins INTEGER, starts VARCHAR, avg_finish VARCHAR, year VARCHAR )
in 1990, how many wins had an avg finish of 35 and a start less than 1?
SELECT MAX(wins) FROM table_name_90 WHERE avg_finish = 35 AND year = 1990 AND starts < 1
CREATE TABLE table_34815 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Liberal ticket" text, "Independent-Socialist ticket" text, "Socialist Labor ticket" text )
Who was the Independent Socialist candidate who ran against the Liberal candidate Edward Goodell?
SELECT "Independent-Socialist ticket" FROM table_34815 WHERE "Liberal ticket" = 'edward goodell'
CREATE TABLE table_14095 ( "Club" text, "League/Division" text, "Home Ground" text, "Location" text, "Position in 2012-13" text )
What is the location for a club of telecom?
SELECT "Location" FROM table_14095 WHERE "Club" = 'telecom'
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, ro...
show me all flights from PITTSBURGH to BALTIMORE tomorrow which serve a meal
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, date_day, days, flight, food_service WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight....
CREATE TABLE table_name_16 ( record VARCHAR, visitor VARCHAR )
What was the record of the game where the Rockets were the visiting team?
SELECT record FROM table_name_16 WHERE visitor = "rockets"
CREATE TABLE table_24887326_6 ( away_team VARCHAR, tie_no VARCHAR )
Who is the away team for tie no 11?
SELECT away_team FROM table_24887326_6 WHERE tie_no = 11
CREATE TABLE table_21411 ( "Season" real, "TV season" text, "Regular Timeslot (EDT)" text, "Episode count" real, "Season premiere" text, "Season finale" text, "Rank" text, "Rating" text )
Name the number of tv seasons for season finale of may 23, 1995
SELECT COUNT("TV season") FROM table_21411 WHERE "Season finale" = 'May 23, 1995'
CREATE TABLE table_49080 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text )
What tournament did Pemra zgen play against julia kimmelmann in the finals?
SELECT "Tournament" FROM table_49080 WHERE "Opponent in the Final" = 'julia kimmelmann'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
among patients discharged on short term hospital care, calcluate the maximum age of male patients.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SHORT TERM HOSPITAL"
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
how many students are there for each major?
SELECT Major, COUNT(*) FROM Student GROUP BY Major
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose age is less than 36 and diagnoses short title is abrasion trunk?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "36" AND diagnoses.short_title = "Abrasion trunk"
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE...
What is zip code of customer with first name as Carole and last name as Bernhard?
SELECT T2.zip_postcode FROM customers AS T1 JOIN addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"