table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_name_80 ( result VARCHAR, year VARCHAR, awards VARCHAR )
What was the result at the Berlin International Film Festival in a year greater than 1987?
SELECT result FROM table_name_80 WHERE year > 1987 AND awards = "berlin international film festival"
CREATE TABLE table_225205_4 ( successor VARCHAR, reason_for_change VARCHAR )
Who is the successor when the reason for change is died November 11, 1845?
SELECT successor FROM table_225205_4 WHERE reason_for_change = "Died November 11, 1845"
CREATE TABLE table_24938621_3 ( no VARCHAR, written_by VARCHAR )
What episode number was written by Gregg Hurwitz?
SELECT no FROM table_24938621_3 WHERE written_by = "Gregg Hurwitz"
CREATE TABLE table_76357 ( "Year of release" real, "Title" text, "Label" text, "Format" text, "Cat. No." text )
What is the total year of release of the title what goes around comes around?
SELECT COUNT("Year of release") FROM table_76357 WHERE "Title" = 'what goes around comes around'
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
what was the four most commonly carried out specimen tests until 2103?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2103' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
CREATE TABLE table_59416 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which golfer finished with a score of 70-71=141?
SELECT "Player" FROM table_59416 WHERE "Score" = '70-71=141'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
Questions with a specific tag.
SELECT p.Id AS "post_link", p.Title FROM Posts AS p LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id LEFT JOIN PostTags AS pt2 ON p.Id = pt2.PostId LEFT JOIN Tags AS t2 ON pt2.TagId = t2.Id WHERE PostTypeId = 1 AND t.TagName = 'raw' AND t2.TagName = '##tag:string##' ORDER BY ViewCount...
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, visualize a scatter chart about the correlation between manufacturer and revenue , and group by attribute headquarter.
SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
CREATE TABLE table_name_16 ( week VARCHAR, finalist VARCHAR )
what is the week when the finalist is marcelo r os?
SELECT week FROM table_name_16 WHERE finalist = "marcelo ríos"
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
did the last serology/blood microbiology test of patient 8005 until 2104 show any organism?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y', microbiologyevents.charttime) <= '2104' O...
CREATE TABLE table_9245 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is the status for Pointe-Verte, with a population smaller than 1,137?
SELECT "Status" FROM table_9245 WHERE "Population" < '1,137' AND "Official Name" = 'pointe-verte'
CREATE TABLE Customer_Payments ( customer_id INTEGER, datetime_payment DATETIME, payment_method_code VARCHAR(10), amount_payment DOUBLE ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCH...
Show the total number from each payment method code, show in desc by the bar.
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code DESC
CREATE TABLE table_name_89 ( artist VARCHAR, theme VARCHAR )
What artist's song was performed in the week with theme of Billboard #1?
SELECT artist FROM table_name_89 WHERE theme = "billboard #1"
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,...
how many patients whose year of birth is less than 2200 and item id is 50882?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.itemid = "50882"
CREATE TABLE table_name_18 ( date VARCHAR, home_team VARCHAR )
What date was the Home team fitzroy?
SELECT date FROM table_name_18 WHERE home_team = "fitzroy"
CREATE TABLE table_73059 ( "Province" text, "Capital" text, "Area (km\u00b2)" text, "Population" real, "Density" real, "Map region" real )
when province is monse or nouel, what is the area (km )?
SELECT "Area (km\u00b2)" FROM table_73059 WHERE "Province" = 'Monseñor Nouel'
CREATE TABLE table_27755784_11 ( high_rebounds VARCHAR, game VARCHAR )
Name the high rebounds for 77 game
SELECT high_rebounds FROM table_27755784_11 WHERE game = 77
CREATE TABLE table_26428602_1 ( absorb__nm_ INTEGER )
What is the lowest dye absoprtion in nm?
SELECT MIN(absorb__nm_) FROM table_26428602_1
CREATE TABLE table_38784 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the date of the game with 38,062 people in attendance?
SELECT "Date" FROM table_38784 WHERE "Attendance" = '38,062'
CREATE TABLE table_name_2 ( hosts VARCHAR, year VARCHAR )
Who are the hosts for the 2004 event?
SELECT hosts FROM table_name_2 WHERE year = "2004"
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
what was the time patient 89840 was discharged from the hospital for the last time until 2104?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 89840 AND STRFTIME('%y', admissions.dischtime) <= '2104' ORDER BY admissions.dischtime DESC LIMIT 1
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 headquarter and the average of price , and group by attribute headquarter, and sort bars from high to low order.
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
CREATE TABLE table_28742659_2 ( immunity VARCHAR, finish VARCHAR )
What is the name of immunity when the finish is 3rd voted out day 9?
SELECT immunity FROM table_28742659_2 WHERE finish = "3rd voted Out Day 9"
CREATE TABLE table_name_66 ( population INTEGER, place VARCHAR, code VARCHAR, area__km_2__ VARCHAR )
What is the Population of Tshepiso with a Code of 70409 or smaller and an Area (km 2) smaller than 5.97?
SELECT MIN(population) FROM table_name_66 WHERE code < 70409 AND area__km_2__ < 5.97 AND place = "tshepiso"
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
For each account type, find the average account balance of customers with credit score lower than 50 Show bar chart, show by the y-axis in ascending.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal)
CREATE TABLE table_2190919_1 ( top_10 VARCHAR, avg_finish VARCHAR )
How many teams finished in the top team with an average finish of 23.3?
SELECT COUNT(top_10) FROM table_2190919_1 WHERE avg_finish = "23.3"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
when was the first time that patient 022-61539 got a output amt-blake drain c output since 1074 days ago?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-61539')) AND intakeoutput.cellpath LIKE '%output%...
CREATE TABLE table_204_184 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "length" text )
how many tracks are listed in this table ?
SELECT COUNT("title") FROM table_204_184
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 prerequisites have I already completed for ASIAN 539 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ASIAN' AND COURSE_1.number =...
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when did patient 24547 since 2132 days ago had chest tube #1 output for the first time?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ches...
CREATE TABLE table_13706 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What is the score in the final of the tournament with a hard surface?
SELECT "Score in the final" FROM table_13706 WHERE "Surface" = 'hard'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
how much is the bone fracture(s) - sternum diagnostic cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - sternum')
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...
provide the number of patients whose ethnicity is white and diagnoses long title is personal history of hodgkin's disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Personal history of hodgkin's disease"
CREATE TABLE table_17708 ( "Club" text, "Overall Record" text, "Goals For" real, "Goals For Avg." text, "Goals Against" real, "Goals Against Avg." text )
The Kansas City Wizards had a 9-10-9 record and what goals against avg?
SELECT "Goals Against Avg." FROM table_17708 WHERE "Overall Record" = '9-10-9'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, display Y-axis in desc order.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC
CREATE TABLE table_name_25 ( elevated VARCHAR, cardinalatial_title VARCHAR )
What's listed for the Elevated with a Cardinalatial title of Priest of S. Eusebio and Archbishop of Benevento?
SELECT elevated FROM table_name_25 WHERE cardinalatial_title = "priest of s. eusebio and archbishop of benevento"
CREATE TABLE table_name_98 ( attendance INTEGER, visitor VARCHAR )
Name the least attendance with visitor of edmonton
SELECT MIN(attendance) FROM table_name_98 WHERE visitor = "edmonton"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
show me what fare codes symbols stand for
SELECT DISTINCT fare_basis_code FROM fare_basis
CREATE TABLE table_name_82 ( group VARCHAR, distance VARCHAR )
What group has 1200 m as the distance?
SELECT group FROM table_name_82 WHERE distance = "1200 m"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
has patient 027-68991 visited an emergency room until 2104?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '027-68991' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) <= '2104'
CREATE TABLE table_name_54 ( location_attendance VARCHAR, record VARCHAR )
What was the location and attendance at the game when the record was 9-6?
SELECT location_attendance FROM table_name_54 WHERE record = "9-6"
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, list in asc by the y axis.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID)
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE department ( dept_code text, de...
What is the number of professors who are in the Accounting or Biology departments?
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
CREATE TABLE table_42891 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Which Tournament was on 2 October 2006?
SELECT "Tournament" FROM table_42891 WHERE "Date" = '2 october 2006'
CREATE TABLE table_47046 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Playoff Apps" text, "Playo...
How many total goals did the squad with 2 playoff apps, 2 FA Cup Apps, and 0 League Cup goals get?
SELECT SUM("Total Goals") FROM table_47046 WHERE "Playoff Apps" = '2' AND "FA Cup Apps" = '2' AND "League Cup Goals" < '0'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
count how many times patient 44848 went to the hospital in 2105.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 44848 AND STRFTIME('%y', admissions.admittime) = '2105'
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, ...
how much has patient 006-76924's change of weight second measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) ...
CREATE TABLE table_48561 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Where was the event Kage Kombat 16?
SELECT "Location" FROM table_48561 WHERE "Event" = 'kage kombat 16'
CREATE TABLE table_name_61 ( record VARCHAR, opponent VARCHAR )
What record has @ detroit as the opponent?
SELECT record FROM table_name_61 WHERE opponent = "@ detroit"
CREATE TABLE table_44962 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text )
Where is the historic place that was built in 1910?
SELECT "Location" FROM table_44962 WHERE "Built" = '1910'
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 discharge location is left against medical advi and procedure icd9 code is 3808?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.icd9_code = "3808"
CREATE TABLE table_name_66 ( award VARCHAR, result VARCHAR, film VARCHAR )
What is Award, when Result is 'Nominated', and when Film is 'Sankranthi'?
SELECT award FROM table_name_66 WHERE result = "nominated" AND film = "sankranthi"
CREATE TABLE table_name_75 ( capacity INTEGER, year_opened VARCHAR )
What is the lowest capacity for 1903?
SELECT MIN(capacity) FROM table_name_75 WHERE year_opened = "1903"
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 admission location and discharge location of subject id 4589?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "4589"
CREATE TABLE table_name_25 ( length VARCHAR, junctions VARCHAR, route_name VARCHAR )
What is the length of the highway with junctions i-35 us 83 and named us 83 bus.?
SELECT length FROM table_name_25 WHERE junctions = "i-35 us 83" AND route_name = "us 83 bus."
CREATE TABLE table_68933 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Name the record with opponent of christian nielson
SELECT "Record" FROM table_68933 WHERE "Opponent" = 'christian nielson'
CREATE TABLE table_56992 ( "Name" text, "Latitude" real, "Longitude" real, "Diameter (km)" real, "Named after" text )
Tell me the named after for diameter less than 19.2 and latitude more than -37.5 with longitude less than 67.3
SELECT "Named after" FROM table_56992 WHERE "Diameter (km)" < '19.2' AND "Latitude" > '-37.5' AND "Longitude" < '67.3'
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
history of leukopenia, anemia, hepatic or renal dysfunction or malignancy
SELECT * FROM table_test_9 WHERE leukopenia = 1 OR anemia = 1 OR hepatic_disease = 1 OR renal_disease = 1 OR malignancy = 1
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_l...
Which classes in the UKRAINE 400 / 500 level have the least amount of work ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'UKRAINE' AND program_course.workload = (SELECT MIN(PR...
CREATE TABLE table_name_30 ( date VARCHAR, visitor VARCHAR )
What was the date of the Red Wings home game against Anaheim?
SELECT date FROM table_name_30 WHERE visitor = "anaheim"
CREATE TABLE table_204_933 ( id number, "year" number, "competition" text, "date" text, "location" text, "opponent" text, "score" text, "result" text, "bye" text )
how many games did this team play against spain ?
SELECT COUNT(*) FROM table_204_933 WHERE "opponent" = 'spain'
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...
questions with tag javascript that have code snippets and answer.
SELECT Title, Tags FROM Posts AS Question WHERE Question.Tags LIKE '%<java>%'
CREATE TABLE table_6453 ( "Birth" text, "Marriage" text, "Became Duchess" text, "Ceased to be Duchess" text, "Death" text, "Spouse" text )
What is the Spouse of the Duchess that has a Death on 6 april 1780?
SELECT "Spouse" FROM table_6453 WHERE "Death" = '6 april 1780'
CREATE TABLE table_1081459_1 ( introduced INTEGER )
What is the smallest introduced value?
SELECT MIN(introduced) FROM table_1081459_1
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 time_zone ( time_zone_code text, time_zone_name ...
where does CP fly
SELECT DISTINCT airport.airport_code FROM airport, flight WHERE flight.airline_code = 'CP' AND flight.to_airport = airport.airport_code
CREATE TABLE table_66656 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Which Losses have Draws smaller than 0?
SELECT MAX("Losses") FROM table_66656 WHERE "Draws" < '0'
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
My Close Votes for Tag X.
SELECT p.Id AS "post_link", c.CreationDate, Tags FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%voting to close%' AND (Tags LIKE '%<email>%' OR Tags LIKE '%<spam>%') AND c.UserId = '##UserId##'
CREATE TABLE table_name_69 ( away_captain VARCHAR, result VARCHAR )
Name the away captain with result of wi by 9 wkts
SELECT away_captain FROM table_name_69 WHERE result = "wi by 9 wkts"
CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_da...
Draw a bar chart of owner versus total number of rating in percent, and display in ascending by the X.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
How many patients admitted to the hospital before 2139 had a lab test base excess?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Base Excess"
CREATE TABLE table_name_6 ( date VARCHAR, score VARCHAR )
Which date has a score of 2-1?
SELECT date FROM table_name_6 WHERE score = "2-1"
CREATE TABLE table_1342370_41 ( result VARCHAR, incumbent VARCHAR )
What was the result in the election where the incumbent was Finis J. Garrett?
SELECT result FROM table_1342370_41 WHERE incumbent = "Finis J. Garrett"
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
show me all flights from SAN DIEGO to LOS ANGELES
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 = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ...
CREATE TABLE table_15081939_4 ( swimsuit VARCHAR, evening_gown VARCHAR )
What is the swimsuit score for the item that has 7.61 as evening gown
SELECT swimsuit FROM table_15081939_4 WHERE evening_gown = "7.61"
CREATE TABLE table_name_58 ( friendly VARCHAR, germany VARCHAR )
What is the friendly game for Germany of France?
SELECT friendly FROM table_name_58 WHERE germany = "france"
CREATE TABLE table_54586 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What is the NBA draft result of the player from Washington, DC?
SELECT "NBA Draft" FROM table_54586 WHERE "Hometown" = 'washington, dc'
CREATE TABLE table_name_62 ( points VARCHAR, difference VARCHAR, drawn VARCHAR )
How many points have a difference of 23, with a drawn less than 5?
SELECT COUNT(points) FROM table_name_62 WHERE difference = "23" AND drawn < 5
CREATE TABLE table_name_65 ( score VARCHAR, dance VARCHAR, result VARCHAR )
What was the score of the team that danced a jive and was safe?
SELECT score FROM table_name_65 WHERE dance = "jive" AND result = "safe"
CREATE TABLE table_79857 ( "Title" text, "Producer(s)" text, "Artist(s)" text, "Time" text, "Team(s)" text )
Who produced 'Fast Life'?
SELECT "Producer(s)" FROM table_79857 WHERE "Title" = 'fast life'
CREATE TABLE table_2850912_12 ( player VARCHAR, college_junior_club_team VARCHAR )
List the players for team bryn s if (sweden).
SELECT player FROM table_2850912_12 WHERE college_junior_club_team = "Brynäs IF (Sweden)"
CREATE TABLE table_13869651_3 ( frequency VARCHAR, part_number_s_ VARCHAR )
What is the frequency of the model whose part number is ado520biaa5do?
SELECT frequency FROM table_13869651_3 WHERE part_number_s_ = "ADO520BIAA5DO"
CREATE TABLE table_14875671_1 ( attendance INTEGER, week VARCHAR )
What was the attendance in week 8?
SELECT MAX(attendance) FROM table_14875671_1 WHERE week = 8
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, could you show X-axis in desc order?
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
CREATE TABLE table_name_75 ( insurgents VARCHAR, civilians VARCHAR )
Name the insurgents for civilians being 49
SELECT insurgents FROM table_name_75 WHERE civilians = "49"
CREATE TABLE table_38374 ( "Issue Date" real, "Album Title" text, "Artist" text, "Sales" real, "Highest Position" real )
What is the highest position Talk on Corners, which had an issue date greater than 1, had?
SELECT COUNT("Highest Position") FROM table_38374 WHERE "Album Title" = 'talk on corners' AND "Issue Date" > '1'
CREATE TABLE table_35810 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
What is the average number of points for a team in the 250cc class with fewer than 0 wins?
SELECT AVG("Points") FROM table_35810 WHERE "Class" = '250cc' AND "Wins" < '0'
CREATE TABLE table_name_41 ( club_province VARCHAR, player VARCHAR )
Which Club/province has a Player of david penalva?
SELECT club_province FROM table_name_41 WHERE player = "david penalva"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
how many prescriptions of bengay until 3 years ago are there?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'bengay' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')
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 the number of patients whose drug code is quin20 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "QUIN20" AND lab.fluid = "Other Body Fluid"
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
What are the dates with a maximum temperature higher than 85, and count them by a bar chart, list in asc by the y axis.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
Show the race class and number of races in each class with a bar chart.
SELECT Class, COUNT(*) FROM race GROUP BY Class
CREATE TABLE table_28838 ( "Place" real, "Nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "Table points" real )
What is the nation when the for is 326?
SELECT "Nation" FROM table_28838 WHERE "for" = '326'
CREATE TABLE table_65543 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
Who are the rowers with the time of 5:54.57?
SELECT "Rowers" FROM table_65543 WHERE "Time" = '5:54.57'
CREATE TABLE table_name_39 ( goal INTEGER, result VARCHAR )
What is the top goal for the result of 2 3?
SELECT MAX(goal) FROM table_name_39 WHERE result = "2–3"
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
what kind of airplane goes from BOSTON to SAN FRANCISCO before 1200
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1200 AND f...
CREATE TABLE table_67768 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Recipient" text, "Date" text, "Award" text )
Who was the director of the film that Sister Films received an award for on 2/3/05?
SELECT "Director(s)" FROM table_67768 WHERE "Date" = '2/3/05' AND "Recipient" = 'sister films'
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
what is the cheapest flight from LONG BEACH to MEMPHIS
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT...
CREATE TABLE table_37294 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text )
Which 7:00 has an 8:00 of la soir e du hockey?
SELECT "7:00" FROM table_37294 WHERE "8:00" = 'la soirée du hockey'
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE conference ( cid int,...
return me the total citations of papers in the VLDB conference in 2005 .
SELECT SUM(publication.citation_num) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year = 2005
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Bar chart x axis nationality y axis how many nationality, and list in descending by the Y-axis.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC