table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE basketball_match ( school_id VARCHAR, acc_percent VARCHAR ) CREATE TABLE university ( Primary_conference VARCHAR, school_id VARCHAR )
What is the primary conference of the school that has the lowest acc percent score in the competition?
SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1
CREATE TABLE table_46930 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" text )
When the game was played at Mile High Stadium before week 9, what was the result?
SELECT "Result" FROM table_46930 WHERE "Week" < '9' AND "Game Site" = 'mile high stadium'
CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE nurse ( employeeid number, name text, position text, registe...
Find the name of the patient who made the appointment with the most recent start date.
SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
CREATE TABLE table_74557 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
Tell me the extra for tournament of olympic games
SELECT "Extra" FROM table_74557 WHERE "Tournament" = 'olympic games'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
provide me with age and gender of patient bruce harris.
SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Bruce Harris"
CREATE TABLE table_14962287_1 ( years VARCHAR, other_a VARCHAR )
which years had other a of 8 (1)?
SELECT years FROM table_14962287_1 WHERE other_a = "8 (1)"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the number of patients whose item id is 51245?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51245"
CREATE TABLE table_79504 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What country is the athlete ekaterina karsten from with a rank less than 4?
SELECT "Country" FROM table_79504 WHERE "Rank" < '4' AND "Athlete" = 'ekaterina karsten'
CREATE TABLE table_58317 ( "Date" text, "Pilot" text, "Weapon Systems Officer" text, "Aircraft" text, "Tail Code" text, "Call Sign" text, "Kill" text )
Which Tail Code belongs to Weapon Systems Officer Capt Charles B. Debellevue?
SELECT "Tail Code" FROM table_58317 WHERE "Weapon Systems Officer" = 'capt charles b. debellevue'
CREATE TABLE table_53277 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 7.8 (50), what was the opposing teams score?
SELECT "Home team score" FROM table_53277 WHERE "Away team score" = '7.8 (50)'
CREATE TABLE table_name_33 ( segment_d VARCHAR, episode VARCHAR, segment_c VARCHAR )
What segment d is associated with an episode number above 16 and a segment c of laser eye surgery?
SELECT segment_d FROM table_name_33 WHERE episode > 16 AND segment_c = "laser eye surgery"
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Number of questions in the [r] tag by day.
WITH rquestions AS (SELECT CAST(TIME_TO_STR(p.CreationDate, '%Y%m%d') AS TEXT(12)) AS daydate, CAST(TIME_TO_STR(p.CreationDate, '%m/%d/%y') AS TEXT(12)) AS usdaydate FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.Id = pt.PostId WHERE p.Po...
CREATE TABLE College ( enr INTEGER )
What is the average enrollment number?
SELECT AVG(enr) FROM College
CREATE TABLE table_204_646 ( id number, "location" text, "region" text, "coordinates\n(links to map & photo sources)" text, "population" number, "elevation" number )
how many people live in santa maria ?
SELECT "population" FROM table_204_646 WHERE "location" = 'santa maria'
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE...
Show name and distance for all aircrafts by a bar chart, list by the X-axis in asc.
SELECT name, distance FROM aircraft ORDER BY name
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
Percentage of unanswered questions for a tag.
SELECT COUNT(p.Id) AS "total_questions", SUM(CASE WHEN p.AcceptedAnswerId > 0 THEN 1 ELSE 0 END) AS "answered_questions", SUM(CASE WHEN p.AcceptedAnswerId > 0 THEN 0 ELSE 1 END) * 1000 / COUNT(p.Id) / 10.0 AS "percentage_unanaswered" FROM Posts AS p, PostTags AS pt, Tags AS t WHERE p.PostTypeId = 1 AND p.Id = pt.PostId...
CREATE TABLE elimination ( Time VARCHAR, Wrestler_ID VARCHAR ) CREATE TABLE wrestler ( Wrestler_ID VARCHAR, Days_held INTEGER )
Show times of elimination of wrestlers with days held more than 50.
SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
how many patients were prescribed pantoprazole 40 mg inj in the same hospital encounter after they had undergone ventilator weaning, during the last year?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilator weaning' AND DATETIME(treatment.treatmenttime, 'start of year'...
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate ti...
tell me the intake method for provera?
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'provera'
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CRE...
post history for Table join using the repository pattern.
SELECT * FROM PostLinks WHERE PostId = 95650
CREATE TABLE table_name_7 ( date VARCHAR, away_team VARCHAR )
What is Date, when Away Team is 'Barnet'?
SELECT date FROM table_name_7 WHERE away_team = "barnet"
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
What is the easiest class I can take to fulfill my Core requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
Give me a histogram for what are the memories and carriers of phones?, list bars from low to high order.
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier
CREATE TABLE table_73541 ( "Horizontal order" real, "Height order" real, "Soundfield type" text, "Number of channels" real, "Channels" text )
If the channels is wxyzuv, what is the number of channels?
SELECT "Number of channels" FROM table_73541 WHERE "Channels" = 'WXYZUV'
CREATE TABLE table_name_20 ( tournament VARCHAR )
Name the 2008 for 2012 being a and tournament of australian open
SELECT 2008 FROM table_name_20 WHERE 2012 = "a" AND tournament = "australian open"
CREATE TABLE table_name_95 ( week_3 VARCHAR, week_4 VARCHAR )
What Week 3 has a Week 4 of gina blair?
SELECT week_3 FROM table_name_95 WHERE week_4 = "gina blair"
CREATE TABLE table_2750 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text )
What's LSU's overall record/
SELECT "Overall Record" FROM table_2750 WHERE "Team" = 'LSU'
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPo...
Amazon Appstore questions asked in 2015.
SELECT p.Title, p.Body, TIME_TO_STR(p.CreationDate, '%Year'), v.PostId AS "post_link", p.Tags FROM Posts AS P JOIN Votes AS V ON p.Id = v.PostId WHERE PostTypeId = 1 AND VoteTypeId = 2 AND p.Tags LIKE '%amazon-appstore%' AND TIME_TO_STR(p.CreationDate, '%Year') = 2015 GROUP BY p.Title, p.Body, v.PostId, p.Tags, p.Creat...
CREATE TABLE table_64746 ( "Rank" text, "Province" text, "Population (2011)" real, "Percentage" real, "Population Estimate (2013)" real )
What is the lowest 2013 population estimate of the province with a 23.7 percentage?
SELECT MIN("Population Estimate (2013)") FROM table_64746 WHERE "Percentage" = '23.7'
CREATE TABLE table_name_87 ( at_neutral_site VARCHAR, overall_record VARCHAR )
With an overall record of MU, 15-8 what is the at neutral site?
SELECT at_neutral_site FROM table_name_87 WHERE overall_record = "mu, 15-8"
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id...
I want to know the proportion of products for each product name.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name
CREATE TABLE table_name_8 ( competition VARCHAR, score VARCHAR, result VARCHAR )
What competition had a score of 3-0, and a result of 4-1?
SELECT competition FROM table_name_8 WHERE score = "3-0" AND result = "4-1"
CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE club ( Club_ID int, Club_name tex...
Compare the number of players of different occupations using a bar chart, I want to show in asc by the Occupation.
SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY Occupation
CREATE TABLE table_64032 ( "Position" real, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
Which Total has an A Score of 6.5, and a Position larger than 5?
SELECT MIN("Total") FROM table_64032 WHERE "A Score" = '6.5' AND "Position" > '5'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
what is the three year survival probability for patients who were prescribed neo*po*nystatin suspension after having been diagnosed with disc dis nec/nos-lumbar?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
CREATE TABLE table_name_59 ( captain VARCHAR, kit_manufacturer VARCHAR, manager VARCHAR )
Who is the captain for the manufacturer Pony, and the manager Harry Redknapp?
SELECT captain FROM table_name_59 WHERE kit_manufacturer = "pony" AND manager = "harry redknapp"
CREATE TABLE table_76206 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What Label has the Region of Australia?
SELECT "Label" FROM table_76206 WHERE "Region" = 'australia'
CREATE TABLE table_11622840_1 ( tournament VARCHAR, location VARCHAR )
Name all the tournaments that took place in Rhode Island.
SELECT tournament FROM table_11622840_1 WHERE location = "Rhode Island"
CREATE TABLE mailshot_customers ( mailshot_id number, customer_id number, outcome_code text, mailshot_customer_date time ) CREATE TABLE premises ( premise_id number, premises_type text, premise_details text ) CREATE TABLE products ( product_id number, product_category text, pro...
What are the distinct address type codes for all customer addresses?
SELECT DISTINCT address_type_code FROM customer_addresses
CREATE TABLE table_76341 ( "Name" text, "Background" text, "Title" text, "Appointment" text, "Presentation of Credentials" text )
What was Anthony D. Marshall's title?
SELECT "Title" FROM table_76341 WHERE "Name" = 'anthony d. marshall'
CREATE TABLE table_1137702_3 ( winning_driver VARCHAR, pole_position VARCHAR, fastest_lap VARCHAR )
Who was the winning driver when the pole position was held by Ayrton Senna and the Fastest lap was Michael Schumacher?
SELECT winning_driver FROM table_1137702_3 WHERE pole_position = "Ayrton Senna" AND fastest_lap = "Michael Schumacher"
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...
count the number of patients whose insurance is private and discharge location is dead/expired?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DEAD/EXPIRED"
CREATE TABLE table_23769 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Jockey" text, "Winner/2nd" text )
What was the weight in kg when the jockey was B. York?
SELECT "Weight (kg)" FROM table_23769 WHERE "Jockey" = 'B. York'
CREATE TABLE table_68937 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
Nam the points for when tries for is 91 and played of 22
SELECT "Points for" FROM table_68937 WHERE "Played" = '22' AND "Tries for" = '91'
CREATE TABLE table_name_10 ( total INTEGER, horse VARCHAR )
Tell me the most total for horse of carlson
SELECT MAX(total) FROM table_name_10 WHERE horse = "carlson"
CREATE TABLE Ref_calendar ( Id VARCHAR )
How many calendar items do we have?
SELECT COUNT(*) FROM Ref_calendar
CREATE TABLE table_name_15 ( season VARCHAR, opponent VARCHAR )
What season has roma as the opponent?
SELECT season FROM table_name_15 WHERE opponent = "roma"
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
What are the options for upper level electives offered before noon ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
CREATE TABLE table_name_11 ( draws VARCHAR, losses VARCHAR, efficiency__percentage VARCHAR )
what is the number of draws when there are 4 losses and 28.6% efficiency?
SELECT COUNT(draws) FROM table_name_11 WHERE losses = 4 AND efficiency__percentage = "28.6%"
CREATE TABLE table_61529 ( "Bow number" text, "Ship name" text, "Launched" text, "Commissioned" text, "Service" text )
When did the ship commissioned in November 1975 with a bow number of ps-18 launch?
SELECT "Launched" FROM table_61529 WHERE "Commissioned" = 'november 1975' AND "Bow number" = 'ps-18'
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
Use a pie chart to show the number of delegates in each county.
SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name
CREATE TABLE table_62355 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text )
What is the nationality of the event with a 1:51.51 time?
SELECT "Nationality" FROM table_62355 WHERE "Time" = '1:51.51'
CREATE TABLE table_77001 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
Can you tell me the sum of FA Cup Goals that has the League Cup Goals larger than 0?
SELECT SUM("FA Cup Goals") FROM table_77001 WHERE "League Cup Goals" > '0'
CREATE TABLE table_name_77 ( opponent VARCHAR, record VARCHAR )
Which opponent has a record of 70-52?
SELECT opponent FROM table_name_77 WHERE record = "70-52"
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE Institution ( Institution_id text, Institution text, Location ...
Show institution names along with the number of proteins for each institution in a bar chart, and rank by the X in descending.
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY Institution DESC
CREATE TABLE table_name_67 ( player VARCHAR, position VARCHAR, club_province VARCHAR )
Which player Munster from Munster is a fly-half?
SELECT player FROM table_name_67 WHERE position = "fly-half" AND club_province = "munster"
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...
what is age and language of subject name francis baseler?
SELECT demographic.age, demographic.language FROM demographic WHERE demographic.name = "Francis Baseler"
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
When and in what zip code did max temperature reach 80?
SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80
CREATE TABLE table_26998135_2 ( outgoing_manager VARCHAR, team VARCHAR )
What is the outgoing manager for the team kas mpa a?
SELECT outgoing_manager FROM table_26998135_2 WHERE team = "Kasımpaşa"
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Count the number of captains that have each rank Visualize by bar chart, rank by the the total number in descending.
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) DESC
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
what is the best restaurant in bay area for american food ?
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE T...
Create a bar chart showing the total number across team, and show bars in asc order.
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team
CREATE TABLE table_9662 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which Home team has a Tie no of replay, a Date of 19 november 1985, and an Away team of tranmere rovers?
SELECT "Home team" FROM table_9662 WHERE "Tie no" = 'replay' AND "Date" = '19 november 1985' AND "Away team" = 'tranmere rovers'
CREATE TABLE table_name_3 ( points VARCHAR, year VARCHAR, chassis VARCHAR )
How many points were there before 1979 with a ferrari 312b2 chassis?
SELECT points FROM table_name_3 WHERE year < 1979 AND chassis = "ferrari 312b2"
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, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
what is the total amount of cerebral ventricular #1 output that patient 94122 had on 06/05/this year?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94122)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cer...
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...
what is the maximum value of mch in patient 006-7325's body in 04/last year?
SELECT MAX(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 = '006-7325')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of year...
CREATE TABLE table_29336 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many U.S. viewers (million) watched the episode directed by Allison Liddi-Brown?
SELECT "U.S. viewers (million)" FROM table_29336 WHERE "Directed by" = 'Allison Liddi-Brown'
CREATE TABLE table_52275 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text )
Who was the winner for the Winton Motor Raceway circuit?
SELECT "Winner" FROM table_52275 WHERE "Circuit" = 'winton motor raceway'
CREATE TABLE table_34076 ( "Track number" real, "Song title" text, "Songwriter(s)" text, "Orchestra" text, "Time" text )
Name the songwriter for track number 12
SELECT "Songwriter(s)" FROM table_34076 WHERE "Track number" = '12'
CREATE TABLE table_77689 ( "Player" text, "Shoots" text, "Acquired" real, "Place of Birth" text, "Joined from" text )
Who acquired tom norton?
SELECT "Acquired" FROM table_77689 WHERE "Player" = 'tom norton'
CREATE TABLE table_8184 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text )
Which Venue has a Club of west bromwich albion?
SELECT "Venue" FROM table_8184 WHERE "Club" = 'west bromwich albion'
CREATE TABLE table_18349 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the candidates for texas 20
SELECT "Candidates" FROM table_18349 WHERE "District" = 'Texas 20'
CREATE TABLE table_204_911 ( id number, "album / name" text, "artist(s)" text, "label" text, "role/credit" text, "date" text, "chart#" text )
what is the top album name ?
SELECT "album / name" FROM table_204_911 WHERE id = 1
CREATE TABLE table_51992 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest amount of bronze Liechtenstein, who has more than 11 gold, has?
SELECT MIN("Bronze") FROM table_51992 WHERE "Nation" = 'liechtenstein' AND "Gold" > '11'
CREATE TABLE table_31438 ( "model" text, "Sonnet" text, "Apple" text, "NUpowr 117" text, "NUpowr 167" text, "NUpowr 183" text, "NUpowr G3" text )
When 0,4, or 8 mb is the nupowr 117 what is the sonnet?
SELECT "Sonnet" FROM table_31438 WHERE "NUpowr 117" = '0,4, or 8 MB'
CREATE TABLE table_203_126 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
who did ohio state play before indiana on october 23 ?
SELECT "opponent#" FROM table_203_126 WHERE id = (SELECT id FROM table_203_126 WHERE "date" = 'october 23' AND "opponent#" = 'indiana') - 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose gender is f and primary disease is congestive heart failure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE"
CREATE TABLE table_name_10 ( area_km_2 INTEGER, population VARCHAR, status VARCHAR, census_ranking VARCHAR )
What is the area (in km2) for the community that has a status of village, a census ranking of 2,471 of 5,008, and a population of less than 748?
SELECT SUM(area_km_2) FROM table_name_10 WHERE status = "village" AND census_ranking = "2,471 of 5,008" AND population < 748
CREATE TABLE table_55235 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text )
What is the score of the competition of friendly, at match 7?
SELECT "Score1" FROM table_55235 WHERE "Competition or tour" = 'friendly' AND "Match" = '7'
CREATE TABLE table_12808 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Player's Score is 69-71-69=208?
SELECT "Player" FROM table_12808 WHERE "Score" = '69-71-69=208'
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, ...
how many patients whose admission type is emergency and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.fluid = "Ascites"
CREATE TABLE table_name_92 ( tv_network_s_ VARCHAR, country VARCHAR )
What is the name of Bulgaria's TV network?
SELECT tv_network_s_ FROM table_name_92 WHERE country = "bulgaria"
CREATE TABLE table_23285849_10 ( score VARCHAR, high_points VARCHAR )
When j.r. smith (26) has the highest amount of points what is the score?
SELECT score FROM table_23285849_10 WHERE high_points = "J.R. Smith (26)"
CREATE TABLE table_name_19 ( date VARCHAR, loss VARCHAR, opponent VARCHAR )
What was the date of A. Benes loss to the Rockies?
SELECT date FROM table_name_19 WHERE loss = "a. benes" AND opponent = "rockies"
CREATE TABLE table_43684 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real )
Which class had Stanley Dickens as a driver?
SELECT "Class" FROM table_43684 WHERE "Driver" = 'stanley dickens'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
what were the four most frequently prescribed drugs to the male patients of age 20s after they were diagnosed with crnry athrscl natve vssl within 2 months since 5 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
CREATE TABLE table_30269 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did the player who was drafted by Calgary go to?
SELECT "College" FROM table_30269 WHERE "CFL Team" = 'Calgary'
CREATE TABLE table_72392 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the district for tim lee hall
SELECT "District" FROM table_72392 WHERE "Incumbent" = 'Tim Lee Hall'
CREATE TABLE table_71059 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
In which place is Emmet French?
SELECT "Place" FROM table_71059 WHERE "Player" = 'emmet french'
CREATE TABLE table_21088 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
Name the name of 36.0n
SELECT "Name" FROM table_21088 WHERE "Latitude" = '36.0N'
CREATE TABLE table_53042 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School" text )
Which pick's player was Marc Lewis (lhp)?
SELECT "Pick" FROM table_53042 WHERE "Player" = 'marc lewis (lhp)'
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 patient ( uniquep...
how many narcotic antagonist - naloxone (narcan) procedures occurred since 2104?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'narcotic antagonist - naloxone (narcan)' AND STRFTIME('%y', treatment.treatmenttime) >= '2104'
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
For all artist names who are not from the United States, show the total number of each year with a bar chart, I want to display Y-axis from low to high order please.
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join ORDER BY COUNT(Year_Join)
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 ) ...
provide the number of patients whose admission location is transfer from hosp/extram and procedure icd9 code is 4573?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "4573"
CREATE TABLE table_name_87 ( name_v_t_e VARCHAR, club VARCHAR )
What is the name of the player from club pro recco?
SELECT name_v_t_e FROM table_name_87 WHERE club = "pro recco"
CREATE TABLE table_name_30 ( silver VARCHAR, nation VARCHAR, rank VARCHAR )
How many silvers have a Nation of hungary, and a Rank larger than 10?
SELECT COUNT(silver) FROM table_name_30 WHERE nation = "hungary" AND rank > 10
CREATE TABLE table_name_36 ( zaaps___ziips VARCHAR, model VARCHAR )
For Model e64 what is the zAAPs/zIIPs?
SELECT zaaps___ziips FROM table_name_36 WHERE model = "e64"
CREATE TABLE table_21501564_1 ( theme VARCHAR, original_artist VARCHAR )
How many weeks featured duffy as the original artist?
SELECT COUNT(theme) FROM table_21501564_1 WHERE original_artist = "Duffy"
CREATE TABLE table_name_31 ( release_date VARCHAR, catalogue VARCHAR, recorded VARCHAR )
When was the cataglogue EPA 4054 released with a 1/12/57 recorded?
SELECT release_date FROM table_name_31 WHERE catalogue = "epa 4054" AND recorded = "1/12/57"
CREATE TABLE table_name_92 ( country VARCHAR, score VARCHAR, player VARCHAR )
Which Country has a Score of 69, and a Player of mick soli?
SELECT country FROM table_name_92 WHERE score = 69 AND player = "mick soli"