table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_51708 ( "Year" real, "Category" text, "Character" text, "For The Show" text, "Result" text )
What show had a nomination for best actor in a lead role female (popular) in 2006?
SELECT "For The Show" FROM table_51708 WHERE "Category" = 'best actor in a lead role – female (popular)' AND "Year" = '2006'
CREATE TABLE table_name_95 ( home_team VARCHAR, crowd INTEGER )
What home team has had a crowd bigger than 20,000?
SELECT home_team FROM table_name_95 WHERE crowd > 20 OFFSET 000
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...
Of the courses being offered this Fall , which are upper-level CHEMBIO classes ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CHEMBIO' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fal...
CREATE TABLE table_56287 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
When Nashville was the visiting team what was the lowest Attendance shown?
SELECT MIN("Attendance") FROM table_56287 WHERE "Visitor" = 'nashville'
CREATE TABLE table_26548 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the name of episode number 77 in the series?
SELECT "Title" FROM table_26548 WHERE "No. in series" = '77'
CREATE TABLE table_60959 ( "Cover Date" text, "Story Title" text, "Writer/s" text, "Letterer/s" text, "Colourist/s" text )
Who is the Colourist that has a Story Title of Broken Glass (part 3) and a Letterer of Albers?
SELECT "Colourist/s" FROM table_60959 WHERE "Letterer/s" = 'albers' AND "Story Title" = 'broken glass (part 3)'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what is the drug patient 013-3028 was prescribed for within 2 days after being diagnosed with acute renal failure until 09/2105?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-3028') AND diagnosis.diagnosi...
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find the names of stadiums that some Australian swimmers have been to, and count them by a bar chart
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name
CREATE TABLE table_13139 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
Who was the player for Japan when the to par was smaller than 7?
SELECT "Player" FROM table_13139 WHERE "To par" < '7' AND "Country" = 'japan'
CREATE TABLE table_201_44 ( id number, "year" number, "title" text, "role" text, "notes" text )
which of elizabeth berkley 's films got her the most award nominations ?
SELECT "title" FROM table_201_44 ORDER BY "notes" DESC LIMIT 1
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients whose gender is m and procedure icd9 code is 102?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "102"
CREATE TABLE table_name_90 ( second VARCHAR, lead VARCHAR )
Who is the Second when Michel Gribi is the lead?
SELECT second FROM table_name_90 WHERE lead = "michel gribi"
CREATE TABLE table_53294 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which away team plays at Arden Street Oval?
SELECT "Away team" FROM table_53294 WHERE "Venue" = 'arden street oval'
CREATE TABLE table_39182 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text )
Which Game has a Series of bruins lead 3 1?
SELECT SUM("Game") FROM table_39182 WHERE "Series" = 'bruins lead 3–1'
CREATE TABLE table_name_90 ( tournament INTEGER, total VARCHAR, team VARCHAR )
How many tournament titles for iowa state with 3 total titles?
SELECT MAX(tournament) FROM table_name_90 WHERE total = 3 AND team = "iowa state"
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_...
what is the name of the procedure that patient 5887 has undergone two times the last month?
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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 588...
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, ...
what was the name of the drug that patient 007-9853 was prescribed for the first time in 10/2102 via inhale route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853')) AND medication.routeadmin = 'inhale' AND STRFTIME('%y-%...
CREATE TABLE table_32421 ( "Season" real, "Driver" text, "Team" text, "Engine" text, "Poles" real, "Wins" real, "Podiums" real, "Points" real, "Margin of defeat" real )
What is the most recent season when Fernando Alonso had more than 13 podiums in a car with a Ferrari engine?
SELECT MAX("Season") FROM table_32421 WHERE "Engine" = 'ferrari' AND "Driver" = 'fernando alonso' AND "Podiums" > '13'
CREATE TABLE table_name_22 ( average_cards_a_game INTEGER, season VARCHAR, red_cards VARCHAR )
Which Average Cards a game has a Season of 2004/2005, and a Red Cards larger than 3?
SELECT MIN(average_cards_a_game) FROM table_name_22 WHERE season = "2004/2005" AND red_cards > 3
CREATE TABLE table_40013 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
When was set 3 of 18-25?
SELECT "Date" FROM table_40013 WHERE "Set 3" = '18-25'
CREATE TABLE table_204_549 ( id number, "series\nnumber" text, "key" text, "composed" text, "published" text, "opus no." text, "brown" text, "kobylanska" text, "chominski" text, "dedication" text, "notes" text )
what was the top publishing year ?
SELECT "published" FROM table_204_549 GROUP BY "published" ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
A bar chart showing the sum of capacity of cinemas open for each year, could you sort in desc by the x-axis?
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year DESC
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 widow patients have had an albumin urine lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Albumin, Urine"
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,...
give me the number of patients whose ethnicity is american indian/alaska native and admission year is less than 2148?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2148"
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
Possibly, an answer in comments.
SELECT p.Id AS "post_link", c.Text FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE c.Text LIKE '%answer%' AND p.AnswerCount = 0 AND p.ClosedDate IS NULL ORDER BY p.CreationDate
CREATE TABLE table_55379 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest Shooting Total with a Bronze less than 0?
SELECT MAX("Total") FROM table_55379 WHERE "Sport" = 'shooting' AND "Bronze" < '0'
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
what is the first flight that travels from ATLANTA to BALTIMORE that serves LUNCH
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food...
CREATE TABLE table_32690 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the lowest crowd size when the away team scored 11.17 (83)?
SELECT MIN("Crowd") FROM table_32690 WHERE "Away team score" = '11.17 (83)'
CREATE TABLE table_8268 ( "Name" text, "Date" text, "Defending forces" text, "Brigade" text, "Population" text )
Which brigade has a population of 190?
SELECT "Brigade" FROM table_8268 WHERE "Population" = '190'
CREATE TABLE table_name_94 ( traffic_direction VARCHAR, street VARCHAR )
What is the traffic direction of 97th street?
SELECT traffic_direction FROM table_name_94 WHERE street = "97th street"
CREATE TABLE table_203_563 ( id number, "#" number, "judge" text, "state" text, "born/died" text, "active" text, "chief" text, "senior" text, "appointed by" text, "reason for\ntermination" text )
which state has the largest amount of judges to serve ?
SELECT "state" FROM table_203_563 GROUP BY "state" ORDER BY COUNT("judge") DESC LIMIT 1
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
This semester who is teaching Upper-Level Writing ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
tell me the name of the medication that patient 14397 was last prescribed via the oral route during their last hospital visit?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'oral' ORDER BY prescriptions.startdate DESC LIMIT 1
CREATE TABLE table_59569 ( "Club" text, "Wins" real, "Byes" real, "Losses" real, "Against" real )
Which wins have less than 1 bye?
SELECT MAX("Wins") FROM table_59569 WHERE "Byes" < '1'
CREATE TABLE table_70343 ( "Year" text, "Total (000s)" real, "Israel" real, "Germany" real, "Jews (Halakha) in Israel" text )
What was the amount of 000s when Germany had 16.6?
SELECT "Total (000s)" FROM table_70343 WHERE "Germany" = '16.6'
CREATE TABLE table_54289 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who did they lose to 3-17?
SELECT "Opponent" FROM table_54289 WHERE "Score" = '3-17'
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
give me the duration of the last stay of patient 28484 in the icu.
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
how many patients have been discharged from hospital since 2 years ago.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-2 year')
CREATE TABLE table_23725 ( "Date" text, "Presenter" text, "Guest 1" text, "Guest 2" text, "Guest 3" text, "Guest 4" text )
Who is the guest 2 in the episode where guest 4 is Iyare Igiehon and guest 3 is John Oliver?
SELECT "Guest 2" FROM table_23725 WHERE "Guest 4" = 'Iyare Igiehon' AND "Guest 3" = 'John Oliver'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
when is the hire date for those employees whose first name does not containing the letter M, and count them by a bar chart
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what were the five most frequently prescribed medications for the peptic ulcer disease female patients of the 30s during the same hospital encounter after they had been diagnosed with peptic ulcer disease?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'peptic ulcer di...
CREATE TABLE table_name_64 ( team_1 VARCHAR, round VARCHAR )
Name the team 1 for round 3
SELECT team_1 FROM table_name_64 WHERE round = "3"
CREATE TABLE table_25711913_14 ( field_goals__4_points_ VARCHAR, touchdowns__5_points_ VARCHAR )
How many field goals were scored by the player that got 7 touchdowns?
SELECT field_goals__4_points_ FROM table_25711913_14 WHERE touchdowns__5_points_ = 7
CREATE TABLE table_52272 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real )
What is the name of the school with a decile of 1, a state authority, and located in Otahuhu?
SELECT "Name" FROM table_52272 WHERE "Decile" = '1' AND "Authority" = 'state' AND "Area" = 'otahuhu'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 varchar(2) ) CREATE T...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and employee_id in a bar chart, and rank Y-axis from low to high order.
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
CREATE TABLE table_31596 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text )
Tell me the stages for 1981
SELECT "Stages" FROM table_31596 WHERE "Year" = '1981'
CREATE TABLE table_name_27 ( language VARCHAR, film_name VARCHAR )
what language is seethaiah in
SELECT language FROM table_name_27 WHERE film_name = "seethaiah"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
give me the number of patients whose gender is m and year of birth is less than 2103?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2103"
CREATE TABLE table_name_89 ( date VARCHAR, venue VARCHAR )
Tell me the date of stade des martyrs, dr congo
SELECT date FROM table_name_89 WHERE venue = "stade des martyrs, dr congo"
CREATE TABLE table_45257 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the sum for the week with the date october 30, 1994?
SELECT SUM("Week") FROM table_45257 WHERE "Date" = 'october 30, 1994'
CREATE TABLE table_23662356_3 ( average VARCHAR, number_of_dances VARCHAR )
How many averages were listed for the couple who had 12 dances?
SELECT COUNT(average) FROM table_23662356_3 WHERE number_of_dances = 12
CREATE TABLE table_name_51 ( type VARCHAR, location VARCHAR )
What was the school type for Los Angeles, California?
SELECT type FROM table_name_51 WHERE location = "los angeles, california"
CREATE TABLE table_203_267 ( id number, "no." number, "song" text, "singers" text, "length (m:ss)" text )
what is the number of songs sung by two singers ?
SELECT COUNT("song") FROM table_203_267 WHERE "singers" >= 2
CREATE TABLE table_70625 ( "Position" text, "Name" text, "Height" text, "Weight (lbs.)" real, "Hometown" text, "Draft Year" real, "Pick" text, "All-Stars" text, "NBA Championships" text, "NBA Team" text )
Who is the pick with the height of 6'9' and weighs (lbs) 215?
SELECT "Pick" FROM table_70625 WHERE "Height" = '6''9' AND "Weight (lbs.)" = '215'
CREATE TABLE table_14903081_1 ( current_venue VARCHAR, tournament VARCHAR )
What is the current venue for the Miami Masters tournament?
SELECT current_venue FROM table_14903081_1 WHERE tournament = "Miami Masters"
CREATE TABLE table_75294 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
after december 29 what is the score?
SELECT "Score" FROM table_75294 WHERE "December" > '29'
CREATE TABLE table_68431 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" real, "Investing Dragon(s)" text )
How much money did gaming alerts ask for?
SELECT COUNT("Money requested (\u00a3)") FROM table_68431 WHERE "Company or product name" = 'gaming alerts'
CREATE TABLE table_2639433_4 ( timeslot VARCHAR, episodes VARCHAR )
If the episode was number 234, what was it's timeslot?
SELECT timeslot FROM table_2639433_4 WHERE episodes = 234
CREATE TABLE table_name_56 ( car INTEGER, yards INTEGER )
What is the highest Car with more than 155 yards?
SELECT MAX(car) FROM table_name_56 WHERE yards > 155
CREATE TABLE table_46120 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text )
What school has a public nickname, founded after 1838 in Harrisonburg, Va?
SELECT "Nickname" FROM table_46120 WHERE "Affiliation" = 'public' AND "Founded" > '1838' AND "Location" = 'harrisonburg, va'
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Top 10 answerers by score for a tag.
SELECT Users.Id AS "user_link", SUM(Posts.Score) AS Score FROM Users JOIN Posts ON Users.Id = Posts.OwnerUserId JOIN PostTags ON PostTags.PostId = Posts.Id GROUP BY Users.Id, DisplayName ORDER BY SUM(Posts.Score) LIMIT 10
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id numbe...
What is the average rating of songs for each language?
SELECT AVG(rating), languages FROM song GROUP BY languages
CREATE TABLE table_name_31 ( recorded VARCHAR, track VARCHAR, translation VARCHAR )
Which recording has a Track larger than 2, and a Translation of the last meal?
SELECT recorded FROM table_name_31 WHERE track > 2 AND translation = "the last meal"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Answers in a given period.
SELECT COUNT(*) FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Users.Id = '##UserID##' AND Posts.CreationDate BETWEEN '##StartDate##' AND '##EndDate##'
CREATE TABLE table_22907 ( "Draw" real, "Country" text, "Language" text, "Artist" text, "Song" text, "English translation" text, "Result" text )
If the English translation is hello girl, what was the language?
SELECT "Language" FROM table_22907 WHERE "English translation" = 'Hello girl'
CREATE TABLE table_name_71 ( opponent VARCHAR, time VARCHAR )
Which opponent had a time of 0:29?
SELECT opponent FROM table_name_71 WHERE time = "0:29"
CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying t...
Show the names of aircrafts and the number of times it won matches. Visualize by pie chart.
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
CREATE TABLE payments ( payment_id number, settlement_id number, payment_method_code text, date_payment_made time, amount_payment number ) CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time, amount_claimed number, ...
Which customer had at least 2 policies but did not file any claims? List the customer details and id.
SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id JOIN claims ...
CREATE TABLE table_204_506 ( id number, "seasons" number, "team" text, "ch.wins" number, "promotions" number, "relegations" number )
how many teams are listed ?
SELECT COUNT("team") FROM table_204_506
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is drug route of drug name nitroglycerin sl?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Nitroglycerin SL"
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 patient ( uniquep...
what procedure did patient 008-39015 receive the first time during the last year.
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-39015')) AND DATETIME(treatment.treatmenttime, 'start of year...
CREATE TABLE table_name_13 ( label VARCHAR, catalog VARCHAR )
What Label has a Catalog of 486 136-2?
SELECT label FROM table_name_13 WHERE catalog = "486 136-2"
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 ( ...
Is there an ORALHEAL 400 -level class that is 9 -credit ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego...
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Questions by users with rep>1000.
SELECT Users.Id AS "user_link", Posts.Title, 'http://english.stackexchange.com/questions/' + CAST(Posts.Id AS TEXT) AS Hyperlink, Posts.LastEditDate, Posts.CreationDate, Posts.ClosedDate, Posts.AcceptedAnswerId FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 1000 AND Title != '' AND Posts.Crea...
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
For my MDE , which classes count toward it ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id
CREATE TABLE table_11268 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
What field did the Home Team score 5.10 (40)?
SELECT "Venue" FROM table_11268 WHERE "Home team score" = '5.10 (40)'
CREATE TABLE table_name_40 ( goals_for VARCHAR, played VARCHAR, draws VARCHAR, losses VARCHAR )
What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?
SELECT COUNT(goals_for) FROM table_name_40 WHERE draws = 3 AND losses > 18 AND played < 38
CREATE TABLE table_name_94 ( bronze INTEGER, total VARCHAR )
what is the most bronze when the total is 9?
SELECT MAX(bronze) FROM table_name_94 WHERE total = 9
CREATE TABLE table_name_24 ( date VARCHAR, location_attendance VARCHAR, game VARCHAR )
What date was the location attendance at&t center 18,797, and a game earlier than 57?
SELECT date FROM table_name_24 WHERE location_attendance = "at&t center 18,797" AND game < 57
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and employee_id in a bar chart, and I want to list X-axis in ascending order.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
CREATE TABLE table_name_92 ( drawn INTEGER, against VARCHAR, played VARCHAR )
What is the highest draws when more than 6 are played and the points against are 54?
SELECT MAX(drawn) FROM table_name_92 WHERE against = 54 AND played > 6
CREATE TABLE table_name_11 ( alliance__association VARCHAR, airline_holding VARCHAR )
For airlines named Aeroflot Group, what is the alliance?
SELECT alliance__association FROM table_name_11 WHERE airline_holding = "aeroflot group"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide me the number of black/haitian patients diagnosed with lower extremity embolism.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND diagnoses.short_title = "Lower extremity embolism"
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the three most frequently prescribed drugs for patients who have been prescribed phentolamine mesylate also at the same time since 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'phentolamine mesylate' AND STRFTIME('%y', prescriptions.startdate...
CREATE TABLE table_name_18 ( evening VARCHAR, sunday VARCHAR, name VARCHAR )
Name the Evening that has a Sunday of no, and a Name of s. vidal/plant express?
SELECT evening FROM table_name_18 WHERE sunday = "no" AND name = "s. vidal/plant express"
CREATE TABLE table_62457 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is Spandau 04 Player Jens Pohlmann's Pos.?
SELECT "Pos." FROM table_62457 WHERE "Club" = 'spandau 04' AND "Name" = 'jens pohlmann'
CREATE TABLE table_name_79 ( europe VARCHAR, title VARCHAR )
Tell me the Europe for z.h.p. unlosing ranger vs darkdeath evilman
SELECT europe FROM table_name_79 WHERE title = "z.h.p. unlosing ranger vs darkdeath evilman"
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, ...
How many female patients are aged below 43 years?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "43"
CREATE TABLE table_name_85 ( position VARCHAR, competition VARCHAR )
What Position has a Super League 1 Competition?
SELECT position FROM table_name_85 WHERE competition = "super league 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is primary disease and admission time of subject name michael tyndall?
SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Michael Tyndall"
CREATE TABLE table_name_64 ( high_assists VARCHAR, high_points VARCHAR )
What is High Assists, when High Points is 'Tayshaun Prince (23)'?
SELECT high_assists FROM table_name_64 WHERE high_points = "tayshaun prince (23)"
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Scores of posts by a specific user.
SELECT Id AS "post_link", Score FROM Posts WHERE OwnerUserId = '##id?210401##' ORDER BY Id
CREATE TABLE table_36673 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Rank has a Bronze larger than 1, and a Silver larger than 0, and a Nation of norway (host nation), and a Total larger than 16?
SELECT COUNT("Rank") FROM table_36673 WHERE "Bronze" > '1' AND "Silver" > '0' AND "Nation" = 'norway (host nation)' AND "Total" > '16'
CREATE TABLE table_name_16 ( surface VARCHAR, score VARCHAR )
What is the Surface of the court in the match with a Score of 4 6, 6 4, 3 6?
SELECT surface FROM table_name_16 WHERE score = "4–6, 6–4, 3–6"
CREATE TABLE table_51607 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If the home team was footscray which venue did they play it?
SELECT "Venue" FROM table_51607 WHERE "Home team" = 'footscray'
CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE customers ( customer_id number, customer_type_code text, address_line_1 text, address_line_2 text, town_city text, state text, ema...
Count the number of different complaint type codes.
SELECT COUNT(DISTINCT complaint_type_code) FROM complaints
CREATE TABLE table_name_44 ( lane INTEGER, mark VARCHAR, react VARCHAR )
What is the highest Lane, when Mark is 46.65, and when React is greater than 0.251?
SELECT MAX(lane) FROM table_name_44 WHERE mark = "46.65" AND react > 0.251
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 scatter chart shows the correlation between Team_ID and ACC_Percent .
SELECT Team_ID, ACC_Percent FROM basketball_match
CREATE TABLE table_42912 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
In which week was attendance at 50,814?
SELECT COUNT("Week") FROM table_42912 WHERE "Attendance" = '50,814'
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_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
please list all the flights from BOSTON to DENVER which serve meals
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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_ser...