table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
was the last game a win or a loss ?
SELECT "result" FROM table_204_795 ORDER BY "date" DESC LIMIT 1
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...
count the number of patients whose insurance is private and admission location is clinic referral/premature.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
in this month has the arterial bp [diastolic] of patient 18159 been normal?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias...
CREATE TABLE table_54160 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What was the surface where the outcome was winner on 12 march 1989?
SELECT "Surface" FROM table_54160 WHERE "Outcome" = 'winner' AND "Date" = '12 march 1989'
CREATE TABLE table_1570003_2 ( open_cup VARCHAR, year VARCHAR )
During 2003 what was open cup qualifying status?
SELECT open_cup FROM table_1570003_2 WHERE year = 2003
CREATE TABLE table_17901155_4 ( original_us_air_date VARCHAR, viewers__millions_ VARCHAR )
Which US air date had 4.4 million viewers?
SELECT original_us_air_date FROM table_17901155_4 WHERE viewers__millions_ = "4.4"
CREATE TABLE table_name_65 ( score VARCHAR, date VARCHAR )
What was the score for the game on June 30?
SELECT score FROM table_name_65 WHERE date = "june 30"
CREATE TABLE table_15203 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the earliest year that has a Bristol engine?
SELECT MIN("Year") FROM table_15203 WHERE "Engine" = 'bristol'
CREATE TABLE table_41506 ( "Number" real, "Name" text, "Builder" text, "Type" text, "Date" text, "Works number" text )
In early 1873, Owen sound had what works number?
SELECT "Works number" FROM table_41506 WHERE "Date" = 'early 1873' AND "Name" = 'owen sound'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
when was the first time that patient 009-5001 was prescribed medication on this hospital encounter via oral route?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001' AND patient.hospitaldischargetime IS NULL)) AND medi...
CREATE TABLE table_name_48 ( team_2 VARCHAR )
What is the 1st leg of cs sfaxien?
SELECT 1 AS st_leg FROM table_name_48 WHERE team_2 = "cs sfaxien"
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBase...
Most upvoted questions asked in the last month.
SELECT TOP(30) AS CreationDate, Id AS "post_link", Score, ViewCount FROM Posts WHERE CreationDate >= (DATEADD(MONTH, -1, GETDATE())) AND PostTypeId = 1 ORDER BY Posts.Score DESC
CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20) ) CREATE TABLE Products ( product_id INTEGER, color_code VARCHAR(15), product_category_code VARCHAR(15), product_name VARCHAR(80), typical_buyin...
Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order.
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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...
Bar graph to show meter_100 from different meter 400, and could you display by the y axis in asc?
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100
CREATE TABLE table_name_90 ( team_2 VARCHAR, team_1 VARCHAR, result VARCHAR )
What team is 2 when 1 is Taipower and the result is 0-1?
SELECT team_2 FROM table_name_90 WHERE team_1 = "taipower" AND result = "0-1"
CREATE TABLE table_name_45 ( system VARCHAR, name VARCHAR )
Which System's Name is Gemulator?
SELECT system FROM table_name_45 WHERE name = "gemulator"
CREATE TABLE table_name_96 ( name VARCHAR, years VARCHAR )
What is the name of the head coach of 1974?
SELECT name FROM table_name_96 WHERE years = "1974"
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Will Prof. Alan Hunt always be setting exams for her classes ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
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, ...
provide the number of patients whose ethnicity is american indian/alaska native and drug code is benz1i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.formulary_drug_cd = "BENZ1I"
CREATE TABLE table_204_89 ( id number, "team" text, "truck(s)" text, "#" number, "driver(s)" text, "primary sponsor(s)" text, "listed owner(s)" text, "crew chief" text )
according to the chart , which team is listed to have the first dodge ram ?
SELECT "team" FROM table_204_89 WHERE "truck(s)" = 'dodge ram' ORDER BY id LIMIT 1
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give the number of patients whose admission type is elective and lab test category is blood gas.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Blood Gas"
CREATE TABLE table_name_77 ( plaid_cymru VARCHAR, polling_organisation_client VARCHAR, date_s__conducted VARCHAR )
I want the plaid cymru for Polling organisation/client of yougov/itv wales for 4 may 2011
SELECT plaid_cymru FROM table_name_77 WHERE polling_organisation_client = "yougov/itv wales" AND date_s__conducted = "4 may 2011"
CREATE TABLE county_public_safety ( Name VARCHAR, Population VARCHAR )
List the name of the county with the largest population.
SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1
CREATE TABLE table_name_31 ( team_1 VARCHAR )
What is the 2nd leg of team 1 Zamalek SC?
SELECT 2 AS nd_leg FROM table_name_31 WHERE team_1 = "zamalek sc"
CREATE TABLE table_name_26 ( week_4 VARCHAR, week_3 VARCHAR )
What is the week 3, prior to the when the week 4 was Laura Nicole?
SELECT week_4 FROM table_name_26 WHERE week_3 = "laura nicole"
CREATE TABLE routes ( dst_apid VARCHAR ) CREATE TABLE airports ( apid VARCHAR, country VARCHAR )
Find the number of routes with destination airports in Italy.
SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'
CREATE TABLE table_204_853 ( id number, "pos" number, "grid" number, "no." number, "driver" text, "team" text, "manufacturer" text, "laps" number, "points" number )
who is the first driver listed ?
SELECT "driver" FROM table_204_853 WHERE id = 1
CREATE TABLE table_13514 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What is the l3 cache when the sspec number is sr0r2(l1)sr0t6(l1)?
SELECT "L3 cache" FROM table_13514 WHERE "sSpec number" = 'sr0r2(l1)sr0t6(l1)'
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...
calculate the minimum age of home health care discharged patients who had overdose primary disease.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.diagnosis = "OVERDOSE"
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( pape...
new semantic parsing papers
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC
CREATE TABLE table_name_76 ( event VARCHAR, position VARCHAR, year VARCHAR )
Which event had 4th place and took place in the year 2007?
SELECT event FROM table_name_76 WHERE position = "4th" AND year = 2007
CREATE TABLE table_name_9 ( tankers VARCHAR, staffing VARCHAR, hazmat VARCHAR, platforms VARCHAR )
Which Tankers have a Hazmat of , and Platforms of , and a Staffing of volunteer?
SELECT tankers FROM table_name_9 WHERE hazmat = "–" AND platforms = "–" AND staffing = "volunteer"
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
what is the AP/57 restriction
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57'
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 taking drug via sl route suffering from pneumonia primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "PNEUMONIA" AND prescriptions.route = "SL"
CREATE TABLE table_70219 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
The EPT German open was won by which listed winner?
SELECT "Winner" FROM table_70219 WHERE "Event" = 'ept german open'
CREATE TABLE table_203_392 ( id number, "rank" text, "belt alternate 1" text, "belt alternate 2" text, "belt alternate 3" text, "belt alternate 4" text )
how many different ranks exist for karate belts ?
SELECT COUNT(DISTINCT "rank") FROM table_203_392
CREATE TABLE table_21310 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
Name the record for attendance location of palace of auburn hills 15,210
SELECT "Record" FROM table_21310 WHERE "Location/Attendance" = 'Palace of Auburn Hills 15,210'
CREATE TABLE table_204_937 ( id number, "rank" number, "lane" number, "athlete" text, "time" number )
how long did it take the fifth place finisher to run the race ?
SELECT "time" FROM table_204_937 WHERE "rank" = 5
CREATE TABLE table_32339 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score when playing at Western Oval?
SELECT "Home team score" FROM table_32339 WHERE "Venue" = 'western oval'
CREATE TABLE table_36349 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Which Opponents have a Partner of irina-camelia begu, and a Surface of hard?
SELECT "Opponents" FROM table_36349 WHERE "Partner" = 'irina-camelia begu' AND "Surface" = 'hard'
CREATE TABLE table_train_159 ( "id" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "kidney_disease" bool, "serum_triglyceride" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
presence of chronic kidney disease ( gfr < 45 ml / min )
SELECT * FROM table_train_159 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 45
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 (...
how many patients whose diagnoses long title is perforation of intestine and lab test category is blood gas?
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 = "Perforation of intestine" AND lab."CATEGORY" = "Blood Gas"
CREATE TABLE table_name_21 ( type VARCHAR, name VARCHAR )
What is the type when McCormack is the name?
SELECT type FROM table_name_21 WHERE name = "mccormack"
CREATE TABLE table_28033 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many numbers were recorded on the fields goals of the Left End player?
SELECT COUNT("Field goals") FROM table_28033 WHERE "Position" = 'Left end'
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, could you show in desc by the y-axis please?
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC
CREATE TABLE table_20297668_1 ( standard_yarn_weight_system VARCHAR, wraps_per_inch__wpi_ VARCHAR )
Name the standard yarn weight system for 7 wpi
SELECT standard_yarn_weight_system FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = "7 wpi"
CREATE TABLE table_1262 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text )
Nametheh school team for norman gonzales
SELECT "School/Club Team" FROM table_1262 WHERE "Name" = 'Norman Gonzales'
CREATE TABLE table_name_51 ( points_against VARCHAR, drawn VARCHAR, tries_for VARCHAR )
For the club that had tries of 50 and drawn of 0, what were the points?
SELECT points_against FROM table_name_51 WHERE drawn = "0" AND tries_for = "50"
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
last time until 20 months ago when did patient 028-23341 get a prescription?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-23341')) AND DATETIME(medication.drugstarttime) <= DATETIM...
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...
Find me the admission type and short title of procedure for the patient with patient id 2110.
SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110"
CREATE TABLE table_name_3 ( yards INTEGER, long VARCHAR, avg VARCHAR )
Name the lowest yards for 34 long and avg less than 12.6
SELECT MIN(yards) FROM table_name_3 WHERE long = 34 AND avg < 12.6
CREATE TABLE table_56314 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who did they lose to on may 9?
SELECT "Loss" FROM table_56314 WHERE "Date" = 'may 9'
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list x-axis in asc order please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
CREATE TABLE table_23718905_6 ( matchup_results VARCHAR, city VARCHAR )
How many different matchup/results appear in San Diego, California?
SELECT COUNT(matchup_results) FROM table_23718905_6 WHERE city = "San Diego, California"
CREATE TABLE table_name_88 ( years VARCHAR, actor VARCHAR, soap_opera VARCHAR, duration VARCHAR )
What years did Marienhof run, which featured Leonore Capell and lasted 10 years?
SELECT years FROM table_name_88 WHERE soap_opera = "marienhof" AND duration = "10 years" AND actor = "leonore capell"
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, V...
Q1-1 What is the most number of comments on a single post?.
SELECT CommentCount, Id, COUNT(*) FROM Posts GROUP BY Id, CommentCount HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how many hours has it been since patient 57050 stayed for the first time on the current hospital visit in ward 14?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL)) AND transfers...
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
give me flights from ATLANTA to BALTIMORE
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
Return a scatter chart about the correlation between Body_Builder_ID and Clean_Jerk .
SELECT Body_Builder_ID, Clean_Jerk FROM body_builder
CREATE TABLE table_10312547_1 ( character VARCHAR )
How many playerd Mrs. Darling in the 1999 Broadway?
SELECT COUNT(1999 AS _broadway) FROM table_10312547_1 WHERE character = "Mrs. Darling"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the maximum age of patients whose death status is 0 and diagnosed with primary disease coronary artery disease\coronary artery bypass graft with mvr; ? maze?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE"
CREATE TABLE table_name_33 ( lost VARCHAR, drawn VARCHAR, tries_against VARCHAR )
What is the value for Lost when Drawn is 0, and Tries against is 41?
SELECT lost FROM table_name_33 WHERE drawn = "0" AND tries_against = "41"
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please.
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC
CREATE TABLE table_name_52 ( venue VARCHAR, away_team VARCHAR )
Where does South Melbourne play?
SELECT venue FROM table_name_52 WHERE away_team = "south melbourne"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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 procedures_icd ( row_id number, su...
what are the procedures that are the top five most commonly received in 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 STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ...
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHA...
Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart.
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what was the name of the laboratory test that patient 021-141335 received last in a month before?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME()...
CREATE TABLE table_68490 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which date has a score of 2-1?
SELECT "Date" FROM table_68490 WHERE "Score" = '2-1'
CREATE TABLE table_71745 ( "Year" real, "Opponent" text, "Competition" text, "Score" text, "Venue" text, "Attendance" text )
What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels?
SELECT COUNT("Year") FROM table_71745 WHERE "Venue" = 'sydney cricket ground' AND "Opponent" = 'parramatta eels'
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ...
what 's the earliest arriving flight between BOSTON and WASHINGTON DC
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_S...
CREATE TABLE table_31998 ( "Stem Meaning" text, "2nd person sg" text, "2nd person sg honorific" text, "3rd person sg" text, "3rd person sg honorific" text )
Tell me the Stem Meaning of ical
SELECT "Stem Meaning" FROM table_31998 WHERE "3rd person sg" = 'ical'
CREATE TABLE table_8680 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many wins happened when there were fewer than 2 draws?
SELECT SUM("Wins") FROM table_8680 WHERE "Draws" < '2'
CREATE TABLE table_10749367_3 ( _number INTEGER, air_date VARCHAR )
What episode aired on 18 April 2007?
SELECT MIN(_number) FROM table_10749367_3 WHERE air_date = "18 April 2007"
CREATE TABLE table_name_62 ( runner_up VARCHAR, name VARCHAR, year VARCHAR )
Who was runner-up in the 2006 Pacific Life Open?
SELECT runner_up FROM table_name_62 WHERE name = "pacific life open" AND year = "2006"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
what is age and procedure short title of subject id 2560?
SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
CREATE TABLE table_name_25 ( points_for INTEGER, record VARCHAR, points_against VARCHAR )
What is the highest Points when the record was 12 2, and the Points Against are larger than 6?
SELECT MAX(points_for) FROM table_name_25 WHERE record = "12–2" AND points_against > 6
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
Top Voted Questions By Tag.
WITH ScoreByTag AS (SELECT pt.TagId, p.Score, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.Score DESC) AS "rank" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY st.Score DESC) AS "rank", t.TagName, st.Score FROM ScoreByTag AS st INNER JOIN Tags AS t ON st.TagId = t.Id ...
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
Show me mean rating by languages in a histogram, sort X from high to low order.
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC
CREATE TABLE table_17347 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text )
what's the score where record is 35 33
SELECT "Score" FROM table_17347 WHERE "Record" = '35–33'
CREATE TABLE table_name_51 ( loss VARCHAR, record VARCHAR )
What was the score of the game that put the team at 27-32?
SELECT loss FROM table_name_51 WHERE record = "27-32"
CREATE TABLE table_name_37 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
What was the To par for bill britton when he placed t7?
SELECT to_par FROM table_name_37 WHERE place = "t7" AND player = "bill britton"
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 demographic (...
what is the number of patients whose admission type is elective and procedure long title is laparoscopic lysis of peritoneal adhesions?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Laparoscopic lysis of peritoneal adhesions"
CREATE TABLE table_name_64 ( record VARCHAR, time VARCHAR, opponent VARCHAR )
What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00?
SELECT record FROM table_name_64 WHERE time = "4:00" AND opponent = "krzysztof soszynski"
CREATE TABLE table_name_35 ( status VARCHAR, date VARCHAR )
What's the status on 16/12/1995?
SELECT status FROM table_name_35 WHERE date = "16/12/1995"
CREATE TABLE table_56036 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd size when the visiting team scored 23.18 (156)?
SELECT COUNT("Crowd") FROM table_56036 WHERE "Away team score" = '23.18 (156)'
CREATE TABLE table_name_77 ( frequency_mhz INTEGER, call_sign VARCHAR )
what is the highest frequency mhz with the call sign w292cu?
SELECT MAX(frequency_mhz) FROM table_name_77 WHERE call_sign = "w292cu"
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
how many patients were prescribed 2 ml : metoclopramide hcl 5 mg/ml inj soln within 2 months since 2103 after being diagnosed with copd - no limitations?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uni...
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
What is the average high temperature for each day of week Plot them as bar chart, rank Y-axis in desc order.
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC
CREATE TABLE table_name_14 ( production_code INTEGER, series__number VARCHAR )
What was the lowest production code value in series #10?
SELECT MIN(production_code) FROM table_name_14 WHERE series__number = 10
CREATE TABLE table_56683 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the total of attendance with a Record of 5-9-0?
SELECT SUM("Attendance") FROM table_56683 WHERE "Record" = '5-9-0'
CREATE TABLE table_78184 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the low lap total for a grid larger than 16 and has a Time/Retired of + 3:27.3?
SELECT MIN("Laps") FROM table_78184 WHERE "Time/Retired" = '+ 3:27.3' AND "Grid" > '16'
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text )
which reps were only appointed by franklin pierce ?
SELECT "representative" FROM table_203_778 WHERE "appointed by" = 'franklin pierce'
CREATE TABLE table_52977 ( "Season" text, "UEFA Season" text, "Coeff" text, "Ranking" real, "Champions" text, "Runner-up" text, "3rd place" text, "Cup winner" text, "Cup runner-up" text )
Which Champion has a Coeff of 1.000?
SELECT "Champions" FROM table_52977 WHERE "Coeff" = '1.000'
CREATE TABLE table_62868 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 2nd leg in match with team 2 of Teram?
SELECT "2nd leg" FROM table_62868 WHERE "Team 2" = 'teram'
CREATE TABLE table_name_41 ( points INTEGER, year VARCHAR, entrant VARCHAR, engine VARCHAR )
What is the fewest number of points scored by Goulds' Garage (Bristol), engines of Maserati Straight-6, in years before 1956?
SELECT MIN(points) FROM table_name_41 WHERE entrant = "goulds' garage (bristol)" AND engine = "maserati straight-6" AND year < 1956
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID...
How many events have each participants attended? Show their total number by each participant type code using a bar chart, rank in asc by the total number of count(*).
SELECT T1.Participant_Type_Code, SUM(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY SUM(COUNT(*))
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
how many hours have elapsed since the last time patient 005-87465 had an intake of norepinephrine on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
CREATE TABLE table_3247 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text )
On what date(s) was the winning team Prema Powerteam?
SELECT "Date" FROM table_3247 WHERE "Winning Team" = 'Prema Powerteam'
CREATE TABLE table_203_572 ( id number, "judge" text, "court" text, "began active\nservice" text, "ended active\nservice" text, "ended senior\nstatus" text )
which judge began active service first , wayne edward alley or james henry alesia ?
SELECT "judge" FROM table_203_572 WHERE "judge" IN ('wayne edward alley', 'james henry alesia') ORDER BY "began active\nservice" LIMIT 1
CREATE TABLE table_name_73 ( down__up_to_kbit_s_ INTEGER, provider VARCHAR, up__up_to_kbit_s_ VARCHAR )
What is the average down (up to kbit/s) when the provider is willy.tel and the up (kbit/s) is more than 1984?
SELECT AVG(down__up_to_kbit_s_) FROM table_name_73 WHERE provider = "willy.tel" AND up__up_to_kbit_s_ > 1984