table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | Top 200 users from Uzbekistan. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%uzb%' OR UPPER(Location) LIKE '%uzb' ORDER BY Reputation DESC LIMIT 200 |
CREATE TABLE table_name_94 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
) | For the match in which player David Frost scored a To Par of +7, what was the final score? | SELECT score FROM table_name_94 WHERE to_par = "+7" AND player = "david frost" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | did patient 81871 get diagnosed with popliteal synovial cyst in 2105? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'popliteal synovial cyst') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81871) AND STRFTIME('%y', dia... |
CREATE TABLE table_204_354 (
id number,
"opus" text,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"composition" text,
"premiere date" text,
"place, theatre" text
) | what is the number of operas from the oper genre ? | SELECT COUNT("title") FROM table_204_354 WHERE "genre" = 'oper' |
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 age is less than 45 and drug name is methylprednisolone sodium succ? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.drug = "MethylPREDNISolone Sodium Succ" |
CREATE TABLE table_178381_1 (
sub_parish__sokn_ VARCHAR,
location_of_the_church VARCHAR
) | What's the sub-parish (sokn) of Eikefjord? | SELECT sub_parish__sokn_ FROM table_178381_1 WHERE location_of_the_church = "Eikefjord" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | how many patients were diagnosed with long-term use of insulin within the same month after previously being diagnosed with atriovent block complete, the previous year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use of i... |
CREATE TABLE table_name_19 (
number_in_series INTEGER,
production_code VARCHAR
) | What is the series number that has a production code of 50021 50025? | SELECT MAX(number_in_series) FROM table_name_19 WHERE production_code = "50021–50025" |
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 demographic ... | calculate the number of patients with gastrointestinal hemorrhage nos who received iv drip therapy | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Gastrointest hemorr NOS" AND prescriptions.route = "IV DRIP" |
CREATE TABLE table_5543 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Which 2010 stat featured the tournament of the Olympic Games? | SELECT "2010" FROM table_5543 WHERE "Tournament" = 'olympic games' |
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,... | give me the number of patients whose drug code is desi30o and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DESI30O" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_name_76 (
_number_of_airlines VARCHAR,
distance__km_ VARCHAR
) | How many Airlines have a total distance of 705 (km)? | SELECT COUNT(_number_of_airlines) FROM table_name_76 WHERE distance__km_ = 705 |
CREATE TABLE table_name_19 (
car_model VARCHAR,
engine VARCHAR
) | What Car Model has the Engine of Ford 6.0 V8? | SELECT car_model FROM table_name_19 WHERE engine = "ford 6.0 v8" |
CREATE TABLE table_name_11 (
position_in_table VARCHAR,
team VARCHAR
) | what is the position in table when the team is hartlepool united? | SELECT position_in_table FROM table_name_11 WHERE team = "hartlepool united" |
CREATE TABLE table_66308 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | who is the developers for demon's souls? | SELECT "Developer(s)" FROM table_66308 WHERE "Game" = 'demon''s souls' |
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... | Find All_Road and All_Games_Percent , and visualize them by a bar chart, I want to display by the total number in ascending. | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
CREATE TABLE table_name_40 (
tyre VARCHAR,
engine_† VARCHAR
) | What is the tyre for the peugeot a20 engine? | SELECT tyre FROM table_name_40 WHERE engine_† = "peugeot a20" |
CREATE TABLE table_23508196_5 (
type_of_aircraft VARCHAR,
number_of_crews VARCHAR
) | What is the aircraft for 21 crews? | SELECT type_of_aircraft FROM table_23508196_5 WHERE number_of_crews = "21" |
CREATE TABLE table_66845 (
"Sunday" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text
) | Which Wednesday has a Monday of getsuy bi? | SELECT "Wednesday" FROM table_66845 WHERE "Monday" = '月曜日 getsuyōbi' |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | Return a bar chart about the distribution of Time and ID , and list by the bar from low to high please. | SELECT Time, ID FROM swimmer ORDER BY Time |
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 ... | how much cosyntropin, for the first time in 02/this year, was prescribed to patient 74159? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159) AND prescriptions.drug = 'cosyntropin' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRF... |
CREATE TABLE table_58179 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Name the rounds for stanley brm | SELECT "Rounds" FROM table_58179 WHERE "Entrant" = 'stanley brm' |
CREATE TABLE table_79089 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
) | WHAT IS THE SILVER WITH A YEAR OF 1962? | SELECT "Silver" FROM table_79089 WHERE "Year" = '1962' |
CREATE TABLE table_28045 (
"Series no." real,
"No. in season" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | what season was written by jonathan collier? | SELECT MAX("No. in season") FROM table_28045 WHERE "Written by" = 'Jonathan Collier' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
... | when did patient 73652 last have the minimum urobilinogen - value during the first hospital visit? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73652 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urob... |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
... | count the numbers of patients who were diagnosed with reflux esophagitis and did not come back to the hospital within 2 months until 2103. | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'reflux eso... |
CREATE TABLE Lessons (
lesson_time INTEGER,
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
) | How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? | SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | Give me a histogram, that simply displays the last name of the employee and the corresponding manager id, and order y-axis from low to high order. | SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId num... | Estimated average question score as visitors can see. Here we assume that question views are equally distributed than the ups. | SELECT AVG(0.5 * ViewCount / Score) AS Average FROM Posts WHERE PostTypeId = 1 AND Score > 0 |
CREATE TABLE table_66376 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the attendance number when the result is l 41-37? | SELECT "Attendance" FROM table_66376 WHERE "Result" = 'l 41-37' |
CREATE TABLE table_train_54 (
"id" int,
"organ_transplantation" bool,
"severe_sepsis" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"thrombocytopenia" float,
"sepsis" bool,
"hypotension" bool,
"burn_injury" int,
"septic_shock" bool,
"age" float,
"NOUSE" f... | human immunodeficiency virus infection ( hiv ) and active aids | SELECT * FROM table_train_54 WHERE hiv_infection = 1 |
CREATE TABLE table_45186 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
) | What is the result of the league/cup competition with the swindon wildcats as the opponent and neil liddiard as the man of the match? | SELECT "Result" FROM table_45186 WHERE "Competition" = 'league/cup' AND "Opponent" = 'swindon wildcats' AND "Man of the Match" = 'neil liddiard' |
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, show me about the distribution of founder and the sum of manufacturer , and group by attribute founder in a bar chart, and sort by the bar from high to low. | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
CREATE TABLE table_62571 (
"Actor in original production" text,
"Actor required" text,
"GamePlan" text,
"FlatSpin" text,
"RolePlay" text
) | Who is the actor in the original production when Troy Stephens is the GamePlan? | SELECT "Actor in original production" FROM table_62571 WHERE "GamePlan" = 'troy stephens' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | how many patients were prescribed potassium chloride during the same hospital visit after having undergone immunoregulatory agents? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'immunoregulatory agents') AS t1 JOIN (SELECT patient.uniquepid, medicatio... |
CREATE TABLE table_72976 (
"Aircraft" text,
"1990" real,
"destroyed" real,
"damaged" real,
"to Iran" real,
"survived" real
) | If there were 14 in 1990 and 6 survived how many were destroyed? | SELECT "destroyed" FROM table_72976 WHERE "1990" = '14' AND "survived" = '6' |
CREATE TABLE table_11 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What's Dorain Anneck's pick number? | SELECT "Pick" FROM table_11 WHERE "Player" = 'Dorain Anneck' |
CREATE TABLE table_train_33 (
"id" int,
"active_infection" bool,
"allergy_to_thiamine" bool,
"receiving_vasopressor" bool,
"liver_disease" bool,
"allergy_to_vitamin_c" bool,
"allergy_to_hydrocortisone" bool,
"hypertension" bool,
"age" float,
"serum_aminotransferase_level_alt_ast"... | known allergy to vitamin c, hydrocortisone, or thiamine | SELECT * FROM table_train_33 WHERE allergy_to_vitamin_c = 1 OR allergy_to_hydrocortisone = 1 OR allergy_to_thiamine = 1 |
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE csu_fees (
campus number,
year number,
campusfee number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
... | How many degrees were conferred at San Jose State University in 2000? | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000 |
CREATE TABLE table_name_53 (
score VARCHAR,
tie_no VARCHAR
) | What is the score when the tie is 8? | SELECT score FROM table_name_53 WHERE tie_no = "8" |
CREATE TABLE table_65300 (
"Human Gene (Protein)" text,
"Mouse Ortholog" text,
"Yeast Ortholog" text,
"Subpathway" text,
"GeneCards Entry" text
) | What is the yeast ortholog that has a subpathway of GGR and GeneCards entry CETN2? | SELECT "Yeast Ortholog" FROM table_65300 WHERE "Subpathway" = 'ggr' AND "GeneCards Entry" = 'cetn2' |
CREATE TABLE table_name_50 (
ages VARCHAR,
report VARCHAR,
school VARCHAR
) | What are the Ages of the Seashell Trust School with Ofsted Report? | SELECT ages FROM table_name_50 WHERE report = "ofsted" AND school = "seashell trust" |
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... | TOP F# users in London and Age. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", u.age, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON... |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
acti... | How many faculty members do we have for each gender? Give me a proportion. | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | To which tags do I answer?. | SELECT MAX(t.TagName), COUNT(1) AS nbe_questions, AVG(Questions.Score) AS Q_score, AVG(Answers.Score) AS A_score FROM Posts AS Questions, Posts AS Answers, PostTags AS pt, Tags AS t WHERE pt.TagId = t.Id AND pt.PostId = Questions.Id AND pt.PostId = Questions.Id AND Questions.PostTypeId = 1 AND Answers.PostTypeId = 2 AN... |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Posts ... | Total length of posts by user. | SELECT SUM(LENGTH(p.Body)) AS TotalLength, u.DisplayName AS UserName FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.DisplayName ORDER BY TotalLength DESC LIMIT 100 |
CREATE TABLE table_1356555_2 (
median_household_income VARCHAR,
county VARCHAR
) | What is the median household income of sacramento? | SELECT median_household_income FROM table_1356555_2 WHERE county = "Sacramento" |
CREATE TABLE table_46719 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What's the record of Game 56? | SELECT "Record" FROM table_46719 WHERE "Game" = '56' |
CREATE TABLE table_2886617_5 (
college_junior_club_team VARCHAR,
nhl_team VARCHAR
) | How may college/junior/club team has a the nhl team listed as Colorado Avalanche? | SELECT COUNT(college_junior_club_team) FROM table_2886617_5 WHERE nhl_team = "Colorado Avalanche" |
CREATE TABLE table_3492 (
"Institution" text,
"Nickname" text,
"Location (all in Minnesota)" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
) | What institution is located in St. Peter? | SELECT "Institution" FROM table_3492 WHERE "Location (all in Minnesota)" = 'St. Peter' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalp... | did patient 004-86136 have a insulin - sliding scale administration procedure in other hospitals in 2105? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitaldischargetime IS NULL)) AND tr... |
CREATE TABLE table_2165 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
) | how many dismissals in a game with 191 innings | SELECT COUNT("Dismissals") FROM table_2165 WHERE "Innings" = '191' |
CREATE TABLE table_18601 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who was the incumbent in Pennsylvania 27? | SELECT "Incumbent" FROM table_18601 WHERE "District" = 'Pennsylvania 27' |
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
... | Show party names and the number of events for each party by a pie chart. | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID |
CREATE TABLE table_27319 (
"Region" text,
"Enrolled men" real,
"Enrolled women" real,
"Enrolled total" real,
"Men of voting age" real,
"Women of voting age" real,
"Voting age population" real,
"E/VAP ratio Men" text,
"E/VAP ratio Women" text,
"E/VAP ratio Total" text
) | what is the percentage of male voters where the level of maturity is 123726 | SELECT "E/VAP ratio Total" FROM table_27319 WHERE "Men of voting age" = '123726' |
CREATE TABLE table_204_363 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
) | lesnar beat herring in ufc 87 , in what event was his previous win ? | SELECT "event" FROM table_204_363 WHERE "res." = 'win' AND "date" < (SELECT "date" FROM table_204_363 WHERE "event" = 'ufc 87') ORDER BY "date" DESC LIMIT 1 |
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 demographic (... | what is the number of emergency room admitted patients who have mesenteric ischemia primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" |
CREATE TABLE table_name_93 (
draw INTEGER,
language VARCHAR,
place VARCHAR
) | How many draws have french as the language, with a place less than 1? | SELECT SUM(draw) FROM table_name_93 WHERE language = "french" AND place < 1 |
CREATE TABLE table_dev_32 (
"id" int,
"post_challenge_capillary_glucose" int,
"gender" string,
"blood_donation" bool,
"untreated_hyperlipidemia" bool,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"fasting_triglycerides" int,
"fasting_blood_glucose_fbg" float,
"fasting_pl... | hematocrit of less than 36 % for male , less than 32 % for female . | SELECT * FROM table_dev_32 WHERE (hematocrit_hct < 36 AND gender = 'male') OR (hematocrit_hct < 32 AND gender = 'female') |
CREATE TABLE table_name_35 (
year VARCHAR,
assists VARCHAR
) | What year had 48 assists? | SELECT year FROM table_name_35 WHERE assists = "48" |
CREATE TABLE table_10975034_5 (
cfl_team VARCHAR,
position VARCHAR
) | What is the cfl team that has a position of ol? | SELECT cfl_team FROM table_10975034_5 WHERE position = "OL" |
CREATE TABLE table_2562572_50 (
type VARCHAR,
settlement VARCHAR
) | What type of settlement is Jazak? | SELECT type FROM table_2562572_50 WHERE settlement = "Jazak" |
CREATE TABLE table_203_583 (
id number,
"title" text,
"release" number,
"6th gen" text,
"handheld" text,
"note" text
) | what game was published in europe as 1945 but had a different name elsewhere ? | SELECT "title" FROM table_203_583 WHERE "note" = 'released and published in europe by play it as 1945 i & ii: the arcade games' |
CREATE TABLE table_14490 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of total with a Rank larger than 12, and a Gold larger than 4? | SELECT COUNT("Total") FROM table_14490 WHERE "Rank" > '12' AND "Gold" > '4' |
CREATE TABLE table_14308895_2 (
new_pageant VARCHAR,
country_territory VARCHAR
) | which is the new pageant from spain? | SELECT new_pageant FROM table_14308895_2 WHERE country_territory = "Spain" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | give me the number of self pay insurance patients who had replacement of tube or enterostomy device of small intestine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Replacement of tube or enterostomy device of small intestine" |
CREATE TABLE table_63183 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What's the class when the identifier is cbf-fm-14? | SELECT "Class" FROM table_63183 WHERE "Identifier" = 'cbf-fm-14' |
CREATE TABLE table_203_287 (
id number,
"rank" number,
"area" text,
"date" text,
"presenter" text,
"seven wonders covered" text
) | what is the name of the last area listed on this chart ? | SELECT "area" FROM table_203_287 ORDER BY id DESC LIMIT 1 |
CREATE TABLE table_name_37 (
player VARCHAR,
place VARCHAR
) | what player has place t10 | SELECT player FROM table_name_37 WHERE place = "t10" |
CREATE TABLE table_name_27 (
d_44_√ VARCHAR,
d_46_√ VARCHAR
) | What's the D 44 when D 46 is d 26? | SELECT d_44_√ FROM table_name_27 WHERE d_46_√ = "d 26" |
CREATE TABLE table_name_59 (
gold INTEGER,
total VARCHAR,
silver VARCHAR
) | What is the fewest number of golds for teams with a total of 3 and fewer than 2 silvers? | SELECT MIN(gold) FROM table_name_59 WHERE total = 3 AND silver < 2 |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)... | I want to see trend the number of date in locaton to over date in locaton to by Location_Code | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body te... | Top 50 users from Kanpur. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kanpur%' OR UPPER(Location) LIKE '%KANPUR' ORDER BY Reputation DESC LIMIT 5000 |
CREATE TABLE table_55375 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
) | What is the average rec that is greater than 10 and has 40 yards? | SELECT AVG("Rec.") FROM table_55375 WHERE "Yards" = '40' AND "Avg." > '10' |
CREATE TABLE table_62564 (
"Year" real,
"Date" text,
"Home Team" text,
"Result" text,
"Visiting Team" text,
"Venue" text
) | What date(s) was the game(s) at Candlestick Park? | SELECT "Date" FROM table_62564 WHERE "Venue" = 'candlestick park' |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
) | What are the names of the wrestlers, ordered descending by days held? | SELECT name FROM wrestler ORDER BY days_held DESC |
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 prescriptions... | provide the number of patients whose ethnicity is american indian/alaska native and item id is 51250? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.itemid = "51250" |
CREATE TABLE table_204_90 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
) | how many medalists came from kenya ? | SELECT COUNT("name") FROM table_204_90 WHERE "nationality" = 'kenya' |
CREATE TABLE table_65540 (
"Date" text,
"Round" text,
"Attendance" real,
"Opposition" text,
"Stadium" text
) | Which stadium had the opposition of 79,122? | SELECT "Stadium" FROM table_65540 WHERE "Opposition" = '79,122' |
CREATE TABLE table_62683 (
"Main contestant" text,
"Co-contestant (Yaar vs. Pyaar)" text,
"Date performed" text,
"Scores by each individual judge" text,
"Total score/week" text,
"Position" text,
"Status" text
) | What are the scores when total score/week is 41/60 and co-contestant is Shalini Chandran? | SELECT "Scores by each individual judge" FROM table_62683 WHERE "Total score/week" = '41/60' AND "Co-contestant (Yaar vs. Pyaar)" = 'shalini chandran' |
CREATE TABLE table_24073 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | On broadcast date is 25april1970, how many people tuned in? | SELECT "Viewers (in millions)" FROM table_24073 WHERE "Broadcast date" = '25April1970' |
CREATE TABLE table_76416 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | How many races did he do in the year he had 8 points? | SELECT "Races" FROM table_76416 WHERE "Points" = '8' |
CREATE TABLE table_name_88 (
overall INTEGER,
position VARCHAR,
round VARCHAR
) | What is the lowest overall for a quarterback with fewer than 7 rounds? | SELECT MIN(overall) FROM table_name_88 WHERE position = "quarterback" AND round < 7 |
CREATE TABLE Plays_games (
gameid VARCHAR,
hours_played INTEGER
) | Show all game ids and the number of hours played. | SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid |
CREATE TABLE table_name_50 (
genre VARCHAR,
origin_of_programming VARCHAR,
network VARCHAR
) | What genre is Star Plus from India? | SELECT genre FROM table_name_50 WHERE origin_of_programming = "india" AND network = "star plus" |
CREATE TABLE table_203_13 (
id number,
"year" number,
"champion" text,
"score" text,
"runner-up" text,
"coach" text
) | how many total games did boston college win in the beanpot ? | SELECT COUNT(*) FROM table_203_13 WHERE "champion" = 'boston college' |
CREATE TABLE table_58651 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the time when the set 1 is 21 25? | SELECT "Time" FROM table_58651 WHERE "Set 1" = '21–25' |
CREATE TABLE table_17103566_1 (
result VARCHAR,
team_1 VARCHAR
) | What is the result when team 1 is ICL Pakistan? | SELECT result FROM table_17103566_1 WHERE team_1 = "ICL Pakistan" |
CREATE TABLE table_1886 (
"Seq." text,
"Name" text,
"Background" real,
"Party Leadership" real,
"Communication Ability" real,
"Relations with Congress" real,
"Court Appointments" real,
"Handling of Economy" real,
"Luck" real,
"Ability to Compromise" real,
"Willing to take Ris... | When the seq is 41, what is the ability to compromise? | SELECT MAX("Ability to Compromise") FROM table_1886 WHERE "Seq." = '41' |
CREATE TABLE table_20592988_1 (
condition VARCHAR,
platelet_count VARCHAR,
prothrombin_time VARCHAR
) | In what conditions are both the platelet count and prothrombin time unaffected? | SELECT condition FROM table_20592988_1 WHERE platelet_count = "Unaffected" AND prothrombin_time = "Unaffected" |
CREATE TABLE table_name_16 (
reign VARCHAR,
days_held VARCHAR,
wrestler VARCHAR
) | What is the reign for super kendo who held it for 35 days? | SELECT reign FROM table_name_16 WHERE days_held = "35" AND wrestler = "super kendo" |
CREATE TABLE table_12394 (
"English" text,
"Crimean Gothic" text,
"Bible Gothic" text,
"German" text,
"Dutch" text,
"Icelandic" text,
"Swedish" text
) | What's the Dutch word for Apel? | SELECT "Dutch" FROM table_12394 WHERE "Crimean Gothic" = 'apel' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | what are the four most commonly prescribed medications for patients that were also prescribed with diphenhydramine 50 mg/1 ml 1 ml inj at the same time in 2105? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'diphenhydramine 50 mg/1 ml 1 ml inj' AND STRFTIME('... |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges Show bar chart, I want to display x axis from low to high order. | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | Show the type of school and the number of buses for each type, and I want to list by the y axis in descending. | SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY COUNT(*) DESC |
CREATE TABLE table_61323 (
"Episode" text,
"18-49" text,
"Viewers (m)" real,
"Rating" text,
"Share" text
) | What Viewers (m) has an Episode of 40 days? | SELECT "Viewers (m)" FROM table_61323 WHERE "Episode" = '40 days' |
CREATE TABLE table_26842217_12 (
result VARCHAR,
broadcast VARCHAR
) | What was the result in the game broadcast on the Big East Network? | SELECT result FROM table_26842217_12 WHERE broadcast = "Big East Network" |
CREATE TABLE table_51191 (
"Player" text,
"Position" text,
"First-Team Appearances" text,
"First-Team Goals" text,
"Current Club" text
) | How many first-team goals does the team have whose player is Samir Carruthers? | SELECT "First-Team Goals" FROM table_51191 WHERE "Player" = 'samir carruthers' |
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 is the marital status of patient 85169 when they visited the hospital first time? | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 85169 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_name_45 (
host_country___countries VARCHAR,
bronze VARCHAR,
host_city___cities VARCHAR
) | Who was the host country when bronze is [[|]] (1) and host city is Krynica? | SELECT host_country___countries FROM table_name_45 WHERE bronze = "[[|]] (1)" AND host_city___cities = "krynica" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.