table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
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 patients whose admission type is emergency and procedure short title is enterovesico fist repair?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Enterovesico fist repair"
CREATE TABLE table_24729_2 ( torque VARCHAR, co2 VARCHAR )
whe, co2 is 206g/km, what is the torque?
SELECT torque FROM table_24729_2 WHERE co2 = "206g/km"
CREATE TABLE table_22043925_1 ( school VARCHAR, location VARCHAR )
What is every school for the Adelaide location?
SELECT school FROM table_22043925_1 WHERE location = "Adelaide"
CREATE TABLE table_name_80 ( year VARCHAR, best_film VARCHAR )
Which Year has a Best Film of mystery?
SELECT year FROM table_name_80 WHERE best_film = "mystery"
CREATE TABLE table_47069 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Can you tell me the highest Gold that has the Bronze smaller than 1, and the Total larger than 4?
SELECT MAX("Gold") FROM table_47069 WHERE "Bronze" < '1' AND "Total" > '4'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
find the number of patients diagnosed for sebaceous cyst whose lab test category is chemistry.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Sebaceous cyst" AND lab."CATEGORY" = "Chemistry"
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
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, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
count the number of patients whose admission location is trsf within this facility and item id is 51419?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "51419"
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize the relationship between ACC_Percent and All_Games_Percent , and group by attribute ACC_Road.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Road
CREATE TABLE table_7306 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the average for games Lost where the Points are 25 and games Played are more than 18?
SELECT AVG("Lost") FROM table_7306 WHERE "Points" = '25' AND "Played" > '18'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
was patient 028-52605 diagnosed with any until 1 year ago?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-52605')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(...
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
Display a line chart for what is the average prices of wines for each each?, list by the X-axis in descending.
SELECT Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year DESC
CREATE TABLE table_name_12 ( date VARCHAR, visitor VARCHAR, record VARCHAR )
What date was the visitor chicago black hawks, and a Record of 1-1?
SELECT date FROM table_name_12 WHERE visitor = "chicago black hawks" AND record = "1-1"
CREATE TABLE shop ( address VARCHAR, open_year VARCHAR )
Show the shop addresses ordered by their opening year.
SELECT address FROM shop ORDER BY open_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...
what is average age of patients whose gender is m and age is greater than or equal to 30?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "30"
CREATE TABLE table_28837 ( "Place" real, "Nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "Table points" real )
WHat is the highest difference?
SELECT MAX("difference") FROM table_28837
CREATE TABLE table_204_634 ( id number, "tour" number, "official title" text, "venue" text, "city" text, "date\nstart" text, "date\nfinish" text, "prize money\nusd" number, "report" text )
what is the total prize payout for all 13 series ?
SELECT SUM("prize money\nusd") FROM table_204_634
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what number of patients transferred within this facility had procedure under icd9 code 3723?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "3723"
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
Get all related tags by tag.
SELECT Tags.TagName, COUNT(Posts.Id) AS "Count" FROM Posts INNER JOIN PostTags AS PT ON Posts.Id = PT.PostId INNER JOIN Tags ON Tags.Id = PT.TagId WHERE Posts.Id IN (SELECT PT.PostId FROM PostTags AS PT WHERE PT.TagId = @tagId) AND Tags.Id != @tagId GROUP BY Tags.TagName ORDER BY 'Count' DESC
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 patients on main drug type prescription who are diagnosed with malignant neoplasm of descending colon?
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 = "Mal neo descend colon" AND prescriptions.drug_type = "MAIN"
CREATE TABLE table_name_94 ( country VARCHAR, total VARCHAR, player VARCHAR )
What country has a total greater than 270, with sandy lyle as the player?
SELECT country FROM table_name_94 WHERE total > 270 AND player = "sandy lyle"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
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, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and display by the total number from low to high.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY)
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a scatter chart about the correlation between Team_ID and School_ID , and group by attribute All_Neutral.
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Neutral
CREATE TABLE table_name_45 ( country VARCHAR, moving_from VARCHAR, transfer_window VARCHAR, ends VARCHAR )
What is the name of the country that has a transfer window of winter with an end after 2009 and moving from Bolton Wanderers?
SELECT country FROM table_name_45 WHERE transfer_window = "winter" AND ends > 2009 AND moving_from = "bolton wanderers"
CREATE TABLE table_name_14 ( rowers VARCHAR, notes VARCHAR, country VARCHAR )
Which rowers represented portugal and had notes of r?
SELECT rowers FROM table_name_14 WHERE notes = "r" AND country = "portugal"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
find the primary disease and time of discharge for patient with patient id 7273.
SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "7273"
CREATE TABLE table_10128 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people were in the crowd for a game than had carlton as the visiting team?
SELECT "Crowd" FROM table_10128 WHERE "Away team" = 'carlton'
CREATE TABLE table_name_12 ( year INTEGER, runner_s__up VARCHAR )
What was the most recent year that Kathy Ahern was a runner-up?
SELECT MAX(year) FROM table_name_12 WHERE runner_s__up = "kathy ahern"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
when did patient 030-47098 first receive an valve replacement >= 7 days diagnosis until 2103?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-47098')) AND diagnosis.diagnosisname = 'valve replacement >= ...
CREATE TABLE table_22972 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What's the series number of the episode seen by 9.35 million people in the US?
SELECT MIN("No. in series") FROM table_22972 WHERE "U.S. viewers (millions)" = '9.35'
CREATE TABLE table_name_6 ( partner VARCHAR, championship VARCHAR, score VARCHAR )
Who was the partner at the Australian Open, Melbourne when the score was 2 6, 7 5, 6 2, 4 6, 3 6?
SELECT partner FROM table_name_6 WHERE championship = "australian open, melbourne" AND score = "2–6, 7–5, 6–2, 4–6, 3–6"
CREATE TABLE table_49532 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
what is the score when the partner is florencia labat, the surface is clay, the opponents is laura golarsa ann grossman?
SELECT "Score" FROM table_49532 WHERE "Partner" = 'florencia labat' AND "Surface" = 'clay' AND "Opponents" = 'laura golarsa ann grossman'
CREATE TABLE table_name_92 ( season VARCHAR, division_two VARCHAR )
Which Season was the Division Two Fownhope Reserves champions?
SELECT season FROM table_name_92 WHERE division_two = "fownhope reserves"
CREATE TABLE building ( name VARCHAR, height_feet VARCHAR, floors VARCHAR )
List the names of buildings with at least 200 feet of height and with at least 20 floors.
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20
CREATE TABLE table_40998 ( "Name" text, "Number" real, "Position" text, "Year" text, "Hometown" text )
What is the name of the position of the person whose hometown is Queens, NY?
SELECT "Position" FROM table_40998 WHERE "Hometown" = 'queens, ny'
CREATE TABLE table_15315276_1 ( tournament_location VARCHAR, champion VARCHAR )
Where was the tournament located when Misun Cho won the championship?
SELECT tournament_location FROM table_15315276_1 WHERE champion = "Misun Cho"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft with mvr; ? maze and procedure short title is ven cath renal dialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND procedures.short_title = "Ven cath renal dialysis"
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( ...
what are the maximum total hospital costs involving a procedure called a oth transureth prostatec?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth transureth prostatec')) GROUP BY cost.hadm_id) AS t1
CREATE TABLE table_21187 ( "Episode number" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Overall)" text )
How much were the shares during the episode '113'?
SELECT MAX("Share") FROM table_21187 WHERE "Episode" = '113'
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
Would there be any upper level classes that do n't require 494 ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%topic0%' OR name LIKE '%topic0%') AND department = 'EECS'
CREATE TABLE table_name_70 ( championships VARCHAR, league VARCHAR )
Which Championships have a League of ontario australian football league?
SELECT championships FROM table_name_70 WHERE league = "ontario australian football league"
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departu...
is there a flight on DL from BOSTON 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
CREATE TABLE table_42969 ( "City of License /Market" text, "Station" text, "Channel TV ( DT )" text, "Years owned" text, "Current affiliation" text )
Which city contains the KPIX station?
SELECT "City of License /Market" FROM table_42969 WHERE "Station" = 'kpix'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
when did patient 11095 get in the hospital for the first time?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 11095 ORDER BY admissions.admittime LIMIT 1
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
what is the amount of days it has elapsed since the first time patient 14467 had a d5w intake on the current icu visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime IS NULL) ...
CREATE TABLE table_63520 ( "Year" real, "Home Team" text, "Away Team" text, "Winner" text, "Score" text )
what is the score when the away team is rivercity rage?
SELECT "Score" FROM table_63520 WHERE "Away Team" = 'rivercity rage'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
since 2104, what was the three most commonly taken lab tests for patients with the age of 30s?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', lab.labresulttime) >= '2104' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
what is the four most frequently ordered procedure for a patient with an age 30s since 2100?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
CREATE TABLE table_name_89 ( issue_price VARCHAR, year VARCHAR, theme VARCHAR )
What is the issue price of a voyageur before 2006?
SELECT issue_price FROM table_name_89 WHERE year < 2006 AND theme = "voyageur"
CREATE TABLE table_44309 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is Venue, when Competition is 2010 FIFA World Cup Qualification, when Result is Won, and when Date is 14 June 2008?
SELECT "Venue" FROM table_44309 WHERE "Competition" = '2010 fifa world cup qualification' AND "Result" = 'won' AND "Date" = '14 june 2008'
CREATE TABLE table_4591 ( "Name" text, "Bullet" text, "Length" text, "Base" text, "Shoulder" text, "Neck" text )
Which name is 51.89 (2.043) long?
SELECT "Name" FROM table_4591 WHERE "Length" = '51.89 (2.043)'
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
Show me a bar chart for what are the apartment number and the room count of each apartment?
SELECT apt_number, room_count FROM Apartments
CREATE TABLE table_9236 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real )
Who was the home team on January 4?
SELECT "Home" FROM table_9236 WHERE "Date" = 'january 4'
CREATE TABLE table_name_5 ( location VARCHAR, manager VARCHAR )
What is the Location of the Stadium where Job Dragtsma is Manager?
SELECT location FROM table_name_5 WHERE manager = "job dragtsma"
CREATE TABLE table_name_92 ( area_km_2 INTEGER, population VARCHAR, status VARCHAR, census_ranking VARCHAR )
What is the area of the village with a census ranking of 1,442 of 5,008 and a population less than 1,778?
SELECT MAX(area_km_2) FROM table_name_92 WHERE status = "village" AND census_ranking = "1,442 of 5,008" AND population < 1 OFFSET 778
CREATE TABLE table_name_47 ( genes VARCHAR, species VARCHAR )
How many genes in the species Rubrobacter Xylanophilus?
SELECT genes FROM table_name_47 WHERE species = "rubrobacter xylanophilus"
CREATE TABLE table_name_9 ( set_3 VARCHAR, set_1 VARCHAR, set_2 VARCHAR )
Which set 3 has a Set 1 of 19-25, and a Set 2 of 19-25?
SELECT set_3 FROM table_name_9 WHERE set_1 = "19-25" AND set_2 = "19-25"
CREATE TABLE table_name_75 ( runner_s__up VARCHAR, tournament VARCHAR )
What is Runner(s)-up, when Tournament is MCI Classic?
SELECT runner_s__up FROM table_name_75 WHERE tournament = "mci classic"
CREATE TABLE roller_coaster ( roller_coaster_id number, name text, park text, country_id number, length number, height number, speed text, opened text, status text ) CREATE TABLE country ( country_id number, name text, population number, area number, languages te...
Show the name and population of the country that has the highest roller coaster.
SELECT T1.name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.country_id = T2.country_id ORDER BY T2.height DESC LIMIT 1
CREATE TABLE invoices ( billing_city VARCHAR, billing_state VARCHAR )
List the number of invoices from Chicago, IL.
SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"
CREATE TABLE table_18795125_6 ( date_of_appointment VARCHAR, position_in_table VARCHAR )
What was the date of appointment for the manager of the 23rd team?
SELECT date_of_appointment FROM table_18795125_6 WHERE position_in_table = "23rd"
CREATE TABLE table_28835 ( "Rnd" real, "Circuit" text, "Lites 1 Race One Winning Team" text, "Lites 2 Race One Winning Team" text, "Lites 1 Race Two Winning Team" text, "Lites 2 Race Two Winning Team" text )
Who was the lites 2 race two winning team when #13 Inspire Motorsports was the Lites 1 race one winning team?
SELECT "Lites 2 Race Two Winning Team" FROM table_28835 WHERE "Lites 1 Race One Winning Team" = '#13 Inspire Motorsports'
CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VARCHAR(10), vi...
A stacked bar chart showing the number of faults for different fault short name and skills required to fix them The x-axis is skill description and group by fault short name, rank in asc by the bar.
SELECT skill_description, COUNT(skill_description) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name, skill_description ORDER BY skill_description
CREATE TABLE table_name_55 ( miss_maja_pilipinas VARCHAR, second_runner_up VARCHAR )
Can you tell me the Miss Pilipinas that has the Second runner-up of maria penson?
SELECT miss_maja_pilipinas FROM table_name_55 WHERE second_runner_up = "maria penson"
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 prescription...
What number of patients were primarily diagnosed for aortic insufficiency re-do sternotomy aortic valve replacement ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
CREATE TABLE table_name_77 ( away_team VARCHAR, home_team VARCHAR )
What was the away team when the home team was South Melbourne?
SELECT away_team FROM table_name_77 WHERE home_team = "south melbourne"
CREATE TABLE features ( feature_id number, feature_details text ) CREATE TABLE royal_family ( royal_family_id number, royal_family_details text ) CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE shops ( shop_id number, shop_details text ) CREATE TABLE st...
What are the distinct location names?
SELECT DISTINCT location_name FROM locations
CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE ref_colors ( color_code text, color_description...
What is the color description of the product with name 'catnip'?
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "catnip"
CREATE TABLE table_23501776_18 ( points INTEGER, seed VARCHAR )
If seed number is 2, what is the maximum amount of points?
SELECT MAX(points) FROM table_23501776_18 WHERE seed = 2
CREATE TABLE table_name_11 ( format VARCHAR, region VARCHAR )
What is Format, when Region is United States?
SELECT format FROM table_name_11 WHERE region = "united states"
CREATE TABLE table_64720 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" real )
Which Format has a Label of columbia, and a Catalog smaller than 88697411432, and a Date of october 24, 2008?
SELECT "Format" FROM table_64720 WHERE "Label" = 'columbia' AND "Catalog" < '88697411432' AND "Date" = 'october 24, 2008'
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) ...
How many injured players not suffering from injury of 'Knee problem' in each match? Show me a bar chart grouping by number of matches, I want to display from low to high by the bars.
SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY Number_of_matches
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
what flights are from MEMPHIS to LAS VEGAS
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 = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE...
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
Top 200 SO user from bangladesh.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE Location = 'Bangladesh' ORDER BY Reputation DESC LIMIT 200
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title te...
indicate the monthly maximum volume of drain out #3 penrose that patient 97330 has had since 81 months ago.
SELECT MAX(outputevents.value) 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 = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra...
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 ...
how many patients diagnosed with esophageal reflux were discharged to home health care?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.long_title = "Esophageal reflux"
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, and show y-axis in asc order.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY)
CREATE TABLE table_1342359_2 ( district VARCHAR, incumbent VARCHAR )
How many districts does william b. oliver represent?
SELECT COUNT(district) FROM table_1342359_2 WHERE incumbent = "William B. Oliver"
CREATE TABLE table_47877 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" text )
Which driver had a grid of 2?
SELECT "Driver" FROM table_47877 WHERE "Grid" = '2'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
when did patient 027-82318 since 4 years ago last get admitted into the hospital via the recovery room?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-82318' AND patient.hospitaladmitsource = 'recovery room' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
last time patient 025-57841 got a procedure during their first hospital visit?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-57841' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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, ...
have patient 12927 been at the hospital in 2105?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 12927 AND STRFTIME('%y', admissions.admittime) = '2105'
CREATE TABLE table_21346767_3 ( age INTEGER, geographical_regions VARCHAR, hometown VARCHAR )
Name the least age for cibao central and santo domingo
SELECT MIN(age) FROM table_21346767_3 WHERE geographical_regions = "Cibao Central" AND hometown = "Santo Domingo"
CREATE TABLE table_name_58 ( district VARCHAR, name VARCHAR )
What is the district for the parish, Brough?
SELECT district FROM table_name_58 WHERE name = "brough"
CREATE TABLE table_26222468_1 ( wins INTEGER )
What is the maximum number of wins?
SELECT MAX(wins) FROM table_26222468_1
CREATE TABLE table_25686 ( "Episode Number" text, "Title" text, "Villains" text, "Director" text, "Writer" text, "Original airdate" text )
Who was the writer of 'Face Off'?
SELECT "Writer" FROM table_25686 WHERE "Title" = 'Face Off'
CREATE TABLE table_29243 ( "Train No." real, "Train Name" text, "Arrival" text, "Departure" text, "Days" text, "Platform No." text )
How many trains arrive at 11:00?
SELECT COUNT("Train No.") FROM table_29243 WHERE "Arrival" = '11:00'
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
what is the total amount of dobutamine-in for patient 033-2671 until 580 days ago?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-2671')) AND intakeoutput.celllabel = 'dobuta...
CREATE TABLE table_name_89 ( year_left VARCHAR, school VARCHAR )
What year did a team from North Dearborn leave?
SELECT year_left FROM table_name_89 WHERE school = "north dearborn"
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transactio...
What are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, and could you display by the date_of_transaction in ascending?
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction
CREATE TABLE table_2668416_18 ( incumbent VARCHAR, district VARCHAR )
If the district is Virginia 8, who is the Incumbent?
SELECT incumbent FROM table_2668416_18 WHERE district = "Virginia 8"
CREATE TABLE table_69158 ( "Club" text, "Sport" text, "Began play" text, "League" text, "Venue" text )
When did the Club of western new york flash begin to play?
SELECT "Began play" FROM table_69158 WHERE "Club" = 'western new york flash'
CREATE TABLE table_71575 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who played on clay on 3 march 2012?
SELECT "Opponent" FROM table_71575 WHERE "Surface" = 'clay' AND "Date" = '3 march 2012'
CREATE TABLE table_name_77 ( player VARCHAR, years_in_orlando VARCHAR )
What is the Player for Orlando in 1989 1991?
SELECT player FROM table_name_77 WHERE years_in_orlando = "1989–1991"
CREATE TABLE table_47252 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the number of points when the played is less than 30?
SELECT COUNT("Points") FROM table_47252 WHERE "Played" < '30'
CREATE TABLE table_203_803 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "place" number, "points" number )
which artist -lrb- s -rrb- scored a total of 32 points ?
SELECT "artist" FROM table_203_803 WHERE "points" = 32
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
there has been any organism found in the first sputum, tracheal specimen microbiology test of patient 031-24513 since 2104?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTI...
CREATE TABLE table_70493 ( "Venue" text, "City" text, "Tickets Sold / Available" text, "Gross Revenue (1986)" text, "Gross Revenue (2011)" text )
How many tickets were there sold/available in Barcelona?
SELECT "Tickets Sold / Available" FROM table_70493 WHERE "City" = 'barcelona'
CREATE TABLE table_203_214 ( id number, "member" text, "party" text, "electorate" text, "state" text, "first elected" text )
who was the first member to be elected ?
SELECT "member" FROM table_203_214 ORDER BY "first elected" LIMIT 1
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of unmarried patients who have procedure icd9 code 5771?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.icd9_code = "5771"