table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_15511 (
"Date" text,
"Time ( CEST )" real,
"Team #1" text,
"Res." text,
"Team #2" text,
"Round" text,
"Attendance" real
) | What id the team with a smaller Time than 18? | SELECT "Team #1" FROM table_15511 WHERE "Time ( CEST )" < '18' |
CREATE TABLE table_23015396_1 (
year VARCHAR,
date VARCHAR
) | Name the number of year for june 30 | SELECT COUNT(year) FROM table_23015396_1 WHERE date = "June 30" |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
... | Top 10 names on Stack Overflow beginning by 'Jon'. | SELECT COUNT(DisplayName), DisplayName FROM Users WHERE UPPER(DisplayName) LIKE 'JON%' GROUP BY DisplayName ORDER BY COUNT(DisplayName) DESC LIMIT 10 |
CREATE TABLE table_name_76 (
home VARCHAR,
score VARCHAR
) | Who has the Home Score of 52-54? | SELECT home FROM table_name_76 WHERE score = "52-54" |
CREATE TABLE table_34734 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | Capacity smaller than 3,292, and a Highest larger than 812, and a Stadium of strathclyde homes stadium has what sum of the average? | SELECT SUM("Average") FROM table_34734 WHERE "Capacity" < '3,292' AND "Highest" > '812' AND "Stadium" = 'strathclyde homes stadium' |
CREATE TABLE table_21453 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the high assists on April 7? | SELECT "High assists" FROM table_21453 WHERE "Date" = 'April 7' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday, and show Y-axis in desc order. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC |
CREATE TABLE table_17111812_1 (
tenth VARCHAR,
ninth VARCHAR
) | When Kubb is in 9th, who is in 10th? | SELECT tenth FROM table_17111812_1 WHERE ninth = "Kubb" |
CREATE TABLE table_47085 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
) | Can you tell me the Score that has the Opponent of at edmonton oilers? | SELECT "Score" FROM table_47085 WHERE "Opponent" = 'at edmonton oilers' |
CREATE TABLE table_name_14 (
long VARCHAR,
ryds VARCHAR
) | What is the Long when the ryds is 18? | SELECT long FROM table_name_14 WHERE ryds = "18" |
CREATE TABLE table_20688030_1 (
county VARCHAR,
obama_percentage VARCHAR
) | What is the total of countys where Obama is popular by 35.44%? | SELECT COUNT(county) FROM table_20688030_1 WHERE obama_percentage = "35.44%" |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)... | Give me a pie chart to show the proportion of event details of events that have more than one participant. | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details |
CREATE TABLE table_name_90 (
score VARCHAR,
high_points VARCHAR
) | Which Score has High points of douglas (15)? | SELECT score FROM table_name_90 WHERE high_points = "douglas (15)" |
CREATE TABLE table_61811 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | SELECT "2011" FROM table_61811 WHERE "2012" = 'a' AND "Tournament" = 'french open' |
CREATE TABLE table_69839 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What is the earliest year in the 125cc class with more than 102 points and a rank of 2nd? | SELECT MIN("Year") FROM table_69839 WHERE "Class" = '125cc' AND "Points" > '102' AND "Rank" = '2nd' |
CREATE TABLE table_name_56 (
distance VARCHAR
) | What is the number of 2012 passengers in millions that have traveled a distance of 1075km? | SELECT COUNT(2012 AS _passengers__in_millions_) FROM table_name_56 WHERE distance = "1075km" |
CREATE TABLE table_28445 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | What is the minimum number of f/laps? | SELECT MIN("F/Laps") FROM table_28445 |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
) | how many matches were in 2007 ? | SELECT COUNT(*) FROM table_204_854 WHERE "date" = 2007 |
CREATE TABLE table_name_78 (
country VARCHAR,
score VARCHAR
) | What country was the golfer with a score of 72-72-72=216 representing? | SELECT country FROM table_name_78 WHERE score = 72 - 72 - 72 = 216 |
CREATE TABLE table_758 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who ran for office in the Alabama 1 district? | SELECT "Candidates" FROM table_758 WHERE "District" = 'Alabama 1' |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CRE... | List all the information about course authors and tutors in alphabetical order of the personal name. | SELECT * FROM course_authors_and_tutors ORDER BY personal_name |
CREATE TABLE table_name_55 (
word VARCHAR,
pronunciation_b VARCHAR
) | Name the word with pronunciation b of *s ks | SELECT word FROM table_name_55 WHERE pronunciation_b = "*sɨks" |
CREATE TABLE table_name_5 (
political_party VARCHAR,
monarchs_served VARCHAR,
birth_place VARCHAR
) | To which political party did the prime minister who served under George V and was born in Manchester belong? | SELECT political_party FROM table_name_5 WHERE monarchs_served = "george v" AND birth_place = "manchester" |
CREATE TABLE table_name_27 (
name VARCHAR,
place_of_birth VARCHAR
) | Who was born in Porsgrunn? | SELECT name FROM table_name_27 WHERE place_of_birth = "porsgrunn" |
CREATE TABLE artist (
gender VARCHAR,
artist_name VARCHAR
)
CREATE TABLE song (
artist_name VARCHAR,
resolution VARCHAR
) | Return the gender and name of artist who produced the song with the lowest resolution. | SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1 |
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
)
... | out of total number of patient discharged after long term hospital care, calculate the maximum age of divorcee patients. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
... | How many home games by each year (bin the year attr into weekdays interval)? Give me a line chart, list X-axis from low to high order. | SELECT year, COUNT(year) FROM home_game ORDER BY year |
CREATE TABLE table_22883210_9 (
game INTEGER,
team VARCHAR
) | What is the highest game number where the team was Cleveland? | SELECT MAX(game) FROM table_22883210_9 WHERE team = "Cleveland" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | since 207 days ago, list the daily maximum heartrate of patient 007-15837. | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837')) AND NOT vitalperiodic.heartrate IS NULL... |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
... | how many patient have died after they were diagnosed with cardiac arrest within 2 months? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and could you sort by the Y in ascending please? | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) |
CREATE TABLE table_67857 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | What position did the 5th place team after 1992 with over 346 laps finish in? | SELECT "Pos." FROM table_67857 WHERE "Class Pos." = '5th' AND "Year" > '1992' AND "Laps" > '346' |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | I want to see 13 -credit Business Forecasting and Equity Valuation courses . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Business Forecasting and Equity Valuation%' OR name LIKE '%Business Forecasting and Equity Valuation%') AND credits = 13 |
CREATE TABLE table_64101 (
"Rank" real,
"Team" text,
"Apps" real,
"Record" text,
"Win %" real
) | What is the lowest apps for rank 3 and 0% wins? | SELECT MIN("Apps") FROM table_64101 WHERE "Rank" = '3' AND "Win %" < '0' |
CREATE TABLE table_31807 (
"Class" text,
"Type" text,
"No. built (Converted*)" text,
"Year built (Converted*)" text,
"No. range" text,
"Withdrawn" real
) | Tell me the year built for number built of 10 | SELECT "Year built (Converted*)" FROM table_31807 WHERE "No. built (Converted*)" = '10' |
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... | give me the number of patients whose insurance is medicare and days of hospital stay is greater than 13? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.days_stay > "13" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | during yesterday, did patient 035-24054 have any output (ml)-nephrostomy left output? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
CREATE TABLE table_name_61 (
career VARCHAR,
super_g VARCHAR,
combined VARCHAR
) | What Career has a Super G of 5, and a Combined of 6? | SELECT career FROM table_name_61 WHERE super_g = "5" AND combined = "6" |
CREATE TABLE table_10128185_2 (
northern_ireland VARCHAR,
total VARCHAR
) | How many votes did Northern Ireland cast if the total was 35? | SELECT northern_ireland FROM table_10128185_2 WHERE total = 35 |
CREATE TABLE table_12828723_5 (
lost VARCHAR
) | What was the lost with tries for? | SELECT lost FROM table_12828723_5 WHERE "tries_for" = "tries_for" |
CREATE TABLE table_name_86 (
score VARCHAR,
team_1 VARCHAR
) | What is the 2nd round with a score of 3 - 3, and a team 1 fc gueugnon (d2)? | SELECT 2 AS nd_round FROM table_name_86 WHERE score = "3 - 3" AND team_1 = "fc gueugnon (d2)" |
CREATE TABLE table_43612 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is the record for the opponent the Cleveland Cavaliers? | SELECT "Record" FROM table_43612 WHERE "Opponent" = 'cleveland cavaliers' |
CREATE TABLE table_name_73 (
team_2 VARCHAR
) | what is the 1st round when team 2 is usl dunkerque (d2)? | SELECT 1 AS st_round FROM table_name_73 WHERE team_2 = "usl dunkerque (d2)" |
CREATE TABLE table_14920 (
"Station" text,
"Frequency" real,
"Network Affiliation" text,
"Format" text,
"City of License" text,
"Status" text
) | What is the largest frequency owned by multicultural broadcasting with a Format of vietnamese? | SELECT MAX("Frequency") FROM table_14920 WHERE "Status" = 'owned by multicultural broadcasting' AND "Format" = 'vietnamese' |
CREATE TABLE table_79493 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What year is the Grim Fandango with a windows platform? | SELECT "Year" FROM table_79493 WHERE "Platform(s)" = 'windows' AND "Game" = 'grim fandango' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose ethnicity is black/african american and procedure short title is pericardiocentesis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Pericardiocentesis" |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP... | how many sections does each course has?, list by the Y in desc. | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
) | How many companies each investor has invested? Show me a bar chart. | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
r... | how many patients have been discharged from hospital until 2 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-2 year') |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
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 train (
id int,
train... | Group by services attribute in station table and compute the total number of services with a bar chart, order by the services in ascending. | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services |
CREATE TABLE table_40938 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
) | What is the Musical Guest/Song with an original airdate of january 2008? | SELECT "Musical Guest/Song performed" FROM table_40938 WHERE "Original Airdate" = 'january 2008' |
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... | what is the number of patients born before 2137 who are still alive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2137" |
CREATE TABLE table_76361 (
"Date" text,
"Name of ship" text,
"Flag" text,
"Tonnage" real,
"Fate" text
) | What is the average tonnage of the ship named proletarij? | SELECT AVG("Tonnage") FROM table_76361 WHERE "Name of ship" = 'proletarij' |
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 patients posses private insurance and are born before 2023? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dob_year < "2023" |
CREATE TABLE table_name_35 (
rank VARCHAR,
wins VARCHAR,
player VARCHAR
) | What rank is Miller Barber with more than 11 wins? | SELECT rank FROM table_name_35 WHERE wins > 11 AND player = "miller barber" |
CREATE TABLE table_name_6 (
country VARCHAR,
score VARCHAR
) | What country did the player who scored 73-73-65=211 come from? | SELECT country FROM table_name_6 WHERE score = 73 - 73 - 65 = 211 |
CREATE TABLE table_53113 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
) | Which System's Name is Gemulator? | SELECT "System" FROM table_53113 WHERE "Name" = 'gemulator' |
CREATE TABLE table_name_63 (
draw INTEGER,
place VARCHAR,
points VARCHAR,
artist VARCHAR
) | What is the Draw number of the song by Artist of 'Loudest Whisper' with 68 or less Points with a place of 9 or larger? | SELECT AVG(draw) FROM table_name_63 WHERE points < 68 AND artist = "loudest whisper" AND place > 9 |
CREATE TABLE table_name_45 (
player VARCHAR,
position VARCHAR,
team_from VARCHAR
) | Who is the player from Hotchkiss School with a position of d? | SELECT player FROM table_name_45 WHERE position = "d" AND team_from = "hotchkiss school" |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | compared to second measured on the first icu visit, is heart rate of patient 13897 greater than first measured on the first icu visit? | SELECT (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 = 13897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
CREATE TABLE table_name_6 (
Id VARCHAR
) | What is the average 2007 value for a 2006 of 2.8 and 2009 under 20? | SELECT AVG(2007) FROM table_name_6 WHERE 2009 < 20 AND 2006 = 2.8 |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | what's the cost for a glucose, pleural laboratory test? | 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 = 'glucose, pleural')) |
CREATE TABLE table_72719 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
) | What are the cities/towns located in the municipality of Moss? | SELECT "City/town" FROM table_72719 WHERE "Municipality" = 'Moss' |
CREATE TABLE table_name_31 (
opponent VARCHAR,
record VARCHAR
) | Which opponent has a Record of 4-5? | SELECT opponent FROM table_name_31 WHERE record = "4-5" |
CREATE TABLE table_75582 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
) | What is the height of the building named 555 17th street? | SELECT "Height ft / m" FROM table_75582 WHERE "Name" = '555 17th street' |
CREATE TABLE table_name_80 (
date VARCHAR,
time VARCHAR
) | Which Date has a Time of 12:00? | SELECT date FROM table_name_80 WHERE time = "12:00" |
CREATE TABLE table_name_7 (
player VARCHAR,
school VARCHAR
) | what player went to ul-monroe | SELECT player FROM table_name_7 WHERE school = "ul-monroe" |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | is the heart rate of patient 25300 last measured on the first icu visit less than second to last measured on the first icu visit. | SELECT (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 = 25300) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
CREATE TABLE table_name_38 (
giro_di_lombardia VARCHAR,
paris_roubaix VARCHAR
) | Which Giro di Lombardia has a Paris Roubaix of servais knaven ( ned )? | SELECT giro_di_lombardia FROM table_name_38 WHERE paris_roubaix = "servais knaven ( ned )" |
CREATE TABLE table_name_75 (
name_of_the_song VARCHAR,
kind_of_the_song VARCHAR,
singer VARCHAR
) | Which song has a ending theme, and is sung by miriam yeung? | SELECT name_of_the_song FROM table_name_75 WHERE kind_of_the_song = "ending theme" AND singer = "miriam yeung" |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | Which are the courses required for the major but not in the CLIMATE department ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'CLIMATE' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE PROFESSOR (
EMP_N... | Give me a histogram for what is the number of professors for different school?, could you order in asc by the x axis? | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE |
CREATE TABLE table_name_47 (
kaz_hayashi VARCHAR,
block_a VARCHAR
) | Name the kaz hayashi with block A of Shuji Kondo | SELECT kaz_hayashi FROM table_name_47 WHERE block_a = "shuji kondo" |
CREATE TABLE table_name_74 (
auckland VARCHAR,
gold_coast VARCHAR,
melbourne VARCHAR,
sydney VARCHAR,
perth VARCHAR
) | yes or no for the auckland with a yes for sydney, no for perth, yes for melbourne and yes for the gold coast? | SELECT auckland FROM table_name_74 WHERE sydney = "yes" AND perth = "no" AND melbourne = "yes" AND gold_coast = "yes" |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,... | could you please give me the cost of a round trip flight from DENVER to PITTSBURGH | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... |
CREATE TABLE table_22355_20 (
athlete VARCHAR,
nation VARCHAR,
rank VARCHAR
) | Who is the athlete from the nation of Ethiopia (eth) who had a rank bigger than 7.0? | SELECT athlete FROM table_22355_20 WHERE nation = "Ethiopia (ETH)" AND rank > 7.0 |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE regions (
region_id number,
region_n... | What are total salaries and department id for each department that has more than 2 employees? | SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2 |
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 who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, and list in desc by the total number of manager id please. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC |
CREATE TABLE table_76857 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What is High Points, when High Rebounds is 'Dwight Howard (16)'? | SELECT "High points" FROM table_76857 WHERE "High rebounds" = 'dwight howard (16)' |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | For upper level electives , which courses count ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
CREATE TABLE table_22883210_7 (
location_attendance VARCHAR,
game VARCHAR
) | Where was game 41 held, and how many people attended? | SELECT location_attendance FROM table_22883210_7 WHERE game = 41 |
CREATE TABLE table_53832 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
) | Who was the owner in 1996 of trainer Nick Zito? | SELECT "Owner" FROM table_53832 WHERE "Trainer" = 'nick zito' AND "Year" = '1996' |
CREATE TABLE table_train_259 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hearing_problem" bool,
"heart_disease" bool,
"high_blood_pressure" bool,
"diabetic" string,
"immune_deficiency_disorder" bool,
"visual_impairment" bool... | uncontrolled high blood pressure ( >= 140 / 90 mmhg ) | SELECT * FROM table_train_259 WHERE high_blood_pressure = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 |
CREATE TABLE table_58247 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What's the Loss listed with a Score of 5-1? | SELECT "Loss" FROM table_58247 WHERE "Score" = '5-1' |
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
)
... | what is the number of patients whose age is less than 77 and drug code is nabc50i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "77" AND prescriptions.formulary_drug_cd = "NABC50I" |
CREATE TABLE table_68043 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
) | What is the Panthers' Division Record? | SELECT "Division Record" FROM table_68043 WHERE "Team" = 'panthers' |
CREATE TABLE table_11877 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the loss for the game on July 1 with an attendance more than 35,621? | SELECT "Loss" FROM table_11877 WHERE "Attendance" > '35,621' AND "Date" = 'july 1' |
CREATE TABLE Apartment_Bookings (
booking_start_date VARCHAR,
apt_id VARCHAR
)
CREATE TABLE Apartments (
apt_number VARCHAR,
apt_id VARCHAR
) | Show the apartment numbers, start dates, and end dates of all the apartment bookings. | SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id |
CREATE TABLE table_18979 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds at the delta center? | SELECT "High rebounds" FROM table_18979 WHERE "Location Attendance" = 'Delta Center' |
CREATE TABLE table_72423 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who ran in the election where Claude Fuller was the incumbent? | SELECT "Candidates" FROM table_72423 WHERE "Incumbent" = 'Claude Fuller' |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREA... | Detect posts misusing backticks for programming languages. | SELECT Id AS "post_link" FROM Posts WHERE Posts.Id > '##StartID:int?1##' AND Posts.Id < '##EndID:int?1000000##' AND (Body LIKE '%<code>PHP</code>%' OR Body LIKE '%<code>javascript</code>%' OR Body LIKE '%<code>C#</code>%' OR Body LIKE '%<code>python</code>%' OR Body LIKE '%<code>java</code>%' OR Body LIKE '%<code>C</co... |
CREATE TABLE table_14981555_3 (
result VARCHAR,
venue VARCHAR
) | In Ascot (UK), what was the result? | SELECT result FROM table_14981555_3 WHERE venue = "Ascot (UK)" |
CREATE TABLE table_name_80 (
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) | Who built the 21 grid car that retired due to suspension? | SELECT constructor FROM table_name_80 WHERE grid > 21 AND time_retired = "suspension" |
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,
ranking number
)
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area number
)
CREATE... | Which city is the headquarter of the store named 'Blackville' in? | SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville" |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | Percentage of AngularJS question without vote in the 5 days. | SELECT CASE WHEN Votes.Id IS NULL THEN 1 ELSE 0 END AS Unvoted, VoteTypes.Name, Posts.Score, Posts.Title FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON PostTags.TagId = Tags.Id JOIN VoteTypes ON VoteTypes.Id = Votes.VoteTypeId WHERE Posts.PostTypeId = 1 AN... |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | SO - Total Posts by Database Server Per Month - DB2. | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'DB2' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'db2%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P... |
CREATE TABLE table_name_74 (
sensor_res VARCHAR,
_size VARCHAR,
model VARCHAR
) | Name the sensor res for model of s9200 | SELECT sensor_res, _size FROM table_name_74 WHERE model = "s9200" |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduct... | What professor teaches computing infrastructure courses ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
) | Display a bar chart for the names and the ages of editors, sort Y-axis in ascending order please. | SELECT Name, Age FROM editor ORDER BY Age |
CREATE TABLE table_16569 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
) | On which episode did actress Sela Ward make her last appearance? | SELECT "Last appearance" FROM table_16569 WHERE "Portrayed by" = 'Sela Ward' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.