table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_30 ( d_45_o VARCHAR, d_46_o VARCHAR )
Name the D 45 O that has D 46 O of d 26
SELECT d_45_o FROM table_name_30 WHERE d_46_o = "d 26"
CREATE TABLE table_61329 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Name the date of Tournament of paris indoor , france?
SELECT SUM("Date") FROM table_61329 WHERE "Tournament" = 'paris indoor , france'
CREATE TABLE Candidate_Assessments ( candidate_id INTEGER, qualification CHAR(15), assessment_date DATETIME, asessment_outcome_code CHAR(15) ) CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE Student_Course_Attenda...
what is the total number of last names of all candidates?
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name
CREATE TABLE table_27879 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
What was the largest ethnic group in in the settlement with the cyrillic name ?
SELECT "Largest ethnic group (2002)" FROM table_27879 WHERE "Cyrillic Name Other Names" = 'Банатски Карловац'
CREATE TABLE table_29202 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text )
What was the Weds 25 Aug time for the driver whose Aug 27 time was 22' 23.97 101.065mph?
SELECT "Wed 25 Aug" FROM table_29202 WHERE "Fri 27 Aug" = '22'' 23.97 101.065mph'
CREATE TABLE table_204_557 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text, "pts" number )
which month had the most games ?
SELECT "date" FROM table_204_557 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_perce...
Show me the owner of the channel with the highest rating.
SELECT owner FROM channel ORDER BY rating_in_percent DESC LIMIT 1
CREATE TABLE table_49473 ( "Tongan" text, "Niuean" text, "S\u0101moan" text, "Takuu" text, "Tahitian" text, "Rarotongan" text, "M\u0101ori" text, "North Marquesan" text, "South Marquesan" text, "Hawai'ian" text, "Mangarevan" text )
What kind of North Marquesan has a Takuu of / ani/?
SELECT "North Marquesan" FROM table_49473 WHERE "Takuu" = '/ɾani/'
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int...
give me the earliest flight on AA tomorrow from ST. PETERSBURG to MILWAUKEE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 A...
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
tell me the cost for a circumcision?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'circumcision'))
CREATE TABLE table_name_31 ( ht VARCHAR, venue VARCHAR )
What was the HT for the game at Stadio Luigi Ferraris?
SELECT ht FROM table_name_31 WHERE venue = "stadio luigi ferraris"
CREATE TABLE table_23281862_6 ( score VARCHAR, high_rebounds VARCHAR )
What's the end score of the game where Shane Battier (8) did the high rebounds?
SELECT score FROM table_23281862_6 WHERE high_rebounds = "Shane Battier (8)"
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
has patient 12797 received a procedure until 2102.
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797) AND STRFTIME('%y', procedures_icd.charttime) <= '2102'
CREATE TABLE table_name_47 ( year INTEGER, saar VARCHAR, hessen VARCHAR )
What is the average year for a Saar of FK Pirmasens and Hessen of Wormatia Worms?
SELECT AVG(year) FROM table_name_47 WHERE saar = "fk pirmasens" AND hessen = "wormatia worms"
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
What courses are offered this Fall ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016
CREATE TABLE table_74601 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team's score when Fitzroy's score was 16.27 (123) on May 13, 1950.
SELECT "Away team score" FROM table_74601 WHERE "Home team score" = '16.27 (123)'
CREATE TABLE table_25458 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Arena Attendance" text, "High Points" text, "High Rebounds" text, "High Assists" text, "Record" text )
Name the high rebounds for td garden 18,624
SELECT "High Rebounds" FROM table_25458 WHERE "Arena Attendance" = 'TD Garden 18,624'
CREATE TABLE table_name_49 ( minimum_height VARCHAR, name_of_the_tunnel VARCHAR )
What is the minimum Height of the Little Switzerland Tunnel?
SELECT minimum_height FROM table_name_49 WHERE name_of_the_tunnel = "little switzerland tunnel"
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, ...
Return a pie chart on what are the ids and trade names of the medicine that can interact with at least 3 enzymes?
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, a...
what are the four most frequent procedures among the patients 50s since 2 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
Plot the number of name by grouped by name as a bar graph, could you list Y in ascending order?
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name)
CREATE TABLE table_15873547_1 ( mascot VARCHAR, colors VARCHAR )
What is the mascot with the colors green and navy?
SELECT mascot FROM table_15873547_1 WHERE colors = "Green and Navy"
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
what flights are available from DENVER to SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions...
when did patient 84346 depart hospital since 5 years ago for the first time?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 84346 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY admissions.dischtime LIMIT 1
CREATE TABLE table_70468 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the tournament that resulted in a winning score of 4 (71-72-72-69=284)?
SELECT "Tournament" FROM table_70468 WHERE "Winning score" = '–4 (71-72-72-69=284)'
CREATE TABLE table_204_193 ( id number, "year" number, "artist" text, "album" text, "chart position" text, "role" text )
what comes before donny hathaway
SELECT "artist" FROM table_204_193 WHERE id = (SELECT id FROM table_204_193 WHERE "artist" = 'donny hathaway') - 1
CREATE TABLE table_35947 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Who was the second when Ilian Kirilov was the lead?
SELECT "Second" FROM table_35947 WHERE "Lead" = 'ilian kirilov'
CREATE TABLE table_10966926_2 ( height VARCHAR, weight VARCHAR )
What is the height of the person that weighs 320 pounds?
SELECT height FROM table_10966926_2 WHERE weight = 320
CREATE TABLE table_54191 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Result" text, "Venue" text )
Which opponent has a Season of 2011/12?
SELECT "Opponent" FROM table_54191 WHERE "Season" = '2011/12'
CREATE TABLE table_75926 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What School/Club did Dominique Wilkins play for?
SELECT "School/Club Team" FROM table_75926 WHERE "Player" = 'dominique wilkins'
CREATE TABLE table_46163 ( "Name" text, "GP-GS" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
WHAT IS THE LOSS WITH AN AVERAGE OF 89.9?
SELECT SUM("Loss") FROM table_46163 WHERE "Avg/G" = '89.9'
CREATE TABLE table_16729930_18 ( socket VARCHAR, frequency VARCHAR )
What is the socket for microprocessors with a frequency of 1.3 ghz?
SELECT socket FROM table_16729930_18 WHERE frequency = "1.3 GHz"
CREATE TABLE table_78549 ( "District" real, "County(s) Represented" text, "Member Senator" text, "Party" text, "First Elected" real )
What district for ulysses currie?
SELECT "District" FROM table_78549 WHERE "Member Senator" = 'ulysses currie'
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, ...
what flights are available from BOSTON to DENVER today
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 1 AND date_day.month_number = 8 AND dat...
CREATE TABLE table_19886463_1 ( round_winner VARCHAR, circuit VARCHAR )
Who is the round winner of the wanneroo park circuit?
SELECT round_winner FROM table_19886463_1 WHERE circuit = "Wanneroo Park"
CREATE TABLE table_name_26 ( result VARCHAR, game VARCHAR )
What was the result of game 1?
SELECT result FROM table_name_26 WHERE game = "game 1"
CREATE TABLE country ( id number, name text ) CREATE TABLE league ( id number, country_id number, name text ) CREATE TABLE sqlite_sequence ( name text, seq text ) CREATE TABLE player ( id number, player_api_id number, player_name text, player_fifa_api_id number, birthd...
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
SELECT player_api_id FROM player WHERE height >= 180 INTERSECT SELECT player_api_id FROM player_attributes WHERE overall_rating > 85
CREATE TABLE table_37073 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
Which opponent has a loss of trout (7-4)?
SELECT "Opponent" FROM table_37073 WHERE "Loss" = 'trout (7-4)'
CREATE TABLE table_name_61 ( spins__since_1998__source VARCHAR, ccm_chart VARCHAR, peak_pos VARCHAR )
How many Spins sources have a CCM Chart of CHR with a peak position less than 1?
SELECT COUNT(spins__since_1998__source) AS :_mediabase FROM table_name_61 WHERE ccm_chart = "chr" AND peak_pos < 1
CREATE TABLE table_57649 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text )
What name has a listed of 03/31/1989 in spartanburg county?
SELECT "Name" FROM table_57649 WHERE "Listed" = '03/31/1989' AND "County" = 'spartanburg'
CREATE TABLE table_49165 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What's the to par of the United States with the score of 71-71=142?
SELECT "To par" FROM table_49165 WHERE "Country" = 'united states' AND "Score" = '71-71=142'
CREATE TABLE table_20962 ( "Solution" text, "Other Name" text, "[Na + ](mmol/L)" real, "[Cl - ](mmol/L)" real, "[Glucose](mmol/L)" real, "[Glucose](mg/dl)" real )
Name the other name where na plus is 77
SELECT "Other Name" FROM table_20962 WHERE "[Na + ](mmol/L)" = '77'
CREATE TABLE table_4163 ( "Province" text, "Number of Dairy Farms" real, "Number of Dairy Cows" real, "Production (hectolitres)" real, "Dairy Cows per Farm" real, "Production (hectolitres) per Farm" real )
what is the least amount of cattle head
SELECT MIN("Number of Dairy Cows") FROM table_4163
CREATE TABLE table_name_22 ( award VARCHAR, category VARCHAR )
Which award show had the category of best supporting actress?
SELECT award FROM table_name_22 WHERE category = "best supporting actress"
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, ...
SELECT * WHERE `ClosedDate` is NOT NULL;.
SELECT * FROM Posts WHERE NOT 'ClosedDate' IS NULL
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
Were I to declare a major in WOMENSTD , which classes would I need to take ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%WOMENSTD%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
CREATE TABLE table_39738 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the lowest Top-25 for the open championship, with a Top-10 larger than 3?
SELECT MIN("Top-25") FROM table_39738 WHERE "Tournament" = 'the open championship' AND "Top-10" > '3'
CREATE TABLE table_18506 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidate was re-elected in the Louisiana 5 district?
SELECT "Candidates" FROM table_18506 WHERE "Result" = 'Re-elected' AND "District" = 'Louisiana 5'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients whose diagnoses icd9 code is 27801?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "27801"
CREATE TABLE table_44957 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
WHAT PLACE DOES TOM LEHMAN HAVE?
SELECT "Place" FROM table_44957 WHERE "Player" = 'tom lehman'
CREATE TABLE table_30159 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production" text, "U.S. viewers (in millions)" text )
What are the original air dates for episodes directed by fred toye?
SELECT "Original air date" FROM table_30159 WHERE "Directed by" = 'Fred Toye'
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 age is less than 45 and procedure long title is open biopsy of liver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Open biopsy of liver"
CREATE TABLE table_34307 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team" text )
Can you tell me the College/Junior/Club Team that has the Position of defence, and the Nationality of czechoslovakia?
SELECT "College/Junior/Club Team" FROM table_34307 WHERE "Position" = 'defence' AND "Nationality" = 'czechoslovakia'
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what was the last time patient 78086 was prescribed medication?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78086) ORDER BY prescriptions.startdate DESC LIMIT 1
CREATE TABLE table_name_48 ( identity VARCHAR, builder VARCHAR )
What is the identity of the brighton works built train?
SELECT identity FROM table_name_48 WHERE builder = "brighton works"
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...
show me the number of patients who are taking tramadol medication and were admitted in hospital before 2163.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2163" AND prescriptions.drug = "traMADOL"
CREATE TABLE table_202_122 ( id number, "rank" number, "title" text, "studio" text, "actor/actress" text, "director" text, "gross" text )
how many films star eddie murphy ?
SELECT COUNT("title") FROM table_202_122 WHERE "actor/actress" = 'eddie murphy'
CREATE TABLE table_26805 ( "School" text, "Mascot" text, "Location" text, "Founded" real, "Entered ISL" real, "Grades" text, "Number of Students" text, "Varsity Teams" real )
how many places have 17 varsity teams?
SELECT COUNT("Location") FROM table_26805 WHERE "Varsity Teams" = '17'
CREATE TABLE table_name_89 ( source VARCHAR, name VARCHAR )
What was the source for the person named Cresswell?
SELECT source FROM table_name_89 WHERE name = "cresswell"
CREATE TABLE customers ( customer_id VARCHAR, customer_name VARCHAR ) CREATE TABLE customers_policies ( customer_id VARCHAR, policy_id VARCHAR ) CREATE TABLE available_policies ( policy_type_code VARCHAR, policy_id VARCHAR )
What are all the policy types of the customer named 'Dayana Robel'?
SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel"
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
has any 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg/5ml po susp been prescribed to patient 004-66442 until 03/2102?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-66442')) AND medication.drugname = '30 ml cup : alum & mag hydroxide-s...
CREATE TABLE table_69377 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text )
What was the opponent on August 29?
SELECT "Opponent" FROM table_69377 WHERE "Date" = 'august 29'
CREATE TABLE table_38319 ( "Round" real, "Circuit" text, "State/Territory" text, "Date" text, "Winning driver" text )
What is the state the winning driver Jamie Whincup from in round 2?
SELECT "State/Territory" FROM table_38319 WHERE "Winning driver" = 'jamie whincup' AND "Round" = '2'
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
Give me a bar chart showing the number of films for each director, rank in ascending by the Y-axis.
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by)
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, les...
How many lessons have been cancelled?
SELECT COUNT(*) FROM lessons WHERE lesson_status_code = "Cancelled"
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and list from high to low by the Team_ID.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC
CREATE TABLE table_9757 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What year or years did arnold palmer win?
SELECT "Year(s) won" FROM table_9757 WHERE "Player" = 'arnold palmer'
CREATE TABLE table_51001 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
In what round was a player from Michigan selected?
SELECT MAX("Round") FROM table_51001 WHERE "School/Club Team" = 'michigan'
CREATE TABLE table_27941 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What is the description of the measure that got 78.27% yes votes?
SELECT "description" FROM table_27941 WHERE "% YES" = '78.27%'
CREATE TABLE table_67537 ( "Country" text, "2012" real, "2011" real, "2010" real, "2009" real, "2008" real, "2007" real, "2006" real, "2005" real, "2004" real, "2003" real, "2002" real, "2001" real, "2000" real, "1999" real, "1998" real, "1997" real, ...
what is the listing for 2012 when 2004 is more than 0, 2008 is more than 1 1994 is 8 and 2005 is less than 11?
SELECT MIN("2012") FROM table_67537 WHERE "2004" > '0' AND "2008" > '1' AND "1994" = '8' AND "2005" < '11'
CREATE TABLE table_78398 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method when the time was 1:01?
SELECT "Method" FROM table_78398 WHERE "Time" = '1:01'
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 demographic ( subject_id text, hadm_id t...
count the number of patients whose death status is 0 and procedure long title is endoscopic removal of stone(s) from biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
CREATE TABLE table_42482 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text )
What is the Song with an Issue Date(s) that is 19 june?
SELECT "Song" FROM table_42482 WHERE "Issue Date(s)" = '19 june'
CREATE TABLE table_29152820_1 ( no_in_season VARCHAR, no_in_series VARCHAR )
How many episodes are 122 in the series?
SELECT COUNT(no_in_season) FROM table_29152820_1 WHERE no_in_series = 122
CREATE TABLE table_name_24 ( result VARCHAR, date VARCHAR )
What is the Result from the Date that is December 8, 1963?
SELECT result FROM table_name_24 WHERE date = "december 8, 1963"
CREATE TABLE table_12070 ( "Year" real, "Movie title" text, "Role" text, "Direction" text, "Screenplay" text )
Which role did joemon play before 1991?
SELECT "Role" FROM table_12070 WHERE "Year" < '1991' AND "Direction" = 'joemon'
CREATE TABLE table_name_6 ( laps INTEGER, driver VARCHAR, grid VARCHAR )
How many laps did Jo Bonnier driver when the grid number was smaller than 11?
SELECT SUM(laps) FROM table_name_6 WHERE driver = "jo bonnier" AND grid < 11
CREATE TABLE table_name_91 ( points VARCHAR, chassis VARCHAR, year VARCHAR )
What is the Point of Chassis of Lancia d50 in 1954
SELECT points FROM table_name_91 WHERE chassis = "lancia d50" AND year = 1954
CREATE TABLE Lessons ( lesson_id INTEGER, customer_id INTEGER, lesson_status_code VARCHAR(15), staff_id INTEGER, vehicle_id INTEGER, lesson_date DATETIME, lesson_time VARCHAR(10), price DOUBLE ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), ...
For each customer status code, how many customers are classified that way Visualize by bar chart, and display in ascending by the bar.
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code
CREATE TABLE table_62305 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which Team 1, has Team 2, Slovan Liberec?
SELECT "Team 1" FROM table_62305 WHERE "Team 2" = 'slovan liberec'
CREATE TABLE table_62464 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" text, "Location of the Church" text )
What is the name of the church that is located in flor ?
SELECT "Church Name" FROM table_62464 WHERE "Location of the Church" = 'florø'
CREATE TABLE table_name_99 ( money___ INTEGER, country VARCHAR )
What is the highest amount of money a play from Scotland United States has?
SELECT MAX(money___) AS $__ FROM table_name_99 WHERE country = "scotland united states"
CREATE TABLE table_50102 ( "Order" real, "Name dates" text, "Princess Royal from (date) to (date)" text, "Parent" text, "Date married" text, "Husband dates" text )
Who was the husband date that was married in 1858?
SELECT "Husband dates" FROM table_50102 WHERE "Date married" = '1858'
CREATE TABLE table_76066 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text )
What is the team #2 with Deport as team #1?
SELECT "Team #2" FROM table_76066 WHERE "Team #1" = 'deport'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
calculate the number of patients treated with benz100 and aged below 67.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.formulary_drug_cd = "BENZ100"
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary V...
Find the dates of assessment notes for students with first name 'Fanny', and count them by a bar chart, and order from low to high by the how many date of notes.
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes)
CREATE TABLE table_204_511 ( id number, "number" number, "driver" text, "entrant" text, "chassis" text, "engine" text, "tyre" text )
troy ruttman was entered by the same person as which other driver ?
SELECT "driver" FROM table_204_511 WHERE "driver" <> 'troy ruttman' AND "entrant" = (SELECT "entrant" FROM table_204_511 WHERE "driver" = 'troy ruttman')
CREATE TABLE table_9216 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
what is the surface when the winner and score is gustavo kuerten 6-4, 7-5, 7-6(6)?
SELECT "Surface" FROM table_9216 WHERE "Winner and score" = 'gustavo kuerten 6-4, 7-5, 7-6(6)'
CREATE TABLE table_203_417 ( id number, "rnd." number, "pick #" number, "nfl team" text, "player" text, "pos." text, "college" text, "conf." text, "notes" text )
who is the first detroit lions pick not from the pac-10 ?
SELECT "player" FROM table_203_417 WHERE "nfl team" = 'detroit lions' AND "conf." <> 'pac-10' ORDER BY "pick #" LIMIT 1
CREATE TABLE table_74957 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "ICFC" real, "FCWC" real, "Total" real )
What is the highest number of FCWC in the Years of 1958 1965, and an ICFC smaller than 11?
SELECT MAX("FCWC") FROM table_74957 WHERE "Years" = '1958–1965' AND "ICFC" < '11'
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text )
What is the name of the highest mountain?
SELECT name FROM mountain ORDER BY height DESC LIMIT 1
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
A bar chart about how many wines are there for each grape?
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape
CREATE TABLE table_75665 ( "Wrestler" text, "Reign" text, "Days held" text, "Location" text, "Event" text )
Where did the wrestler, super parka, with the title with a reign of 2?
SELECT "Location" FROM table_75665 WHERE "Wrestler" = 'super parka' AND "Reign" = '2'
CREATE TABLE table_58876 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
When was Mario Elie picked in a round before 7?
SELECT MAX("Pick") FROM table_58876 WHERE "Player" = 'mario elie' AND "Round" < '7'
CREATE TABLE table_204_590 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text, "avg. attendance" number )
what was the number of times usl a league did not qualify for the playoffs ?
SELECT COUNT(*) FROM table_204_590 WHERE "league" = 'usl a-league' AND "playoffs" = 'did not qualify'
CREATE TABLE table_14911 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
When did sony music direct a label?
SELECT "Date" FROM table_14911 WHERE "Label" = 'sony music direct'
CREATE TABLE table_name_71 ( method VARCHAR, opponent VARCHAR )
I want to know the method for opponent of jerry bohlander
SELECT method FROM table_name_71 WHERE opponent = "jerry bohlander"
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Most viewed posts of me.
SELECT Id AS "post_link", ViewCount, Score, Tags FROM Posts WHERE Posts.OwnerUserId = @UserId AND ViewCount > 0 ORDER BY ViewCount DESC, Score DESC LIMIT 20
CREATE TABLE table_1769428_2 ( car__number VARCHAR, winning_driver VARCHAR )
How many car numbers were listed for Rusty Wallace?
SELECT COUNT(car__number) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
give me the top four most common output events in this year.
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ...