table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_204_634 (
id number,
"tour" number,
"official title" text,
"venue" text,
"city" text,
"date\nstart" text,
"date\nfinish" text,
"prize money\nusd" number,
"report" text
) | does the malaysia open super series pay more or less than french super series ? | SELECT (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'malaysia open super series') > (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series') |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | What are the memories and carriers of phones. | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | what was the new prescription for patient 017-88691 today compared to the prescription yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '017-88691') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
CREATE TABLE table_203_363 (
id number,
"city\n2010 census" text,
"chinese" text,
"built-up area" number,
"urban area" number,
"level" text,
"administrative area" number,
"province-level division" text,
"remarks" text
) | which city has more in their built up area than any other ? | SELECT "city\n2010 census" FROM table_203_363 ORDER BY "built-up area" DESC LIMIT 1 |
CREATE TABLE table_44485 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
) | What is Tries Against, when Points Against is 213? | SELECT "Tries against" FROM table_44485 WHERE "Points against" = '213' |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Na... | Posts Containing Statistics in Title. | SELECT Title, Score, Id FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%stat%' ORDER BY Score DESC |
CREATE TABLE table_name_84 (
opponent VARCHAR,
time VARCHAR
) | Which Opponent has a Time of 4:51? | SELECT opponent FROM table_name_84 WHERE time = "4:51" |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | what was the total number of outputs patient 016-18150 had since 299 days ago? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND intakeoutput.cellpath LIKE '%ou... |
CREATE TABLE table_name_11 (
type VARCHAR,
moving_from VARCHAR
) | What is the type of the player moving from belgrano? | SELECT type FROM table_name_11 WHERE moving_from = "belgrano" |
CREATE TABLE table_name_31 (
bluetooth VARCHAR,
model VARCHAR
) | Does the s35 model have bluetooth? | SELECT bluetooth FROM table_name_31 WHERE model = "s35" |
CREATE TABLE table_29141354_4 (
first_broadcast VARCHAR,
jamie_and_johns_guest VARCHAR
) | When id the episode broadcast with Mark Webber as Jamie and John's guest? | SELECT first_broadcast FROM table_29141354_4 WHERE jamie_and_johns_guest = "Mark Webber" |
CREATE TABLE table_16371 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Production code" text
) | Who's the writer for the episode with a production code 2395114? | SELECT "Writer(s)" FROM table_16371 WHERE "Production code" = '2395114' |
CREATE TABLE table_name_25 (
attendance VARCHAR,
week VARCHAR,
date VARCHAR
) | What was the attendance for the game held on September 18, 1994, with a week less than 5? | SELECT attendance FROM table_name_25 WHERE week < 5 AND date = "september 18, 1994" |
CREATE TABLE table_name_21 (
other VARCHAR,
christianity VARCHAR
) | What is the other value associated with a Christianity value of 10.24%? | SELECT other FROM table_name_21 WHERE christianity = "10.24%" |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id numb... | Most viewed questions with a tag converted to a synonym since then. | SELECT Posts.Id AS "post_link", Posts.ViewCount, TagSynonyms.SourceTagName AS "Its tag...", TagSynonyms.TargetTagName AS "...is a synonym of" FROM TagSynonyms, Tags, PostTags, Posts WHERE Tags.TagName = TagSynonyms.SourceTagName AND PostTags.TagId = Tags.Id AND Posts.Id = PostTags.PostId ORDER BY Posts.ViewCount DESC, ... |
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... | What is the relationship between Height and Weight ? | SELECT Height, Weight FROM people |
CREATE TABLE table_61106 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | What is the result for the Outer Critics Circle award earlier than 2004? | SELECT "Result" FROM table_61106 WHERE "Award" = 'outer critics circle award' AND "Year" < '2004' |
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... | what is the number of patients whose diagnoses icd9 code is v667 and drug route is tp? | 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.icd9_code = "V667" AND prescriptions.route = "TP" |
CREATE TABLE table_35934 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the highest round of Ed Smith, who had a pick higher than 261 and played halfback? | SELECT MAX("Round") FROM table_35934 WHERE "Pick" < '261' AND "Position" = 'halfback' AND "Player" = 'ed smith' |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | In every semester , can you take ENDODONT 651 ? | SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'ENDODONT' AND COURSEalias0.numb... |
CREATE TABLE table_name_29 (
listed VARCHAR,
location VARCHAR
) | On what date was the bridge located in McClain listed? | SELECT listed FROM table_name_29 WHERE location = "mcclain" |
CREATE TABLE table_19229 (
"Country/Territory" text,
"Former pageant" text,
"Last competed" real,
"New pageant" text,
"Franchise since" real
) | How many new pageants does Aruba have? | SELECT COUNT("New pageant") FROM table_19229 WHERE "Country/Territory" = 'Aruba' |
CREATE TABLE table_name_30 (
overall VARCHAR,
name VARCHAR
) | How much Overall has a Name of bob anderson? | SELECT COUNT(overall) FROM table_name_30 WHERE name = "bob anderson" |
CREATE TABLE table_name_2 (
time VARCHAR,
nfl_recap VARCHAR,
result VARCHAR
) | What was the time of the game that had an NFL recap and a result of W 22 16? | SELECT time FROM table_name_2 WHERE nfl_recap = "recap" AND result = "w 22–16" |
CREATE TABLE table_name_95 (
played INTEGER,
position VARCHAR,
drawn VARCHAR,
team VARCHAR
) | Which Played has a Drawn of 5, and a Team of palmeiras, and a Position smaller than 6? | SELECT MAX(played) FROM table_name_95 WHERE drawn = 5 AND team = "palmeiras" AND position < 6 |
CREATE TABLE table_23474 (
"#" real,
"Title" text,
"Maneater" text,
"Television Premiere" text,
"DVD release" text,
"Writer" text,
"Director" text,
"Producer" text
) | How many numbers have Charles Salmon as the producer and January 27, 2007 was the television premiere? | SELECT MIN("#") FROM table_23474 WHERE "Producer" = 'Charles Salmon' AND "Television Premiere" = 'January 27, 2007' |
CREATE TABLE table_27257896_2 (
working_force_of_hk VARCHAR,
nepalese VARCHAR
) | If the nepalese is 37.1%, what is the working force of HK? | SELECT working_force_of_hk FROM table_27257896_2 WHERE nepalese = "37.1%" |
CREATE TABLE table_name_82 (
elected VARCHAR
) | Who is the 1st member elected in 1620/21? | SELECT 1 AS st_member FROM table_name_82 WHERE elected = "1620/21" |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
... | what is FF | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'FF' |
CREATE TABLE table_name_70 (
year INTEGER,
category VARCHAR
) | What is the latest year for the distinguished performance? | SELECT MAX(year) FROM table_name_70 WHERE category = "distinguished performance" |
CREATE TABLE table_79696 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the sum of top-10s for events with more than 0 wins? | SELECT SUM("Top-10") FROM table_79696 WHERE "Wins" > '0' |
CREATE TABLE table_2223177_3 (
season INTEGER
) | Name the least season | SELECT MIN(season) FROM table_2223177_3 |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | During the Spring season , has the PHYSED 305 ever been offered ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND course.number = 305 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester |
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,
... | How many emergency hospital admission patients have calculus of bile duct without mention of cholecystitis or obstruction diagnoses? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Calculus of bile duct without mention of cholecystitis, without mention of obstruction" |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For all employees who have the letters D or S in their first name, a scatter chart shows the correlation between employee_id and department_id . | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE table_40519 (
"Year" text,
"Team" text,
"GP/GS" text,
"Goals" text,
"Assists" text,
"Total Points" text
) | What assists has the Team SMU and the total points of 85? | SELECT "Assists" FROM table_40519 WHERE "Team" = 'smu' AND "Total Points" = '85' |
CREATE TABLE table_18733480_1 (
players_left_after_round_1 VARCHAR,
team_1 VARCHAR
) | How many times was team 1 the wykeham wonderers? | SELECT COUNT(players_left_after_round_1) FROM table_18733480_1 WHERE team_1 = "Wykeham Wonderers" |
CREATE TABLE table_52677 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What date were the high rebounds Evans (14)? | SELECT "Date" FROM table_52677 WHERE "High rebounds" = 'evans (14)' |
CREATE TABLE table_name_94 (
goal_difference INTEGER,
goals_against VARCHAR,
draws VARCHAR
) | What is the lowest goal difference a club with 61 goals against and less than 11 draws has? | SELECT MIN(goal_difference) FROM table_name_94 WHERE goals_against = 61 AND draws < 11 |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | What percentile am I in for a given tag (Cross-Validated)?. Determines where you rank in a given tag as of the last data load | SELECT STR(NTILE(100) OVER (ORDER BY SUM(answers.Score) DESC), 3) + '%' AS "top", ROW_NUMBER() OVER (ORDER BY SUM(answers.Score) DESC) AS "ranking", Users.DisplayName AS "user_link", SUM(answers.Score) AS "total_score" FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId AND Tags.TagName = '##TagName##' JOIN Posts AS qu... |
CREATE TABLE table_238124_1 (
platelet_count VARCHAR,
condition VARCHAR
) | What is the platelet count for congenital afibrinogenemia? | SELECT platelet_count FROM table_238124_1 WHERE condition = "Congenital afibrinogenemia" |
CREATE TABLE table_name_21 (
date VARCHAR,
label VARCHAR,
format VARCHAR
) | What is the date for Hydra Head Records with a CD format? | SELECT date FROM table_name_21 WHERE label = "hydra head records" AND format = "cd" |
CREATE TABLE table_name_51 (
length_of_retirement VARCHAR,
age_at_inauguration VARCHAR
) | What is the Length of retirement of the President with an Age at inauguration of 70years, 53days? | SELECT length_of_retirement FROM table_name_51 WHERE age_at_inauguration = "70years, 53days" |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and show by the bar in asc please. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID |
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... | How many patients who were diagnosed under icd9 code 481 have pb as drug route? | 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.icd9_code = "481" AND prescriptions.route = "PB" |
CREATE TABLE table_26516 (
"Co-king" text,
"Relationship to Monarch" text,
"Crowned" text,
"Co-kingship ceased" text,
"Reason" text,
"Monarch" text
) | Name the crownded for 17 september 1025 | SELECT "Crowned" FROM table_26516 WHERE "Co-kingship ceased" = '17 September 1025' |
CREATE TABLE table_73844 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What date did 'd.a.w.' Originally air? | SELECT "Original air date" FROM table_73844 WHERE "Title" = 'D.A.W.' |
CREATE TABLE table_name_21 (
opponent VARCHAR,
result VARCHAR
) | What team was the opponent when the result was l 0-27? | SELECT opponent FROM table_name_21 WHERE result = "l 0-27" |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
... | Do I need to take any specific courses before taking PHARMACY 690 ? | 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 table_71313 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original title" text,
"Director" text
) | What was the original title of the Hindi film? | SELECT "Original title" FROM table_71313 WHERE "Language" = 'hindi' |
CREATE TABLE table_name_8 (
population INTEGER,
country_territory_entity VARCHAR,
rank VARCHAR
) | Name the most population for seychelles and rank less than 13 | SELECT MAX(population) FROM table_name_8 WHERE country_territory_entity = "seychelles" AND rank < 13 |
CREATE TABLE table_name_69 (
champion VARCHAR,
score VARCHAR,
location VARCHAR,
year VARCHAR
) | What is the Champion at Sopot prior to 2006 with a Score of 6 4, 6 7(7), 6 3? | SELECT champion FROM table_name_69 WHERE location = "sopot" AND year < 2006 AND score = "6–4, 6–7(7), 6–3" |
CREATE TABLE table_name_97 (
winner VARCHAR,
fifth VARCHAR
) | WHAT IS THE WINNER WITH A FIFTH OF JOSS STONE? | SELECT winner FROM table_name_97 WHERE fifth = "joss stone" |
CREATE TABLE table_62597 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | When the total was 290 what was the To par? | SELECT "To par" FROM table_62597 WHERE "Total" = '290' |
CREATE TABLE table_14044 (
"Rank" real,
"Artist" text,
"Album" text,
"Peak position" text,
"Sales" real,
"Certification" text
) | What is the sales when the artist is kelly clarkson? | SELECT COUNT("Sales") FROM table_14044 WHERE "Artist" = 'kelly clarkson' |
CREATE TABLE table_name_47 (
left_office VARCHAR,
took_office VARCHAR,
minister VARCHAR
) | What is Left Office, when Took Office is '11 June 2001', and when Minister is 'Mirko Tremaglia'? | SELECT left_office FROM table_name_47 WHERE took_office = "11 june 2001" AND minister = "mirko tremaglia" |
CREATE TABLE table_2093995_1 (
stations VARCHAR,
city__neighborhood VARCHAR
) | What are the stations in Tarzana? | SELECT stations FROM table_2093995_1 WHERE city__neighborhood = "Tarzana" |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, could you order the average of salary in ascending order? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) |
CREATE TABLE table_78193 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the away team scored 16.21 (117), what was the home teams score? | SELECT "Home team score" FROM table_78193 WHERE "Away team score" = '16.21 (117)' |
CREATE TABLE table_50501 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Assists, when High Points is 'Tayshaun Prince (23)'? | SELECT "High assists" FROM table_50501 WHERE "High points" = 'tayshaun prince (23)' |
CREATE TABLE table_54237 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the time/retired when the laps is less than 54 and the driver is mark donohue? | SELECT "Time/Retired" FROM table_54237 WHERE "Laps" < '54' AND "Driver" = 'mark donohue' |
CREATE TABLE table_1733513_1 (
others_percentage VARCHAR,
bush_number VARCHAR
) | What is the percentage of others when the number for Bush is 1329? | SELECT others_percentage FROM table_1733513_1 WHERE bush_number = 1329 |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_na... | what ground transportation is available in BOSTON | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_code |
CREATE TABLE table_4521 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home side when north melbourne is the away side? | SELECT "Home team" FROM table_4521 WHERE "Away team" = 'north melbourne' |
CREATE TABLE table_name_64 (
points_classification VARCHAR,
stage VARCHAR
) | who is the points classification in stage 1? | SELECT points_classification FROM table_name_64 WHERE stage = "1" |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
... | Bin all date of transactions into the YEAR interval, and sum the share count of each bin Return the result using a line chart, and I want to display from high to low by the x axis please. | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC |
CREATE TABLE table_29535057_4 (
challenge_leader VARCHAR,
winner VARCHAR
) | Who were the challenge leaders of the games won by boston college (88-76)? | SELECT challenge_leader FROM table_29535057_4 WHERE winner = "Boston College (88-76)" |
CREATE TABLE diagnoses (
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,
... | Provide me the number of patients who stayed in the hospital for more than 27 days that had a magnesium lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "27" AND lab.label = "Magnesium" |
CREATE TABLE table_4212 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" text,
"Earnings ($)" real
) | What is Jonathan Kaye's money list ranking? | SELECT COUNT("Money list rank") FROM table_4212 WHERE "Player" = 'Jonathan Kaye' |
CREATE TABLE table_12759 (
"Date" text,
"Opponent#" text,
"Rank#" text,
"Result" text,
"Attendance" text
) | What date was the attendance 82,500? | SELECT "Date" FROM table_12759 WHERE "Attendance" = '82,500' |
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
)
... | what is the number of patients whose procedure long title is combined right and left heart angiocardiography? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Combined right and left heart angiocardiography" |
CREATE TABLE table_name_61 (
built VARCHAR,
name VARCHAR
) | When was the sargent bridge built? | SELECT built FROM table_name_61 WHERE name = "sargent bridge" |
CREATE TABLE table_66468 (
"Sport" text,
"Body" text,
"Year" text,
"Event type" text,
"Location" text,
"Nations" text
) | What body is at the World Championship for Underwater Target shooting? | SELECT "Body" FROM table_66468 WHERE "Event type" = 'world championship' AND "Sport" = 'underwater target shooting' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | For all employees who have the letters D or S in their first name, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE table_6897 (
"Peel" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | Which Draws has a Wins smaller than 17, and an Against smaller than 1158? | SELECT COUNT("Draws") FROM table_6897 WHERE "Wins" < '17' AND "Against" < '1158' |
CREATE TABLE table_71571 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score of the game on June 1? | SELECT "Score" FROM table_71571 WHERE "Date" = 'june 1' |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Show names and seatings for all tracks opened after 2000 by a pie chart. | SELECT Name, Seating FROM track WHERE Year_Opened > 2000 |
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
)
CREAT... | what was the first thing patient 027-142451 got diagnosed with in this year? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-142451')) AND DATETIME(diagnosis.diagnosistime, 'start of yea... |
CREATE TABLE table_27003186_3 (
other VARCHAR,
registered_voters VARCHAR
) | What is other when registered voters is 50.7%? | SELECT other FROM table_27003186_3 WHERE registered_voters = "50.7%" |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Return a pie chart about the proportion of Team_Name and Team_ID. | SELECT Team_Name, Team_ID FROM basketball_match |
CREATE TABLE table_26842217_4 (
site VARCHAR,
visiting_team VARCHAR
) | Where's the louisiana-lafayette as a visiting team? | SELECT site FROM table_26842217_4 WHERE visiting_team = "Louisiana-Lafayette" |
CREATE TABLE table_name_69 (
week INTEGER,
opponent VARCHAR,
attendance VARCHAR
) | Which Week has an Opponent of pittsburgh steelers, and an Attendance larger than 47,727? | SELECT MIN(week) FROM table_name_69 WHERE opponent = "pittsburgh steelers" AND attendance > 47 OFFSET 727 |
CREATE TABLE table_name_35 (
republican VARCHAR,
lead_margin VARCHAR
) | What is the percentage for Brown when the lead margin is 26? | SELECT republican AS :_roy_brown FROM table_name_35 WHERE lead_margin = 26 |
CREATE TABLE table_35925 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | What tournament has a year prior to 2001? | SELECT "Tournament" FROM table_35925 WHERE "Year" < '2001' |
CREATE TABLE table_name_78 (
crowd INTEGER,
away_team VARCHAR
) | What is the lowest crowd when essendon is the away team? | SELECT MIN(crowd) FROM table_name_78 WHERE away_team = "essendon" |
CREATE TABLE Students (
personal_name VARCHAR,
student_id VARCHAR
)
CREATE TABLE Student_Course_Enrolment (
student_id VARCHAR
) | Find the student ID and personal name of the student with at least two enrollments. | SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2 |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show me about the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road in a bar chart, order X-axis in descending order please. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minu... | EA flight 825 from ATLANTA to DENVER leaving at 555 what type of aircraft is used on that flight | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (((flight.departure_time = 555 AND flight.flight_number = 825) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
CREATE TABLE table_13121 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
) | Which Date has a Venue of bucharest? | SELECT "Date" FROM table_13121 WHERE "Venue" = 'bucharest' |
CREATE TABLE table_name_12 (
total VARCHAR,
set_3 VARCHAR
) | What was the total when the set 3 score was 25 27? | SELECT total FROM table_name_12 WHERE set_3 = "25–27" |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hi... | what flights go from DALLAS to BALTIMORE | 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... |
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 text,
icd9_code text,
short_title text,
long_title text
)
... | find out the number of divorced patients who were admitted before the year 2121. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2121" |
CREATE TABLE table_name_24 (
high_assists VARCHAR,
game VARCHAR,
team VARCHAR
) | Who had the high assist in a game number above 77 for Milwaukee? | SELECT high_assists FROM table_name_24 WHERE game > 77 AND team = "milwaukee" |
CREATE TABLE table_6849 (
"Rank" real,
"Country" text,
"Claimant" text,
"Highest point" text,
"Height" text
) | Which highest rank belongs to the palestinian territories? | SELECT MAX("Rank") FROM table_6849 WHERE "Country" = 'palestinian territories' |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_da... | A bar chart about the number of faults for different fault short name, show in descending by the total number. | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name ORDER BY COUNT(fault_short_name) DESC |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | Top 10 Gold Badge Users. | SELECT u.DisplayName, Posts.OwnerUserId AS UserId, BadgeCount, COUNT(Posts.Id) AS PostsCount FROM Posts JOIN Users AS u ON u.Id = Posts.OwnerUserId JOIN (SELECT Badges.UserId AS UserId, COUNT(Badges.Id) AS BadgeCount FROM Badges WHERE Badges.Class = 1 GROUP BY Badges.UserId) AS B ON Posts.OwnerUserId = B.UserId GROUP B... |
CREATE TABLE table_66359 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How much Scored has Losses smaller than 0? | SELECT SUM("Scored") FROM table_66359 WHERE "Losses" < '0' |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | Show me how many long by long in a histogram | SELECT long, COUNT(long) FROM station |
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,
... | what is maximum age of patients whose ethnicity is asian and days of hospital stay is 23? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23" |
CREATE TABLE table_name_84 (
year__ceremony_ VARCHAR,
film_title_used_in_nomination VARCHAR
) | What year has a nomination title of 'sangrador'? | SELECT year__ceremony_ FROM table_name_84 WHERE film_title_used_in_nomination = "sangrador" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.