table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price tex...
Return the name of the characteristic that is most common across all products.
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_70835 ( "Name" text, "Frequency" text, "Language" text, "City" text, "Website" text )
Which website is in english and has the frequency of an online newspaper ?
SELECT "Website" FROM table_70835 WHERE "Language" = 'english' AND "Frequency" = 'online newspaper'
CREATE TABLE table_13210 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Nation has Silver smaller than 16, Bronze larger than 6, and Gold of 2?
SELECT "Nation" FROM table_13210 WHERE "Silver" < '16' AND "Bronze" > '6' AND "Gold" = '2'
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Gold Badges for Node.js Worldwide.
SELECT * FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.Class = 1 AND Badges.TagBased = 1 AND Badges.Name = 'node.js' ORDER BY Reputation DESC
CREATE TABLE table_18373 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what is the party when the incumbent is sidney r. yates?
SELECT "Party" FROM table_18373 WHERE "Incumbent" = 'Sidney R. Yates'
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_i...
have any microbiological tests been done for patient 59002 on the first hospital visit?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59002 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3),...
Find the name and credit score of the customers who have some loans.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID
CREATE TABLE table_name_17 ( draws INTEGER, against VARCHAR, wins VARCHAR, losses VARCHAR )
What is the average draws with more than 1 win, 14 losses, and against less than 1836?
SELECT AVG(draws) FROM table_name_17 WHERE wins > 1 AND losses = 14 AND against < 1836
CREATE TABLE table_203_414 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
which team was the top scorer in the 1st leg ?
SELECT "team 1" FROM table_203_414 ORDER BY "1st leg" DESC LIMIT 1
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Which patients with medicaid health insurance have brain mass and intracranial hemorrhage as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
CREATE TABLE table_name_36 ( result VARCHAR, original_title VARCHAR )
What was Zona Sur's result after being considered for nomination?
SELECT result FROM table_name_36 WHERE original_title = "zona sur"
CREATE TABLE table_204_29 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text )
how many swimmers swam at least a 1:59.99 race ?
SELECT COUNT("name") FROM table_204_29 WHERE "time" = 1
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 )
Visualize the proportion of the total number of captains in each class using a pie chart.
SELECT Class, COUNT(Class) FROM captain GROUP BY Class
CREATE TABLE table_36828 ( "Title" text, "Genre" text, "C=64" text, "ZX Spectrum" text, "Others" text, "Year" real, "Format" text )
Which ZX Spectrum has a C=64 of c64, and a Title of ankh?
SELECT "ZX Spectrum" FROM table_36828 WHERE "C=64" = 'c64' AND "Title" = 'ankh'
CREATE TABLE table_11354111_3 ( overall_rank VARCHAR, viewers__m_ VARCHAR )
what's the overall rank with viewers (m) of 7.44
SELECT overall_rank FROM table_11354111_3 WHERE viewers__m_ = "7.44"
CREATE TABLE table_name_16 ( school VARCHAR, team VARCHAR )
What school does the Blue Raiders belong to?
SELECT school FROM table_name_16 WHERE team = "blue raiders"
CREATE TABLE table_47786 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who placed t7 with a score of 70-71=141?
SELECT "Player" FROM table_47786 WHERE "Place" = 't7' AND "Score" = '70-71=141'
CREATE TABLE table_name_92 ( gold INTEGER, bronze VARCHAR, total VARCHAR )
Which Gold has a Bronze larger than 1, and a Total larger than 80?
SELECT SUM(gold) FROM table_name_92 WHERE bronze > 1 AND total > 80
CREATE TABLE table_65916 ( "Team" text, "Winners" real, "Runners-up" real, "Years won" text, "Years runners-up" text )
What is the sum of winners when 1983 is the years won?
SELECT COUNT("Winners") FROM table_65916 WHERE "Years won" = '1983'
CREATE TABLE table_name_43 ( car_no VARCHAR, time_retired VARCHAR )
What car number had a race time of +0.3844?
SELECT car_no FROM table_name_43 WHERE time_retired = "+0.3844"
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
What are the different classes of races, and how many races correspond to each. Show bar chart.
SELECT Class, COUNT(*) FROM race GROUP BY Class
CREATE TABLE table_1341718_14 ( first_elected INTEGER, district VARCHAR )
what was the year first elected for district illinois 7?
SELECT MAX(first_elected) FROM table_1341718_14 WHERE district = "Illinois 7"
CREATE TABLE table_name_15 ( type VARCHAR, unit VARCHAR )
Which type had the unit greifswald - 7 (kgr 7) ?
SELECT type FROM table_name_15 WHERE unit = "greifswald - 7 (kgr 7)"
CREATE TABLE table_name_17 ( round VARCHAR, grand_prix VARCHAR, fastest_lap VARCHAR, pole_position VARCHAR )
During the hungarian grand prix where the pole position was michael schumacher and the fastest lap was driven by damon hill, what's the total number of rounds of races matching these standards?
SELECT COUNT(round) FROM table_name_17 WHERE fastest_lap = "damon hill" AND pole_position = "michael schumacher" AND grand_prix = "hungarian grand prix"
CREATE TABLE table_204_877 ( id number, "place" number, "position" text, "number" number, "name" text, "league two" number, "fa cup" number, "league cup" number, "fl trophy" number, "total" number )
what number of players scored in the league cup ?
SELECT COUNT("name") FROM table_204_877 WHERE "league cup" > 0
CREATE TABLE table_name_99 ( winter VARCHAR, year VARCHAR )
What is the Winter in 1906?
SELECT winter FROM table_name_99 WHERE year = 1906
CREATE TABLE table_13079788_3 ( circuit VARCHAR, date VARCHAR, gt3_winner VARCHAR )
what are all the circuit for 9 september and gt3 winner hector lester allan simonsen
SELECT circuit FROM table_13079788_3 WHERE date = "9 September" AND gt3_winner = "Hector Lester Allan Simonsen"
CREATE TABLE table_45336 ( "Year" real, "Domestic freight" real, "Domestic mail" real, "International freight" real, "International mail" real, "Total freight and mail" real, "Change" text )
What is the most domestic freight with a change of +9,8% and a total freight and mail of more than 3,278?
SELECT MAX("Domestic freight") FROM table_45336 WHERE "Change" = '+9,8%' AND "Total freight and mail" > '3,278'
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 ...
what is the yearly minimum value of patient 26720's pco2 until 2102?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26720) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND STRFTIME('%y', labevents.charttime) <= '2102' GROUP BY STRFTIME(...
CREATE TABLE table_name_48 ( catalogue VARCHAR, date VARCHAR )
Name the october 15, 2004 catalogue
SELECT catalogue FROM table_name_48 WHERE date = "october 15, 2004"
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me the number of all home by all home in a histogram
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home
CREATE TABLE table_12052 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real )
Who was the Visitor when the Home team was Anaheim on the Date of April 12?
SELECT "Visitor" FROM table_12052 WHERE "Home" = 'anaheim' AND "Date" = 'april 12'
CREATE TABLE table_train_134 ( "id" int, "mini_mental_state_examination_mmse" int, "geriatric_depression_scale_gds" int, "alzheimer_disease_ad" bool, "rosen_modified_hachinski_ischemic_score" int, "clinical_dementia_rating_cdr" float, "NOUSE" float )
diagnosis of probable alzheimer's disease ( ad ) of mild to moderate severity ( as determined by a mini mental state examination ( mmse ) score of 14 _ 26 inclusive )
SELECT * FROM table_train_134 WHERE alzheimer_disease_ad = 1 OR (mini_mental_state_examination_mmse >= 14 AND mini_mental_state_examination_mmse <= 26)
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( tra...
Show the ids and details of the investors who have at least two transactions with type code 'SALE' by a bar chart.
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE"
CREATE TABLE table_name_30 ( method VARCHAR, race VARCHAR, date_of_execution VARCHAR )
How was the native american executed in July 1836?
SELECT method FROM table_name_30 WHERE race = "native american" AND date_of_execution = "july 1836"
CREATE TABLE table_32177 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
What is the average round when there is a defensive back and an overall smaller than 199?
SELECT AVG("Round") FROM table_32177 WHERE "Position" = 'defensive back' AND "Overall" < '199'
CREATE TABLE table_34392 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What is the record of the game played at home by the Blues where the attendance was larger than 4,719?
SELECT "Record" FROM table_34392 WHERE "Attendance" > '4,719' AND "Home" = 'blues'
CREATE TABLE people ( People_ID VARCHAR ) CREATE TABLE employment ( People_ID VARCHAR, Company_ID VARCHAR ) CREATE TABLE company ( Name VARCHAR, Company_ID VARCHAR )
Show the names of companies and the number of employees they have
SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name
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 whose insurance is government and procedure long title is umbilical vein catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Umbilical vein catheterization"
CREATE TABLE table_name_42 ( result VARCHAR, opponent VARCHAR )
What is the result of the match with Zab Judah as the opponent?
SELECT result FROM table_name_42 WHERE opponent = "zab judah"
CREATE TABLE table_name_84 ( driver VARCHAR, grid VARCHAR, laps VARCHAR )
What driver has a grid of under 10, and under 70 laps?
SELECT driver FROM table_name_84 WHERE grid < 10 AND laps < 70
CREATE TABLE table_28511 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text )
what type of institution is ottawa university?
SELECT "Type" FROM table_28511 WHERE "Institution" = 'Ottawa University'
CREATE TABLE table_name_40 ( district VARCHAR, place_of_birth VARCHAR, delegate VARCHAR )
How many districts in Baltimore City does Cheryl Glenn dictate?
SELECT COUNT(district) FROM table_name_40 WHERE place_of_birth = "baltimore city" AND delegate = "cheryl glenn"
CREATE TABLE table_name_90 ( laps VARCHAR, rank VARCHAR )
Name the total number of laps with rank of 8
SELECT COUNT(laps) FROM table_name_90 WHERE rank = "8"
CREATE TABLE table_8438 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Team 1, Everton, has what as a 1st leg?
SELECT "1st leg" FROM table_8438 WHERE "Team 1" = 'everton'
CREATE TABLE table_12718 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Country is David Toms from?
SELECT "Country" FROM table_12718 WHERE "Player" = 'david toms'
CREATE TABLE table_name_39 ( points VARCHAR, club VARCHAR, goal_difference VARCHAR, wins VARCHAR )
In the club of Real Oviedo, what were the points of the competitor with a goal difference less than 38, and 12 wins?
SELECT points FROM table_name_39 WHERE goal_difference < 38 AND wins = 12 AND club = "real oviedo"
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...
what is the number of patients whose admission type is emergency and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "BASE"
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 diagnoses ( ...
give me the number of patients whose marital status is divorced and procedure long title is coronary arteriography using a single catheter?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Coronary arteriography using a single catheter"
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the job_id , show by the bar in desc.
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC
CREATE TABLE table_50539 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is Date, when Game is '65'?
SELECT "Date" FROM table_50539 WHERE "Game" = '65'
CREATE TABLE table_name_76 ( accreditation_level VARCHAR, network_brand_name VARCHAR )
What is the accreditation level of the network brand Movistar?
SELECT accreditation_level FROM table_name_76 WHERE network_brand_name = "movistar"
CREATE TABLE table_57327 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
Which grand prix had gerhard berger in his fastest lap and a jacques villeneuve pole position?
SELECT "Grand Prix" FROM table_57327 WHERE "Fastest Lap" = 'gerhard berger' AND "Pole Position" = 'jacques villeneuve'
CREATE TABLE table_77720 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who is Runner(s)-up that has a Date of may 24, 1999?
SELECT "Runner(s)-up" FROM table_77720 WHERE "Date" = 'may 24, 1999'
CREATE TABLE table_71601 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text )
When was there a team of Simon and the start was 3?
SELECT "Year" FROM table_71601 WHERE "Team" = 'simon' AND "Start" = '3'
CREATE TABLE table_763 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who was the candidate in the election in the Tennessee 9 district?
SELECT "Candidates" FROM table_763 WHERE "District" = 'Tennessee 9'
CREATE TABLE table_8120 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Winning score has a Date of aug 26, 1973?
SELECT "Winning score" FROM table_8120 WHERE "Date" = 'aug 26, 1973'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
among patients who were prescribed senna after they had been diagnosed with extremity compartment syndrome - right lower extremity show me the three year survival rate.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_...
when was last time the respiratory rate of patient 12775 was less than 19.0 on the current icu visit?
SELECT chartevents.charttime 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 = 12775) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
CREATE TABLE table_36106 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
Name the average attendance from june 11
SELECT AVG("Attendance") FROM table_36106 WHERE "Date" = 'june 11'
CREATE TABLE table_11164 ( "Difficulty Value" text, "1d10 Resolution (+5)" real, "3d6 or 1d20 Resolution (+10)" real, "+1d6-1d6 or +1d10-1d10 (+0)" real, "+1d12 (6)" real )
What is the highest +1d12 (6) with a 3d6 or 1d20 Resolution (+10) larger than 10,with a +1d6-1d6 or +1d10-1d10 (+0) of 4, with 1d10 Resolution (+5) larger than 9?
SELECT MAX("+1d12 (6)") FROM table_11164 WHERE "3d6 or 1d20 Resolution (+10)" > '10' AND "+1d6-1d6 or +1d10-1d10 (+0)" = '4' AND "1d10 Resolution (+5)" > '9'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is lab test name of subject name jerry deberry?
SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
CREATE TABLE table_204_555 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
julio rene martinez is from guatemala , what did he place in 2002 ?
SELECT "position" FROM table_204_555 WHERE "year" = 2002
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, ...
was there any microbiology test results for the sputum, tracheal specimen of patient 025-28600 since 2104?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('...
CREATE TABLE table_27509 ( "Song" text, "Singer" text, "Co-Singers" text, "Music Director" text, "Lyricist" text, "Co-Stars" text, "Movie/Album" text, "Year" text, "Additional Info" text )
In which years are co-stars mala sinha and amitabh bachchan?
SELECT "Year" FROM table_27509 WHERE "Co-Stars" = 'Mala Sinha and Amitabh Bachchan'
CREATE TABLE table_204_658 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
how many games were played in olympic stadium and had attendance over 12,000 ?
SELECT COUNT(*) FROM table_204_658 WHERE "game site" = 'olympic stadium' AND "attendance" > 12000
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
what's the number of inputs patient 15447 has received today?
SELECT SUM(inputevents_cv.amount) 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 = 15447)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), ...
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,...
calculate the total amount of gastric nasogastric of patient 1272 since 05/06/2102.
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 = 1272)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gast...
CREATE TABLE table_name_55 ( date VARCHAR, margin_of_victory VARCHAR, runner_s__up VARCHAR )
Which date was the event that Yani won in a playoff over Yueh-Chyn Huang?
SELECT date FROM table_name_55 WHERE margin_of_victory = "playoff" AND runner_s__up = "yueh-chyn huang"
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,...
what is marital status and language of subject id 2560?
SELECT demographic.marital_status, demographic.language FROM demographic WHERE demographic.subject_id = "2560"
CREATE TABLE table_46676 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average number of gold medals the netherlands got when they had more than 4 bronze medals?
SELECT AVG("Gold") FROM table_46676 WHERE "Nation" = 'netherlands' AND "Bronze" > '4'
CREATE TABLE table_name_72 ( year VARCHAR, award VARCHAR, category VARCHAR )
What year was there a Tony award category of Best Revival of a Musical?
SELECT year FROM table_name_72 WHERE award = "tony award" AND category = "best revival of a musical"
CREATE TABLE table_61478 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the away team with a 4 tie no.?
SELECT "Away team" FROM table_61478 WHERE "Tie no" = '4'
CREATE TABLE table_59944 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
what is 2008 when 2012 is 3r and 2009 is 2r?
SELECT "2008" FROM table_59944 WHERE "2012" = '3r' AND "2009" = '2r'
CREATE TABLE table_name_70 ( points VARCHAR, scored VARCHAR, conceded VARCHAR, position VARCHAR, losses VARCHAR )
How many Points have a Position larger than 4, and Losses larger than 5, and a Conceded of 15, and a Scored larger than 11?
SELECT COUNT(points) FROM table_name_70 WHERE position > 4 AND losses > 5 AND conceded = 15 AND scored > 11
CREATE TABLE table_15746 ( "Year" real, "Denomination" text, "Alloy" text, "Reverse" text, "Diameter" text, "Weight" text, "Obverse" text, "Mintage" real, "Series" text )
What is the denomination of the III Series?
SELECT "Denomination" FROM table_15746 WHERE "Series" = 'iii series'
CREATE TABLE table_27277284_27 ( mult_1 VARCHAR, frequency VARCHAR )
What are the possible multipliers for 1900MHz processors?
SELECT mult_1 FROM table_27277284_27 WHERE frequency = "1900MHz"
CREATE TABLE table_14298 ( "Name A[\u203a ]" text, "Dam or A[\u203a ] Reservoir" text, "GNIS Feature ID # Link A[\u203a ] B[\u203a ]" real, "Elevation A[\u203a ]" text, "Borough or A[\u203a ] Census area" text )
what is the dam or a[ ] reservoir when the gnis feature id # link a [ ] b [ ] is 1415517?
SELECT "Dam or A[\u203a ] Reservoir" FROM table_14298 WHERE "GNIS Feature ID # Link A[\u203a ] B[\u203a ]" = '1415517'
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and manager_id , and could you display by the x-axis in descending?
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
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...
find the number of patients categorized under hematology lab test who have diagnoses of insulins and antidiabetic agents causing adverse effects in therapeutic use.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Insulins and antidiabetic agents causing adverse effects in therapeutic use" AND lab."CATEGORY" = "Hematology"
CREATE TABLE table_203_266 ( id number, "group" text, "members" number, "caucusing" number, "total" number )
what group had the greatest amount of members ?
SELECT "group" FROM table_203_266 ORDER BY "members" DESC LIMIT 1
CREATE TABLE table_name_24 ( unwto_region VARCHAR, country VARCHAR )
What is Italy's UNWTO region?
SELECT unwto_region FROM table_name_24 WHERE country = "italy"
CREATE TABLE table_name_9 ( latitude INTEGER, water__sqmi_ VARCHAR, ansi_code VARCHAR )
How much Latitude has a Water (sqmi) of 0.267, and an ANSI code larger than 1759605?
SELECT SUM(latitude) FROM table_name_9 WHERE water__sqmi_ = 0.267 AND ansi_code > 1759605
CREATE TABLE table_name_18 ( opponent VARCHAR, record VARCHAR )
Who was the Blue Jays opponent when their record was 84-69?
SELECT opponent FROM table_name_18 WHERE record = "84-69"
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 medication ( medi...
how many times patient 006-80884 has produced a colostomy production on the current icu visit?
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-80884') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpa...
CREATE TABLE table_54369 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
What is the smallest rank with less than 2 wings, more than 26 events, and less than $1,831,211?
SELECT MIN("Rank") FROM table_54369 WHERE "Wins" < '2' AND "Earnings ( $ )" < '1,831,211' AND "Events" > '26'
CREATE TABLE table_40783 ( "Rank" text, "Runs" text, "Player" text, "Match" text, "Venue" text, "Season" text )
What venue has don bradman (nsw) as the player?
SELECT "Venue" FROM table_40783 WHERE "Player" = 'don bradman (nsw)'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creatio...
Top 500 answerers on the site of windows phone in 2017.
SELECT Users.Id AS "user_link", COUNT(respostas.Id) AS Answers, CAST(AVG(CAST(respostas.Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts AS respostas INNER JOIN Users ON Users.Id = OwnerUserId JOIN Posts AS pergutas ON respostas.ParentId = pergutas.Id AND pergutas.PostTypeId = 1 WHERE respostas.Pos...
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, Exam...
Find the physicians who are trained in a procedure that costs more than 5000, and count them by a pie chart
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name
CREATE TABLE table_64970 ( "Governor" text, "Took office" text, "Left office" text, "Party" text, "Lieutenant Governor" text, "Terms" text )
Who was Lieutenant Governor to the governor that left office on January 14, 1929?
SELECT "Lieutenant Governor" FROM table_64970 WHERE "Left office" = 'january 14, 1929'
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...
tell me patient 19059's last time of revise lg bowel anastom since 6 years ago?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'revise lg bowel anastom') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059) AND ...
CREATE TABLE table_60592 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
What Name has a Winning constructor of ansaldo?
SELECT "Name" FROM table_60592 WHERE "Winning constructor" = 'ansaldo'
CREATE TABLE table_1140116_5 ( date VARCHAR, race_name VARCHAR )
When does V Madgwick Cup take place?
SELECT date FROM table_1140116_5 WHERE race_name = "V Madgwick Cup"
CREATE TABLE table_name_21 ( fin_pos VARCHAR, grid VARCHAR )
What was the finishing position for the car that started in grid 6?
SELECT fin_pos FROM table_name_21 WHERE grid = "6"
CREATE TABLE table_name_13 ( us_ac VARCHAR, year VARCHAR )
What is the US A.C. in 1974?
SELECT us_ac FROM table_name_13 WHERE year = 1974
CREATE TABLE table_56126 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the attendance at Windy Hill?
SELECT MAX("Crowd") FROM table_56126 WHERE "Venue" = 'windy hill'
CREATE TABLE table_21199 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the most assists and how many did they have in the game against Miami?
SELECT "High assists" FROM table_21199 WHERE "Team" = 'Miami'
CREATE TABLE table_name_85 ( round INTEGER, time VARCHAR )
What is the total number of Round that has a Time of 6:04?
SELECT SUM(round) FROM table_name_85 WHERE time = "6:04"
CREATE TABLE table_name_43 ( venue VARCHAR, date VARCHAR )
Where was the game played on 2004-06-23?
SELECT venue FROM table_name_43 WHERE date = "2004-06-23"
CREATE TABLE Order_Items ( item_id INTEGER, order_item_status_code VARCHAR(15), order_id INTEGER, product_id INTEGER, item_status_code VARCHAR(15), item_delivered_datetime DATETIME, item_order_quantity VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_category VARCHA...
Give me a bar chart about the number of customer addresses in each premises type, display premises_type in asc order.
SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY premises_type ORDER BY premises_type