table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_204_429 (
id number,
"battle" text,
"location" text,
"date(s)" text,
"engagement remarks" text,
"victor" text
) | what was the total amount of m -lrb- mexican -rrb- victories ? | SELECT COUNT(*) FROM table_204_429 WHERE "victor" = 'm' |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | what was the first arterial bp [systolic] value patient 594 had since 271 days ago? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 594)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp... |
CREATE TABLE table_8308 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What was the score when the match was in the country of Scotland? | SELECT "Score" FROM table_8308 WHERE "Country" = 'scotland' |
CREATE TABLE table_20799905_1 (
mccain_percentage VARCHAR,
county VARCHAR
) | How many figures are given for McCain's % in Davidson county? | SELECT COUNT(mccain_percentage) FROM table_20799905_1 WHERE county = "DAVIDSON" |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,... | Stacked bar of services and how many services colored by local_authority, and sort in ascending by the Y-axis. | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services) |
CREATE TABLE table_name_45 (
grid VARCHAR,
laps VARCHAR
) | What grid is associated with 67 laps? | SELECT grid FROM table_name_45 WHERE laps = 67 |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | when did patient 94937 have a procedure for the first time since 2105? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94937) AND STRFTIME('%y', procedures_icd.charttime) >= '2105' ORDER BY procedures_icd.charttime LIMIT 1 |
CREATE TABLE table_171250_2 (
census_ranking VARCHAR,
population VARCHAR
) | What are the census ranking(s) for a population of 284? | SELECT census_ranking FROM table_171250_2 WHERE population = 284 |
CREATE TABLE table_name_35 (
date VARCHAR,
label VARCHAR
) | What Date has a label of alfa records? | SELECT date FROM table_name_35 WHERE label = "alfa records" |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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,
round_trip_cost int,
round_trip_re... | show ground transportation for PITTSBURGH | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Get upvoted answers where question doesn t have tag. | SELECT a.ParentId, q.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.Score > 0 AND a.OwnerUserId = @userId AND a.PostTypeId = 2 AND NOT q.Tags LIKE '%<' + @tags + '>%' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inpute... | what is the yearly average of arterial bp [systolic] for patient 655? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 655)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arteri... |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | 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 amount of job_id over the job_id , and group by attribute job_id, and sort by the X in ascending please. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID |
CREATE TABLE table_name_15 (
result VARCHAR,
event VARCHAR,
method VARCHAR
) | Which Result has the Event Strikeforce and the Method, Ko (spinning back fist)? | SELECT result FROM table_name_15 WHERE event = "strikeforce" AND method = "ko (spinning back fist)" |
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 prescription... | how many patients aged below 27 years had bradycardia as the primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.age < "27" |
CREATE TABLE table_54256 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Where was the game with result 7-2 played? | SELECT "Venue" FROM table_54256 WHERE "Result" = '7-2' |
CREATE TABLE table_20329 (
"Year" real,
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Tied" real,
"Success Rate" text,
"Position" text,
"Summary" text
) | Name the least wins of 56.25% | SELECT MIN("Wins") FROM table_20329 WHERE "Success Rate" = '56.25%' |
CREATE TABLE table_40608 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | What is the highest Rank, when Name is Travis Watson, and when Games is less than 14? | SELECT MAX("Rank") FROM table_40608 WHERE "Name" = 'travis watson' AND "Games" < '14' |
CREATE TABLE table_53355 (
"Track" real,
"Title" text,
"Author(s)" text,
"Recorded" text,
"Length" text
) | Which title is 3:43 long? | SELECT "Title" FROM table_53355 WHERE "Length" = '3:43' |
CREATE TABLE table_name_98 (
model_number VARCHAR,
multiplier VARCHAR,
front_side_bus VARCHAR,
l2_cache VARCHAR
) | Which Model number has a Front Side Bus of 100mhz, a L2-Cache of 64kib and a Multiplier of 8.5 ? | SELECT model_number FROM table_name_98 WHERE front_side_bus = "100mhz" AND l2_cache = "64kib" AND multiplier = "8.5×" |
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 ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME var... | Show the number of courses for each course description in a stacked bar chart. The x-axis is course description and group by office name. | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute name in a bar chart, show by the X in asc please. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name |
CREATE TABLE table_name_26 (
colours VARCHAR,
head_coach VARCHAR
) | What are the colours of the team with benedikt gu mundsson as head coach? | SELECT colours FROM table_name_26 WHERE head_coach = "benedikt guðmundsson" |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | Can you draw the trend of sum budget in billions over the creation?, I want to rank x axis from low to high order. | SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_des... | are there any flights from PHILADELPHIA to DALLAS which stop in ATLANTA | SELECT DISTINCT flight.flight_id FROM 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 = 'DALLAS' AND CITY_2.cit... |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | Python and Django BE Gracall v Praze. | SELECT u.Id AS "user_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.Age FROM Users AS u JOIN (SELECT DISTINCT UserId FROM Badges WHERE LOWER(Name) IN ('python', 'django') AND Class IN (1, 2, 3) AND TagBased = 1) AS tag_badges ON tag_badges.UserId = u.Id WHERE LOWER(Locatio... |
CREATE TABLE table_43429 (
"Year" text,
"Award" text,
"Production" text,
"Role" text,
"Result" text
) | Which award was given in 2012? | SELECT "Award" FROM table_43429 WHERE "Year" = '2012' |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
ins... | Most recently , who has taught SCAND 104 ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri... |
CREATE TABLE table_27512025_1 (
ab_ripper_x VARCHAR,
exercise VARCHAR
) | What is the ab ripper x when exercise is x stretch? | SELECT ab_ripper_x FROM table_27512025_1 WHERE exercise = "X Stretch" |
CREATE TABLE table_204_751 (
id number,
"date" text,
"train" text,
"location" text,
"present location" text,
"comments" text,
"top speed (km/h)" text
) | how many trains listed have the same speed as the hmb2 ? | SELECT COUNT("train") FROM table_204_751 WHERE "train" <> 'hmb2' AND "top speed (km/h)" = (SELECT "top speed (km/h)" FROM table_204_751 WHERE "train" = 'hmb2') |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID |
CREATE TABLE table_name_19 (
tournament VARCHAR
) | What is 2011, when 2006 is 'A', when 2008 is 'A', and when Tournament is 'Rome'? | SELECT 2011 FROM table_name_19 WHERE 2006 = "a" AND 2008 = "a" AND tournament = "rome" |
CREATE TABLE table_55062 (
"Block A" text,
"Ryuji Hijikata" text,
"Shuji Kondo" text,
"El NOSAWA Mendoza" text,
"PEPE Michinoku" text,
"Katsuhiko Nakajima" text
) | What is the Block A value for an El NOSAWA Mendoza value of kondo (7:08)? | SELECT "Block A" FROM table_55062 WHERE "El NOSAWA Mendoza" = 'kondo (7:08)' |
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
playe... | Return me a bar chart to show the frequency of the year attribute by binning into a weekday interval, order by the the number of year in desc please. | SELECT year, COUNT(year) FROM home_game ORDER BY COUNT(year) DESC |
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height real,
Hometown text
)
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real... | Visualize a pie chart with what are the hometowns of gymnasts and the corresponding number of gymnasts? | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown |
CREATE TABLE table_2933761_1 (
occupation VARCHAR,
name VARCHAR
) | What is Joan Leaven's occupation? | SELECT occupation FROM table_2933761_1 WHERE name = "Joan Leaven" |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
) | how many times was his average finish below 18 ? | SELECT COUNT(*) FROM table_203_424 WHERE "avg. finish" < 18 |
CREATE TABLE table_53454 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What is the stadium when the date of the game is December 14? | SELECT "Stadium" FROM table_53454 WHERE "Date" = 'december 14' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patient... | when was patient 035-11687 for the first time prescribed a medication via the po route since 12/2102? | 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 = '035-11687')) AND medication.routeadmin = 'po' AND STRFTIME('%y... |
CREATE TABLE table_68466 (
"Event" text,
"Individual" text,
"Sprint" text,
"Pursuit" text,
"Mass Start" text,
"Relay" text
) | Who was the individual in the event of 1998 Pokljuka? | SELECT "Individual" FROM table_68466 WHERE "Event" = '1998 pokljuka' |
CREATE TABLE table_41271 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | Which bike had a grid less than 35 and time at 37:58.607? | SELECT "Bike" FROM table_41271 WHERE "Grid" < '35' AND "Time" = '37:58.607' |
CREATE TABLE table_71259 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which engine has a Lotus 49c chassis? | SELECT "Engine" FROM table_71259 WHERE "Chassis" = 'lotus 49c' |
CREATE TABLE table_18899 (
"Rnd" real,
"Circuit" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"TO Winning Team" text,
"TU Winning Team" text,
"Results" text
) | What was the gtu winning team when the gto winning team was #48 greenwood racing? | SELECT "GTU Winning Team" FROM table_18899 WHERE "GTO Winning Team" = '#48 Greenwood Racing' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | indicate the daily maximum dose of enteral two kal hn that patient 006-80884 has received. | SELECT MAX(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 = '006-80884')) AND intakeoutput.celllabel = 'enter... |
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
) | Plot the average of age by grouped by class as a bar graph, could you show in ascending by the Y-axis? | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) |
CREATE TABLE table_69089 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award Description(s)" text,
"Result(s)" text
) | Which is the average year with the date of February 24? | SELECT AVG("Year") FROM table_69089 WHERE "Date" = 'february 24' |
CREATE TABLE table_204_945 (
id number,
"episode" number,
"name" text,
"synopsis" text,
"sent home" text,
"highest seller" text
) | who was the last person to be sent home ? | SELECT "sent home" FROM table_204_945 ORDER BY "episode" DESC LIMIT 1 |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... | Can you provide me with a list of classes being taught by Dr. Kathleen Wisser next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kathleen Wisser%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... |
CREATE TABLE table_13103 (
"Result" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text
) | Who did Tony Oakey win against when he had type of w pts 12? | SELECT "Opponent" FROM table_13103 WHERE "Result" = 'win' AND "Type" = 'w pts 12' |
CREATE TABLE table_name_21 (
to_par VARCHAR,
player VARCHAR
) | What was Bert Yancey's finishing score to par? | SELECT to_par FROM table_name_21 WHERE player = "bert yancey" |
CREATE TABLE diagnoses (
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
)
C... | among patients diagnosed with critical illness myopthy, how many of them received drug via id 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.short_title = "Critical illness myopthy" AND prescriptions.route = "ID" |
CREATE TABLE table_name_49 (
qual_2 VARCHAR,
qual_1 VARCHAR
) | What is the qual 2 when the qual 1 is 1:16.841? | SELECT qual_2 FROM table_name_49 WHERE qual_1 = "1:16.841" |
CREATE TABLE table_58877 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
) | In what round did someone from North Carolina State get picked larger than 91? | SELECT COUNT("Round") FROM table_58877 WHERE "School/Club Team" = 'north carolina state' AND "Pick" > '91' |
CREATE TABLE table_26402 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
) | How many people directed 'through the looking glass'? | SELECT COUNT("Directed by") FROM table_26402 WHERE "Title" = 'Through The Looking Glass' |
CREATE TABLE table_1342426_18 (
incumbent VARCHAR,
candidates VARCHAR
) | Who was the incumbent in the election of henry garland dupr (d) unopposed? | SELECT incumbent FROM table_1342426_18 WHERE candidates = "Henry Garland Dupré (D) Unopposed" |
CREATE TABLE table_16409745_1 (
dpi VARCHAR,
dimensions__mm_ VARCHAR
) | What is the dpi of a scanner with the mm dimensions 280 x 95 x 40? | SELECT dpi FROM table_16409745_1 WHERE dimensions__mm_ = "280 x 95 x 40" |
CREATE TABLE table_name_97 (
java_ee_compatibility VARCHAR,
edition VARCHAR
) | What is the Java EE compatibility of the 5.2.4 edition? | SELECT java_ee_compatibility FROM table_name_97 WHERE edition = "5.2.4" |
CREATE TABLE tourist_attractions (
tourist_attraction_id number,
attraction_type_code text,
location_id number,
how_to_get_there text,
name text,
description text,
opening_hours text,
other_details text
)
CREATE TABLE tourist_attraction_features (
tourist_attraction_id number,
f... | What are the names of the tourist attractions that can be accessed by bus? | SELECT name FROM tourist_attractions WHERE how_to_get_there = "bus" |
CREATE TABLE table_27961684_1 (
institution VARCHAR,
team_name VARCHAR
) | How many institutes have the team name Spartans? | SELECT COUNT(institution) FROM table_27961684_1 WHERE team_name = "Spartans" |
CREATE TABLE table_15347 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Which Sydney has a Perth of no, an Adelaide of yes, and a Gold Coast of no? | SELECT "Sydney" FROM table_15347 WHERE "Perth" = 'no' AND "Adelaide" = 'yes' AND "Gold Coast" = 'no' |
CREATE TABLE table_14302582_1 (
result VARCHAR,
record VARCHAR
) | What was the result when the team was 4-1? | SELECT result FROM table_14302582_1 WHERE record = "4-1" |
CREATE TABLE airport_aircraft (
id number,
airport_id number,
aircraft_id number
)
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE match (
round number,
location text,
country text,
date text,
fastest_qualifying text,
winning_pilot text,
w... | What are the names of all the aircrafts associated with London Gatwick airport? | SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Gatwick" |
CREATE TABLE table_24486462_1 (
disposable_usd_growth INTEGER,
country VARCHAR
) | What is Australia's Disposable USD growth? | SELECT MAX(disposable_usd_growth) FROM table_24486462_1 WHERE country = "Australia" |
CREATE TABLE table_77776 (
"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 7.11 (53) what venue did they play at? | SELECT "Venue" FROM table_77776 WHERE "Away team score" = '7.11 (53)' |
CREATE TABLE table_7694 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the highest attendance for the game after week 1 against the New York Jets? | SELECT MAX("Attendance") FROM table_7694 WHERE "Week" > '1' AND "Opponent" = 'new york jets' |
CREATE TABLE table_17123 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | How many have been replaced where the appointment date is 10 December 2007 and the manner of departure is quit? | SELECT COUNT("Replaced by") FROM table_17123 WHERE "Date of appointment" = '10 December 2007' AND "Manner of departure" = 'Quit' |
CREATE TABLE table_name_16 (
young_rider_classification VARCHAR,
general_classification VARCHAR,
stage VARCHAR
) | Name the young rider classification for giuseppe saronni at stage 6 | SELECT young_rider_classification FROM table_name_16 WHERE general_classification = "giuseppe saronni" AND stage = "6" |
CREATE TABLE table_17060277_6 (
date VARCHAR,
high_assists VARCHAR
) | Which date did Chris Duhon (13) receive high assists? | SELECT date FROM table_17060277_6 WHERE high_assists = "Chris Duhon (13)" |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | What is minimum age for different job title, sort in descending by the X. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC |
CREATE TABLE table_22473 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
) | How many places associated with latitude 48.247662? | SELECT COUNT("ANSI code") FROM table_22473 WHERE "Latitude" = '48.247662' |
CREATE TABLE table_66935 (
"Stage" text,
"Time (EEST)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | What is the Name, when the Time is 8:10.1? | SELECT "Name" FROM table_66935 WHERE "Time" = '8:10.1' |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | on this month/21, was patient 10855's arterial bp [diastolic] ever less than 61.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias... |
CREATE TABLE table_11624 (
"Year" real,
"Athlete" text,
"Country/State" text,
"Time" text,
"Location" text
) | At what location was the time 1:54:21? | SELECT "Location" FROM table_11624 WHERE "Time" = '1:54:21' |
CREATE TABLE table_14425454_1 (
ground VARCHAR,
crowd VARCHAR
) | What stadiums had an attendance of 8,256? | SELECT ground FROM table_14425454_1 WHERE crowd = "8,256" |
CREATE TABLE table_15187735_15 (
segment_d VARCHAR,
episode VARCHAR
) | What was segment D for episode 183? | SELECT segment_d FROM table_15187735_15 WHERE episode = 183 |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
)... | what is the five most frequently taken laboratory tests since 2104? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) >= '2104' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5) |
CREATE TABLE table_42983 (
"Year" text,
"GP/GS" text,
"Goals" text,
"Assists" text,
"Total Points" text
) | How many assists were there when the total points was 2? | SELECT "Assists" FROM table_42983 WHERE "Total Points" = '2' |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | tell me the cost of a lab test for epithelial cells? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'epithelial cells')) |
CREATE TABLE table_79120 (
"Club" text,
"City" text,
"Stadium" text,
"2007\u201308 result" text,
"Capacity" real
) | What stadium has 9th in 2.hnl as the 2007-08 result? | SELECT "Stadium" FROM table_79120 WHERE "2007\u201308 result" = '9th in 2.hnl' |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE DE... | What is the relationship between lowest and average student GPA for every department? Give me a scatter chart grouping by department code. | SELECT AVG(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE |
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id numbe... | Find the names of the swimmers who have both 'win' and 'loss' results in the record. | SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Loss' |
CREATE TABLE table_69029 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
) | Which Occupation has a Rank of 5th, a Gender of M, with a Residence of orono? | SELECT "Occupation" FROM table_69029 WHERE "Rank" = '5th' AND "Gender" = 'm' AND "Residence" = 'orono' |
CREATE TABLE table_name_79 (
type VARCHAR,
quantity VARCHAR
) | Which type has 140 made? | SELECT type FROM table_name_79 WHERE quantity = "140" |
CREATE TABLE table_28232 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | how many million u.s. viewers watched the episode directed by dan lerner? | SELECT "U.S. viewers (million)" FROM table_28232 WHERE "Directed by" = 'Dan Lerner' |
CREATE TABLE table_41270 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | Who was the rider with a grid of 36? | SELECT "Rider" FROM table_41270 WHERE "Grid" = '36' |
CREATE TABLE discount_coupons (
coupon_id number,
date_issued time,
coupon_amount number
)
CREATE TABLE view_product_availability (
product_id number,
booking_id number,
status_date time,
available_yn text
)
CREATE TABLE payments (
payment_id number,
booking_id number,
customer... | What is the id of the product that is booked for 3 times? | SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3 |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
d... | please show me CO flights from SAN FRANCISCO to PITTSBURGH on friday | 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 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 A... |
CREATE TABLE table_28211988_1 (
womens_singles VARCHAR,
season VARCHAR
) | How many people are women's singles in the season of 2000/01? | SELECT COUNT(womens_singles) FROM table_28211988_1 WHERE season = "2000/01" |
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
l... | What is the name of member in charge of greatest number of events? | SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_name_6 (
place INTEGER,
artist VARCHAR,
points VARCHAR
) | What is the highest place of a song by Henri D s that has fewer than 8 points? | SELECT MAX(place) FROM table_name_6 WHERE artist = "henri dès" AND points < 8 |
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... | provide the number of patients whose age is less than 74 and drug code is neut? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.formulary_drug_cd = "NEUT" |
CREATE TABLE table_19426 (
"State/UT Code" real,
"India/State/UT" text,
"Literate Persons (%)" text,
"Males (%)" text,
"Females (%)" text
) | What is the percentage of all the literate people where females are 73.17? | SELECT "Literate Persons (%)" FROM table_19426 WHERE "Females (%)" = '73.17' |
CREATE TABLE table_66651 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which county did the player with a total of 294 represent? | SELECT "Country" FROM table_66651 WHERE "Total" = '294' |
CREATE TABLE table_73569 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Number Of Dances" real,
"Total Points Earned" real,
"Average" text
) | What was the name of the couple if the number of dances is 6? | SELECT "Couple" FROM table_73569 WHERE "Number Of Dances" = '6' |
CREATE TABLE table_52234 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which competition took place at Stade Fernand Fournier, Arles? | SELECT "Competition" FROM table_52234 WHERE "Venue" = 'stade fernand fournier, arles' |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId n... | Get Vote Data for Posts. | SELECT v.UserId, vt.Name, COUNT(*) FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE p.OwnerUserId = 154486 GROUP BY vt.Name, v.UserId |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | During the next 6 semesters which classes will be offered ? | SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se... |
CREATE TABLE table_13110459_2 (
rating VARCHAR,
viewers__m_ VARCHAR
) | what are all the rating with viewers (m) being 2.61 | SELECT rating FROM table_13110459_2 WHERE viewers__m_ = "2.61" |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
) | Draw a scatter chart about the correlation between Snatch and Total . | SELECT Snatch, Total FROM body_builder |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | Show me a bar chart for what are the department names and how many employees work in each of them?, rank y axis from high to low order please. | SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY COUNT(*) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.