table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Visualize the title and and the total star rating of the movie using a bar chart, show from low to high by the total number.
SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY SUM(stars)
CREATE TABLE table_76789 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
Which College has a Position of ol, and a Pick # smaller than 32?
SELECT "College" FROM table_76789 WHERE "Position" = 'ol' AND "Pick #" < '32'
CREATE TABLE table_name_33 ( competition VARCHAR, score VARCHAR )
What was the competition when the score was 3-0?
SELECT competition FROM table_name_33 WHERE score = "3-0"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients whose diagnoses icd9 code is 30400 and lab test abnormal status is delta?
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 = "30400" AND lab.flag = "delta"
CREATE TABLE table_43562 ( "1946 Nos" text, "1947 Nos" text, "Date" real, "Built at" text, "LMS Nos" text, "BR Nos" text )
Which 1947 Nos has a BR Nos of 48730-9?
SELECT "1947 Nos" FROM table_43562 WHERE "BR Nos" = '48730-9'
CREATE TABLE table_name_31 ( imed_avicenna_listed VARCHAR, established VARCHAR, degree VARCHAR, regional_offshore VARCHAR, country_territory VARCHAR )
What is the imed/avicenna listed for a medical school offshore in saint kitts and nevis which was established before 2000 and will give you an MD?
SELECT imed_avicenna_listed FROM table_name_31 WHERE regional_offshore = "offshore" AND country_territory = "saint kitts and nevis" AND degree = "md" AND established < 2000
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
Are any professors appointed for Winter Other classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
CREATE TABLE table_75989 ( "Source" text, "Date" text, "Goberman" text, "Loera" text, "Merkley" text, "Neville" text, "Novick" text, "Obrist" text, "Other/ Undecided" text )
Which Loera has a Source of surveyusa, and a Date of may 16 may 18, 2008?
SELECT "Loera" FROM table_75989 WHERE "Source" = 'surveyusa' AND "Date" = 'may 16–may 18, 2008'
CREATE TABLE table_19102 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many points are there when the lost is 7?
SELECT "Points for" FROM table_19102 WHERE "Lost" = '7'
CREATE TABLE table_name_86 ( date VARCHAR, record VARCHAR )
What was the date of the game when the record was 70-74?
SELECT date FROM table_name_86 WHERE record = "70-74"
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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
For upper-level classes , do they all have exams ?
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
CREATE TABLE table_name_35 ( yonguk VARCHAR, halang VARCHAR )
Which Yonguk has a Halang of ran ?
SELECT yonguk FROM table_name_35 WHERE halang = "ran¹"
CREATE TABLE table_15755 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real )
What is the highest Total with a League Cup greater than 0, Player Gary Harkins, and Scottish Cup greater than 0?
SELECT MAX("Total") FROM table_15755 WHERE "League Cup" > '0' AND "Player" = 'gary harkins' AND "Scottish Cup" > '0'
CREATE TABLE table_56228 ( "D 50" text, "D 49" text, "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
What is the D 42 when the D 50 is d 31?
SELECT "D 42" FROM table_56228 WHERE "D 50" = 'd 31'
CREATE TABLE table_58447 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the date of Competition of 2008 africa cup of nations?
SELECT "Date" FROM table_58447 WHERE "Competition" = '2008 africa cup of nations'
CREATE TABLE table_796 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who were the candidates in the district of South Carolina 5?
SELECT "Candidates" FROM table_796 WHERE "District" = 'South Carolina 5'
CREATE TABLE table_name_76 ( name VARCHAR, species_authority VARCHAR )
What is the name for the species Authority of sigmodon hispidus say & ord, 1825?
SELECT name FROM table_name_76 WHERE species_authority = "sigmodon hispidus say & ord, 1825"
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...
A pie chart shows the proportion of ACC_Regular_Season and School_ID.
SELECT ACC_Regular_Season, School_ID FROM basketball_match
CREATE TABLE table_13012165_1 ( maryland VARCHAR, pennsylvania VARCHAR )
Who played in Maryland the same year that Deep Run Valley LL Hilltown played in Pennsylvania?
SELECT maryland FROM table_13012165_1 WHERE pennsylvania = "Deep Run Valley LL Hilltown"
CREATE TABLE table_76772 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
How much Gain has a Long of 29, and an Avg/G smaller than 33.7?
SELECT COUNT("Gain") FROM table_76772 WHERE "Long" = '29' AND "Avg/G" < '33.7'
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...
what is discharge location and discharge time of subject id 29961?
SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "29961"
CREATE TABLE table_46431 ( "Club" text, "Location" text, "Current manager" text, "Team captain" text, "Stadium" text, "Capacity" real )
Who is the team captain of the Guldensporen Stadion with a stadium capacity larger than 12,919?
SELECT "Team captain" FROM table_46431 WHERE "Capacity" > '12,919' AND "Stadium" = 'guldensporen stadion'
CREATE TABLE table_79744 ( "Name" text, "Birth year and age" text, "Net worth US$ (billions)" real, "Citizenship" text, "Source" text )
What's the source of wealth of the person worth $17 billion?
SELECT "Source" FROM table_79744 WHERE "Net worth US$ (billions)" = '17'
CREATE TABLE table_27712702_11 ( game INTEGER, record VARCHAR )
what was the game number where the record was 46 24?
SELECT MIN(game) FROM table_27712702_11 WHERE record = "46–24"
CREATE TABLE table_25446 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the surface when the us open is the championship in the year 1979?
SELECT "Surface" FROM table_25446 WHERE "Championship" = 'US Open' AND "Year" = '1979'
CREATE TABLE table_name_62 ( silver INTEGER, nation VARCHAR, gold VARCHAR, bronze VARCHAR, total VARCHAR )
what is the most silver when bronze is more than 0, total is more than 1, gold is more than 0 and the nation is china (chn)?
SELECT MAX(silver) FROM table_name_62 WHERE bronze > 0 AND total > 1 AND gold > 0 AND nation = "china (chn)"
CREATE TABLE table_46927 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
If the player is Corey Pavin when he had a To par of over 7, what was the sum of his totals?
SELECT SUM("Total") FROM table_46927 WHERE "To par" > '7' AND "Player" = 'corey pavin'
CREATE TABLE table_name_29 ( release_date VARCHAR, sspec_number VARCHAR )
What's the release date for the processor spec number SLBEQ(d0)?
SELECT release_date FROM table_name_29 WHERE sspec_number = "slbeq(d0)"
CREATE TABLE Students ( first_name VARCHAR, student_id VARCHAR ) CREATE TABLE Student_Addresses ( student_id VARCHAR )
What are the id and first name of the student whose addresses have the highest average monthly rental?
SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
CREATE TABLE table_201_39 ( id number, "no" number, "title" text, "directed by" text, "released" number )
what was the last title that sid marcus directed ?
SELECT "title" FROM table_201_39 WHERE "directed by" = 'sid marcus' ORDER BY "no" DESC LIMIT 1
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 ( ...
How many patients had undergone other radiotherapeutic procedures?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other radiotherapeutic procedure"
CREATE TABLE table_name_32 ( pick VARCHAR, college VARCHAR )
WHAT IS THE TOTAL PICK FOR BOSTON COLLEGE?
SELECT COUNT(pick) FROM table_name_32 WHERE college = "boston college"
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
Show me about the correlation between student_id and address_id , and group by attribute other_details in a scatter chart.
SELECT student_id, address_id FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
CREATE TABLE table_75321 ( "Name" text, "Birth" text, "Marriage" text, "Became Consort" text, "Coronation" text, "Ceased to be Consort" text, "Death" text, "Spouse" text )
On what date did James II take a consort?
SELECT "Became Consort" FROM table_75321 WHERE "Spouse" = 'james ii'
CREATE TABLE table_name_12 ( date VARCHAR, set_1 VARCHAR, set_3 VARCHAR )
What date was the set 1 25 23, and a Set 3 of 25 14?
SELECT date FROM table_name_12 WHERE set_1 = "25–23" AND set_3 = "25–14"
CREATE TABLE table_31404 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight ( lb. )" real, "Year" text, "Hometown" text, "Previous School" text )
What year was player number 10?
SELECT "Year" FROM table_31404 WHERE "#" = '10'
CREATE TABLE table_67242 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What entrant had a Maserati 250F chassis and fewer than 6 points before 1957?
SELECT "Entrant" FROM table_67242 WHERE "Chassis" = 'maserati 250f' AND "Year" < '1957' AND "Points" < '6'
CREATE TABLE table_64388 ( "Rank" real, "Heat" real, "Athlete" text, "Country" text, "Time" real )
what is the heat when the athlete is anita pistone?
SELECT SUM("Heat") FROM table_64388 WHERE "Athlete" = 'anita pistone'
CREATE TABLE table_73084 ( "Episode title" text, "Subject" text, "Music by" text, "Lyrics by" text, "Performed by" text, "First aired" text )
When zachary sanders is the performer how many first aired are there?
SELECT COUNT("First aired") FROM table_73084 WHERE "Performed by" = 'Zachary Sanders'
CREATE TABLE table_2818164_5 ( production_code INTEGER, no_in_series VARCHAR )
What is the production code for episode 96 in the series?
SELECT MIN(production_code) FROM table_2818164_5 WHERE no_in_series = "96"
CREATE TABLE table_14903491_1 ( womens_singles VARCHAR, womens_doubles VARCHAR )
Name the womens singles for raina tzvetkova petya nedelcheva
SELECT womens_singles FROM table_14903491_1 WHERE womens_doubles = "Raina Tzvetkova Petya Nedelcheva"
CREATE TABLE table_23293785_2 ( date VARCHAR, race_total_pts_ VARCHAR )
How many dates have a total points for race of 180?
SELECT COUNT(date) FROM table_23293785_2 WHERE race_total_pts_ = 180
CREATE TABLE table_23721 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text )
How many players had 6 180s?
SELECT COUNT("Player") FROM table_23721 WHERE "180s" = '6'
CREATE TABLE table_67960 ( "Year" real, "Population (Region total)" real, "Population (Stanthorpe)" real, "Population (Warwick)" real, "Population (Allora)" real, "Population (Glengallan)" real, "Population (Rosenthal)" real )
How many people in Stanthorpe had a population matching Rosenthan of 1,553 and a population greater than 25,917?
SELECT COUNT("Population (Stanthorpe)") FROM table_67960 WHERE "Population (Rosenthal)" = '1,553' AND "Population (Region total)" > '25,917'
CREATE TABLE table_77276 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the score for the match where the home team was Leicester City?
SELECT "Score" FROM table_77276 WHERE "Home team" = 'leicester city'
CREATE TABLE table_39189 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What is the highest round for the Minnesota Junior Stars (Mjhl)?
SELECT MAX("Round") FROM table_39189 WHERE "College/Junior/Club Team (League)" = 'minnesota junior stars (mjhl)'
CREATE TABLE table_69928 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
what was the opponent on november 14, 2005?
SELECT "Opponent" FROM table_69928 WHERE "Date" = 'november 14, 2005'
CREATE TABLE table_203_420 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "home team" text )
which stadium has the largest number of seats ?
SELECT "stadium" FROM table_203_420 ORDER BY "capacity" DESC LIMIT 1
CREATE TABLE table_name_54 ( centerfold_model VARCHAR, date VARCHAR )
Which Centerfold model has a Date of 3-01?
SELECT centerfold_model FROM table_name_54 WHERE date = "3-01"
CREATE TABLE table_name_47 ( tournament VARCHAR, finalist VARCHAR )
WHich Tournament has a Finalist of marat safin (12)?
SELECT tournament FROM table_name_47 WHERE finalist = "marat safin (12)"
CREATE TABLE table_name_8 ( time_retired VARCHAR, grid VARCHAR )
What is the time/retired for grid 5?
SELECT time_retired FROM table_name_8 WHERE grid = 5
CREATE TABLE table_29217650_1 ( movies VARCHAR, december_25 VARCHAR )
What film earmed p3.2 million on December 25?
SELECT movies FROM table_29217650_1 WHERE december_25 = "P3.2 million"
CREATE TABLE table_32038 ( "Manager" text, "Ukraine career" text, "Played" real, "Drawn" real, "Lost" real, "Win %" real )
What years had a manager who lost more than 1 and drawn more than 11?
SELECT "Ukraine career" FROM table_32038 WHERE "Lost" > '1' AND "Drawn" > '11'
CREATE TABLE table_5868 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the NHL team of dave murphy?
SELECT "NHL team" FROM table_5868 WHERE "Player" = 'dave murphy'
CREATE TABLE table_12077 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
Which Round has a Club team of brandon wheat kings (whl)?
SELECT "Round" FROM table_12077 WHERE "Club team" = 'brandon wheat kings (whl)'
CREATE TABLE table_name_88 ( authority VARCHAR, name VARCHAR )
Name the authority for morrinsville college
SELECT authority FROM table_name_88 WHERE name = "morrinsville college"
CREATE TABLE table_name_50 ( week_4 VARCHAR, week_9 VARCHAR )
What kind of Week 4 has a Week 9 of all housemates?
SELECT week_4 FROM table_name_50 WHERE week_9 = "all housemates"
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number )
which school has placed fourth the most times ?
SELECT "team" FROM table_203_502 ORDER BY "fourth place" DESC LIMIT 1
CREATE TABLE table_49604 ( "Place" text, "Country" text, "Qualifying Grand Prix" text, "Class" text, "Dates" text )
What is Class, when Dates is '22 April - 3 May 2009'?
SELECT "Class" FROM table_49604 WHERE "Dates" = '22 april - 3 may 2009'
CREATE TABLE table_54383 ( "Rank" text, "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the highest silver for table tennis and bronze more than 0
SELECT MAX("Silver") FROM table_54383 WHERE "Sport" = 'table tennis' AND "Bronze" > '0'
CREATE TABLE table_203_231 ( id number, "season" text, "tier" number, "division" text, "place" text )
how many years were they in tier 3
SELECT COUNT("season") FROM table_203_231 WHERE "tier" = 3
CREATE TABLE table_134987_3 ( target_city__market VARCHAR, city_of_license VARCHAR, format VARCHAR )
What are the market city/market(s) for Rapid City Alternative format?
SELECT target_city__market FROM table_134987_3 WHERE city_of_license = "Rapid City" AND format = "Alternative"
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ...
Find questions that were closed and have body like 'How do I get started'.
SELECT COUNT(q.Id) FROM Posts AS q INNER JOIN PostHistory AS ph ON q.Id = ph.PostId WHERE q.PostTypeId = 1 AND NOT ClosedDate IS NULL AND q.Body LIKE '%started%'
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...
list the top four most common drugs that patients were prescribed with in the same hospital visit after they were prescribed with ns 0.9% since 2102.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ns 0.9%' AND STR...
CREATE TABLE table_204_12 ( id number, "area served" text, "city of license" text, "vc" number, "rf" number, "callsign" text, "network" text, "notes" text )
which city is served by the most full power stations ?
SELECT "city of license" FROM table_204_12 GROUP BY "city of license" ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
find out the average age of elective admission patients who stayed in the hospital for 16 days.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "16"
CREATE TABLE school ( School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR ) CREATE TABLE budget ( school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR )
List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.
SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted
CREATE TABLE table_name_56 ( date VARCHAR, attendance VARCHAR )
What day had 37,500 attending?
SELECT date FROM table_name_56 WHERE attendance = "37,500"
CREATE TABLE table_name_25 ( süskən VARCHAR, malax VARCHAR )
What is the S sk n village with a Malax village me ba ?
SELECT süskən FROM table_name_25 WHERE malax = "meşəbaş"
CREATE TABLE table_48494 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the attendance for the game against the Houston Oilers?
SELECT "Attendance" FROM table_48494 WHERE "Opponent" = 'houston oilers'
CREATE TABLE table_4871 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team that features a home team of south melbourne?
SELECT "Away team score" FROM table_4871 WHERE "Home team" = 'south melbourne'
CREATE TABLE table_29836 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
what was the location for charlotte?
SELECT "Location Attendance" FROM table_29836 WHERE "Team" = 'Charlotte'
CREATE TABLE table_name_41 ( crowd INTEGER, away_team VARCHAR )
What is the Crowd number for the Away team of Richmond?
SELECT SUM(crowd) FROM table_name_41 WHERE away_team = "richmond"
CREATE TABLE table_29437 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
who directed the episode that elaine ko wrote?
SELECT "Directed by" FROM table_29437 WHERE "Written by" = 'Elaine Ko'
CREATE TABLE table_35869 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
Which event has 12-1 as a record?
SELECT "Event" FROM table_35869 WHERE "Record" = '12-1'
CREATE TABLE table_203_476 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text )
what are the number of titles with a date of november ?
SELECT COUNT("title (latin)") FROM table_203_476 WHERE "date" = 11
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
when did patient 1205 receive a first diagnosis of twin-mate lb-in hos w cs since 4 years ago?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'twin-mate lb-in hos w cs') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND DATETIM...
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 lab ( labid numbe...
did sodium chloride 0.9 % ij soln, lisinopril 10 mg po tabs, or potassium chloride 20 meq in be prescribed to patient 016-9636 on their current hospital visit?
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 = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn...
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Show the total number from each allergy, and sort bars in desc order.
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy DESC
CREATE TABLE table_name_64 ( election INTEGER, mayor VARCHAR, inhabitants VARCHAR )
In what Election year was Adalberto Mosaner the Mayor with less than 16,170 Inhabitants?
SELECT SUM(election) FROM table_name_64 WHERE mayor = "adalberto mosaner" AND inhabitants < 16 OFFSET 170
CREATE TABLE table_52259 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
what is the venue when the home team is melbourne?
SELECT "Venue" FROM table_52259 WHERE "Home team" = 'melbourne'
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,...
which patients have lab test item id 50915?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50915"
CREATE TABLE table_name_98 ( runs VARCHAR, batting_partners VARCHAR )
How many runs did Vijay Hazare and Gul Mohammad score?
SELECT runs FROM table_name_98 WHERE batting_partners = "vijay hazare and gul mohammad"
CREATE TABLE table_58504 ( "Grid" real, "Driver" text, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text )
Which constructor has Chuck Weyant as a driver, 45 laps, and a qual of less than 142.29?
SELECT "Constructor" FROM table_58504 WHERE "Laps" = '45' AND "Qual" < '142.29' AND "Driver" = 'chuck weyant'
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 microlab ( microl...
how many hours have passed since patient 004-64091 first received the procedure in the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091...
CREATE TABLE table_40419 ( "Advocate" text, "Wins" real, "Losses" real, "Ties" real, "Poll wins" real, "Poll losses" real )
What is the highest poll of the advocate Andy Kindler with poll losses greater than 2 and ties less than 0?
SELECT MAX("Poll wins") FROM table_40419 WHERE "Poll losses" > '2' AND "Advocate" = 'andy kindler' AND "Ties" < '0'
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, order by the x axis in ascending.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
CREATE TABLE table_27501971_2 ( categoría VARCHAR, country VARCHAR )
What was the categoria when E.E.U.U was the country?
SELECT categoría FROM table_27501971_2 WHERE country = "E.E.U.U"
CREATE TABLE table_name_90 ( home_team VARCHAR, tie_no VARCHAR )
What was the Home team in Tie no 16?
SELECT home_team FROM table_name_90 WHERE tie_no = "16"
CREATE TABLE table_name_23 ( height VARCHAR, date_of_birth VARCHAR )
What is the Height of the Player with a Date of Birth of 1979-06-12?
SELECT height FROM table_name_23 WHERE date_of_birth = "1979-06-12"
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
Show the number of professors who is in office DRE 102 hired in each month with a bar chart.
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
Questions and Answers per Day on a Monthly Basis.
SELECT (SUM(pd.Questions) * 1.00 / COUNT(pd.Date)) AS "questions_per_day", (SUM(pd.Answers) * 1.00 / COUNT(pd.Date)) AS "answers_per_day", TIME_TO_STR(pd.Date, '%m') AS "month", TIME_TO_STR(pd.Date, '%Y') AS "year" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", SUM(CASE WHEN p.PostTypeId...
CREATE TABLE table_28211674_3 ( mixed_restricted VARCHAR, mixed_veteran VARCHAR, u21_womens VARCHAR )
Who won the mixed restricted when Tomasz Rzeszotko won the mixed veteran and Karina Le Fevre won the U21 womens?
SELECT mixed_restricted FROM table_28211674_3 WHERE mixed_veteran = "Tomasz Rzeszotko" AND u21_womens = "Karina Le Fevre"
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, ...
show me one way flights from MILWAUKEE to ORLANDO wednesday
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 23 AND DATE_DAY_0.month_...
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives...
Find the number of distinct gender for dorms.
SELECT COUNT(DISTINCT gender) FROM dorm
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
what difference is in the lactate value of patient 016-18150 second measured on the last hospital visit compared to the value first measured on the last hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text )
Return the different nominees of musicals that have an award that is not the Tony Award.
SELECT DISTINCT nominee FROM musical WHERE award <> "Tony Award"
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details t...
What are the names and buying prices of all the products?
SELECT product_name, typical_buying_price FROM products
CREATE TABLE table_name_32 ( frequency VARCHAR, power VARCHAR, channel VARCHAR )
On channel 32, when the power is 32 kW horizontal, what is the frequency?
SELECT frequency FROM table_name_32 WHERE power = "32 kw horizontal" AND channel = 32
CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE player_coach ( Pl...
Show different occupations along with the number of players in each occupation Show bar chart, show in ascending by the bar.
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY Occupation