table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_33462 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
Where does the network Star Cricket originate?
SELECT "Origin of Programming" FROM table_33462 WHERE "Genre" = 'cricket' AND "Network" = 'star cricket'
CREATE TABLE table_name_70 ( title VARCHAR, year VARCHAR )
What is the title of the TV series in 2012?
SELECT title FROM table_name_70 WHERE year = "2012"
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the first time patient 11362 had a sodium test in 11/this year?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_...
CREATE TABLE table_25799 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who scored the highest points and how much against the raptors?
SELECT "High points" FROM table_25799 WHERE "Team" = 'Raptors'
CREATE TABLE table_23183 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
How many different enrollment numbers are there for the school whose students are nicknamed Barons?
SELECT COUNT("Enrollment") FROM table_23183 WHERE "Nickname" = 'Barons'
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furnit...
Give me the names and prices of furnitures which some companies are manufacturing with a pie chart.
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
CREATE TABLE table_29651 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text )
What was the result for Barreto when his song choice was 'Olhar 43'?
SELECT "Result" FROM table_29651 WHERE "Song Choice" = 'Olhar 43'
CREATE TABLE table_43003 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text )
WHo is Winner/2nd that has c. symons?
SELECT "Winner/2nd" FROM table_43003 WHERE "Jockey" = 'c. symons'
CREATE TABLE table_25355501_2 ( march_27_29 VARCHAR, june_10_11 VARCHAR )
march 27-29 where june 10-11 is 127?
SELECT march_27_29 FROM table_25355501_2 WHERE june_10_11 = "127"
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
How many courses each teacher taught? Show me a bar chart grouping by instructor's first name, order Y in descending order.
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC
CREATE TABLE table_204_675 ( id number, "year" number, "game of the year" text, "abstract strategy" text, "advanced strategy" text, "family" text, "family card" text, "family strategy" text, "party" text, "puzzle" text, "word" text, "historical simulation" text, "othe...
how many puzzles are on the chart ?
SELECT COUNT("puzzle") FROM table_204_675
CREATE TABLE table_32628 ( "Rank" real, "Player" text, "Nation" text, "Games" real, "Goals" real, "Years" text )
What is the smallest number of goals for the player from 2008-present named tony beltran, ranked lower than 7?
SELECT MIN("Goals") FROM table_32628 WHERE "Years" = '2008-present' AND "Player" = 'tony beltran' AND "Rank" > '7'
CREATE TABLE table_name_13 ( score VARCHAR, record VARCHAR )
What was the score of the game with a record of 33 25 9?
SELECT score FROM table_name_13 WHERE record = "33–25–9"
CREATE TABLE table_name_63 ( election VARCHAR, outcome_of_election VARCHAR, number_of_votes VARCHAR )
What is the election with an outcome of ndc opposition and 2,728,241 votes?
SELECT election FROM table_name_63 WHERE outcome_of_election = "ndc opposition" AND number_of_votes = "2,728,241"
CREATE TABLE table_21878 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
When 45 is the goals for and 10 is the drawn what is the lost?
SELECT "Lost" FROM table_21878 WHERE "Drawn" = '10' AND "Goals For" = '45'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
on the current intensive care unit visit, when was the last time that the sao2 of patient 006-157753 was greater than 97.0?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NULL)...
CREATE TABLE table_name_43 ( goals INTEGER, name VARCHAR )
What is the Highest Goals for Grella?
SELECT MAX(goals) FROM table_name_43 WHERE name = "grella"
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
Visualize a bar chart about the distribution of personal_name and gender_mf .
SELECT personal_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, and list from low to high by the Name please.
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
CREATE TABLE table_26677 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text )
When 11:40:26 is the time (utc) what is the depth?
SELECT "Depth" FROM table_26677 WHERE "Time (UTC)" = '11:40:26'
CREATE TABLE savings ( balance INTEGER, custid VARCHAR ) CREATE TABLE accounts ( name VARCHAR, custid VARCHAR )
Find the total saving balance for each account name.
SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name
CREATE TABLE table_29229 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What is the pick # of cfl team bc lions (7)
SELECT "Pick #" FROM table_29229 WHERE "CFL Team" = 'BC Lions (7)'
CREATE TABLE table_name_67 ( opponents_in_the_final VARCHAR, partner VARCHAR )
What is Opponents In The Final, when Partner is 'Ji Nov k'?
SELECT opponents_in_the_final FROM table_name_67 WHERE partner = "jiří novák"
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
top 100 users by reputation who haven't asked any questions.
SELECT Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC), u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.Id NOT IN (SELECT DISTINCT OwnerUserId FROM Posts WHERE PostTypeId = 1 AND OwnerUserId != '') ORDER BY u.Reputation DESC LIMIT 100
CREATE TABLE table_72907 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What class in the word with part 4 'giheizan'?
SELECT "Class" FROM table_72907 WHERE "Part 4" = 'giheizan'
CREATE TABLE table_name_21 ( elevation_ VARCHAR, _height VARCHAR, name VARCHAR )
What is the elevation and height for Halfbeak?
SELECT elevation_ + _height FROM table_name_21 WHERE name = "halfbeak"
CREATE TABLE table_name_67 ( floors INTEGER, built VARCHAR, roof___m__ VARCHAR )
What's the average number of floors that were built in 2004, and have a roof (m) of 106?
SELECT AVG(floors) FROM table_name_67 WHERE built = 2004 AND roof___m__ = 106
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Tell me what Old Church Slavic courses give you 5 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Old Church Slavic%' OR name LIKE '%Old Church Slavic%') AND credits = 5
CREATE TABLE table_204_870 ( id number, "product" text, "main functionality" text, "input format" text, "output format" text, "platform" text, "license and cost" text, "notes" text )
which product as rdf for input or output
SELECT "product" FROM table_204_870 WHERE "input format" = 'rdf' OR "output format" = 'rdf'
CREATE TABLE table_name_95 ( function__figure_ VARCHAR, serial_number VARCHAR )
What Function (figure) has Serial number AF 934103?
SELECT function__figure_ FROM table_name_95 WHERE serial_number = "af 934103"
CREATE TABLE table_24556 ( "Municipality" text, "Type" text, "District" text, "Area (km\u00b2)" text, "Population (2010)" real, "Pop. Density (per km\u00b2)" text, "No. of Barangays" real, "Municipal Mayor" text )
How many different counts of the population in Cavinti in 2010 are there?
SELECT COUNT("Population (2010)") FROM table_24556 WHERE "Municipality" = 'Cavinti'
CREATE TABLE table_name_21 ( position VARCHAR, league_from VARCHAR )
What team is from the Russian Major League?
SELECT position FROM table_name_21 WHERE league_from = "russian major league"
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, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Show all allergies with number of students affected with a bar chart, sort by the Y-axis from low to high.
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*)
CREATE TABLE table_30676 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
What is the largest number for karianne gulliksen?
SELECT MAX("Karianne Gulliksen") FROM table_30676
CREATE TABLE table_1682026_7 ( market_value__billion_$_ VARCHAR, assets__billion_$_ VARCHAR )
What is the market value in billions when the assets totaled 1,380.88?
SELECT market_value__billion_$_ FROM table_1682026_7 WHERE assets__billion_$_ = "1,380.88"
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREAT...
Show each county along with the number of schools.
SELECT County, COUNT(*) FROM School GROUP BY County
CREATE TABLE table_21483 ( "Year" real, "West Manila" text, "East Manila" text, "Consumer Price Index (2005=100)" text, "West Manila as a share of 1996 real tariff" text, "East Manila as a share of 1996 real tariff" text )
What was West Manila's tariff increase when its CPI is 119.4?
SELECT "West Manila" FROM table_21483 WHERE "Consumer Price Index (2005=100)" = '119.4'
CREATE TABLE table_name_25 ( score_in_the_final VARCHAR, opponent_in_the_final VARCHAR )
What is the score of the match that was against alberto berasategui?
SELECT score_in_the_final FROM table_name_25 WHERE opponent_in_the_final = "alberto berasategui"
CREATE TABLE table_36241 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2000" text )
Which Capacity has a Location of mogilev?
SELECT SUM("Capacity") FROM table_36241 WHERE "Location" = 'mogilev'
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
Show the relationship between the rank and market values of the companies in the banking industry with a scatter chart.
SELECT Rank, Market_Value FROM company WHERE Main_Industry = 'Banking'
CREATE TABLE table_name_73 ( against VARCHAR, losses VARCHAR, wins VARCHAR )
What is the number against when losses are smaller than 3, and wins arelarger than 16?
SELECT COUNT(against) FROM table_name_73 WHERE losses < 3 AND wins > 16
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
what were the outputs of patient 033-42758 for the first time on 11/08/last year?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-42758')) AND intakeoutput.cellpath LIKE '%output%' AND D...
CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE regions ( region...
Which job titles correspond to jobs with salaries over 9000?
SELECT job_title FROM jobs WHERE min_salary > 9000
CREATE TABLE table_20522228_2 ( rating VARCHAR, viewers__millions_ VARCHAR )
What are the ratings/share ratio when viewers are 5.50 Million?
SELECT rating / SHARE(18 - 49) FROM table_20522228_2 WHERE viewers__millions_ = "5.50"
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose ethnicity is hispanic or latino and diagnoses short title is crbl art ocl nos w infrc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Crbl art ocl NOS w infrc"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
what was the first value of a alt (sgpt) laboratory testing of patient 030-56105 until 09/2105?
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 = '030-56105')) AND lab.labname = 'alt (sgpt)' AND STRFTIME('%y-%m', lab.labresulttime) <=...
CREATE TABLE table_67880 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is on tv at 8:00 on the same channel that had Loft Story on at 7:00?
SELECT "8:00" FROM table_67880 WHERE "7:00" = 'loft story'
CREATE TABLE table_21602734_1 ( league VARCHAR, year VARCHAR )
What league was involved in 2010?
SELECT league FROM table_21602734_1 WHERE year = 2010
CREATE TABLE table_name_87 ( profits__billion_ INTEGER, sales__billion_$_ VARCHAR, headquarters VARCHAR, market_value__billion_$_ VARCHAR )
What is the highest profits in billions of the company headquartered in the USA with a market value of 194.87 billions and less than 76.66 billions in sales?
SELECT MAX(profits__billion_) AS $_ FROM table_name_87 WHERE headquarters = "usa" AND market_value__billion_$_ = 194.87 AND sales__billion_$_ < 76.66
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number )
who is above michigan in years of participation .
SELECT "team" FROM table_203_502 WHERE "years participated" > (SELECT "years participated" FROM table_203_502 WHERE "team" = 'michigan')
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 all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, could you list bar in asc order?
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE stude...
Show ids for the faculty members who don't advise any student.
SELECT facid FROM faculty EXCEPT SELECT advisor FROM student
CREATE TABLE table_name_82 ( attendance VARCHAR, date VARCHAR )
What was the attendance of the game on December 11, 2005?
SELECT attendance FROM table_name_82 WHERE date = "december 11, 2005"
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
tell me the flights from DALLAS to BALTIMORE
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
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...
when the last time patient 76332 had a phosphate lab test in their current hospital encounter?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC ...
CREATE TABLE table_name_62 ( time_retired VARCHAR, grid VARCHAR )
What is the time/retired of the team with a grid of 14?
SELECT time_retired FROM table_name_62 WHERE grid = 14
CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description V...
Give me a bar graph for what is the total number of last names of all candidates?, sort in asc by the x axis.
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name
CREATE TABLE table_45876 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
Which state includes the Harry A. Gampel Pavilion venue?
SELECT "State" FROM table_45876 WHERE "Venue" = 'harry a. gampel pavilion'
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...
when was patient 017-45919 first received mannitol - bolus .25-.5 gms/kg during this year?
SELECT 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 = '017-45919')) AND treatment.treatmentname = 'mannitol - bolus .25-...
CREATE TABLE table_27835 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What is the original air date for 'one rat, one ranger'?
SELECT "Original air date" FROM table_27835 WHERE "Title" = 'One Rat, One Ranger'
CREATE TABLE table_name_20 ( round VARCHAR, event VARCHAR )
What is the Round for the jiu-jitsu vs martial arts?
SELECT round FROM table_name_20 WHERE event = "jiu-jitsu vs martial arts"
CREATE TABLE table_55758 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest Bronze that has a Total larger than 18 and a Silver smaller than 143?
SELECT MIN("Bronze") FROM table_55758 WHERE "Total" > '18' AND "Sport" = 'total' AND "Silver" < '143'
CREATE TABLE table_name_32 ( team VARCHAR, rider VARCHAR )
What team does Anthony Redmond ride for?
SELECT team FROM table_name_32 WHERE rider = "anthony redmond"
CREATE TABLE table_name_94 ( name VARCHAR, perfection VARCHAR )
Who had a perfection percentage of 77.96%?
SELECT name FROM table_name_94 WHERE perfection = "77.96%"
CREATE TABLE table_1571238_2 ( years_participated INTEGER, team VARCHAR )
How many years did notre dame participate?
SELECT MAX(years_participated) FROM table_1571238_2 WHERE team = "Notre Dame"
CREATE TABLE table_2048 ( "Province" text, "Latin Americans 2001" real, "% 2001" text, "Latin Americans 2011" real, "% 2011" text )
What are the percentages in 2001 in all the provinces where the percentage in 2011 is 0.2%?
SELECT "% 2001" FROM table_2048 WHERE "% 2011" = '0.2%'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
fraction of nonpositively-scored Qs per tag.
SELECT Tags.TagName, CAST(SUM(CASE WHEN Posts.Score < 1 THEN 1 ELSE 0 END) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS fraction_of_nonpositive_Qs FROM (PostTags INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.Count > 9 GROUP BY Tags.TagName ORDER BY fraction_of_nonposit...
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
count the number of patients who were prescribed narcan in the same hospital visit following a mri - head procedure in 2103.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mri - head' AND STRFTIME('%y', treatment.treatmenttime) = '2103') AS t1 J...
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Please return me a bar chart show what are the average smallest rating of different movie title?, and sort by the x axis in descending.
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC
CREATE TABLE table_name_21 ( circuit VARCHAR, winning_driver VARCHAR, round VARCHAR )
What circuit did Rupert Keegan win in round 8?
SELECT circuit FROM table_name_21 WHERE winning_driver = "rupert keegan" AND round = 8
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
until 3 years ago, for patients of the 40s, what was the three most frequently prescribed drugs within the same month after they had been diagnosed with chest pain?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND DATETIME(diagnosis.diagnosistime) ...
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
Which courses are Dr. Karen Acton teaching next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Karen Acton%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
CREATE TABLE table_23981882_1 ( title VARCHAR, no_in_season VARCHAR )
What is the episode title for number 7 in the season?
SELECT title FROM table_23981882_1 WHERE no_in_season = 7
CREATE TABLE table_name_18 ( to_par VARCHAR, player VARCHAR )
Ben Crenshaw has what To par?
SELECT to_par FROM table_name_18 WHERE player = "ben crenshaw"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
what is the first ward id of patient 021-35988 in 2103?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-35988') AND STRFTIME('%y', patient.unitadmittime) = '2103' ORDER BY patient.unitadmittime LIMIT 1
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
flight from MILWAUKEE to DENVER
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENV...
CREATE TABLE table_29079 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
List all times with Kentucky as the home team.
SELECT "Time" FROM table_29079 WHERE "Home team" = 'Kentucky'
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destr...
Show all role codes and the number of employees in each role Show bar chart, and show by the X-axis in ascending.
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY Role_Code
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 discharge time and lab test name of subject name bessie giordano?
SELECT demographic.dischtime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Bessie Giordano"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
how much of patient 94956's glucose second measured on the first hospital visit changed compared to the first value measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94956 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
CREATE TABLE table_57501 ( "City of license/market" text, "Station" text, "Channel TV ( RF )" text, "Year of affiliation" real, "Year of disaffiliation" real )
What is the earliest year of disaffiliation of a CHCH-TV station, licensed in Hamilton, Ontario?
SELECT MIN("Year of disaffiliation") FROM table_57501 WHERE "City of license/market" = 'hamilton, ontario'
CREATE TABLE table_10211 ( "Rank" real, "Stadium" text, "Capacity" real, "Location" text, "County" text )
What is the Gaelic Football Stadium at McHale Park's ranking in total capacity?
SELECT COUNT("Rank") FROM table_10211 WHERE "Stadium" = 'mchale park'
CREATE TABLE table_64028 ( "Class to 1928" text, "Class from 1928" text, "Seats" text, "Quantity" real, "Year(s) of Manufacture" text, "Remarks" text )
What is the smallest quantity having a Class to 1928 of BDi-21?
SELECT MIN("Quantity") FROM table_64028 WHERE "Class to 1928" = 'bdi-21'
CREATE TABLE table_48563 ( "Driver" text, "Entrant" text, "Constructor" text, "Time/Retired" text, "Grid" text, "Heat 1/2" text )
What was Menato Boffa's grid?
SELECT "Grid" FROM table_48563 WHERE "Driver" = 'menato boffa'
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
CREATE TABLE table_10581768_2 ( founded VARCHAR, institution VARCHAR )
how many founded dates are listed for carlow university 1
SELECT COUNT(founded) FROM table_10581768_2 WHERE institution = "Carlow University 1"
CREATE TABLE table_204_659 ( id number, "seat" text, "state" text, "majority" number, "member" text, "party" text )
who is listed before don randall ?
SELECT "member" FROM table_204_659 WHERE id = (SELECT id FROM table_204_659 WHERE "member" = 'don randall') - 1
CREATE TABLE table_name_39 ( score VARCHAR, home VARCHAR, date VARCHAR )
What is the score of the Boston Bruins game from April 11?
SELECT score FROM table_name_39 WHERE home = "boston bruins" AND date = "april 11"
CREATE TABLE table_11900378_1 ( tournament VARCHAR, singles_champions VARCHAR )
How many singles tournaments did Ludovic Walter win?
SELECT COUNT(tournament) FROM table_11900378_1 WHERE singles_champions = "Ludovic Walter"
CREATE TABLE table_1341472_34 ( district VARCHAR, first_elected VARCHAR )
Name thedistrict for 1994
SELECT district FROM table_1341472_34 WHERE first_elected = 1994
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
i need to know what flights leave ATLANTA on sunday evening and arrive in BALTIMORE
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 = 'BALTIMORE' AND date_day.day_number = 27 AND date_day.month_number = 8 AN...
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
Of the Advanced Leadership and Service Learning courses which satisfy the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Leadership and Service Learning%' OR course.description LIKE '%Advanced Leadership and ...
CREATE TABLE table_11960944_11 ( date VARCHAR, score VARCHAR )
What date was the game for the score L 88 79?
SELECT date FROM table_11960944_11 WHERE score = "L 88–79"
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...
Draw a bar chart about the distribution of All_Road and Team_ID .
SELECT All_Road, Team_ID FROM basketball_match
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
report the number of patients admitted before 2177 who had left internal jugular vein thrombosis; left arm edema primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.admityear < "2177"
CREATE TABLE table_name_31 ( attendance VARCHAR, away_team VARCHAR, home_team VARCHAR )
How many people attended the game when the away team was dynamo kyiv, and a Home team of torpedo zaporizhia?
SELECT attendance FROM table_name_31 WHERE away_team = "dynamo kyiv" AND home_team = "torpedo zaporizhia"
CREATE TABLE table_34154 ( "Round" text, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What position is Sweden in round 2?
SELECT "Position" FROM table_34154 WHERE "Nationality" = 'sweden' AND "Round" = '2'
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Which of the MATSCIE courses aren 't meeting on Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'MATSCIE' AND semester.semester = 'WN' AN...
CREATE TABLE table_59243 ( "Name" text, "Total" real, "Outstanding Performance" real, "Fighting Spirit" real, "Technique" real, "Years" text, "Highest rank" text )
What are asashio's years?
SELECT "Years" FROM table_59243 WHERE "Name" = 'asashio'
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
get top 400 questions with content tagged with something randomly.
SELECT Title, Body, Id, Tags, AnswerCount, CommentCount, CONCAT('https://stackoverflow.com/questions/', Id), CreationDate, AcceptedAnswerId, ViewCount, FavoriteCount FROM Posts WHERE Tags LIKE '%api%' ORDER BY RAND() LIMIT 400