answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
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.short_title = "Sepsis" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
how many patients with sepsis diagnosis had csf lab test?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT position FROM table_name_41 WHERE driver = "bib stillwell"
Can you tell me the Position that has the Driver of bib stillwell?
CREATE TABLE table_name_41 (position VARCHAR, driver VARCHAR)
SELECT 2 AS nd FROM table_27298240_28 WHERE pronoun = "vi (you pl.)"
what is 2nd when the pronoun is vi (you pl.)?
CREATE TABLE table_27298240_28 (pronoun VARCHAR)
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT result FROM table_name_70 WHERE attendance = "41,429"
What are the results for a game with an attendance of 41,429?
CREATE TABLE table_name_70 (result VARCHAR, attendance VARCHAR)
SELECT r FROM table WHERE total = 1 AND position = "FW"
What is the R when the total is 1 and the position is fw?
CREATE TABLE table (r VARCHAR, total VARCHAR, position VARCHAR)
SELECT player FROM table_name_36 WHERE to_par = "+21"
What player has +21 as the to par?
CREATE TABLE table_name_36 ( player VARCHAR, to_par VARCHAR )
SELECT opponent_number FROM table_name_1 WHERE attendance = "48,165"
Who were the opponents when there was an attendance of 48,165?
CREATE TABLE table_name_1 (opponent_number VARCHAR, attendance VARCHAR)
SELECT MIN(league_cup) FROM table
What is the lowest league cup?
CREATE TABLE table (league_cup INTEGER)
SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name
For each film, show the price and group them by cinema name in a stacked bar chart.
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
SELECT result FROM table_name_41 WHERE attendance = "82,113"
What are the results for the game with 82,113 attending?
CREATE TABLE table_name_41 (result VARCHAR, attendance VARCHAR)
SELECT position FROM table WHERE player = Becchio
What is the position for the player becchio?
CREATE TABLE table (position VARCHAR, player VARCHAR, Becchio VARCHAR)
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1819)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-270 day') ORDER ...
when was first intake time of patient 1819 since 270 days ago?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
SELECT week_4 FROM table_name_12 WHERE week_3 = "mikaela james"
Who was the girl on week 4 after week 3's Mikaela James?
CREATE TABLE table_name_12 (week_4 VARCHAR, week_3 VARCHAR)
SELECT COUNT(league_cup) FROM table WHERE r = 4
How many times was the r 4?
CREATE TABLE table (league_cup VARCHAR, r VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "COPD EXACERBATION"
give me the number of patients whose admission location is phys referral/normal deli and primary disease is copd exacerbation?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT week_1 FROM table_name_23 WHERE week_3 = "ava hart"
Who was the girl on week 1 that was previous to week 3's Ava Hart?
CREATE TABLE table_name_23 (week_1 VARCHAR, week_3 VARCHAR)
SELECT parent FROM table_2731431_1 WHERE peak = "Cima Tosa"
What is the parent for peak cima tosa?
CREATE TABLE table_2731431_1 (parent VARCHAR, peak VARCHAR)
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 25814 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
what is the name of the medication that was prescribed to patient 25814 in the same hospital encounter after receiving a entral infus nutrit sub procedure since 08/2105?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid nu...
SELECT week_2 FROM table_name_73 WHERE week_4 = "chelsie loraine"
Who was the girl on week 2 that was previous to week 4's Chelsie Loraine?
CREATE TABLE table_name_73 (week_2 VARCHAR, week_4 VARCHAR)
SELECT MIN(elevation__m_) FROM table_2731431_1 WHERE location = "Austria" AND peak = "Wildspitze"
What is the elevation for the peak wildspitze in Austria?
CREATE TABLE table_2731431_1 (elevation__m_ INTEGER, location VARCHAR, peak VARCHAR)
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
Calculate the minimum age of patients who have posterior communicating aneurysm/sda and were discharged home.
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 lab ( subject_id text, hadm_id text, ...
SELECT week_5 FROM table_name_72 WHERE week_3 = "mikaela james"
Who was the girl on week 5 that came after week 3's Mikaela James?
CREATE TABLE table_name_72 (week_5 VARCHAR, week_3 VARCHAR)
SELECT MAX(elevation__m_) FROM table_2731431_1 WHERE no = 39
What is the elevation for number 39?
CREATE TABLE table_2731431_1 (elevation__m_ INTEGER, no VARCHAR)
SELECT player FROM table_11677100_3 WHERE school = "Torrey Pines High school"
What player goes to Torrey Pines High School?
CREATE TABLE table_11677100_3 ( player VARCHAR, school VARCHAR )
SELECT week_1 FROM table_name_12 WHERE week_2 = "kamila sulewska"
Who was the girl on week 1 that preceded week 2's Kamila Sulewska?
CREATE TABLE table_name_12 (week_1 VARCHAR, week_2 VARCHAR)
SELECT col_location FROM table_2731431_1 WHERE location = "France / Italy"
What is the col location for the location of france / italy?
CREATE TABLE table_2731431_1 (col_location VARCHAR, location VARCHAR)
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
what is the three most common lab testing done this year?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT week_5 FROM table_name_21 WHERE week_3 = "shelly louise"
Who was the girl on week 5 that came after week 3's Shelly Louise?
CREATE TABLE table_name_21 (week_5 VARCHAR, week_3 VARCHAR)
SELECT col_location FROM table_2731431_1 WHERE col_height__m_ = 1107
What is the col location with a col height (m) of 1107?
CREATE TABLE table_2731431_1 (col_location VARCHAR, col_height__m_ VARCHAR)
SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)
What are the names of wines that are more expensive then all wines made in the year 2006?
CREATE TABLE WINE ( Name VARCHAR, Price INTEGER, YEAR VARCHAR )
SELECT 1987 AS _88 FROM table_name_24 WHERE points = 136
What is 1987-88, when Points is "136"?
CREATE TABLE table_name_24 (points VARCHAR)
SELECT location FROM table_2731431_1 WHERE elevation__m_ = 3798
Which location has an elevation of 3798?
CREATE TABLE table_2731431_1 (location VARCHAR, elevation__m_ VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2174" AND prescriptions.drug = "Allopurinol"
give me the number of patients on allopurinol prescription who were admitted in hospital before 2174.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT MAX(draw) FROM table_name_13 WHERE points = "22" AND goals_conceded < 26
Name the the highest Draw which has Points of 22 and Goals Conceded smaller than 26?
CREATE TABLE table_name_13 (draw INTEGER, points VARCHAR, goals_conceded VARCHAR)
SELECT title FROM table_27303975_3 WHERE catalog_number = "CAL01 / 0091037137319"
What is the title when the catalog number is cal01 / 0091037137319?
CREATE TABLE table_27303975_3 (title VARCHAR, catalog_number VARCHAR)
SELECT club FROM table_name_74 WHERE league_cup_goals = 0 AND league_goals = "11" AND scorer = "joe laidlaw"
Which Club has a League Cup goals of 0, and a League goals of 11, and a Scorer of joe laidlaw?
CREATE TABLE table_name_74 ( club VARCHAR, scorer VARCHAR, league_cup_goals VARCHAR, league_goals VARCHAR )
SELECT MAX(played) FROM table_name_23 WHERE goals_scored < 18 AND lost > 10
Name the highest Played of Goals Scored smaller than 18 and a Lost larger than 10?
CREATE TABLE table_name_23 (played INTEGER, goals_scored VARCHAR, lost VARCHAR)
SELECT COUNT(studio) FROM table_27303975_3 WHERE title = "AM/PM Callanetics"
How many times is the title am/pm callanetics?
CREATE TABLE table_27303975_3 (studio VARCHAR, title VARCHAR)
SELECT "Venue" FROM table_11425 WHERE "Home team" = 'geelong'
Where does Geelong play their home game?
CREATE TABLE table_11425 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG(played) FROM table_name_72 WHERE points = "0*"
Name the average Played with a Points of 0*?
CREATE TABLE table_name_72 (played INTEGER, points VARCHAR)
SELECT COUNT(title) FROM table_27303975_3 WHERE catalog_number = "CAL04 / 0091037553546"
How many times was the catalog number cal04 / 0091037553546?
CREATE TABLE table_27303975_3 (title VARCHAR, catalog_number VARCHAR)
SELECT "County" FROM table_67727 WHERE "Elevation (m)" < '1833' AND "Isolation (km)" > '18' AND "Peak" = 'store lenangstind'
What country has an Elevation less than 1833 and an Isolation (km) larger than 18, and a Peak of store lenangstind?
CREATE TABLE table_67727 ( "Peak" text, "Elevation (m)" real, "Prominence (m)" real, "Isolation (km)" real, "Municipality" text, "County" text )
SELECT SUM(draw) FROM table_name_59 WHERE lost = 0 AND goals_scored > 0
Count the Draw which has Lost of 0, and a Goals Scored larger than 0?
CREATE TABLE table_name_59 (draw INTEGER, lost VARCHAR, goals_scored VARCHAR)
SELECT COUNT(copyright_information) FROM table_27303975_3 WHERE catalog_number = "CAL04 / 0091037553546"
how many times was the catalog number cal04 / 0091037553546?
CREATE TABLE table_27303975_3 (copyright_information VARCHAR, catalog_number VARCHAR)
SELECT country FROM table_name_26 WHERE career = "1989–2004"
What Country has a Career of 1989 2004?
CREATE TABLE table_name_26 ( country VARCHAR, career VARCHAR )
SELECT AVG(goals_conceded) FROM table_name_48 WHERE draw = 0 AND played > 0
Name the Goals Conceded which has a Draw of 0 and a Played larger than 0?
CREATE TABLE table_name_48 (goals_conceded INTEGER, draw VARCHAR, played VARCHAR)
SELECT COUNT(copyright_information) FROM table_27303975_3 WHERE catalog_number = "CAL01 / 0091037137319"
how many times was the catalog number cal01 / 0091037137319?
CREATE TABLE table_27303975_3 (copyright_information VARCHAR, catalog_number VARCHAR)
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-30149')) AND STRFTIME('%y', treatment.treatmenttime) = '2105'...
tell me the last procedure patient 029-30149 had in 2105?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT rank FROM table_name_74 WHERE total < 13 AND nation = "mixed team"
What is the rank for the Mixed Team nation with a total of less than 13?
CREATE TABLE table_name_74 (rank VARCHAR, total VARCHAR, nation VARCHAR)
SELECT COUNT(title) FROM table_27303975_3 WHERE catalog_number = "CAL05 / 0091037137357"
how many times was the catalog number cal05 / 0091037137357?
CREATE TABLE table_27303975_3 (title VARCHAR, catalog_number VARCHAR)
SELECT MAX("Episodes") FROM table_65178 WHERE "TV Station" = 'tbs' AND "Japanese Title" = '今夜ひとりのベッドで'
Which Episodes have a TV Station of tbs, and a Japanese Title of ?
CREATE TABLE table_65178 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
SELECT COUNT(bronze) FROM table_name_98 WHERE silver < 0
What is the total number of bronze medals for teams with less than 0 silver?
CREATE TABLE table_name_98 (bronze VARCHAR, silver INTEGER)
SELECT directed_by FROM table_27332038_1 WHERE written_by = "Elaine Ko"
who directed the episode that elaine ko wrote?
CREATE TABLE table_27332038_1 (directed_by VARCHAR, written_by VARCHAR)
SELECT bocas_is FROM table_1850282_7 WHERE species = "Chironius multiventris septentrionalis"
Name the bocas for chironius multiventris septentrionalis
CREATE TABLE table_1850282_7 ( bocas_is VARCHAR, species VARCHAR )
SELECT AVG(bronze) FROM table_name_87 WHERE silver > 1 AND total < 9
What is the average number of bronze medals when the team's silver are more than 1 but the total medals are less than 9?
CREATE TABLE table_name_87 (bronze INTEGER, silver VARCHAR, total VARCHAR)
SELECT original_air_date FROM table_27332038_1 WHERE production_code = "2ARG01"
when was the episode with production code "2arg01" originally aired?
CREATE TABLE table_27332038_1 (original_air_date VARCHAR, production_code VARCHAR)
SELECT MIN("Left St. Louis") FROM table_24469 WHERE "Venue" = 'Scottrade Center'
What year did the team who played at the Scottrade Center leave the city?
CREATE TABLE table_24469 ( "Team" text, "Sport" text, "League" text, "Established" real, "Began in St. Louis" real, "Venue" text, "Championships in St. Louis" text, "Left St. Louis" real )
SELECT military_and_or_civilian_wounded FROM table_name_39 WHERE civilian_deaths = "unknown" AND total_deaths__not_including_foreigners_ = "unknown"
How many military or civilians were wounded in the conflict that had an unknown number of civilian and total deaths?
CREATE TABLE table_name_39 (military_and_or_civilian_wounded VARCHAR, civilian_deaths VARCHAR, total_deaths__not_including_foreigners_ VARCHAR)
SELECT title FROM table_27332038_1 WHERE production_code = "2ARG09"
what is the title of the episode with production code "2arg09"?
CREATE TABLE table_27332038_1 (title VARCHAR, production_code VARCHAR)
SELECT email_address FROM students WHERE first_name = "Emma" AND last_name = "Rohan"
What is the email of the student with first name 'Emma' and last name 'Rohan'?
CREATE TABLE behavior_incident ( incident_id number, incident_type_code text, student_id number, date_incident_start time, date_incident_end time, incident_summary text, recommendations text, other_details text ) CREATE TABLE addresses ( address_id number, line_1 text, line_...
SELECT civilian_deaths FROM table_name_21 WHERE military_deaths = "231"
How many civilians died in the conflict that left 231 members of the military dead?
CREATE TABLE table_name_21 (civilian_deaths VARCHAR, military_deaths VARCHAR)
SELECT original_air_date FROM table_27332038_1 WHERE production_code = "2ARG24"
when was the episode with production code "2arg24" originally aired?
CREATE TABLE table_27332038_1 (original_air_date VARCHAR, production_code VARCHAR)
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.icd9_code = "7454" AND lab."CATEGORY" = "Chemistry"
provide the number of patients whose diagnoses icd9 code is 7454 and lab test category is chemistry?
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT civilian_deaths FROM table_name_19 WHERE total_deaths__not_including_foreigners_ = "178"
How many civilians died in the conflict that left 178, excluding foreigners, dead?
CREATE TABLE table_name_19 (civilian_deaths VARCHAR, total_deaths__not_including_foreigners_ VARCHAR)
SELECT episode FROM table_27319183_7 WHERE share___percentage_ = "41.5"
What episode had a share percentage of 41.5%?
CREATE TABLE table_27319183_7 (episode VARCHAR, share___percentage_ VARCHAR)
SELECT p.Title, 'https://codereview.stackexchange.com/questions/' + CAST(p.Id AS TEXT) AS URL, p.CreationDate FROM Posts AS p WHERE 1 = 1 AND NOT p.Title IS NULL AND p.ClosedDate IS NULL AND p.DeletionDate IS NULL AND LOWER(p.Body) LIKE '%o(n%' AND NOT LOWER(p.Body) LIKE '%\$o(n%' ORDER BY p.CreationDate DESC LIMIT 3
Posts containing BIG-O Notation requiring MathJax Formatting.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange ...
SELECT military_deaths FROM table_name_38 WHERE total_casualties = "531"
How many members of the military died in the conflict that had a total of 531 casualties?
CREATE TABLE table_name_38 (military_deaths VARCHAR, total_casualties VARCHAR)
SELECT date FROM table_27319183_7 WHERE weekly_rank = 12
What date was the show's weekly ranking 12?
CREATE TABLE table_27319183_7 (date VARCHAR, weekly_rank VARCHAR)
SELECT COUNT(rank) FROM table_name_46 WHERE name = "ku hyo-jin"
What did Ku Hyo-Jin rank?
CREATE TABLE table_name_46 ( rank VARCHAR, name VARCHAR )
SELECT civilian_deaths FROM table_name_95 WHERE total_casualties = "1,130"
How many civilians died in the conflict that had a total of 1,130 casualties?
CREATE TABLE table_name_95 (civilian_deaths VARCHAR, total_casualties VARCHAR)
SELECT total_itv_viewers__millions_ FROM table_27319183_7 WHERE official_itv_rating__millions_ = "10.24"
How many total itv viewers were there for the episode with official itv ratings of 10.24 million?
CREATE TABLE table_27319183_7 (total_itv_viewers__millions_ VARCHAR, official_itv_rating__millions_ VARCHAR)
SELECT "Winner" FROM table_9713 WHERE "City" = 'punta del este'
What is the Winner of the Event in Punta del Este?
CREATE TABLE table_9713 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
SELECT opponent FROM table_name_7 WHERE week = 15
Which team was the opponent on week 15?
CREATE TABLE table_name_7 (opponent VARCHAR, week VARCHAR)
SELECT total_itv_viewers__millions_ FROM table_27319183_7 WHERE official_itv_hd_rating__millions_ = "1.12"
How many total itv viewers were there for the episode with official itv hd ratings of 1.12 million?
CREATE TABLE table_27319183_7 (total_itv_viewers__millions_ VARCHAR, official_itv_hd_rating__millions_ VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "JEWISH" AND diagnoses.short_title = "DMII wo cmp nt st uncntr"
provide the number of patients whose religion is jewish and diagnoses short title is dmii wo cmp nt st uncntr?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT AVG(total) FROM table_name_44 WHERE finish = "t47"
What is the average Total, when Finish is "T47"?
CREATE TABLE table_name_44 (total INTEGER, finish VARCHAR)
SELECT official_itv_rating__millions_ FROM table_27319183_7 WHERE total_itv_viewers__millions_ = "8.53"
What were the official itv ratings in millions for the episode with a total of 8.53 million itv viewers
CREATE TABLE table_27319183_7 (official_itv_rating__millions_ VARCHAR, total_itv_viewers__millions_ VARCHAR)
SELECT AVG("Wins") FROM table_42435 WHERE "Team" = 'great britain'
What are the average wins that have great britain as the team?
CREATE TABLE table_42435 ( "Pos." real, "Team" text, "Wins" real, "Ties" real, "Losses" real, "Goals" text, "Diff." text, "Points" text )
SELECT to_par FROM table_name_37 WHERE total < 297 AND finish = "1"
What is To par, when Total is less than 297, and when Finish is "1"?
CREATE TABLE table_name_37 (to_par VARCHAR, total VARCHAR, finish VARCHAR)
SELECT official_itv_rating__millions_ FROM table_27319183_7 WHERE episode = "Semi-final 5"
What were the official itv ratings in millions for semi-final 5?
CREATE TABLE table_27319183_7 (official_itv_rating__millions_ VARCHAR, episode VARCHAR)
SELECT "Goals Scored" FROM table_10761 WHERE "Pos." > '4' AND "Years Active" = '2001-'
How many goals were scored with a pos larger than 4 and active in 2001-?
CREATE TABLE table_10761 ( "Pos." real, "Player" text, "Goals Scored" text, "Games Played" text, "Years Active" text )
SELECT official_itv1_rating FROM table_name_96 WHERE episode = "auditions 4"
What is the Official ITV1 rating for auditions 4?
CREATE TABLE table_name_96 (official_itv1_rating VARCHAR, episode VARCHAR)
SELECT club FROM table_27374004_2 WHERE chairman = "Roger Lambrecht"
What is the club when the chairman is roger lambrecht?
CREATE TABLE table_27374004_2 (club VARCHAR, chairman VARCHAR)
SELECT Party, COUNT(*) FROM driver GROUP BY Party
Show the party and the number of drivers in each party. Visualize by pie chart.
CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
SELECT MIN(official_itv1_rating) FROM table_name_32 WHERE share = "45.4%"
What is the lowest official ITV1 rating with 45.4% share?
CREATE TABLE table_name_32 (official_itv1_rating INTEGER, share VARCHAR)
SELECT team_captain FROM table_27374004_2 WHERE shirt_sponsor = "Quick"
What is the team captain when the shirt sponser is quick?
CREATE TABLE table_27374004_2 (team_captain VARCHAR, shirt_sponsor VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "9465" AND prescriptions.route = "SL"
what is the number of patients whose procedure icd9 code is 9465 and drug route is sl?
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(goals_against) FROM table_name_48 WHERE wins > 12 AND club = "ud las palmas" AND position > 5
How many Goals against have Wins larger than 12, and a Club of ud las palmas, and a Position larger than 5?
CREATE TABLE table_name_48 (goals_against VARCHAR, position VARCHAR, wins VARCHAR, club VARCHAR)
SELECT chairman FROM table_27374004_2 WHERE current_manager = "Bob Peeters"
Who is the chairman when the current manager is bob peeters?
CREATE TABLE table_27374004_2 (chairman VARCHAR, current_manager VARCHAR)
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY AVG(Amount_Payment) DESC
Bar graph to show the average of amount payment from different payment method code, could you list the average of amount payment from high to low order?
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER,...
SELECT MAX(goals_against) FROM table_name_65 WHERE points < 26 AND goals_for < 38 AND position > 14 AND goal_difference < -32
Which Goals against has Points smaller than 26, and Goals for smaller than 38, and a Position larger than 14, and a Goal Difference smaller than -32?
CREATE TABLE table_name_65 (goals_against INTEGER, goal_difference VARCHAR, position VARCHAR, points VARCHAR, goals_for VARCHAR)
SELECT club FROM table_27374004_2 WHERE shirt_sponsor = "e-lotto.be"
What is the club when the shirt sponsor is e-lotto.be?
CREATE TABLE table_27374004_2 (club VARCHAR, shirt_sponsor VARCHAR)
SELECT "Winning driver" FROM table_49886 WHERE "Pole position" = 'bryan herta'
Who's the Winning driver with a Pole position of bryan herta?
CREATE TABLE table_49886 ( "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text )
SELECT AVG(goals_against) FROM table_name_15 WHERE club = "cd castellón" AND points < 24
Which Goals against have a Club of cd castellón, and Points smaller than 24?
CREATE TABLE table_name_15 (goals_against INTEGER, club VARCHAR, points VARCHAR)
SELECT team_captain FROM table_27374004_2 WHERE club = "K.F.C. Germinal Beerschot"
Who is the team captain when the club is k.f.c. germinal beerschot?
CREATE TABLE table_27374004_2 (team_captain VARCHAR, club VARCHAR)
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, please bin X-axis into Year interval, rank by the y axis from high to low please.
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, ...
SELECT SUM(played) FROM table_name_51 WHERE goals_against < 34 AND wins < 13
How much Played has Goals against smaller than 34, and Wins smaller than 13?
CREATE TABLE table_name_51 (played INTEGER, goals_against VARCHAR, wins VARCHAR)
SELECT varsity_name FROM table_27369069_4 WHERE university = "McGill university"
What is the varsity name of the university of mcgill university?
CREATE TABLE table_27369069_4 (varsity_name VARCHAR, university VARCHAR)
SELECT SUM(game) FROM table_name_39 WHERE team = "new york"
What is the total for New York's game?
CREATE TABLE table_name_39 ( game INTEGER, team VARCHAR )