table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_49 (
away_team VARCHAR,
home_team VARCHAR
) | When the Home team of collingwood played, what was the opposing Away team score? | SELECT away_team AS score FROM table_name_49 WHERE home_team = "collingwood" |
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
)
... | how many patients whose insurance is government and lab test name is po2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "pO2" |
CREATE TABLE table_name_10 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | What Player has a To par of +1 and the Score 75-70-71-73=289? | SELECT player FROM table_name_10 WHERE to_par = "+1" AND score = 75 - 70 - 71 - 73 = 289 |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many treatment of hyperkalemia - insulin / glucose procedures have occurred since 2100? | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'treatment of hyperkalemia - insulin / glucose' AND STRFTIME('%y', treatment.treatmenttime) >= '2100' |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CL... | Show the number of courses each instructor taught in a stacked bar chart The x-axis is the instructor's first name and group by course code, and show by the bars from low to high please. | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY EMP_FNAME |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | had patient 032-4849 when they visited the hospital first time been admitted to an er? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '032-4849' AND patient.hospitaladmitsource = 'emergency department' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 |
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... | Give me the comparison about All_Games_Percent over the All_Neutral by a bar chart, I want to order by the x axis in desc. | SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Neutral DESC |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE o... | when was patient 62977 in 2101 admitted for the first time to the hospital? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 62977 AND STRFTIME('%y', admissions.admittime) = '2101' ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_54660 (
"Name" text,
"Scotland career" text,
"Caps" real,
"Goals" real,
"Average" real
) | What is the low goal for kenny miller with an average smaller than 0.261? | SELECT MIN("Goals") FROM table_54660 WHERE "Name" = 'kenny miller' AND "Average" < '0.261' |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Return a scatter chart about the correlation between People_ID and Height , and group by attribute Sex. | SELECT People_ID, Height FROM people GROUP BY Sex |
CREATE TABLE table_name_19 (
civilian_deaths VARCHAR,
total_deaths__not_including_foreigners_ VARCHAR
) | How many civilians died in the conflict that left 178, excluding foreigners, dead? | SELECT civilian_deaths FROM table_name_19 WHERE total_deaths__not_including_foreigners_ = "178" |
CREATE TABLE table_name_76 (
away_team VARCHAR,
tie_no VARCHAR
) | In Tie #18, who was the away team? | SELECT away_team FROM table_name_76 WHERE tie_no = "18" |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Draw a bar chart showing the total number of every ship type by categorizing by nationality, could you sort bars in asc order? | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY Type |
CREATE TABLE table_204_375 (
id number,
"#" number,
"season" number,
"competition" text,
"date" text,
"round" text,
"opponent" text,
"h / a" text,
"result" text,
"scorer (s)" text
) | what was the total number of points scored in the game held on 2013-05-21 ? | SELECT "result" + "result" FROM table_204_375 WHERE "date" = '2013-05-21' |
CREATE TABLE table_name_34 (
season VARCHAR,
score VARCHAR
) | Can you tell me the Season that has the Score of 1-0? | SELECT season FROM table_name_34 WHERE score = "1-0" |
CREATE TABLE payment (
payment_id SMALLINT UNSIGNED,
customer_id SMALLINT UNSIGNED,
staff_id TINYINT UNSIGNED,
rental_id INT,
amount DECIMAL(5,2),
payment_date DATETIME,
last_update TIMESTAMP
)
CREATE TABLE film_actor (
actor_id SMALLINT UNSIGNED,
film_id SMALLINT UNSIGNED,
last... | What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a bar chart, I want to display by the Y in descending. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC |
CREATE TABLE table_245 (
"Model" text,
"Engine make/Capacity" text,
"Power kW@rpm" text,
"Torque Nm@rpm" text,
"Transmission Make/Type/Speed" text,
"GVM (kg) Technical Capacity" text,
"GCM (kg) Technical Capacity" text
) | When the transmission make/type/speed is eaton fs 5306-a manual synchromesh 6 speed, what is the value of the gcm (kg) technical capacity? | SELECT "GCM (kg) Technical Capacity" FROM table_245 WHERE "Transmission Make/Type/Speed" = 'Eaton FS 5306-A Manual Synchromesh 6 Speed' |
CREATE TABLE table_name_62 (
points VARCHAR,
year INTEGER
) | with year greater than 1988 what is the total number of points? | SELECT COUNT(points) FROM table_name_62 WHERE year > 1988 |
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 the number of hispanic or latino-puerto rican patients who had ventriculo puncture through previously implanted catheter? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Ventriculopuncture through previously implanted catheter" |
CREATE TABLE table_44634 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was the par for the t5 place player Steve Jones? | SELECT "To par" FROM table_44634 WHERE "Place" = 't5' AND "Player" = 'steve jones' |
CREATE TABLE table_11690135_1 (
interview VARCHAR,
evening_gown VARCHAR
) | Who had an evening gown score of 9.78? | SELECT interview FROM table_11690135_1 WHERE evening_gown = "9.78" |
CREATE TABLE table_name_56 (
enrollment VARCHAR,
school VARCHAR
) | How much Enrollment has a School of shakamak? | SELECT COUNT(enrollment) FROM table_name_56 WHERE school = "shakamak" |
CREATE TABLE table_2861364_1 (
executed_person VARCHAR,
under_president VARCHAR,
crime VARCHAR
) | who was executed during president charles de gaulle's reign for thr crime of child murder after rape? | SELECT executed_person FROM table_2861364_1 WHERE under_president = "Charles de Gaulle" AND crime = "Child murder after rape" |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_descriptio... | what airlines fly into SALT LAKE CITY | SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SALT LAKE CITY' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code |
CREATE TABLE manufacturer (
name VARCHAR,
open_year VARCHAR,
num_of_shops VARCHAR,
Num_of_Factories VARCHAR
) | Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. | SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10 |
CREATE TABLE table_64899 (
"Elector" text,
"Place of birth" text,
"Cardinalatial title" text,
"Elevated" text,
"Elevator" text
) | What Elector has the Place of Birth listed as Bavaria? | SELECT "Elector" FROM table_64899 WHERE "Place of birth" = 'bavaria' |
CREATE TABLE table_45195 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
) | Sum of m. night shyamalan ranks? | SELECT SUM("Rank") FROM table_45195 WHERE "Director(s)" = 'm. night shyamalan' |
CREATE TABLE table_train_179 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_plasma_glucose_fpg" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | uncontrolled diabetes defined as a fpg level of > 240 mg / dl at screening | SELECT * FROM table_train_179 WHERE diabetes = 1 OR fasting_plasma_glucose_fpg > 240 |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | what does patient 13686 age be in their first hospital visit? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 13686 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE cite (
cited int,... | return me the authors who have papers in VLDB conference before 2002 after 1995 . | SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year < 2002 AND publication.year > 1995 AND writes.aid = author.aid AND writes.pid = publication.pid |
CREATE TABLE table_38657 (
"Discipline" text,
"Peter" real,
"Adam" real,
"Jade" real,
"Plat'num" real
) | What's Adam's score when Jade's score is greater than 5 and Peter's score is less than 0? | SELECT AVG("Adam") FROM table_38657 WHERE "Jade" > '5' AND "Peter" < '0' |
CREATE TABLE table_54517 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | What was the venue where the result was 12th? | SELECT "Venue" FROM table_54517 WHERE "Result" = '12th' |
CREATE TABLE table_name_85 (
turbine_vendor VARCHAR,
wind_farm VARCHAR,
size__mw_ VARCHAR,
turbines VARCHAR,
county VARCHAR
) | Who is the turbine vendor for Meenadreen in Donegal county with less than 6 turbines with a size of 0.85 MW? | SELECT turbine_vendor FROM table_name_85 WHERE turbines < 6 AND county = "donegal" AND size__mw_ = "0.85" AND wind_farm = "meenadreen" |
CREATE TABLE table_46409 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
) | What's the total diameter when longitude is 357.8e later than 1985? | SELECT COUNT("Diameter (km)") FROM table_46409 WHERE "Longitude" = '357.8e' AND "Year named" > '1985' |
CREATE TABLE table_name_4 (
result VARCHAR,
date VARCHAR
) | What is the Result with a Date with 4 september 2013? | SELECT result FROM table_name_4 WHERE date = "4 september 2013" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | tell me the change in bedside glucose levels of patient 027-178495 measured at 2102-06-02 12:25:17 compared to the value measured at 2102-06-02 00:23:17? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2102... |
CREATE TABLE table_25421463_1 (
season VARCHAR,
final_placing VARCHAR,
team_name VARCHAR
) | In what season was the final placing NC and the team SL Formula Racing? | SELECT season FROM table_25421463_1 WHERE final_placing = "NC†" AND team_name = "SL Formula Racing" |
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... | Show me about the distribution of Team_Name and Team_ID in a bar chart, and order Y-axis in asc order. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID |
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... | Posts which had given tag in the past. | SELECT DISTINCT PostHistory.PostId AS "post_link", url = 'site://posts/' + CAST(PostHistory.PostId AS TEXT) + '/revisions', Posts.OwnerUserId AS "user_link", Posts.Score, Posts.Tags, Posts.CreationDate, Posts.LastActivityDate FROM PostHistory INNER JOIN Posts ON PostHistory.PostId = Posts.Id WHERE PostHistoryTypeId IN ... |
CREATE TABLE company (
headquarters VARCHAR,
main_industry VARCHAR
) | Show headquarters with at least two companies in the banking industry. | SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2 |
CREATE TABLE table_25162 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
) | What was the date if the driver was Robert Pressley? | SELECT "Date" FROM table_25162 WHERE "Driver" = 'Robert Pressley' |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | Which upper level classes do not require 496 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... |
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,
booking_start_date time,
booking_end_date time
)
CREATE TABLE apartments (
apt_id number,
b... | Give me the minimum and maximum bathroom count among all the apartments. | SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments |
CREATE TABLE table_204_833 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
) | what is the next date after april 8 ? | SELECT "date" FROM table_204_833 WHERE "game" = (SELECT "game" FROM table_204_833 WHERE "date" = 'april 8') + 1 |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | For CEE 650 next semester , are there any sections not on Monday ? | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'CEE' AND course.number = 650 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.ye... |
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,
... | count the number of patients whose marital status is single and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart, I want to list X in descending order please. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
CREATE TABLE table_name_29 (
rank INTEGER,
source VARCHAR,
year VARCHAR
) | What is the average rank that has cia world factbook as the source and a year prior to 2005? | SELECT AVG(rank) FROM table_name_29 WHERE source = "cia world factbook" AND year < 2005 |
CREATE TABLE table_name_76 (
player VARCHAR,
place VARCHAR,
score VARCHAR
) | Who placed in t5 and scored 73-69-68=210? | SELECT player FROM table_name_76 WHERE place = "t5" AND score = 73 - 69 - 68 = 210 |
CREATE TABLE table_203_594 (
id number,
"canal" text,
"length (miles)" number,
"locks" number,
"max length (ft)" number,
"width (ft)" number,
"year opened" number,
"year abandoned" number,
"year restored" number
) | which was the last canal opened in scotland ? | SELECT "canal" FROM table_203_594 WHERE "year opened" = (SELECT MAX("year opened") FROM table_203_594) |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | show me all flights from SAN FRANCISCO to DENVER | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
CREATE TABLE table_203_349 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text,
"production\ncode" text,
"u.s. viewers\n(millions)" number
) | how many episodes were shown in season 1 ? | SELECT COUNT("title") FROM table_203_349 |
CREATE TABLE table_200_35 (
id number,
"party" text,
"active voters" number,
"inactive voters" number,
"total voters" number,
"percentage" text
) | as of october 25 , 2005 , how many voters are either democratic or republican ? | SELECT SUM("total voters") FROM table_200_35 WHERE "party" IN ('democratic', 'republican') |
CREATE TABLE table_name_33 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
) | What is the lowest silver that has 2 as the bronze, with a total greater than 4? | SELECT MIN(silver) FROM table_name_33 WHERE bronze = 2 AND total > 4 |
CREATE TABLE table_name_75 (
bronze INTEGER,
nation VARCHAR
) | How many Bronzes that has a Nation of italy? | SELECT MAX(bronze) FROM table_name_75 WHERE nation = "italy" |
CREATE TABLE table_16941304_4 (
driver___passenger VARCHAR,
points VARCHAR
) | Name the driver passenger for 394 points | SELECT driver___passenger FROM table_16941304_4 WHERE points = 394 |
CREATE TABLE table_31326 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who is the director when the title is 'believers'? | SELECT "Directed by" FROM table_31326 WHERE "Title" = 'Believers' |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | My answers on Stack Exchange. | SELECT * FROM Posts WHERE OwnerUserId = 3422261 |
CREATE TABLE table_name_46 (
lost INTEGER,
games INTEGER
) | How many games lost for teams with over 6 games? | SELECT MIN(lost) FROM table_name_46 WHERE games > 6 |
CREATE TABLE table_23098 (
"Year" text,
"Marriages between men" real,
"Marriages between women" real,
"Same-sex marriages" real,
"Total marriages" real,
"% same-sex marriages" text
) | How many marriages between women have % same-sex marriages of 1.06? | SELECT "Marriages between women" FROM table_23098 WHERE "% same-sex marriages" = '1.06' |
CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residen... | Show different occupations along with the number of players in each occupation with a bar chart. | SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation |
CREATE TABLE table_203_300 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"extra" text
) | was there a result of 1st place after the year 2006 ? | SELECT (SELECT COUNT(*) FROM table_203_300 WHERE "result" = 1 AND "year" > 2006) > 0 |
CREATE TABLE table_name_4 (
date VARCHAR,
record VARCHAR
) | Which Date has a Record of 29 47? | SELECT date FROM table_name_4 WHERE record = "29–47" |
CREATE TABLE table_9712 (
"Province" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | How many ends lost for Alberta when stolen ends are greater than 7? | SELECT SUM("Ends Lost") FROM table_9712 WHERE "Province" = 'alberta' AND "Stolen Ends" > '7' |
CREATE TABLE table_53769 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | what is the result when the competition is friendly on 8 october 2009? | SELECT "Result" FROM table_53769 WHERE "Competition" = 'friendly' AND "Date" = '8 october 2009' |
CREATE TABLE table_12002388_1 (
year INTEGER,
reg_season VARCHAR
) | What year did they finish 1st, southern? | SELECT MAX(year) FROM table_12002388_1 WHERE reg_season = "1st, Southern" |
CREATE TABLE table_30594 (
"Version" text,
"Release" text,
"Release date" text,
"End of maintenance" text,
"Requirement" text
) | What's the number of the 1.0.12 release version? | SELECT COUNT("Version") FROM table_30594 WHERE "Release" = '1.0.12' |
CREATE TABLE table_21058823_1 (
result VARCHAR,
opponent VARCHAR
) | What did they do against Memphis? | SELECT result FROM table_21058823_1 WHERE opponent = "Memphis" |
CREATE TABLE table_31153 (
"Name/ designation" text,
"Year of intro" real,
"Country of origin" text,
"Primary cartridge" text,
"Major users" text
) | Who are all the major users of the Saturn Machine Pistol? | SELECT "Major users" FROM table_31153 WHERE "Name/ designation" = 'Saturn machine pistol' |
CREATE TABLE table_203_535 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total amount of medals spain has won ? | SELECT "total" FROM table_203_535 WHERE "nation" = 'spain' |
CREATE TABLE table_name_3 (
surface VARCHAR,
date VARCHAR
) | Name the surface for 12 september 2006 | SELECT surface FROM table_name_3 WHERE date = "12 september 2006" |
CREATE TABLE table_16402 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many players played for adams state school? | SELECT COUNT("Player") FROM table_16402 WHERE "College" = 'Adams State' |
CREATE TABLE table_74055 (
"English" text,
"Proto-Semitic" text,
"Akkadian" text,
"Arabic" text,
"Aramaic" text,
"Hebrew" text,
"Geez" text,
"Mehri" text
) | If in arabic it is sal m-, what is it in proto-semitic? | SELECT "Proto-Semitic" FROM table_74055 WHERE "Arabic" = 'salām-' |
CREATE TABLE table_6945 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What away team has tottenham hotspur as the home team? | SELECT "Away team" FROM table_6945 WHERE "Home team" = 'tottenham hotspur' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what is the minimum total cost of a hospital involving a laboratory test for peak airway/pressure last year? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'peak airway/pressure')) AND DATETIME(cost.chargetime, 'start of year... |
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
) | which year did she work on the most films ? | SELECT "year" FROM table_203_239 GROUP BY "year" ORDER BY COUNT("title") DESC LIMIT 1 |
CREATE TABLE table_56135 (
"Nation" text,
"Gold" text,
"Silver" text,
"Bronze" text,
"Total" real
) | Tell me the gold for netherlands | SELECT "Gold" FROM table_56135 WHERE "Nation" = 'netherlands' |
CREATE TABLE table_14309 (
"Date" text,
"Opponent" text,
"City" text,
"Result" text,
"Score" text
) | Who was Milwaukee's opponent? | SELECT "Opponent" FROM table_14309 WHERE "City" = 'milwaukee' |
CREATE TABLE table_53507 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the total number on roll for Shelly Park school? | SELECT COUNT("Roll") FROM table_53507 WHERE "Name" = 'shelly park school' |
CREATE TABLE table_name_56 (
publisher VARCHAR,
release_title VARCHAR
) | Who was the publisher of Martial Law: Dead Ringers? | SELECT publisher FROM table_name_56 WHERE release_title = "martial law: dead ringers" |
CREATE TABLE table_28885977_1 (
location VARCHAR,
stadium VARCHAR
) | What is the location of the Moorabbin Oval stadium? | SELECT location FROM table_28885977_1 WHERE stadium = "Moorabbin Oval" |
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 diagnosis (
diagn... | what was the name of the drug prescription that patient 030-53717 was last prescribed in their first hospital encounter? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53717' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p... |
CREATE TABLE table_203_726 (
id number,
"year" number,
"national champion" text,
"score" text,
"runner-up" text,
"host or site" text
) | how many times was ucla national champion ? | SELECT COUNT(*) FROM table_203_726 WHERE "national champion" = 'ucla' |
CREATE TABLE table_42816 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who was the Home captain that played at the venue Oval? | SELECT "Home captain" FROM table_42816 WHERE "Venue" = 'oval' |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
) | how many teams finished better than spain in cycling at the 1996 summer olympics men 's team pursuit ? | SELECT COUNT("team") FROM table_204_735 WHERE "rank" < (SELECT "rank" FROM table_204_735 WHERE "team" = 'spain') |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | i would like a flight from SAN FRANCISCO to PITTSBURGH on friday morning after 1000 o'clock | 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 (((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim... |
CREATE TABLE table_26454128_4 (
athlete VARCHAR,
height VARCHAR,
country VARCHAR
) | Which athlete has a height of 1.87 and is from Sweden? | SELECT athlete FROM table_26454128_4 WHERE height = "1.87" AND country = "Sweden" |
CREATE TABLE instructor (
dept_name VARCHAR,
salary INTEGER
) | Find the name of the department which has the highest average salary of professors. | SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1 |
CREATE TABLE table_17798093_20 (
ending VARCHAR,
examples VARCHAR
) | what are the endings of examples achilles, appendices, f ces | SELECT ending FROM table_17798093_20 WHERE examples = "Achilles, appendices, fæces" |
CREATE TABLE table_1480455_1 (
area__km_2__ VARCHAR,
population_density___km_2__ VARCHAR
) | What is the area (km 2) where the population density (/mk2) is 84.3? | SELECT area__km_2__ FROM table_1480455_1 WHERE population_density___km_2__ = "84.3" |
CREATE TABLE table_38154 (
"Date" text,
"Venue" text,
"Result" text,
"Goals" real,
"Competition" text
) | On what date was a friendly match held at Auckland? | SELECT "Date" FROM table_38154 WHERE "Competition" = 'friendly match' AND "Venue" = 'auckland' |
CREATE TABLE table_74568 (
"Area" text,
"Advertisement date" text,
"Block" text,
"Winning applicant" text,
"Ensemble name" text
) | What is Oxfordshire Area's Ensemble Name? | SELECT "Ensemble name" FROM table_74568 WHERE "Area" = 'oxfordshire' |
CREATE TABLE table_20477 (
"Headphone Model" text,
"Headphone Class" text,
"Driver-matched dB" text,
"Construction" text,
"Earpads" text,
"Termination" text,
"US MSRP" text
) | Which terminations correspond with headphone model SR80I? | SELECT "Termination" FROM table_20477 WHERE "Headphone Model" = 'SR80i' |
CREATE TABLE table_3764 (
"Artist" text,
"Country" text,
"Number-one single(s)" text,
"Year" real,
"Weeks at #1" real,
"Straight to #1 ?" text
) | Name the number one singles for desvarieux, jacob | SELECT "Number-one single(s)" FROM table_3764 WHERE "Artist" = 'Desvarieux, Jacob' |
CREATE TABLE table_name_80 (
original_us_air_date VARCHAR,
original_canadian_air_date VARCHAR
) | What is the Original U.S. air-date for the Original Canadian air-date of december 9, 2007? | SELECT original_us_air_date FROM table_name_80 WHERE original_canadian_air_date = "december 9, 2007" |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | i need to make reservations from DENVER 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, flight 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_name = 'BOSTON'... |
CREATE TABLE table_name_28 (
points INTEGER,
winnings VARCHAR
) | Which driver has the highest point total after winning $133,386? | SELECT MAX(points) FROM table_name_28 WHERE winnings = "$133,386" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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 cost (
row_id... | what was the name of the output which patient 10855 had for the first time on this month/25? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND DATETIME(outputevents.charttim... |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions... | when was the last time until 38 months ago that patient 88558 had the minimum red blood cells value? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88558) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(),... |
CREATE TABLE table_14850099_18 (
planet VARCHAR,
cardinal_direction VARCHAR
) | What is the planet associated with the direction of south? | SELECT planet FROM table_14850099_18 WHERE cardinal_direction = "South" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.