table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_23114 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Persian title" text,
"Director" text,
"Result" text
) | If the film title nominated is Baran, what was the result? | SELECT "Result" FROM table_23114 WHERE "Film title used in nomination" = 'Baran' |
CREATE TABLE table_72718 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
) | What are the cities/towns located in the municipality of Horten? | SELECT "City/town" FROM table_72718 WHERE "Municipality" = 'Horten' |
CREATE TABLE table_22654073_6 (
team VARCHAR,
record VARCHAR
) | Name the team for record 3-2 | SELECT team FROM table_22654073_6 WHERE record = "3-2" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | tell me the number of patients admitted before the year 2172 who had other phototherapy procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2172" AND procedures.long_title = "Other phototherapy" |
CREATE TABLE table_name_44 (
to_par VARCHAR,
country VARCHAR,
score VARCHAR
) | What is the to par of the player from the United States with a score of 69-68-65=202? | SELECT to_par FROM table_name_44 WHERE country = "united states" AND score = 69 - 68 - 65 = 202 |
CREATE TABLE table_204_779 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
) | what is the total number of affiliates among all the networks ? | SELECT SUM("affiliates") FROM table_204_779 |
CREATE TABLE table_203_33 (
id number,
"conference" text,
"date" text,
"place" text,
"attendance" number,
"archive of presentations" text
) | which wikimania conference has the least number of attendees ? | SELECT "conference" FROM table_203_33 ORDER BY "attendance" LIMIT 1 |
CREATE TABLE table_27258 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Podiums" real,
"Points" text,
"Position" text
) | How many wins were listed when he had 112 points? | SELECT "Wins" FROM table_27258 WHERE "Points" = '112' |
CREATE TABLE table_191105_2 (
lyrics_by VARCHAR,
subject VARCHAR
) | When interjection is the subject who are the lyrics by? | SELECT lyrics_by FROM table_191105_2 WHERE subject = "interjection" |
CREATE TABLE table_204_90 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
) | the total number of ethiopian runners | SELECT COUNT("name") FROM table_204_90 WHERE "nationality" = 'ethiopia' |
CREATE TABLE table_name_41 (
division_record VARCHAR,
school VARCHAR
) | What is the division record of Sussex Central? | SELECT division_record FROM table_name_41 WHERE school = "sussex central" |
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 products with a price between 60 and 120, return a scatter chart about the correlation between code and manufacturer , and group by attribute name. | SELECT Code, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name |
CREATE TABLE table_14681 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which score has a competition of 1997 dunhill cup malaysia and february 23, 1997 as the date? | SELECT "Score" FROM table_14681 WHERE "Competition" = '1997 dunhill cup malaysia' AND "Date" = 'february 23, 1997' |
CREATE TABLE table_74578 (
"Lane" real,
"Name" text,
"Nationality" text,
"Split (50m)" real,
"Time" real
) | What is the total of lane(s) for swimmers from Sweden with a 50m split of faster than 26.25? | SELECT SUM("Lane") FROM table_74578 WHERE "Nationality" = 'sweden' AND "Split (50m)" < '26.25' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | what new prescriptions did patient 006-76924 have today compared to the prescription given yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-76924') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
CREATE TABLE table_32169 (
"Date" text,
"Venue" text,
"Result" text,
"Scored" real,
"Competition" text
) | What is the highest scored in the 2010 east asian football championship? | SELECT MAX("Scored") FROM table_32169 WHERE "Competition" = '2010 east asian football championship' |
CREATE TABLE table_23394920_1 (
branding VARCHAR,
power_kw VARCHAR,
station_type VARCHAR
) | When relay is the station type and 5kw is the power kw what is the branding? | SELECT branding FROM table_23394920_1 WHERE power_kw = "5kW" AND station_type = "Relay" |
CREATE TABLE customers (
customer_id VARCHAR,
customer_name VARCHAR
) | List all the customers in increasing order of IDs. | SELECT customer_id, customer_name FROM customers ORDER BY customer_id |
CREATE TABLE table_name_23 (
capacity INTEGER,
kitmaker VARCHAR
) | What is umbro's highest capacity? | SELECT MAX(capacity) FROM table_name_23 WHERE kitmaker = "umbro" |
CREATE TABLE table_name_49 (
decile VARCHAR,
roll VARCHAR,
authority VARCHAR,
area VARCHAR
) | What is the total Decile that has a state authority, fairlie area and roll smarter than 206? | SELECT COUNT(decile) FROM table_name_49 WHERE authority = "state" AND area = "fairlie" AND roll < 206 |
CREATE TABLE table_63686 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year Joined" real,
"Year Left" real,
"Conference Joined" text
) | what is the mascot for moores hill that joined later than 1952? | SELECT "Mascot" FROM table_63686 WHERE "Year Joined" > '1952' AND "School" = 'moores hill' |
CREATE TABLE table_name_63 (
railway VARCHAR,
built VARCHAR
) | Which railway was built in 1909? | SELECT railway FROM table_name_63 WHERE built = "1909" |
CREATE TABLE appointment (
patient VARCHAR
)
CREATE TABLE patient (
ssn VARCHAR
) | what are name and phone number of patients who had more than one appointment? | SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1 |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Products (
product_id ... | Show the product ids and the number of unique orders containing each product by a scatter chart. | SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items |
CREATE TABLE table_train_113 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"NOUSE" float
) | body mass index ( bmi ) of approximately 18 to 33 kg / m2; and a total body weight > 50 kg ( 110 lbs ) . | SELECT * FROM table_train_113 WHERE (body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 33) AND body_weight > 50 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id... | Downvoted posts with no comment. | SELECT PostId AS "post_link", SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS "dvs", Score FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE COALESCE(p.CommentCount, 0) = 0 AND v.VoteTypeId = 3 GROUP BY PostId, Score |
CREATE TABLE table_name_20 (
time VARCHAR,
rider VARCHAR,
grid VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
) | what is the time when laps is less than 21, manufacturer is aprilia, grid is less than 17 and the rider is thomas luthi? | SELECT time FROM table_name_20 WHERE laps < 21 AND manufacturer = "aprilia" AND grid < 17 AND rider = "thomas luthi" |
CREATE TABLE table_10903 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did the team play when they scored 10.10 (70)? | SELECT "Venue" FROM table_10903 WHERE "Away team score" = '10.10 (70)' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | give me the number of patients whose gender is m and drug name is xopenex neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Xopenex Neb" |
CREATE TABLE table_78116 (
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | what is at 10:00 when at 9:00 it is lost (#19, 4.6 rating) and at 8:30 it is lost (reruns)? | SELECT "10:00" FROM table_78116 WHERE "9:00" = 'lost (#19, 4.6 rating)' AND "8:30" = 'lost (reruns)' |
CREATE TABLE table_33299 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
) | What is the lowest ERP W of the 67829 Facility ID? | SELECT MIN("ERP W") FROM table_33299 WHERE "Facility ID" = '67829' |
CREATE TABLE table_name_67 (
rider VARCHAR,
grid VARCHAR,
bike VARCHAR,
laps VARCHAR,
time VARCHAR
) | What is the driver with the laps under 16, grid of 10, a bike of Yamaha YZF-R6, and ended with an accident? | SELECT rider FROM table_name_67 WHERE laps < 16 AND time = "accident" AND bike = "yamaha yzf-r6" AND grid = 10 |
CREATE TABLE table_name_97 (
longest_span_in_s_metre___feet__ VARCHAR,
land VARCHAR,
name VARCHAR
) | How long is the UK's Ballochmyle Viaduct? | SELECT longest_span_in_s_metre___feet__ FROM table_name_97 WHERE land = "uk" AND name = "ballochmyle viaduct" |
CREATE TABLE table_204_223 (
id number,
"party" text,
"previous council" number,
"staying councillors" number,
"seats up for election" number,
"election result" number,
"new council" number
) | how many parties had zero councils ? | SELECT COUNT("party") FROM table_204_223 WHERE "new council" = 0 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose admission year is less than 2187 and procedure long title is infusion of vasopressor agent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2187" AND procedures.long_title = "Infusion of vasopressor agent" |
CREATE TABLE table_name_50 (
took_office INTEGER,
senator VARCHAR,
district VARCHAR
) | What is the lowest Took Office, when Senator is Eddie Bernice Johnson, and when District is greater than 23? | SELECT MIN(took_office) FROM table_name_50 WHERE senator = "eddie bernice johnson" AND district > 23 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose gender is f and death status is 1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1" |
CREATE TABLE table_204_135 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | which club had 27 point and a goal difference of +1 ? | SELECT "club" FROM table_204_135 WHERE "points" = 27 AND "goal difference" = 1 |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | Can you specify the Core classes that are offered next Winter ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
CREATE TABLE table_3729 (
"#" real,
"Matches As Captain" text,
"Player" text,
"Asian Cup Played As A Captain" text,
"Years Active" text,
"Caps(Goals)" text
) | What were the years active where Asian Cup played as a captain is Qatar 1988? | SELECT "Years Active" FROM table_3729 WHERE "Asian Cup Played As A Captain" = 'Qatar 1988' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | the first time patient 67902 received int inser lead atri-vent until 2104? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int inser lead atri-vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND... |
CREATE TABLE table_204_431 (
id number,
"yacht" text,
"nation" text,
"owner" text,
"skipper" text,
"launch year" number
) | who is the owner of the wild oatsxi bob oatley or mark richards ? | SELECT "owner" FROM table_204_431 WHERE "yacht" = 'wild oats xi' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose admission year is less than 2146 and diagnoses icd9 code is 3004? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2146" AND diagnoses.icd9_code = "3004" |
CREATE TABLE table_74305 (
"#" real,
"Episode" text,
"Directed by" text,
"Written by" text,
"U.S. Viewers (in millions)" text,
"Original airdate" text
) | Who wrote the episode with 7.52 million US viewers? | SELECT "Written by" FROM table_74305 WHERE "U.S. Viewers (in millions)" = '7.52' |
CREATE TABLE table_name_2 (
record VARCHAR,
attendance VARCHAR
) | What was the score when attendance was 19,887? | SELECT record FROM table_name_2 WHERE attendance = "19,887" |
CREATE TABLE table_204_840 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text,
"prod. code" text
) | who wrote the first episode of the season ? | SELECT "written by" FROM table_204_840 WHERE "no. in\nseason" = 1 |
CREATE TABLE table_38793 (
"Season" text,
"Team" text,
"Wins" text,
"Losses" text,
"Draws" text
) | Which season had 0 wins and 5 losses for the Surrey team? | SELECT "Season" FROM table_38793 WHERE "Wins" = '0' AND "Losses" = '5' AND "Team" = 'surrey' |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What was the last time period the class THTREMUS 252 was offered ? | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THTREMUS' AND course.number = 252 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1 |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | what was the minimum monthly number of patients who were admitted for encephalopathy - metabolic in a year before? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) ... |
CREATE TABLE table_name_76 (
engine VARCHAR,
year VARCHAR
) | What engine was used in 1999? | SELECT engine FROM table_name_76 WHERE year = "1999" |
CREATE TABLE table_name_2 (
second VARCHAR,
fourth VARCHAR,
fifth VARCHAR,
sixth VARCHAR
) | What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania placed fourth? | SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania" |
CREATE TABLE table_11914 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team scored 10.5 (65)? | SELECT "Away team" FROM table_11914 WHERE "Away team score" = '10.5 (65)' |
CREATE TABLE table_name_73 (
rating___percentage_ VARCHAR,
channel VARCHAR
) | Name the rating % for channel of anhui satellite tv | SELECT rating___percentage_ FROM table_name_73 WHERE channel = "anhui satellite tv" |
CREATE TABLE table_27504 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What title did Bill Foster direct ? | SELECT "Title" FROM table_27504 WHERE "Directed by" = 'Bill Foster' |
CREATE TABLE table_60387 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
) | Who won Gold later than 2004 with Notes of 2.73km, 14controls? | SELECT "Gold" FROM table_60387 WHERE "Year" > '2004' AND "Notes" = '2.73km, 14controls' |
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name ... | For players whose occupation is not 'Researcher', tell me the distribution of their residences with a bar chart, and could you display by the total number in desc? | SELECT Residence, COUNT(Residence) FROM player WHERE Occupation <> "Researcher" GROUP BY Residence ORDER BY COUNT(Residence) DESC |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients had admission location as clinic referral/premature and diagnoses icd9 code as 25541? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541" |
CREATE TABLE table_name_43 (
loser VARCHAR,
year VARCHAR,
winner VARCHAR
) | Who was the loser against the New York Giants in 2001? | SELECT loser FROM table_name_43 WHERE year = 2001 AND winner = "new york giants" |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | Show the name of each party and the corresponding number of delegates from that party with a bar chart, and sort by the bar in asc. | SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party |
CREATE TABLE table_203_338 (
id number,
"#" number,
"title" text,
"date" text,
"director" text,
"story" text,
"synopsis" text,
"notes" text
) | what is the next cartoon directed by robert mckimson after le quiet squad ? | SELECT "title" FROM table_203_338 WHERE "director" = 'robert mckimson' AND "date" > (SELECT "date" FROM table_203_338 WHERE "title" = 'le quiet squad') ORDER BY "date" LIMIT 1 |
CREATE TABLE table_name_87 (
uninterrupted_rank VARCHAR,
name VARCHAR
) | How many uninterrupted ranks does john dingell have? | SELECT COUNT(uninterrupted_rank) FROM table_name_87 WHERE name = "john dingell" |
CREATE TABLE table_56465 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What's the record of Carlos Boozer (23) as the leading scorer? | SELECT "Record" FROM table_56465 WHERE "Leading scorer" = 'carlos boozer (23)' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and list Y in descending order. | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC |
CREATE TABLE table_name_40 (
position INTEGER,
points VARCHAR,
conceded VARCHAR
) | The highest position with more than 16 points and less than 7 concedes? | SELECT MAX(position) FROM table_name_40 WHERE points > 16 AND conceded < 7 |
CREATE TABLE table_name_39 (
mascot VARCHAR,
_number___county VARCHAR
) | what's the mascot for 66 pulaski 2? | SELECT mascot FROM table_name_39 WHERE _number___county = "66 pulaski 2" |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | Find the states where have some college students in tryout. | SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname |
CREATE TABLE school_performance (
School_Id int,
School_Year text,
Class_A text,
Class_AA text
)
CREATE TABLE school_details (
School_ID int,
Nickname text,
Colors text,
League text,
Class text,
Division text
)
CREATE TABLE player (
Player_ID int,
Player text,
Team ... | Create a bar chart showing the total number across denomination | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination |
CREATE TABLE table_name_32 (
official_itv1_rating INTEGER,
share VARCHAR
) | What is the lowest official ITV1 rating with 45.4% share? | SELECT MIN(official_itv1_rating) FROM table_name_32 WHERE share = "45.4%" |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
... | what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way | 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, fare_basis WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what were the first creatine kinase (ck) from patient 96833 in the current hospital visit? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') ORDER BY labevents.chart... |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | Show me a bar chart for how many faculty members do we have for each faculty rank?, and list by the total number in ascending. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*) |
CREATE TABLE table_62381 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
) | How much money did Willie Klein take home from the game in which he had a to par score larger than 13? | SELECT SUM("Money ( $ )") FROM table_62381 WHERE "Player" = 'willie klein' AND "To par" > '13' |
CREATE TABLE table_61341 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is the Total for the Player with a To par of +11? | SELECT MAX("Total") FROM table_61341 WHERE "To par" = '+11' |
CREATE TABLE table_name_21 (
rank VARCHAR,
gross VARCHAR
) | What rank is the title with a gross of $26,589,355? | SELECT rank FROM table_name_21 WHERE gross = "$26,589,355" |
CREATE TABLE table_40471 (
"Year" real,
"Author" text,
"Illustrator" text,
"Title" text,
"Publisher" text
) | Who was the illustrator in 1987? | SELECT "Illustrator" FROM table_40471 WHERE "Year" = '1987' |
CREATE TABLE table_61246 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Who was the girl on week 1 that preceded week 2's Kamila Sulewska? | SELECT "Week 1" FROM table_61246 WHERE "Week 2" = 'kamila sulewska' |
CREATE TABLE table_5645 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (BOTP)" text,
"Voice acto... | What is the mecha with a condor bird uniform? | SELECT "Mecha" FROM table_5645 WHERE "Bird Uniform" = 'condor' |
CREATE TABLE table_train_208 (
"id" int,
"anemia" bool,
"serum_bicarbonate" int,
"hemoglobin_a1c_hba1c" float,
"temperature" float,
"dementia" bool,
"electrolyte_imbalances" bool,
"impaired_sensorium" bool,
"age" float,
"NOUSE" float
) | age > 75 years | SELECT * FROM table_train_208 WHERE age > 75 |
CREATE TABLE table_name_63 (
area VARCHAR,
roll VARCHAR
) | What is the Area with 26 in Roll | SELECT area FROM table_name_63 WHERE roll = 26 |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart, and rank in desc by the bars. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE... | get top protected questions by tag. | SELECT 'post_link' = Posts.Id, Posts.ViewCount, Posts.Score, Tags.TagName AS "tag_name" FROM PostHistory INNER JOIN PostTags ON PostTags.PostId = PostHistory.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE PostHistory.PostHistoryTypeId = 19 AND Tags.TagName = @Tag... |
CREATE TABLE table_18955 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
) | What club had 523 points against? | SELECT "Club" FROM table_18955 WHERE "Points against" = '523' |
CREATE TABLE table_204_937 (
id number,
"rank" number,
"lane" number,
"athlete" text,
"time" number
) | how many athletes did not finish with the time less than 53.00 ? | SELECT COUNT("athlete") FROM table_204_937 WHERE "time" >= 53 |
CREATE TABLE table_4948 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
) | On what Date is the Circuit at Sandown Raceway? | SELECT "Date" FROM table_4948 WHERE "Circuit" = 'sandown raceway' |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
... | show me all UA flights from DENVER to SAN FRANCISCO for 9 1 1991 | 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 = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 9... |
CREATE TABLE table_204_151 (
id number,
"game" number,
"day" text,
"date" text,
"kickoff" text,
"opponent" text,
"results\nscore" text,
"results\nrecord" text,
"location" text,
"attendance" number
) | how many times did the team play at home but did not win ? | SELECT COUNT(*) FROM table_204_151 WHERE "opponent" = 'home' AND "results\nscore" <> 'w' |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the number of patients to whom lidocaine 5% patch was administered when admitted to emergency. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Lidocaine 5% Patch" |
CREATE TABLE table_name_15 (
year INTEGER,
category VARCHAR
) | What year had Best Actor in a Musical as a category? | SELECT SUM(year) FROM table_name_15 WHERE category = "best actor in a musical" |
CREATE TABLE table_53610 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | where did rochdale play as opponent? | SELECT "Venue" FROM table_53610 WHERE "Opponent" = 'rochdale' |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | Find journals about Neutralizing Antibody Languages . | SELECT DISTINCT paper.journalid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Neutralizing Antibody Languages' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.journalid |
CREATE TABLE table_204_414 (
id number,
"name" text,
"armenian" text,
"location" text,
"# of prisoners designed for" number,
"notes" text
) | how many prisons are in nubarashen ? | SELECT COUNT("name") FROM table_204_414 WHERE "location" = 'nubarashen' |
CREATE TABLE table_49359 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
) | What is the Date of the Event in Punta del Este? | SELECT "Date" FROM table_49359 WHERE "City" = 'punta del este' |
CREATE TABLE table_7116 (
"Title" text,
"Author" text,
"Un-/Abridged" text,
"Read by" text,
"Published" text
) | Who read the unabridged book written by Gary Paulsen? | SELECT "Read by" FROM table_7116 WHERE "Un-/Abridged" = 'unabridged' AND "Author" = 'gary paulsen' |
CREATE TABLE table_15248 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
) | What is the earliest year with points more than 8? | SELECT MIN("Year") FROM table_15248 WHERE "Pts." > '8' |
CREATE TABLE table_33987 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What's the score on April 9? | SELECT "Score" FROM table_33987 WHERE "Date" = 'april 9' |
CREATE TABLE table_5600 (
"Season" text,
"Regionalliga S\u00fcd" text,
"Regionalliga West/S\u00fcdwest" text,
"Regionalliga Nord" text,
"Regionalliga Nord-Ost" text
) | Which season had a Regionalliga Sud of Stuttgarter Kickers? | SELECT "Season" FROM table_5600 WHERE "Regionalliga S\u00fcd" = 'stuttgarter kickers' |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is age and diagnoses icd9 code of subject id 42067? | SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067" |
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 medication (
medi... | in 12/this year protonix, ondansetron inj or lisinopril have been prescribed for patient 012-37411? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND medication.drugname IN ('protonix', 'ondansetron inj', 'l... |
CREATE TABLE table_18967450_2 (
club VARCHAR,
goals VARCHAR
) | Which team/s have 48 goals total? | SELECT club FROM table_18967450_2 WHERE goals = 48 |
CREATE TABLE table_25240 (
"Rnd" real,
"Date" text,
"Race Name" text,
"Length" text,
"Track" text,
"Location" text,
"Type" text,
"Pole Position" text,
"Winning Driver" text
) | How many races took place on the Indianapolis Motor Speedway track? | SELECT COUNT("Race Name") FROM table_25240 WHERE "Track" = 'Indianapolis Motor Speedway' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.