answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT dar FROM table_15887683_5 WHERE n° = "336" AND language = "Italian" | What DAR is available for n. 336 in Italian? | CREATE TABLE table_15887683_5 (dar VARCHAR, n° VARCHAR, language VARCHAR) |
SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' | Find the first name and office of the professor who is in the history department and has a Ph.D. degree. | CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT lost FROM table_name_33 WHERE drawn = "0" AND tries_against = "41" | What is the value for Lost when Drawn is 0, and Tries against is 41? | CREATE TABLE table_name_33 (
lost VARCHAR,
drawn VARCHAR,
tries_against VARCHAR
) |
SELECT n° FROM table_15887683_5 WHERE package_option = "Sky Cinema" AND content = "cinema" AND television_service = "Sky Cinema" + 24 | What are the values of n for cinema content provided by Sky Cinema +24 on its Sky Cinema package? | CREATE TABLE table_15887683_5 (n° VARCHAR, television_service VARCHAR, package_option VARCHAR, content VARCHAR) |
SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | Find the first names of all instructors who have taught some course and the course code. | CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC | Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please. | 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
) |
SELECT language FROM table_15887683_5 WHERE television_service = "Sky Cinema Passion" AND n° = "308" | What language is Sky Cinema Passion television service n. 308? | CREATE TABLE table_15887683_5 (language VARCHAR, television_service VARCHAR, n° VARCHAR) |
SELECT T2.emp_fname, T3.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 | Find the first names of all instructors who have taught some course and the course description. | CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT venue FROM table_name_52 WHERE away_team = "south melbourne" | Where does South Melbourne play? | CREATE TABLE table_name_52 (
venue VARCHAR,
away_team VARCHAR
) |
SELECT package_option FROM table_15887683_5 WHERE content = "cinema" AND n° = "333" | What package offers cinema content and is n. 333? | CREATE TABLE table_15887683_5 (package_option VARCHAR, content VARCHAR, n° VARCHAR) |
SELECT T2.emp_fname, T4.prof_office, T3.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 | Find the first names and offices of all instructors who have taught some course and also find the course description. | CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ... | what are the procedures that are the top five most commonly received in 2100? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
su... |
SELECT COUNT(dar) FROM table_15887683_9 WHERE television_service = "Disney Channel" AND n° = 613 | Name the total number of dar for disney channel and number is 613 | CREATE TABLE table_15887683_9 (dar VARCHAR, television_service VARCHAR, n° VARCHAR) |
SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name 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 JOIN department AS T5 ON T4.dept_code = T5.dept_code | Find the first names and offices of all instructors who have taught some course and the course description and the department name. | CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VA... |
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart. | CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHA... |
SELECT country FROM table_15887683_9 WHERE dar = "16:9" AND language = "Italian English" AND television_service = "Disney XD +2" | Name the country when dar is 16:9 for italian english for disney xd +2 | CREATE TABLE table_15887683_9 (country VARCHAR, television_service VARCHAR, dar VARCHAR, language VARCHAR) |
SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code | Find names of all students who took some course and the course description. | CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) |
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME()... | what was the name of the laboratory test that patient 021-141335 received last in a month before? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... |
SELECT player FROM table_15893020_2 WHERE best_bowling = "2/43" | Who was the player with a bowling best of 2/43? | CREATE TABLE table_15893020_2 (player VARCHAR, best_bowling VARCHAR) |
SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' | Find names of all students who took some course and got A or C. | CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) |
SELECT "Date" FROM table_68490 WHERE "Score" = '2-1' | Which date has a score of 2-1? | CREATE TABLE table_68490 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) |
SELECT MAX(maidens) FROM table_15893020_2 WHERE best_bowling = "1/13" | What is the highest number of maidens when the bowling best was 1/13? | CREATE TABLE table_15893020_2 (maidens INTEGER, best_bowling VARCHAR) |
SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting' | Find the first names of all professors in the Accounting department who is teaching some course and the class room. | CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT COUNT("Year") FROM table_71745 WHERE "Venue" = 'sydney cricket ground' AND "Opponent" = 'parramatta eels' | What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels? | CREATE TABLE table_71745 (
"Year" real,
"Opponent" text,
"Competition" text,
"Score" text,
"Venue" text,
"Attendance" text
) |
SELECT overs FROM table_15893020_2 WHERE player = "Oliver Hannon-Dalby" | How many overs did Oliver Hannon-Dalby have? | CREATE TABLE table_15893020_2 (overs VARCHAR, player VARCHAR) |
SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems' | Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department. | CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) |
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_S... | what 's the earliest arriving flight between BOSTON and WASHINGTON DC | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... |
SELECT MAX(5 AS w) FROM table_15893020_2 WHERE average = "21.33" | What is the highest number of 5w when there was a 21.33 average? | CREATE TABLE table_15893020_2 (average VARCHAR) |
SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018 | What is the last name of the student who got a grade A in the class with code 10018. | CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR) |
SELECT "Stem Meaning" FROM table_31998 WHERE "3rd person sg" = 'ical' | Tell me the Stem Meaning of ical | CREATE TABLE table_31998 (
"Stem Meaning" text,
"2nd person sg" text,
"2nd person sg honorific" text,
"3rd person sg" text,
"3rd person sg honorific" text
) |
SELECT country FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "2040(93%)" | What are the countries in which the agricultural use (m 3 /p/yr)(in %) is 2040(93%)? | CREATE TABLE table_15909409_2 (country VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR) |
SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.' | Find the first name and office of history professor who did not get a Ph.D. degree. | CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) |
SELECT SUM("Wins") FROM table_8680 WHERE "Draws" < '2' | How many wins happened when there were fewer than 2 draws? | CREATE TABLE table_8680 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) |
SELECT COUNT(country) FROM table_15909409_2 WHERE per_capita_withdrawal__m_3__p_yr_ = 372 | How many countries had a per capita withdrawal (m 3 /p/yr) of 372? | CREATE TABLE table_15909409_2 (country VARCHAR, per_capita_withdrawal__m_3__p_yr_ VARCHAR) |
SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1 | Find the first names of professors who are teaching more than one class. | CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) |
SELECT MIN(_number) FROM table_10749367_3 WHERE air_date = "18 April 2007" | What episode aired on 18 April 2007? | CREATE TABLE table_10749367_3 (
_number INTEGER,
air_date VARCHAR
) |
SELECT COUNT(total_freshwater_withdrawal__km_3__yr_) FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "428(62%)" | How many countries had a total freshwater withdrawal (km 3 /yr) where the agricultural use (m 3 /p/yr)(in %) was 428(62%)? | CREATE TABLE table_15909409_2 (total_freshwater_withdrawal__km_3__yr_ VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR) |
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1 | Find the first names of students who took exactly one class. | CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR) |
SELECT runner_up FROM table_name_62 WHERE name = "pacific life open" AND year = "2006" | Who was runner-up in the 2006 Pacific Life Open? | CREATE TABLE table_name_62 (
runner_up VARCHAR,
name VARCHAR,
year VARCHAR
) |
SELECT total_freshwater_withdrawal__km_3__yr_ FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "1029(96%)" | In Pakistan, what was the total freshwater withdrawal (km 3 /yr) where the agricultural use (m 3 /p/yr)(in %) was 1029(96%)? | CREATE TABLE table_15909409_2 (total_freshwater_withdrawal__km_3__yr_ VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR) |
SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%' | Find the name of department that offers the class whose description has the word "Statistics". | CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) |
SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" | what is age and procedure short title of subject id 2560? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... |
SELECT country FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "794(86%)" | What was the country in which the agricultural use (m 3 /p/yr)(in %) was 794(86%)? | CREATE TABLE table_15909409_2 (country VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR) |
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' | What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class? | CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR, stu_lname VARCHAR) |
SELECT MAX(points_for) FROM table_name_25 WHERE record = "12–2" AND points_against > 6 | What is the highest Points when the record was 12 2, and the Points Against are larger than 6? | CREATE TABLE table_name_25 (
points_for INTEGER,
record VARCHAR,
points_against VARCHAR
) |
SELECT COUNT(country) FROM table_15909409_2 WHERE total_freshwater_withdrawal__km_3__yr_ = "169.39" | In how many countries was the total freshwater withdrawal (km 3 /yr) 169.39? | CREATE TABLE table_15909409_2 (country VARCHAR, total_freshwater_withdrawal__km_3__yr_ VARCHAR) |
SELECT COUNT(*) FROM club | How many clubs are there? | CREATE TABLE club (Id VARCHAR) |
WITH ScoreByTag AS (SELECT pt.TagId, p.Score, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.Score DESC) AS "rank" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY st.Score DESC) AS "rank", t.TagName, st.Score FROM ScoreByTag AS st INNER JOIN Tags AS t ON st.TagId = t.Id ... | Top Voted Questions By Tag. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... |
SELECT date FROM table_1590652_4 WHERE winning_score = 67 - 67 - 63 = 197 | Name the date of winning score being 67-67-63=197 | CREATE TABLE table_1590652_4 (date VARCHAR, winning_score VARCHAR) |
SELECT DISTINCT Region FROM club ORDER BY Region | List the distinct region of clubs in ascending alphabetical order. | CREATE TABLE club (Region VARCHAR) |
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC | Show me mean rating by languages in a histogram, sort X from high to low order. | CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(5... |
SELECT runner_s__up FROM table_1590652_4 WHERE tournament = "WGC-Accenture Match Play Championship" | Name the runners up for when tournament is wgc-accenture match play championship | CREATE TABLE table_1590652_4 (runner_s__up VARCHAR, tournament VARCHAR) |
SELECT AVG(Gold) FROM club_rank | What is the average number of gold medals for clubs? | CREATE TABLE club_rank (Gold INTEGER) |
SELECT "Score" FROM table_17347 WHERE "Record" = '35–33' | what's the score where record is 35 33 | CREATE TABLE table_17347 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) |
SELECT COUNT(no) FROM table_1590652_4 WHERE date = "30 May 2010" | Name the total number when date is 30 may 2010 | CREATE TABLE table_1590652_4 (no VARCHAR, date VARCHAR) |
SELECT Competition_type, Country FROM competition | What are the types and countries of competitions? | CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR) |
SELECT loss FROM table_name_51 WHERE record = "27-32" | What was the score of the game that put the team at 27-32? | CREATE TABLE table_name_51 (
loss VARCHAR,
record VARCHAR
) |
SELECT margin_of_victory FROM table_1590652_4 WHERE date = "10 Jul 2011" | Name th margin of victory when date is 10 jul 2011 | CREATE TABLE table_1590652_4 (margin_of_victory VARCHAR, date VARCHAR) |
SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> "Tournament" | What are the distinct years in which the competitions type is not "Tournament"? | CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR) |
SELECT to_par FROM table_name_37 WHERE place = "t7" AND player = "bill britton" | What was the To par for bill britton when he placed t7? | CREATE TABLE table_name_37 (
to_par VARCHAR,
place VARCHAR,
player VARCHAR
) |
SELECT MAX(no) FROM table_1590652_4 WHERE tournament = "Madrid Masters" | Name the most number when tournament is madrid masters | CREATE TABLE table_1590652_4 (no INTEGER, tournament VARCHAR) |
SELECT MAX(Silver), MIN(Silver) FROM club_rank | What are the maximum and minimum number of silver medals for clubs. | CREATE TABLE club_rank (Silver INTEGER) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Laparoscopic lysis of peritoneal adhesions" | what is the number of patients whose admission type is elective and procedure long title is laparoscopic lysis of peritoneal adhesions? | 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 (... |
SELECT MAX(episode_number) FROM table_1590967_2 WHERE air_date = "6 January 2006" | Name the most episode numbers of 6 january 2006 | CREATE TABLE table_1590967_2 (episode_number INTEGER, air_date VARCHAR) |
SELECT COUNT(*) FROM club_rank WHERE Total < 10 | How many clubs have total medals less than 10? | CREATE TABLE club_rank (Total INTEGER) |
SELECT record FROM table_name_64 WHERE time = "4:00" AND opponent = "krzysztof soszynski" | What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00? | CREATE TABLE table_name_64 (
record VARCHAR,
time VARCHAR,
opponent VARCHAR
) |
SELECT COUNT(validation) FROM table_15905399_1 WHERE iin_ranges = "36" | How many validations are listed for the iin range 36? | CREATE TABLE table_15905399_1 (validation VARCHAR, iin_ranges VARCHAR) |
SELECT name FROM club ORDER BY Start_year | List all club names in ascending order of start year. | CREATE TABLE club (name VARCHAR, Start_year VARCHAR) |
SELECT status FROM table_name_35 WHERE date = "16/12/1995" | What's the status on 16/12/1995? | CREATE TABLE table_name_35 (
status VARCHAR,
date VARCHAR
) |
SELECT validation FROM table_15905399_1 WHERE iin_ranges = "5610, 560221-560225" | What is the validation for iin ranges 5610, 560221-560225? | CREATE TABLE table_15905399_1 (validation VARCHAR, iin_ranges VARCHAR) |
SELECT name FROM club ORDER BY name DESC | List all club names in descending alphabetical order. | CREATE TABLE club (name VARCHAR) |
SELECT COUNT("Crowd") FROM table_56036 WHERE "Away team score" = '23.18 (156)' | What was the crowd size when the visiting team scored 23.18 (156)? | CREATE TABLE table_56036 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) |
SELECT length FROM table_15905399_1 WHERE iin_ranges = "51-55" | What is the length for iin range 51-55? | CREATE TABLE table_15905399_1 (length VARCHAR, iin_ranges VARCHAR) |
SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | Please show the names and the players of clubs. | CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR) |
SELECT MAX(frequency_mhz) FROM table_name_77 WHERE call_sign = "w292cu" | what is the highest frequency mhz with the call sign w292cu? | CREATE TABLE table_name_77 (
frequency_mhz INTEGER,
call_sign VARCHAR
) |
SELECT active FROM table_15905399_1 WHERE iin_ranges = "4" | Is the iin range 4 active? | CREATE TABLE table_15905399_1 (active VARCHAR, iin_ranges VARCHAR) |
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing" | Show the names of clubs that have players with position "Right Wing". | CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR) |
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uni... | how many patients were prescribed 2 ml : metoclopramide hcl 5 mg/ml inj soln within 2 months since 2103 after being diagnosed with copd - no limitations? | 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 lab (
labid numbe... |
SELECT COUNT(episode_number) FROM table_1590967_7 WHERE guest_host = "Pamela Anderson" | What episode did Pamela Anderson guest host. | CREATE TABLE table_1590967_7 (episode_number VARCHAR, guest_host VARCHAR) |
SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB" | What is the average points of players from club with name "AIB". | CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR) |
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC | What is the average high temperature for each day of week Plot them as bar chart, rank Y-axis in desc order. | CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
win... |
SELECT musical_guest__song_performed_ FROM table_1590967_7 WHERE guest_host = "Barbara Windsor" | What song was performed when Barbara Windsor was the guest host? | CREATE TABLE table_1590967_7 (musical_guest__song_performed_ VARCHAR, guest_host VARCHAR) |
SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION | List the position of players and the average number of points of players of each position. | CREATE TABLE player (POSITION VARCHAR, Points INTEGER) |
SELECT MIN(production_code) FROM table_name_14 WHERE series__number = 10 | What was the lowest production code value in series #10? | CREATE TABLE table_name_14 (
production_code INTEGER,
series__number VARCHAR
) |
SELECT weight__kg_ FROM table_15926991_1 WHERE jockey = "D. Nikolic" | What is the entry for weight in kilograms of jockey D. Nikolic? | CREATE TABLE table_15926991_1 (weight__kg_ VARCHAR, jockey VARCHAR) |
SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20 | List the position of players with average number of points scored by players of that position bigger than 20. | CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER) |
SELECT SUM("Attendance") FROM table_56683 WHERE "Record" = '5-9-0' | What is the total of attendance with a Record of 5-9-0? | CREATE TABLE table_56683 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) |
SELECT group FROM table_15926991_1 WHERE time = "1:11.65" | Which group had the time 1:11.65? | CREATE TABLE table_15926991_1 (group VARCHAR, time VARCHAR) |
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | List the types of competition and the number of competitions of each type. | CREATE TABLE competition (Competition_type VARCHAR) |
SELECT MIN("Laps") FROM table_78184 WHERE "Time/Retired" = '+ 3:27.3' AND "Grid" > '16' | What is the low lap total for a grid larger than 16 and has a Time/Retired of + 3:27.3? | CREATE TABLE table_78184 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) |
SELECT winner_2nd FROM table_15926991_1 WHERE time = "1:35.98" | Which horse won with a time of 1:35.98 and what was their position? | CREATE TABLE table_15926991_1 (winner_2nd VARCHAR, time VARCHAR) |
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 | List the most common type of competition. | CREATE TABLE competition (Competition_type VARCHAR) |
SELECT "representative" FROM table_203_778 WHERE "appointed by" = 'franklin pierce' | which reps were only appointed by franklin pierce ? | CREATE TABLE table_203_778 (
id number,
"representative" text,
"title" text,
"presentation\nof credentials" text,
"termination\nof mission" text,
"appointed by" text
) |
SELECT engine_type FROM table_15944_5 WHERE scenario = "Space shuttle vacuum" | What engine type is used in a Space Shuttle Vacuum scenario? | CREATE TABLE table_15944_5 (engine_type VARCHAR, scenario VARCHAR) |
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 | List the types of competition that have at most five competitions of that type. | CREATE TABLE competition (Competition_type VARCHAR) |
SELECT "Champions" FROM table_52977 WHERE "Coeff" = '1.000' | Which Champion has a Coeff of 1.000? | CREATE TABLE table_52977 (
"Season" text,
"UEFA Season" text,
"Coeff" text,
"Ranking" real,
"Champions" text,
"Runner-up" text,
"3rd place" text,
"Cup winner" text,
"Cup runner-up" text
) |
SELECT COUNT(effective_exhaust_velocity__m_s_) FROM table_15944_5 WHERE scenario = "Space shuttle vacuum" | What is the effective exhaust velocity in a Space Shuttle Vacuum? | CREATE TABLE table_15944_5 (effective_exhaust_velocity__m_s_ VARCHAR, scenario VARCHAR) |
SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player) | List the names of clubs that do not have any players. | CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR) |
SELECT "2nd leg" FROM table_62868 WHERE "Team 2" = 'teram' | What is the 2nd leg in match with team 2 of Teram? | CREATE TABLE table_62868 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) |
SELECT MAX(specific_impulse__s_) FROM table_15944_5 WHERE effective_exhaust_velocity__m_s_ = 4423 | What is the maximum specific impulse with a 4423 m/s effective exhaust velocity? | CREATE TABLE table_15944_5 (specific_impulse__s_ INTEGER, effective_exhaust_velocity__m_s_ VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.