table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients died of acute subdural hamatoma?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA"
CREATE TABLE table_train_122 ( "id" int, "metabolic_disease" bool, "stroke" bool, "renal_disease" bool, "huntington_disease" bool, "hepatic_disease" bool, "psychiatric_disease" bool, "multiple_sclerosis" bool, "hyperlipidemia" bool, "cardiovascular_disease" bool, "estimated_g...
significant neurologic disease: any significant neurologic disease, such as parkinson's disease, stroke, huntington's disease, normal pressure hydrocephalus, brain tumor, progressive supranuclear palsy, subdural hematoma, multiple sclerosis, seizure disorder, or other significant deficits ( other than alzheimer's demen...
SELECT * FROM table_train_122 WHERE neurological_disease = 1 OR (parkinson_disease = 1 OR stroke = 1 OR huntington_disease = 1 OR normal_pressure_hydrocephalus = 1 OR brain_tumor = 1 OR supranuclear_palsy = 1 OR subdural_hematoma = 1 OR multiple_sclerosis = 1 OR seizure_disorder = 1 AND alzheimer_dementia = 0)
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
what was the top four of the most frequent procedures last year?
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 DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye...
CREATE TABLE table_54478 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
What Event is at the Time 1:16?
SELECT "Event" FROM table_54478 WHERE "Time" = '1:16'
CREATE TABLE table_name_98 ( date VARCHAR, home VARCHAR )
What is the date of the game when the Mavericks were the home team?
SELECT date FROM table_name_98 WHERE home = "mavericks"
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 ...
has patient 83466 ever undergone a excise lg intestine les the previous year?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise lg intestine les') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND DATETIME(pro...
CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE affected_region ( region_id number, storm_id nu...
List name, dates active, and number of deaths for all storms with at least 1 death.
SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar,...
does flight UA 270 from DENVER to PHILADELPHIA have a meal
SELECT DISTINCT food_service.compartment, food_service.meal_code, food_service.meal_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY...
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arriv...
EA flies from ATLANTA to DENVER what type of aircraft do you use before 1800
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time < 1800 AND flight....
CREATE TABLE table_33534 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
Which service has a hindi language, general genre and zee tv network?
SELECT "Service" FROM table_33534 WHERE "Language" = 'hindi' AND "Genre" = 'general' AND "Network" = 'zee tv'
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
How many tags have issued at least one tag badge?.
SELECT COUNT(*) FROM (SELECT TagName FROM Badges INNER JOIN Tags ON TagName = Badges.Name WHERE TagBased = 'true' GROUP BY TagName) AS tagbadges
CREATE TABLE table_174151_5 ( devices_per_channel VARCHAR, raw_bandwidth__mbit_s_ VARCHAR )
Name the devices per channel for 2560
SELECT devices_per_channel FROM table_174151_5 WHERE raw_bandwidth__mbit_s_ = 2560
CREATE TABLE table_11308 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Name the away team for home team of fitzroy
SELECT "Away team" FROM table_11308 WHERE "Home team" = 'fitzroy'
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) ...
What is average and maximum salary of all employees.
SELECT AVG(salary), MAX(salary) FROM employee
CREATE TABLE table_62647 ( "Region" text, "Date" text, "Format(s)" text, "Edition(s)" text, "Label" text )
What is the Label of the September 19, 2008 release in Germany?
SELECT "Label" FROM table_62647 WHERE "Date" = 'september 19, 2008' AND "Region" = 'germany'
CREATE TABLE table_name_26 ( tournament VARCHAR, year INTEGER )
What tournament has a year prior to 2001?
SELECT tournament FROM table_name_26 WHERE year < 2001
CREATE TABLE table_name_9 ( home_team VARCHAR, away_team VARCHAR )
Which home team had the away team Southport?
SELECT home_team FROM table_name_9 WHERE away_team = "southport"
CREATE TABLE table_56466 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What date was Carlos Boozer (23) the leading scorer?
SELECT "Date" FROM table_56466 WHERE "Leading scorer" = 'carlos boozer (23)'
CREATE TABLE table_28646 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
Name the rank for mikey and melanie
SELECT "Rank" FROM table_28646 WHERE "Couple" = 'Mikey and Melanie'
CREATE TABLE table_65980 ( "Rank" real, "Artist" text, "Album" text, "Peak position" real, "Sales" real, "Certification" text )
Which artist had a 4x platinum?
SELECT "Artist" FROM table_65980 WHERE "Certification" = '4x platinum'
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 )
Return a histogram on what are the names and prices of all products in the store?, rank y axis from high to low order.
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY AVG(Price) DESC
CREATE TABLE table_48217 ( "Province" text, "Map #" real, "ISO 3166-2:AF" text, "Centers" text, "Population" real, "Area (km\u00b2)" real, "Language" text, "Notes" text, "U.N. Region" text )
Which province is Parun in?
SELECT "Province" FROM table_48217 WHERE "Centers" = 'parun'
CREATE TABLE table_22902 ( "Series No." real, "Season No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.K. viewers (million)" text )
How many different original air dates does the episode with series number 13 have?
SELECT COUNT("Original air date") FROM table_22902 WHERE "Series No." = '13'
CREATE TABLE table_68416 ( "Vol." text, "English title" text, "Japanese title" text, "Release date (Japan)" text, "Sony Catalog No." text )
What is the English title of ?
SELECT "English title" FROM table_68416 WHERE "Japanese title" = '餓狼伝説バトルアーカイブズ2'
CREATE TABLE table_32513 ( "Total tenure rank" real, "Uninterrupted rank" real, "Name" text, "State represented" text, "Total tenure time" text, "Uninterrupted time" text )
What is the total tenure time of Warren Magnuson, who had an uninterrupted rank larger than 4 and a total tenure rank larger than 9?
SELECT "Total tenure time" FROM table_32513 WHERE "Uninterrupted rank" > '4' AND "Total tenure rank" > '9' AND "Name" = 'warren magnuson'
CREATE TABLE table_3964 ( "Operator" text, "Number purchased" real, "Variant" text, "Bodybuilder" text, "Year(s) purchased" text )
Who was the bodybuilder when Coventry was operating?
SELECT "Bodybuilder" FROM table_3964 WHERE "Operator" = 'Coventry'
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 diagnoses long title of diagnoses icd9 code 920?
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "920"
CREATE TABLE table_27432 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight" real, "Year" text, "Former school" text, "Hometown" text )
What were the former schools of the player from East Brunswick, NJ?
SELECT "Former school" FROM table_27432 WHERE "Hometown" = 'East Brunswick, NJ'
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admis...
what was the first dose of pantoprazole until 15 months ago, prescribed to patient 31169?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31169) AND prescriptions.drug = 'pantoprazole' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-15 month') ORDER BY prescriptions.startdate LIMIT...
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subj...
indicate the daily minimum amount of heart rate for patient 3229 since 09/2105.
SELECT MIN(chartevents.valuenum) 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 = 3229)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart...
CREATE TABLE table_63112 ( "Season" text, "LeagueContested" text, "Level" real, "LeaguePosition" text, "Avg.Home Attendance 1" text, "FA Cup" text, "FA Trophy" text, "Leading scorer 1" text )
Which Level has a Leading scorer 1 of tom greaves 8?
SELECT "Level" FROM table_63112 WHERE "Leading scorer 1" = 'tom greaves 8'
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, ...
Are there classes on Friday for 941 with Prof. Midhat Farooq ?
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.number = 941 AND c...
CREATE TABLE table_name_51 ( attendance VARCHAR, week VARCHAR, opponent VARCHAR )
What's the total attendance of games against the New York Giants after week 13?
SELECT COUNT(attendance) FROM table_name_51 WHERE week > 13 AND opponent = "new york giants"
CREATE TABLE table_name_68 ( team VARCHAR, race_1 VARCHAR )
Which team received 4 in race 1?
SELECT team FROM table_name_68 WHERE race_1 = "4"
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...
mention the admission time and diagnosis icd9 code of patient with patient id 74032.
SELECT demographic.admittime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "74032"
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
get me the top four most frequent outputs in 2105?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) = '2105' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4)
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
among the patients aged 60 or above in 2100, what are the top three most frequent procedures?
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 >...
CREATE TABLE table_9073 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which date has a Result of l 25-13?
SELECT "Date" FROM table_9073 WHERE "Result" = 'l 25-13'
CREATE TABLE table_20683381_3 ( against___percentage_ VARCHAR, ±_yes_side_2008___percentage_ VARCHAR )
When +18.1 is the yes side 2008 percentage what is the percentage of against?
SELECT against___percentage_ FROM table_20683381_3 WHERE ±_yes_side_2008___percentage_ = "+18.1"
CREATE TABLE table_68445 ( "Need" text, "Being (qualities)" text, "Having (things)" text, "Doing (actions)" text, "Interacting (settings)" text )
Name the being for having things of language, religions, work, customs, values, norms?
SELECT "Being (qualities)" FROM table_68445 WHERE "Having (things)" = 'language, religions, work, customs, values, norms'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what was the difference in weight of patient 006-123134 second measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1)...
CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) ) CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) ...
A bar chart showing the number of tourist attractions for each attraction name, sort Y from low to high order please.
SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID ORDER BY COUNT(*)
CREATE TABLE table_15352382_1 ( against VARCHAR, difference VARCHAR )
How many under the category of Against have a Difference of 11
SELECT COUNT(against) FROM table_15352382_1 WHERE difference = 11
CREATE TABLE table_name_33 ( latin VARCHAR, english VARCHAR )
What is the Latin word for the English word bone?
SELECT latin FROM table_name_33 WHERE english = "bone"
CREATE TABLE table_name_22 ( attendance INTEGER, round VARCHAR )
Name the sum of attendance for round 3
SELECT SUM(attendance) FROM table_name_22 WHERE round = "round 3"
CREATE TABLE table_name_39 ( record VARCHAR, opponent VARCHAR )
What is the record of the game with the toronto huskies as the opponent?
SELECT record FROM table_name_39 WHERE opponent = "toronto huskies"
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, ...
what is primary disease and admission time of subject name richard gundlach?
SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Richard Gundlach"
CREATE TABLE table_75744 ( "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" real )
When did chatham complete the Hmsmedusa?
SELECT "Completed" FROM table_75744 WHERE "Builder" = 'chatham' AND "Name" = 'hmsmedusa'
CREATE TABLE table_16961 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
Where was the Fairfield Barnett classic tournament held?
SELECT "Location" FROM table_16961 WHERE "Tournament" = 'Fairfield Barnett Classic'
CREATE TABLE table_name_41 ( record VARCHAR, round VARCHAR, time VARCHAR )
what is the record when the round is before 3 and the time si 4:59?
SELECT record FROM table_name_41 WHERE round < 3 AND time = "4:59"
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGui...
Posts deleted by VoteType 4.
SELECT *, 'site://posts/' + CAST(PostId AS TEXT) + '/revisions' AS Link FROM Votes WHERE VoteTypeId = 4 ORDER BY Id DESC
CREATE TABLE table_28759261_5 ( dadar_xi_‘b’ VARCHAR, good_shepherd VARCHAR )
what is the dadar xi b where the good shepherd is sea liner fc?
SELECT dadar_xi_‘b’ FROM table_28759261_5 WHERE good_shepherd = "Sea Liner FC"
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 ...
give me the number of patients whose procedure long title is aortography?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Aortography"
CREATE TABLE table_name_73 ( position VARCHAR, school_club_team VARCHAR )
Who is the position from the school/club Far Eastern?
SELECT position FROM table_name_73 WHERE school_club_team = "far eastern"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
has there ever been any promote w/fiber given to patient 4401 on the current intensive care unit visit?
SELECT COUNT(*) > 0 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 = 4401) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHE...
CREATE TABLE table_49614 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
How much did Larry Nelson win?
SELECT "Money ( $ )" FROM table_49614 WHERE "Player" = 'larry nelson'
CREATE TABLE table_name_79 ( evening_gown VARCHAR, preliminaries VARCHAR, state VARCHAR )
What is the evening gown score of the contestant from the District of Columbia with preliminaries smaller than 8.647?
SELECT COUNT(evening_gown) FROM table_name_79 WHERE preliminaries < 8.647 AND state = "district of columbia"
CREATE TABLE table_name_73 ( tournament VARCHAR, score VARCHAR )
Which Tournament has a Score of 6(4) 7 2 6?
SELECT tournament FROM table_name_73 WHERE score = "6(4)–7 2–6"
CREATE TABLE table_name_25 ( school_club_team VARCHAR, player VARCHAR, pick VARCHAR, round VARCHAR )
Which school/club has a pick smaller than 196, a round higher than 5 and has Blake Miller?
SELECT school_club_team FROM table_name_25 WHERE pick < 196 AND round > 5 AND player = "blake miller"
CREATE TABLE table_77883 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What circuit was the British Grand Prix?
SELECT "Circuit" FROM table_77883 WHERE "Race" = 'british grand prix'
CREATE TABLE table_49721 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Location" text, "Attendance" real )
For the game showing a final record of 0-5, what was the attendance level?
SELECT "Attendance" FROM table_49721 WHERE "Record" = '0-5'
CREATE TABLE table_name_49 ( city VARCHAR, opposition VARCHAR, year VARCHAR, venue VARCHAR )
Which city held the game in Old Trafford before 1907 when the Opposition was sussex?
SELECT city FROM table_name_49 WHERE year < 1907 AND venue = "old trafford" AND opposition = "sussex"
CREATE TABLE table_name_85 ( silver VARCHAR, total VARCHAR, bronze VARCHAR )
what is the total silver when total is 30 and bronze is more than 10?
SELECT COUNT(silver) FROM table_name_85 WHERE total = 30 AND bronze > 10
CREATE TABLE table_203_504 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
how many games were classified friendly competition ?
SELECT COUNT(*) FROM table_203_504 WHERE "competition" = 'friendly'
CREATE TABLE table_15926991_1 ( winner_2nd VARCHAR, time VARCHAR )
Which horse won with a time of 1:35.98 and what was their position?
SELECT winner_2nd FROM table_15926991_1 WHERE time = "1:35.98"
CREATE TABLE table_61247 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
Who was the girl on week 5 that came after week 3's Shelly Louise?
SELECT "Week 5" FROM table_61247 WHERE "Week 3" = 'shelly louise'
CREATE TABLE table_204_47 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents" text, "score" text )
was there more clay surfaces used than hard surfaces ?
SELECT (SELECT COUNT(*) FROM table_204_47 WHERE "surface" = 'clay') > (SELECT COUNT(*) FROM table_204_47 WHERE "surface" = 'hard')
CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VAR...
List the distinct payment method codes with the number of orders mad in a bar chart, list in asc by the y axis.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*)
CREATE TABLE table_28138035_33 ( mens_doubles VARCHAR, mens_singles VARCHAR )
How many times has Ma Long won the men's singles?
SELECT COUNT(mens_doubles) FROM table_28138035_33 WHERE mens_singles = "Ma Long"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
how many times does patient 006-2586 today have d5ns intake?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
CREATE TABLE table_name_45 ( bandwidth_included VARCHAR, price VARCHAR )
What is Bandwidth Included, when Price is '50 EUR'?
SELECT bandwidth_included FROM table_name_45 WHERE price = "50 eur"
CREATE TABLE table_name_92 ( constructor VARCHAR, rounds VARCHAR, driver VARCHAR )
Who constructed Gerhard Berger car that went all rounds?
SELECT constructor FROM table_name_92 WHERE rounds = "all" AND driver = "gerhard berger"
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
What is the total and minimum enrollment of all schools?
SELECT SUM(enrollment), MIN(enrollment) FROM university
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...
provide the number of patients whose admission type is urgent and lab test name is glucose, body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Glucose, Body Fluid"
CREATE TABLE table_204_291 ( id number, "rank" number, "name" text, "nation" text, "cp" number, "fp" number, "points" number, "placings" number )
which woman finished first in the 1971 world figured skating championships ?
SELECT "name" FROM table_204_291 WHERE "rank" = 1
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Create a pie chart showing the number of nationality across nationality.
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality
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 demographic ( subject_id text, hadm_id t...
How many patients born on or before 2126 have had a (aorto)coronary bypass of two coronary arteries procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries"
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...
provide the number of patients with procedure icd9 code 9390 who had inpatient hospital discharge.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "9390"
CREATE TABLE table_name_58 ( first_leg VARCHAR, opposition VARCHAR )
What was the first leg score in the match against Twente?
SELECT first_leg FROM table_name_58 WHERE opposition = "twente"
CREATE TABLE table_name_91 ( wins INTEGER, cuts_made VARCHAR, top_10 VARCHAR )
What is the average wins with 5 cuts and 1 in the top-10?
SELECT AVG(wins) FROM table_name_91 WHERE cuts_made = 5 AND top_10 = 1
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( ...
Show the number of start dates of all the apartment bookings made by guests with gender code 'Female' for each year in a bar chart.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female"
CREATE TABLE table_21732 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
Name the class for boten
SELECT "Class" FROM table_21732 WHERE "Part 3" = 'boten'
CREATE TABLE table_203_804 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number )
how many drivers had a total of 58 laps or more ?
SELECT COUNT("driver") FROM table_203_804 WHERE "laps" >= 58
CREATE TABLE table_name_72 ( december VARCHAR, november VARCHAR )
Who is the December playmate with a November playmate Marlene Janssen?
SELECT december FROM table_name_72 WHERE november = "marlene janssen"
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 )
Select the name of the products with a price less than or equal to $200, and count them by a bar chart, and could you display Name from high to low order?
SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY Name DESC
CREATE TABLE table_name_61 ( married_filing_jointly_or_qualified_widow_er_ VARCHAR, head_of_household VARCHAR )
Name the married filing jointly or qualified widow(er) with head of household being $117,451 $190,200
SELECT married_filing_jointly_or_qualified_widow_er_ FROM table_name_61 WHERE head_of_household = "$117,451–$190,200"
CREATE TABLE table_name_69 ( away_team VARCHAR, home_team VARCHAR )
What did the away team score in the game against Richmond?
SELECT away_team AS score FROM table_name_69 WHERE home_team = "richmond"
CREATE TABLE table_22870 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the first year she played in the french open?
SELECT MIN("Year") FROM table_22870 WHERE "Championship" = 'French Open'
CREATE TABLE table_name_65 ( total VARCHAR, to_par VARCHAR )
How much total has a To par of +9?
SELECT COUNT(total) FROM table_name_65 WHERE to_par = "+9"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
what is the total amount of dopamine intake that patient 006-2586 had gotten today?
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 = '006-2586')) AND intakeoutput.celllabel = 'dopami...
CREATE TABLE table_15463188_7 ( school_club_team VARCHAR, season VARCHAR )
Name the school/club team when season is 2009-2011
SELECT school_club_team FROM table_15463188_7 WHERE season = "2009-2011"
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 015-52724 first had the maximum platelets x 1000 level this month?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND lab.labname = 'platelets x 1000' AND DATETIME(lab.labresulttime, '...
CREATE TABLE table_name_17 ( pinnacle_height VARCHAR, town VARCHAR )
What is the Pinnacle height for Metcalf, Georgia?
SELECT pinnacle_height FROM table_name_17 WHERE town = "metcalf, georgia"
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what was the drug that was prescribed to patient 40435 after receiving audiological evaluation since 08/2105 within 2 days?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 40435 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
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, ...
give me the number of patients whose insurance is medicaid and procedure icd9 code is 5198?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "5198"
CREATE TABLE procedures_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 diagnoses_icd ( row_id number, subject_id number,...
what was the name of the specimen test that patient 12572 received for the last time until 19 months ago?
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12572) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-19 month') ORDER BY microbiologyevents.charttime DESC LIMIT 1
CREATE TABLE table_name_45 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
What is the Player that has a To standard of 4, and a Score of 74-70-68=212?
SELECT player FROM table_name_45 WHERE to_par = "–4" AND score = 74 - 70 - 68 = 212
CREATE TABLE table_name_3 ( ceased_to_be_queen VARCHAR, birth VARCHAR )
Who was born on 10 May 1788 that ceased to be queen?
SELECT ceased_to_be_queen FROM table_name_3 WHERE birth = "10 may 1788"
CREATE TABLE table_66444 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
What is the rank for the man from China with notes of QS?
SELECT MAX("Rank") FROM table_66444 WHERE "Notes" = 'qs' AND "Country" = 'china'
CREATE TABLE table_69163 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text )
Which area served coed genders at Kaharoa school and had a Decile of 9?
SELECT "Area" FROM table_69163 WHERE "Gender" = 'coed' AND "Decile" = '9' AND "Name" = 'kaharoa school'