table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_74320 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who wrote the episode that got 5.95 million U.S. viewers?
SELECT "Written by" FROM table_74320 WHERE "U.S. viewers (million)" = '5.95'
CREATE TABLE table_name_9 ( club_team VARCHAR, round VARCHAR, position VARCHAR )
What Club team with a Round larger than 5 have a defense position?
SELECT club_team FROM table_name_9 WHERE round > 5 AND position = "defense"
CREATE TABLE table_63037 ( "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
How many total points did Oisin McConville have from his 5 matches?
SELECT COUNT("Total") FROM table_63037 WHERE "Player" = 'oisin mcconville' AND "Matches" < '5'
CREATE TABLE table_48980 ( "Region" text, "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "2000" real )
What is the lowest value for 1990, when the Region is East Asia (10 Economies), and when 1960 has a value less than 12.6?
SELECT MIN("1990") FROM table_48980 WHERE "Region" = 'east asia (10 economies)' AND "1960" < '12.6'
CREATE TABLE table_name_18 ( date VARCHAR, loss VARCHAR )
What was the date of the game with a loss of Bush (1 5)?
SELECT date FROM table_name_18 WHERE loss = "bush (1–5)"
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
Show the number of courses for each office in a stacked bar chart The x-axis is office name and group by course description, and rank x axis in descending order.
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE ORDER BY PROF_OFFICE DESC
CREATE TABLE table_79648 ( "Year" real, "Player" text, "Country" text, "Score" text, "To Par" text, "Margin" real, "Earnings ($)" real )
Which To Par has Earnings ($) larger than 360,000, and a Year larger than 1998, and a Country of united states, and a Score of 69-68-66-64=267?
SELECT "To Par" FROM table_79648 WHERE "Earnings ($)" > '360,000' AND "Year" > '1998' AND "Country" = 'united states' AND "Score" = '69-68-66-64=267'
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row...
tell me the maximum hospital cost if there is a male gen inflam dis nec since 2100?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'male gen inflam dis nec')) AND STRFTIME('%y', cost.chargetime) ...
CREATE TABLE table_76304 ( "noun root (meaning)" text, "case suffix (case)" text, "postposition" text, "full word" text, "English meaning" text )
What is Case Suffix (Case), when Postposition is '-mde (drops d)'?
SELECT "case suffix (case)" FROM table_76304 WHERE "postposition" = '-mde (drops d)'
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, visualize a scatter chart about the correlation between salary and commission_pct .
SELECT SALARY, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
until 2104, what was the yearly minimum weight of patient 005-86645?
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-86645') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2104' GROUP BY STRFTIME('%y', patient.unitadmitt...
CREATE TABLE table_26967904_2 ( f_bolt VARCHAR, p1_diameter__mm_ VARCHAR )
What is the f bolt for 11.35 p1 diameter (mm)?
SELECT f_bolt FROM table_26967904_2 WHERE p1_diameter__mm_ = "11.35"
CREATE TABLE table_17926 ( "Position" real, "Club" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Pts For" real, "Pts Agst" real, "B.P." real, "Points" real )
What position did the sheffield eagles finish in?
SELECT MAX("Position") FROM table_17926 WHERE "Club" = 'Sheffield Eagles'
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
What are the names of products with price at most 200?
SELECT name FROM products WHERE price <= 200
CREATE TABLE table_18812 ( "Specification" text, "Gender" text, "Junior High School (12\u201315 yrs)" text, "Senior High School (15\u201318 yrs)" text, "University students and Adults (18yrs+)" text )
What amount of senior high school where junior high school is 114cm?
SELECT "Senior High School (15\u201318 yrs)" FROM table_18812 WHERE "Junior High School (12\u201315 yrs)" = '114cm'
CREATE TABLE table_67528 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who had a score of 69-70=139?
SELECT "Player" FROM table_67528 WHERE "Score" = '69-70=139'
CREATE TABLE table_name_86 ( winners VARCHAR, runners_up VARCHAR )
Who was the winner when the runner-up was Chemnitzer FC II?
SELECT winners FROM table_name_86 WHERE runners_up = "chemnitzer fc ii"
CREATE TABLE table_5974 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
Team of honda 250cc, and a Time of 31 03.093 has what lowest rank?
SELECT MIN("Rank") FROM table_5974 WHERE "Team" = 'honda 250cc' AND "Time" = '31’ 03.093'
CREATE TABLE table_33071 ( "Lecturers" real, "Associate professors" real, "Assistant professors" real, "Professors" real, "Total" real )
What is the total in the case where theere are 6 lecturers and fewer than 48 professors?
SELECT AVG("Total") FROM table_33071 WHERE "Lecturers" = '6' AND "Professors" < '48'
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, ...
what ground transportation is available in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
CREATE TABLE table_29880 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many games did they play on january 7?
SELECT COUNT("High points") FROM table_29880 WHERE "Date" = 'January 7'
CREATE TABLE diagnoses ( 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 procedures ( ...
what is average age of patients whose language is cape and primary disease is coronary artery disease?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
how much is the change in sodium in patient 17462 second measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') ORDER BY labevents.charttime L...
CREATE TABLE college ( college_id number, name text, leader_name text, college_location text ) CREATE TABLE member ( member_id number, name text, country text, college_id number ) CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_rou...
List the names of members who did not participate in any round.
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM round)
CREATE TABLE table_name_57 ( score VARCHAR, home_team VARCHAR )
What was the final score for the match where Hereford United was the home team?
SELECT score FROM table_name_57 WHERE home_team = "hereford united"
CREATE TABLE table_name_6 ( name VARCHAR, transfer_window VARCHAR, moving_to VARCHAR )
What's the name that had a moving to Anorthosis Famagusta and a transfer window of winter?
SELECT name FROM table_name_6 WHERE transfer_window = "winter" AND moving_to = "anorthosis famagusta"
CREATE TABLE table_44862 ( "Rank" real, "Name" text, "S-League" text, "Singapore Cup" text, "Singapore League Cup" text, "AFC Cup" text, "Total" text )
Which AFC cup does Kenji Arai have?
SELECT "AFC Cup" FROM table_44862 WHERE "Name" = 'kenji arai'
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose age is less than 80 and drug code is aztr1000fb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.formulary_drug_cd = "AZTR1000FB"
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose days of hospital stay is greater than 1 and diagnoses short title is malnutrition mild degree?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.short_title = "Malnutrition mild degree"
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of department_id over the hire_date bin hire_date by time by a bar chart, I want to rank by the Y-axis in asc.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID)
CREATE TABLE table_77539 ( "Rider" text, "Horse" text, "Faults" text, "Round 1 Points" text, "Total" real )
Tell me the rider with 18.185 points round 1
SELECT "Rider" FROM table_77539 WHERE "Round 1 Points" = '18.185'
CREATE TABLE people ( person_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_address text, login_name text, password text ) CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text )...
List the first names of people in alphabetical order?
SELECT first_name FROM people ORDER BY first_name
CREATE TABLE table_name_49 ( voltage VARCHAR, model_number VARCHAR )
What's the voltage for the pentium dual-core e2140?
SELECT voltage FROM table_name_49 WHERE model_number = "pentium dual-core e2140"
CREATE TABLE table_name_55 ( result VARCHAR, week VARCHAR )
What was the result of the game on week 11?
SELECT result FROM table_name_55 WHERE week = 11
CREATE TABLE table_36958 ( "Outcome" text, "Date" text, "Location" text, "Surface" text, "Opponent in final" text, "Score" text )
Name the date for clay surface and location of santos, brazil
SELECT "Date" FROM table_36958 WHERE "Surface" = 'clay' AND "Location" = 'santos, brazil'
CREATE TABLE table_67901 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2010 result of a tournament that is A in 2006 and A in 2011?
SELECT "2010" FROM table_67901 WHERE "2011" = 'a' AND "2006" = 'a'
CREATE TABLE table_37942 ( "School" text, "City" text, "Team Name" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What school is in Brookville?
SELECT "School" FROM table_37942 WHERE "City" = 'brookville'
CREATE TABLE table_name_64 ( round INTEGER, pick__number VARCHAR, position VARCHAR )
what is the round when the pick # is less than 236 and the position is offensive guard?
SELECT AVG(round) FROM table_name_64 WHERE pick__number < 236 AND position = "offensive guard"
CREATE TABLE table_23274514_6 ( date VARCHAR, record VARCHAR )
What day was the record 14-27?
SELECT date FROM table_23274514_6 WHERE record = "14-27"
CREATE TABLE table_name_22 ( grid INTEGER, manufacturer VARCHAR, time_retired VARCHAR )
What was the highest grid value for riders with manufacturer of Aprilia and time of +1.660?
SELECT MAX(grid) FROM table_name_22 WHERE manufacturer = "aprilia" AND time_retired = "+1.660"
CREATE TABLE customer_orders ( order_id number, customer_id number, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text ) CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_...
What is the payment method code used by the most orders?
SELECT payment_method_code FROM invoices GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_name_6 ( swim__15km_ VARCHAR, event VARCHAR, athlete VARCHAR )
Daniela Ryf who competes in the women's even had what swim (1.5km)?
SELECT swim__15km_ FROM table_name_6 WHERE event = "women's" AND athlete = "daniela ryf"
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
Is the ROMLING 450 course available in next semester ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ROMLING' AND course.number = 450 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
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, weight int, capacity int, pay_load int, cruising_speed int, range_...
i would like to go from ATLANTA to DENVER on tuesday
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 = 'DENVER' AND date_day.day_number = 22 AND date_day.month_number = 3 AND da...
CREATE TABLE table_64315 ( "Name" text, "Geographic code" text, "Type" text, "Households" real, "Population (2004)" real, "Foreign population" real, "Moroccan population" real )
Which Population (2004) has a Moroccan population larger than 234506?
SELECT AVG("Population (2004)") FROM table_64315 WHERE "Moroccan population" > '234506'
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
show me the cheapest flights from SAN FRANCISCO to BOSTON
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND ...
CREATE TABLE table_67766 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Recipient" text, "Date" text, "Award" text )
Who directed the film that Avie Luthra received an award for?
SELECT "Director(s)" FROM table_67766 WHERE "Recipient" = 'avie luthra'
CREATE TABLE table_name_27 ( location VARCHAR, opponent VARCHAR )
Where was the game against the buffalo sabres?
SELECT location FROM table_name_27 WHERE opponent = "buffalo sabres"
CREATE TABLE table_name_91 ( length_fuel VARCHAR, floor_styling VARCHAR, year_built VARCHAR )
What is the Length/Fuel of the bus built between 2000-2003 with a high Floor Styling?
SELECT length_fuel FROM table_name_91 WHERE floor_styling = "high" AND year_built = "2000-2003"
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Eve...
Bar chart x axis event details y axis how many event details, sort Y-axis in desc order.
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY COUNT(Event_Details) DESC
CREATE TABLE table_70074 ( "Goal" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text )
Which Assist/pass has a Score of 1-0, and a Goal of 5?
SELECT "Assist/pass" FROM table_70074 WHERE "Score" = '1-0' AND "Goal" = '5'
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varc...
show me flights from NEW YORK to MIAMI
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI...
CREATE TABLE table_74492 ( "Year" text, "Competition" text, "Opponent" text, "Score" text, "Venue" text )
At what venue was there a competition with a score reported as 7.14 (56) - 4.5 (29)?
SELECT "Venue" FROM table_74492 WHERE "Score" = '7.14 (56) - 4.5 (29)'
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 ethnicity of subject name stephanie suchan?
SELECT demographic.ethnicity FROM demographic WHERE demographic.name = "Stephanie Suchan"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
has patient 41014 been admitted to a hospital er the last year?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 41014 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose days of hospital stay is greater than 15 and lab test name is calcium, urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Calcium, Urine"
CREATE TABLE table_name_95 ( attendance VARCHAR, week VARCHAR )
What is Attendance, when Week is 5?
SELECT attendance FROM table_name_95 WHERE week = 5
CREATE TABLE table_2328113_1 ( percentage__2006_ VARCHAR, mother_tongue VARCHAR )
What was the percentage in 2006 whose natives is Polish?
SELECT percentage__2006_ FROM table_2328113_1 WHERE mother_tongue = "Polish"
CREATE TABLE table_name_54 ( starts INTEGER, avg_finish INTEGER )
How many starts for an average finish greater than 43?
SELECT SUM(starts) FROM table_name_54 WHERE avg_finish > 43
CREATE TABLE table_name_22 ( winner VARCHAR, prize VARCHAR )
What Winner had a Prize of z 2,153,999?
SELECT winner FROM table_name_22 WHERE prize = "zł2,153,999"
CREATE TABLE table_47082 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
Can you tell me the Record that has the Game larger than 15, and the Opponent of edmonton oilers?
SELECT "Record" FROM table_47082 WHERE "Game" > '15' AND "Opponent" = 'edmonton oilers'
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE dom...
return me the number of papers in PVLDB after 2000 in ' University of Michigan ' .
SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = pu...
CREATE TABLE manufacturers ( name VARCHAR, revenue INTEGER, headquarter VARCHAR )
Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')
CREATE TABLE table_47432 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What Tournament's Score was 6 2, 4 6, 6 4?
SELECT "Tournament" FROM table_47432 WHERE "Score" = '6–2, 4–6, 6–4'
CREATE TABLE table_name_10 ( loss INTEGER, name VARCHAR, gain VARCHAR )
What is the lowest Loss with Gain larger than 319 for derrick locke?
SELECT MIN(loss) FROM table_name_10 WHERE name = "derrick locke" AND gain > 319
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
What are the countries of mountains with height bigger than 5000?
SELECT country FROM mountain WHERE height > 5000
CREATE TABLE table_50489 ( "Position" real, "Equipment" text, "Points" real, "Wins" text, "Second" text, "Third" text )
What is Equipment, when Points is less than 6, and when Position is 53?
SELECT "Equipment" FROM table_50489 WHERE "Points" < '6' AND "Position" = '53'
CREATE TABLE table_76049 ( "Round" text, "Main date" text, "Number of fixtures" real, "Clubs" text, "New entries this round" text )
What is the sum of Number of fixtures when the rounds shows quarter-finals?
SELECT SUM("Number of fixtures") FROM table_76049 WHERE "Round" = 'quarter-finals'
CREATE TABLE table_26736 ( "Series No." real, "Episode No." real, "Title" text, "Directed by" text, "Written by" text, "UK Ratings (BBC2 Rank)" text, "Original air date" text )
Name the written by for john trefor
SELECT "Written by" FROM table_26736 WHERE "Directed by" = 'John Trefor'
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a bar chart about the distribution of All_Games and School_ID .
SELECT All_Games, School_ID FROM basketball_match
CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) ...
What is the name of the instructor who advises the student with the greatest number of total credits?
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
CREATE TABLE table_58004 ( "Singular abbreviation" text, "Singular Word" text, "Plural abbreviation" text, "Plural Word" text, "Discipline" text )
A singular abbreviation of p. is used for what singular word?
SELECT "Singular Word" FROM table_58004 WHERE "Singular abbreviation" = 'p.'
CREATE TABLE table_80294 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Chart Peak" text, "Song Title" text, "Writer(s)" text, "Time" text )
What is the time of songs that have the writer Aaron Schroeder and Wally Gold?
SELECT "Time" FROM table_80294 WHERE "Writer(s)" = 'aaron schroeder and wally gold'
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose admission type is emergency and drug route is buccal.
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.route = "BUCCAL"
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
Find questions titles that are not phrased as questions. Find question titles that do not contain the Five Ws (Who, What, When, Where and why), interrogative words, and question marks. This query MAY be useful for identifying titles that aren't phrased as a question or low quality questions. Special thanks: s.tk/user...
SELECT Id AS "post_link" FROM Posts WHERE NOT Title LIKE '%Who%' AND NOT Title LIKE '%What%' AND NOT Title LIKE '%When%' AND NOT Title LIKE '%Where%' AND NOT Title LIKE '%Why%' AND NOT Title LIKE '%How%' AND NOT Title LIKE '%Can%' AND NOT Title LIKE '%Is%' AND NOT Title LIKE '%Which%' AND NOT Title LIKE '%Was%' AND NOT...
CREATE TABLE university ( school VARCHAR, founded VARCHAR, affiliation VARCHAR )
Find the schools that were either founded after 1850 or public.
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
CREATE TABLE table_62448 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text )
Who was the 2nd member of the parliament that was assembled on 3 november 1529?
SELECT "2nd member" FROM table_62448 WHERE "Assembled" = '3 november 1529'
CREATE TABLE table_name_21 ( pick INTEGER, name VARCHAR )
Lowest pick for mike flater?
SELECT MIN(pick) FROM table_name_21 WHERE name = "mike flater"
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, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Numbers of downvotes on posts by a specific user.
SELECT p.Id AS "post_link", COUNT(v.Id) FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE (p.OwnerUserId = '##id?210401##') AND (v.VoteTypeId = 3) GROUP BY p.Id ORDER BY p.Id
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is subject name and date of death of subject id 2560?
SELECT demographic.name, demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
CREATE TABLE table_1009 ( "Player" text, "Position" text, "Games started" text, "Hometown" text, "Height" text, "Weight" real, "Class" text, "Prior experience" text )
What is the weight for the player who is 6' 2'?
SELECT MAX("Weight") FROM table_1009 WHERE "Height" = '6'' 2'
CREATE TABLE table_23412 ( "No. overall" text, "No. in series" real, "Family/families" text, "Location(s)" text, "Original air date" text )
Name the least number in series
SELECT MIN("No. in series") FROM table_23412
CREATE TABLE table_33072 ( "Lecturers" real, "Associate professors" real, "Assistant professors" real, "Professors" real, "Total" real )
What is the total in the case when there are more than 4 associate professors, 5 lecturers and fewer professors than 40?
SELECT COUNT("Total") FROM table_33072 WHERE "Associate professors" > '4' AND "Lecturers" = '5' AND "Professors" < '40'
CREATE TABLE table_23915_4 ( translation VARCHAR, ipa___rio_de_janeiro__ VARCHAR )
What is the original of the ipa ( rio de janeiro )translation ki mo t a w n t t i t n ?
SELECT translation FROM table_23915_4 WHERE ipa___rio_de_janeiro__ = "ki̥ mo̞ɕˈtɾaɾɜ̃w̃ nɐ ˈtɛʁə tɕĩʑiˈtɜ̃nə"
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CH...
How many buildings are managed by 'Kyle'? Return a bar chart grouping by apartment type codes, list y-axis in asc order.
SELECT apt_type_code, COUNT(apt_type_code) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" GROUP BY apt_type_code ORDER BY COUNT(apt_type_code)
CREATE TABLE table_25740548_4 ( title VARCHAR, us_viewers__million_ VARCHAR )
Which episode had 2.75 million viewers in the U.S.?
SELECT title FROM table_25740548_4 WHERE us_viewers__million_ = "2.75"
CREATE TABLE Songs ( SongId VARCHAR, Title VARCHAR ) CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR ) CREATE TABLE Band ( firstname VARCHAR, lastname VARCHAR, id VARCHAR )
Who is performing in the back stage position for the song 'Badlands'? Show the first name and the last name.
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back"
CREATE TABLE table_50829 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
Which class has *alanaz as Part 4?
SELECT "Class" FROM table_50829 WHERE "Part 4" = '*alanaz'
CREATE TABLE table_name_77 ( score VARCHAR, money___$__ VARCHAR )
Which score has a prize of $400?
SELECT score FROM table_name_77 WHERE money___$__ = 400
CREATE TABLE table_7911 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
what is team 2 when team 1 is fc rouen (d1)?
SELECT "Team 2" FROM table_7911 WHERE "Team 1" = 'fc rouen (d1)'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients who had emergency admission with neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant as primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT"
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, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
select PostTypeId, count(PostTypeId) from user Posts by PostTypeId.
SELECT PostTypeId, COUNT(PostTypeId) FROM Posts GROUP BY PostTypeId
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
In Summer , name the classes that are available that count towards CS major .
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem...
CREATE TABLE table_76109 ( "Model number" text, "Frequency" text, "L2 cache" text, "FPU width" text, "Multi 1" text, "Socket" text, "Release date" text, "Order part number" text )
What is the socket with an order part number of amm300dbo22gq and a September 10, 2009 release date?
SELECT "Socket" FROM table_76109 WHERE "Release date" = 'september 10, 2009' AND "Order part number" = 'amm300dbo22gq'
CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Worki...
Give me a histogram for what are the statuses and average populations of each city?, could you sort Y from high to low order?
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) DESC
CREATE TABLE table_61197 ( "Date" text, "Year" real, "Location" text, "Country" text, "Killed" text, "Injured" text )
What is the injured that has skierlik as the location?
SELECT "Injured" FROM table_61197 WHERE "Location" = 'skierlik'
CREATE TABLE table_18480 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who is the incumbent first elected in 1944?
SELECT "Incumbent" FROM table_18480 WHERE "First elected" = '1944'
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, ...
how many male patients had sm-to-sm bowel anastom?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Sm-to-sm bowel anastom"
CREATE TABLE constructors ( constructorId INTEGER, constructorRef TEXT, name TEXT, nationality TEXT, url TEXT ) CREATE TABLE circuits ( circuitId INTEGER, circuitRef TEXT, name TEXT, location TEXT, country TEXT, lat REAL, lng REAL, alt TEXT, url TEXT ) CREATE TA...
Find the names of Japanese constructors that have once earned more than 5 points, and count them by a bar chart, could you order total number from high to low order please?
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name) DESC
CREATE TABLE table_109 ( "Track #" real, "Song" text, "Singers" text, "Picturization" text, "Length" text, "Lyricist" text )
Which lyricist has a song with a length of 6:14?
SELECT "Lyricist" FROM table_109 WHERE "Length" = '6:14'