table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_70 ( date VARCHAR, score_in_final VARCHAR )
On what Date was the Score in Final 6 3, 6 3?
SELECT date FROM table_name_70 WHERE score_in_final = "6–3, 6–3"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
tell me whether patient 004-66442 got 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg/5ml po susp until 03/2102?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-66442')) AND medication.drugname = '30 ml cup : alum & mag hydroxide-s...
CREATE TABLE table_name_75 ( points INTEGER, year VARCHAR, rank VARCHAR )
Which Points is the lowest one that has a Year larger than 1974, and a Rank of 15th?
SELECT MIN(points) FROM table_name_75 WHERE year > 1974 AND rank = "15th"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose diagnoses title is abrasion or friction burn of trunk, without mention of infection were admitted before the year 2125?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2125" AND diagnoses.long_title = "Abrasion or friction burn of trunk, without mention of infection"
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 many days have gone since patient 60136 was admitted to the hospital for?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL
CREATE TABLE table_39888 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text )
What is the home team of the game that ended with a score of 0-1?
SELECT "Home Team" FROM table_39888 WHERE "Score" = '0-1'
CREATE TABLE table_77550 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score when the NY Islanders was the visiting team?
SELECT "Score" FROM table_77550 WHERE "Visitor" = 'ny islanders'
CREATE TABLE products_for_hire ( product_description VARCHAR, product_id VARCHAR ) CREATE TABLE products_booked ( product_id VARCHAR, booked_amount VARCHAR )
What is the product description of the product booked with an amount of 102.76?
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
how many hours have passed since the first time patient 006-195316 visited ward 386 during the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-195316' AND patient.wardid = 386 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
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...
Select Top 100 *From Posts.
SELECT * FROM Users LIMIT 100
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Give me a histogram for how many rooms cost more than 120, for each different decor?, could you sort y-axis from low to high order?
SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*)
CREATE TABLE table_203_288 ( id number, "season" text, "premiere date" text, "the winner" text, "runner-up" text, "finalists" text, "contestants in order of elimination" text, "number of contestants" text, "number of concerts" number )
what is the least number of concerts given in a season
SELECT MIN("number of concerts") FROM table_203_288
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id nu...
Count the number of different affected regions.
SELECT COUNT(DISTINCT region_id) FROM affected_region
CREATE TABLE table_45174 ( "Circuit" text, "Location / State" text, "Date" text, "Round winner" text, "Team" text )
On what team did John Bowe round winner at Winton Motor Raceway belong to?
SELECT "Team" FROM table_45174 WHERE "Round winner" = 'john bowe' AND "Circuit" = 'winton motor raceway'
CREATE TABLE table_204_592 ( id number, "#" number, "title" text, "type" text, "opening\ndate" text, "closing\ndate" text, "performances" number, "comment" text )
which production has the same number of performances as sleuth ?
SELECT "title" FROM table_204_592 WHERE "title" <> 'sleuth' AND "performances" = (SELECT "performances" FROM table_204_592 WHERE "title" = 'sleuth')
CREATE TABLE table_44576 ( "Skip" text, "Third" text, "Second" text, "Lead" text, "City" text )
WHAT IS THE CITY WITH THIRD AS LORI OLSON-JOHNS?
SELECT "City" FROM table_44576 WHERE "Third" = 'lori olson-johns'
CREATE TABLE table_name_75 ( away VARCHAR, club VARCHAR )
What is NK Rijeka's away score?
SELECT away FROM table_name_75 WHERE club = "nk rijeka"
CREATE TABLE table_name_10 ( hard VARCHAR, record VARCHAR, carpet VARCHAR, clay VARCHAR, grass VARCHAR )
Which hard has a Clay of 0 0, Grass of 0 0, Carpet of 0 0, and a Record of 1 0?
SELECT hard FROM table_name_10 WHERE clay = "0–0" AND grass = "0–0" AND carpet = "0–0" AND record = "1–0"
CREATE TABLE artist ( name VARCHAR, year_join VARCHAR, country VARCHAR )
Show all artist names and the year joined who are not from United States.
SELECT name, year_join FROM artist WHERE country <> 'United States'
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 ( ...
find out the number of divorced patients for whom cortisol lab test had been ordered.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Cortisol"
CREATE TABLE table_39336 ( "Rank" real, "Country/Territory" text, "Miss World" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "5th Runner-up" real, "6th Runner-up" real, "Semifinalists" real, "Total" real )
Rank larger than 3, and a 6th Runner-up larger than 0, and a 5th Runner-up smaller than 1 has which lowest 1st Runner-up?
SELECT MIN("1st Runner-up") FROM table_39336 WHERE "Rank" > '3' AND "6th Runner-up" > '0' AND "5th Runner-up" < '1'
CREATE TABLE table_50351 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
How much money for 1st place with a to par less than 1?
SELECT COUNT("Money ( $ )") FROM table_50351 WHERE "Place" = '1' AND "To par" < '1'
CREATE TABLE table_name_93 ( tournament VARCHAR, date VARCHAR )
What tournament was on May 31, 1987?
SELECT tournament FROM table_name_93 WHERE date = "may 31, 1987"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Find the number of patients whose is age less than 80 years and diagnoses long title is late effects of cerebrovascular disease hemiplegia affecting unspecified side.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
i want to fly from CLEVELAND to SAN DIEGO tomorrow and stop in INDIANAPOLIS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight, flight_stop WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'INDIA...
CREATE TABLE table_name_71 ( height VARCHAR, player VARCHAR )
What is the height of the player, Larry Hughes?
SELECT height FROM table_name_71 WHERE player = "larry hughes"
CREATE TABLE table_25740548_2 ( written_by VARCHAR, production_code VARCHAR )
How many episodes with the production code CA106 are there?
SELECT COUNT(written_by) FROM table_25740548_2 WHERE production_code = "CA106"
CREATE TABLE table_9034 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the outcome of the match on 01/07/2007?
SELECT "Outcome" FROM table_9034 WHERE "Date" = '01/07/2007'
CREATE TABLE table_74458 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
In how many different games did Oliver Miller (7) did the high rebounds?
SELECT COUNT("Game") FROM table_74458 WHERE "High rebounds" = 'Oliver Miller (7)'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
whats patient 14467 last ward id since 4 years ago?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( ...
BALTIMORE to PHILADELPHIA wednesday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 ...
CREATE TABLE table_67604 ( "Name" text, "League" real, "Play-offs" real, "FA Cup" real, "League Cup" real, "Total" real )
What's the FA Cup that has a league less than 1?
SELECT SUM("FA Cup") FROM table_67604 WHERE "League" < '1'
CREATE TABLE table_name_83 ( school VARCHAR, county VARCHAR )
County of 46 laporte is what school?
SELECT school FROM table_name_83 WHERE county = "46 laporte"
CREATE TABLE table_26545 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What episode number in the series is 'dance to the music'?
SELECT MIN("No. in series") FROM table_26545 WHERE "Title" = 'Dance to the Music'
CREATE TABLE table_name_7 ( attendance INTEGER, opponents VARCHAR )
What is the attendance when Cork City is the opponent?
SELECT AVG(attendance) FROM table_name_7 WHERE opponents = "cork city"
CREATE TABLE table_name_60 ( opponents VARCHAR, partnering VARCHAR, date VARCHAR )
Which Opponents have a Partnering of alessandro motti, and a Date of 12 september 2005?
SELECT opponents FROM table_name_60 WHERE partnering = "alessandro motti" AND date = "12 september 2005"
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, ...
How to create an Image file from dataURL and save it?.
SELECT Ans.CreationDate, Qus.Tags, Qus.Title, Qus.ViewCount, Ans.Score, Ans.Id, Qus.AcceptedAnswerId FROM Posts AS Qus LEFT JOIN Posts AS Ans ON Qus.Id = Ans.ParentId WHERE Ans.OwnerUserId = 5720148 ORDER BY Ans.CreationDate DESC
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
How many same release titles are there in the table?
SELECT COUNT(*) FROM (SELECT groupname FROM torrents GROUP BY groupname HAVING COUNT(*) > 1)
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
how many employers have at least 300 employees ?
SELECT COUNT("employer") FROM table_203_737 WHERE "# of employees" >= 300
CREATE TABLE table_75368 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text )
What is the Project Name with a Country that is kazakhstan and a Peak that is 150?
SELECT "Project Name" FROM table_75368 WHERE "Country" = 'kazakhstan' AND "Peak" = '150'
CREATE TABLE table_name_5 ( week VARCHAR, result VARCHAR, attendance VARCHAR )
Which Week had a Result of w 10-0, and an Attendance smaller than 58,571?
SELECT COUNT(week) FROM table_name_5 WHERE result = "w 10-0" AND attendance < 58 OFFSET 571
CREATE TABLE news_report ( journalist_id number, event_id number, work_type text ) CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, years_working number ) CREATE TABLE event ( event_id number, date text, venue text, name text, e...
What is the nationality of the journalist with the largest number of years working?
SELECT nationality FROM journalist ORDER BY years_working DESC LIMIT 1
CREATE TABLE table_1879 ( "Sl no" real, "Name of the prabandham" text, "Starting from" real, "Ending with" real, "Number of pasurams" real, "Sung by" text )
Name the most ending with
SELECT MAX("Ending with") FROM table_1879
CREATE TABLE table_13861 ( "Competition" text, "Total" real, "Al Ahly wins" real, "Draws" real, "El Zamalek wins" real )
What is the fewest Al Ahly wins for El Zamalek wins of 0 and 0 draws?
SELECT MIN("Al Ahly wins") FROM table_13861 WHERE "Draws" = '0' AND "El Zamalek wins" < '0'
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, give me the comparison about code over the name , and group by attribute headquarter by a bar chart, and sort x-axis in descending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
CREATE TABLE table_name_21 ( title VARCHAR, appointed_by VARCHAR )
Which Title has an Appointed by of Millard Fillmore?
SELECT title FROM table_name_21 WHERE appointed_by = "millard fillmore"
CREATE TABLE table_36662 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real )
Who is the driver for team Coll Racing with more than 206 points?
SELECT "Driver" FROM table_36662 WHERE "Team" = 'collé racing' AND "Points" > '206'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of employee_id bin hire_date by time in a bar chart, and sort by the y-axis in descending.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE d...
what were the first ast (sgot) from patient 010-20205 in 08/last year?
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 = '010-20205')) AND lab.labname = 'ast (sgot)' AND DATETIME(lab.labresulttime, 'start of y...
CREATE TABLE table_54538 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the result of the UEFA Euro 2008 Qualifying competition?
SELECT "Result" FROM table_54538 WHERE "Competition" = 'uefa euro 2008 qualifying'
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE accounts ( account_id number, statement_id number,...
Count the number of budget codes.
SELECT COUNT(*) FROM ref_budget_codes
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and manager_id , and show by the y axis in desc.
SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC
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 ) ...
let me know the number of patients on ih route of drug administration who have diagnoses icd9 code 81201.
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.icd9_code = "81201" AND prescriptions.route = "IH"
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
how many coronar arteriogr-1 cath procedures has been performed until 2 years ago?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-1 cath') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year')
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
Number of Posts by Number of Users.
SELECT Posts, COUNT(*) AS Qty FROM (SELECT OwnerUserId, COUNT(OwnerUserId) AS Posts FROM Posts AS P WHERE P.PostTypeId = 1 OR P.PostTypeId = 2 GROUP BY OwnerUserId) AS SUB WHERE Posts > 0 GROUP BY Posts ORDER BY Posts
CREATE TABLE table_21497 ( "Season" text, "Games" real, "GS" real, "Points" text, "Rebounds" text, "Assists" text, "Blocks" text, "Steals" text, "Turnovers" text )
Name the assists for 157 games
SELECT "Assists" FROM table_21497 WHERE "Games" = '157'
CREATE TABLE table_name_51 ( fcc_info VARCHAR, city_of_license VARCHAR )
What is the FCC info of the translator with an Irmo, South Carolina city license?
SELECT fcc_info FROM table_name_51 WHERE city_of_license = "irmo, south carolina"
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY...
Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart, and show in ascending by the total number.
SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY)
CREATE TABLE table_name_50 ( losses VARCHAR, goals_for VARCHAR, team VARCHAR )
What is the total number of losses for the Team of Montreal with Goals For larger than 29?
SELECT COUNT(losses) FROM table_name_50 WHERE goals_for > 29 AND team = "montreal"
CREATE TABLE table_12526990_1 ( gayndah INTEGER, perry VARCHAR )
What is the gayndah when perry is 304?
SELECT MAX(gayndah) FROM table_12526990_1 WHERE perry = 304
CREATE TABLE table_24224647_2 ( main_presenter VARCHAR, region_country VARCHAR )
Who is every main presenter for the Estonia region/country?
SELECT main_presenter FROM table_24224647_2 WHERE region_country = "Estonia"
CREATE TABLE table_48596 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the resolution of the fight against steve schneider?
SELECT "Res." FROM table_48596 WHERE "Opponent" = 'steve schneider'
CREATE TABLE table_16857_2 ( mls_cup_playoffs VARCHAR, concacaf_champions_cup___champions_league VARCHAR, us_open_cup VARCHAR )
How did the team place when they did not qualify for the Concaf Champions Cup but made it to Round of 16 in the U.S. Open Cup?
SELECT mls_cup_playoffs FROM table_16857_2 WHERE concacaf_champions_cup___champions_league = "Did not qualify" AND us_open_cup = "Round of 16"
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 diagnoses long title is insomnia, unspecified and drug type is additive?
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.long_title = "Insomnia, unspecified" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Inform me of what 's needed for a CS-LSA degree .
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
CREATE TABLE table_29584 ( "Represent" real, "Contestant" text, "Age" real, "Sizes" text, "Height" text, "Hometown" text, "Agency" text )
who are the participants that wear clothing in 33-23-36
SELECT "Contestant" FROM table_29584 WHERE "Sizes" = '33-23-36'
CREATE TABLE table_23987362_2 ( world_record VARCHAR )
How many of 3:26.00 have a championship record?
SELECT COUNT(3) AS :2600 FROM table_23987362_2 WHERE world_record = "Championship record"
CREATE TABLE table_name_61 ( play VARCHAR, company VARCHAR )
what is the play when the company is cyprus theatre organisation?
SELECT play FROM table_name_61 WHERE company = "cyprus theatre organisation"
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )...
Short comment with thanks askdiff.
SELECT 'https://apple.stackexchange.com/questions/' + CAST(PostId AS TEXT), Text, Score, Comments.CreationDate, Users.DisplayName, Users.Reputation FROM Comments INNER JOIN Users ON Comments.UserId = Users.Id WHERE LENGTH(Text) < 20 AND (Text LIKE '%thanks%' OR Text LIKE '%welcome%' OR Text LIKE '%works%') ORDER BY Cre...
CREATE TABLE table_14050 ( "Event" text, "Record" text, "Nationality" text, "Date" text, "Games" text )
What's the record of Barbados?
SELECT "Record" FROM table_14050 WHERE "Nationality" = 'barbados'
CREATE TABLE table_name_65 ( part_4 VARCHAR, part_2 VARCHAR )
What is Part 4, when Part 2 is 'hlj p'?
SELECT part_4 FROM table_name_65 WHERE part_2 = "hljóp"
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, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
what airlines have BUSINESS class
SELECT DISTINCT airline.airline_code FROM airline, fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'BUSINESS' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = airline.airline_code AND flight.flight_id = flight_fare.flight_id
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
find the name of subject id 65652.
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "65652"
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
Show all fires caused by campfires in Texas.
SELECT * FROM fires WHERE state = "TX" AND stat_cause_descr LIKE "Campfire"
CREATE TABLE table_15430606_1 ( no_disc INTEGER, directed_by VARCHAR )
Name the maximum number of disc for bill gereghty
SELECT MAX(no_disc) FROM table_15430606_1 WHERE directed_by = "Bill Gereghty"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
how many patients got dialysis access surgery two times during the previous year?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'dialysis access surgery' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(),...
CREATE TABLE table_4216 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
When 52 is the ends won what is the skip(club)?
SELECT "Skip (Club)" FROM table_4216 WHERE "Ends Won" = '52'
CREATE TABLE table_name_14 ( date VARCHAR, home_team VARCHAR )
Name the Home team of tranmere rovers?
SELECT date FROM table_name_14 WHERE home_team = "tranmere rovers"
CREATE TABLE table_33202 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text )
The school nicknamed the wildcats has what sum of enrollment?
SELECT SUM("Enrollment") FROM table_33202 WHERE "Team Nickname" = 'wildcats'
CREATE TABLE table_63669 ( "School" text, "City" text, "Team Name" text, "Enrollment 08-09" real, "IHSAA Class" text, "IHSAA Class Football" text, "County" text, "Year Joined (Or Joining)" real, "Previous Conference" text )
What was the total enrollment 08-09 of Franklin County?
SELECT COUNT("Enrollment 08-09") FROM table_63669 WHERE "School" = 'franklin county'
CREATE TABLE table_name_33 ( format VARCHAR, country VARCHAR, label VARCHAR, catalogue_number_s_ VARCHAR )
Which Format has a Label of eagle eye media, a Catalogue number(s) of , and a Country of united states?
SELECT format FROM table_name_33 WHERE label = "eagle eye media" AND catalogue_number_s_ = "—" AND country = "united states"
CREATE TABLE table_77831 ( "Name" text, "Date of Birth" text, "Date of Death" text, "Age at Time of Disaster" text, "Age at Time of Death" text )
When did the person born 24 September 1851 pass away?
SELECT "Date of Death" FROM table_77831 WHERE "Date of Birth" = '24 september 1851'
CREATE TABLE table_name_55 ( solvent VARCHAR, boiling_point VARCHAR )
What solvent has a boiling point of 100 103 c?
SELECT solvent FROM table_name_55 WHERE boiling_point = "100–103 °c"
CREATE TABLE table_name_97 ( opponent VARCHAR, score VARCHAR )
Who was the opponent with a score of 141 102?
SELECT opponent FROM table_name_97 WHERE score = "141–102"
CREATE TABLE table_name_83 ( class VARCHAR, number_in_class INTEGER )
Which class has more than 15 people in the class?
SELECT class FROM table_name_83 WHERE number_in_class > 15
CREATE TABLE table_name_92 ( time_retired VARCHAR, driver VARCHAR )
What is the time/retired for thierry boutsen?
SELECT time_retired FROM table_name_92 WHERE driver = "thierry boutsen"
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 prescription...
how many patients aged below 83 years had the drug code albu5250?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "ALBU5250"
CREATE TABLE table_37191 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text, "Customer" text )
What is the name of the location and ship type in the Gulf of Mexico that entered service in 1999?
SELECT "Name" FROM table_37191 WHERE "Location" = 'gulf of mexico' AND "Type" = 'ship' AND "Entered service" = '1999'
CREATE TABLE football_data ( season text, datetime time, div text, country text, league text, referee text, hometeam text, awayteam text, fthg number, ftag number, ftr text, hthg number, htag number, htr text, psh number, psd number, psa number, b3...
Which year has most matches?
SELECT year FROM betfront GROUP BY year ORDER BY COUNT(*) 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 (...
provide the number of patients whose item id is 51214 and lab test abnormal status is delta.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51214" AND lab.flag = "delta"
CREATE TABLE table_19026 ( "Rank" real, "Airport" text, "Total Passengers" real, "% Change 2005/2006" text, "International Passengers" real, "Domestic Passengers" real, "Transit Passengers" real, "Aircraft Movements" real, "Freight (Metric Tonnes)" real )
how many airport with rank being 4
SELECT COUNT("Airport") FROM table_19026 WHERE "Rank" = '4'
CREATE TABLE table_31535 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
What year is United States school/club team from Arkansas play in Toronto
SELECT "Years in Toronto" FROM table_31535 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'arkansas'
CREATE TABLE table_49635 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which home team played against Los Angeles in game 1?
SELECT "Home Team" FROM table_49635 WHERE "Road Team" = 'los angeles' AND "Game" = 'game 1'
CREATE TABLE table_1341586_26 ( candidates VARCHAR, district VARCHAR )
Which candidates are from the Missouri 3 district?
SELECT candidates FROM table_1341586_26 WHERE district = "Missouri 3"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is maximum age of patients whose admission type is urgent and insurance is government?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Government"
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
What are the top 10 countries with most number of operational plants?
SELECT country FROM nuclear_power_plants WHERE status = "Operational" GROUP BY country ORDER BY COUNT(name) DESC LIMIT 10
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medication...
has patient 006-205326 undergone any medical procedure in a year before?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-205326')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATET...
CREATE TABLE table_2004 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Year Joined" real, "Nickname" text, "Conference" text )
How many University founded in 1863?
SELECT COUNT("Enrollment") FROM table_2004 WHERE "Founded" = '1863'
CREATE TABLE table_name_4 ( quantity_rebuilt VARCHAR, type VARCHAR, railway_number_s_ VARCHAR )
What is the total of quantity rebuilt if the type is 1B N2T and the railway number is 88, 118?
SELECT COUNT(quantity_rebuilt) FROM table_name_4 WHERE type = "1b n2t" AND railway_number_s_ = "88, 118"
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sale...
What is the number of companies for each headquarter? Visualize by bar chart, and could you order by the total number in ascending?
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters)