instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which opponent has a week smaller than 15, and a Result of l 23-17?
CREATE TABLE table_9071 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_9071 WHERE "Week" < '15' AND "Result" = 'l 23-17'
What is Population density (per km ), when Name is Antigua and Barbuda, and when Capital is St. John's?
CREATE TABLE table_41614 ("Name" text,"Subdivisions" text,"Area (km\u00b2)" real,"Population (1 July 2005 est.)" real,"Population density (per km\u00b2)" real,"Capital" text)
SELECT "Population density (per km\u00b2)" FROM table_41614 WHERE "Name" = 'antigua and barbuda' AND "Capital" = 'st. john''s'
which company released audiobooks authored by day, martin martin day
CREATE TABLE table_20174050_24 (company VARCHAR,author VARCHAR)
SELECT company FROM table_20174050_24 WHERE author = "Day, Martin Martin Day"
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the last_name by a bar chart, rank by the y axis from high to low please.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
What are the ids of songs that are available in either mp4 format or have resolution above 720?
CREATE TABLE genre (g_name text,rating text,most_popular_in text)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 number,genr...
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
Accepted answers with zero score.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPos...
SELECT answers.Id AS "post_link" FROM (SELECT * FROM Posts WHERE PostTypeId = 2) AS answers JOIN (SELECT * FROM Posts WHERE PostTypeId = 1) AS questions ON questions.AcceptedAnswerId = answers.Id WHERE answers.OwnerUserId = @UserId AND answers.Score = 0
give me the number of patients whose ethnicity is black/cape verdean and procedure icd9 code is 8674?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8674"
How many seasons in Tamil occur when the season in Sanskrit is Grishma?
CREATE TABLE table_21671 ("Season in Tamil" text,"English Transliteration" text,"English Translation" text,"Season in Sanskrit" text,"Season in English" text,"Tamil Months" text,"Gregorian Months" text)
SELECT COUNT("Season in Tamil") FROM table_21671 WHERE "Season in Sanskrit" = 'Grishma'
What is every original game for the artist Lynyrd Skynyrd?
CREATE TABLE table_24417 ("Year" real,"Song Title" text,"Artist" text,"Genre" text,"Original Game" text,"Band Tier/Venue" text,"Exportable to GH5/BH" text)
SELECT "Original Game" FROM table_24417 WHERE "Artist" = 'Lynyrd Skynyrd'
13.7 million watched the 22nd year . how many watched the previous year ?
CREATE TABLE table_204_996 (id number,"no." text,"air date" text,"network" text,"household\nrating" number,"viewers\n(millions)" text)
SELECT "viewers\n(millions)" FROM table_204_996 WHERE "no." = 22 - 1
Which Played has a Lost of 3, and an Against of 23?
CREATE TABLE table_name_63 (played INTEGER,lost VARCHAR,against VARCHAR)
SELECT AVG(played) FROM table_name_63 WHERE lost = 3 AND against = 23
What is 17th c., when Initial-Syllable Open/Semi-Open Unstressed Vowels is 'o / /'?
CREATE TABLE table_name_76 (initial_syllable_open_semi_open_unstressed_vowels VARCHAR)
SELECT 17 AS th_c FROM table_name_76 WHERE initial_syllable_open_semi_open_unstressed_vowels = "o /ɵ/"
Find dates and attendance for exhibitions that happened in 2004, show me the proportion of attendance by date.
CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)
SELECT Date, Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004
what FIRST class flights are available from DENVER to BALTIMORE on 7 25 1991
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE...
What was the highest number on money list rank for Angela Stanford's career?
CREATE TABLE table_14836185_3 (money_list_rank INTEGER)
SELECT MAX(money_list_rank) FROM table_14836185_3
Find the distinct majors of students who have treasurer votes.
CREATE TABLE STUDENT (Major VARCHAR,StuID VARCHAR)CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR)
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
What venue has euro 2004 q. as the competition?
CREATE TABLE table_66269 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Venue" FROM table_66269 WHERE "Competition" = 'euro 2004 q.'
calculate the amount of albumin 5% patient 20898 has taken since 599 days ago.
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 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 TABL...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
What was the opponent for the game at Multi-sport Field?
CREATE TABLE table_name_65 (opponent VARCHAR,field VARCHAR)
SELECT opponent FROM table_name_65 WHERE field = "multi-sport field"
What team does tariq kirksay, a guard who is taller than 1.8M and born before 1982, represent?
CREATE TABLE table_name_13 (current_club VARCHAR,player VARCHAR,year_born VARCHAR,height VARCHAR,position VARCHAR)
SELECT current_club FROM table_name_13 WHERE height > 1.8 AND position = "guard" AND year_born < 1982 AND player = "tariq kirksay"
What is the number of bronze medals when there are fewer than 0 silver medals?
CREATE TABLE table_name_19 (bronze INTEGER,silver INTEGER)
SELECT SUM(bronze) FROM table_name_19 WHERE silver < 0
Show the number of customer address history in each day and group by date to with a line chart, and I want to sort by the x axis in descending.
CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(15),product_name VARCHAR(80),product_price DOUBLE)CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_date DATETIME,order_status_code VARCHAR(15))CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VA...
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to DESC
What is the lowest position with points 1 of 27 2 and fewer than 9 drawn?
CREATE TABLE table_60612 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT MIN("Position") FROM table_60612 WHERE "Points 1" = '27 2' AND "Drawn" < '9'
A bar chart for listing the number of the names of patients who have made appointments, I want to sort by the y axis from high to low.
CREATE TABLE Department (DepartmentID INTEGER,Name VARCHAR(30),Head INTEGER)CREATE TABLE Undergoes (Patient INTEGER,Procedures INTEGER,Stay INTEGER,DateUndergoes DATETIME,Physician INTEGER,AssistingNurse INTEGER)CREATE TABLE Physician (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),SSN INTEGER)CREATE TABLE On...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC
The color sapphire is assigned to which Terminus?
CREATE TABLE table_4617 ("Line" text,"Color" text,"Terminus" text,"Length" text,"Stations" text,"Daily Ridership" real)
SELECT "Terminus" FROM table_4617 WHERE "Color" = 'sapphire'
Which year has the most CDs released?
CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text)
SELECT groupyear FROM torrents GROUP BY groupyear ORDER BY COUNT(groupname) DESC LIMIT 1
How many times was Plan B 4th place?
CREATE TABLE table_72846 ("Poll Year" text,"Winner" text,"Second" text,"Third" text,"Fourth" text,"Fifth" text,"Sixth" text,"Seventh" text,"Eighth" text,"Ninth" text,"Tenth" text)
SELECT COUNT("Winner") FROM table_72846 WHERE "Fourth" = 'Plan B'
Who is the player on a team from the 1970s?
CREATE TABLE table_name_63 (player VARCHAR,team VARCHAR)
SELECT player FROM table_name_63 WHERE team = "1970s"
What is Original title, when Film title used in nomination is Train Without A Timetable?
CREATE TABLE table_41274 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text)
SELECT "Original title" FROM table_41274 WHERE "Film title used in nomination" = 'train without a timetable'
What is the total number of captains in each rank and class? Let class as X-axis, and categorize by rank with a stacked bar chart, rank by the X-axis in ascending.
CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text)
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class
How many people are in 477 ?
CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assi...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 477
A bar chart shows the distribution of Name and Height , and I want to show by the y axis in descending.
CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Name, Height FROM people ORDER BY Height DESC
give me the number of patients born before 2200 who had lab test item id 50882.
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)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
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"
Find the component amounts and names of all furnitures that have more than 10 components. Show me the proportion of component amounts using a pie chart.
CREATE TABLE furniture (Furniture_ID int,Name text,Num_of_Component int,Market_Rate real)CREATE TABLE furniture_manufacte (Manufacturer_ID int,Furniture_ID int,Price_in_Dollar real)CREATE TABLE manufacturer (Manufacturer_ID int,Open_Year real,Name text,Num_of_Factories int,Num_of_Shops int)
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10
specify the gender of patient id 2560 and drug code he was treated with.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.gender, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
what was patient 11362 first height in 11/this year?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 admissions (row_id number,subject_id number,hadm_id number,admitt...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
How many US events did jason bennett win?
CREATE TABLE table_68183 ("Name" text,"From" text,"Discipline" text,"Events won (UK Series)" real,"Events won (US Series)" real)
SELECT AVG("Events won (US Series)") FROM table_68183 WHERE "Name" = 'jason bennett'
which original owner had the most locomotives ?
CREATE TABLE table_204_30 (id number,"year built" text,"works number" number,"wheel arr." text,"gauge" text,"original owner" text,"name" text,"current location" text,"notes" text)
SELECT "original owner" FROM table_204_30 GROUP BY "original owner" ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the manager who was replaced by michael skibbe?
CREATE TABLE table_62209 ("Name" text,"Club" text,"Date of departure" text,"Replacement" text,"Date of appointment" text)
SELECT "Name" FROM table_62209 WHERE "Replacement" = 'michael skibbe'
Show the average room count of the apartments that have booking status code 'Provisional'.
CREATE TABLE Apartment_Bookings (apt_id VARCHAR,booking_status_code VARCHAR)CREATE TABLE Apartments (apt_id VARCHAR)
SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
What languages were spoken in the film 'FireDancer'?
CREATE TABLE table_21390 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Language(s)" text,"Director" text,"Result" text)
SELECT "Language(s)" FROM table_21390 WHERE "Film title used in nomination" = 'FireDancer'
Who is the opponent for week 10?
CREATE TABLE table_31939 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_31939 WHERE "Week" = '10'
Search for URL in answers.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE Votes (Id number,PostId numb...
SELECT Id AS "post_link", Score, Title FROM Posts WHERE Body LIKE '%##URL##%' AND CreationDate >= '2016-08-01' ORDER BY Score DESC
where is a good place in mountain view for arabic food ?
CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
Questions per month, Scala Web Frameworks. How do Scala web frameworks compare to each other? I'm restricting the questions to those tagged Scala, to avoid polluting Playframework's result. It might be unfair, but I can't think of any other way to do it. At least all frameworks are being equally discriminated against.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostLinks (Id n...
SELECT *, COUNT(*) AS "Count" FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '...
What is the date an away ream scored 6.16 (52)?
CREATE TABLE table_57155 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_57155 WHERE "Away team score" = '6.16 (52)'
What tv season was episode 23 broadcast?
CREATE TABLE table_74023 ("Season" real,"Episodes" real,"Timeslot (ET)" text,"Season premiere" text,"Season finale" text,"TV season" text,"Rank" text,"Viewers (in millions)" text)
SELECT "TV season" FROM table_74023 WHERE "Episodes" = '23'
what is the score when the venue is athens olympic stadium on 30 april 2011?
CREATE TABLE table_name_78 (score VARCHAR,venue VARCHAR,year VARCHAR)
SELECT score FROM table_name_78 WHERE venue = "athens olympic stadium" AND year = "30 april 2011"
What is the minimum sum?
CREATE TABLE table_30018460_1 (total INTEGER)
SELECT MIN(total) FROM table_30018460_1
Name the venue for 23 january 2009
CREATE TABLE table_name_88 (venue VARCHAR,date VARCHAR)
SELECT venue FROM table_name_88 WHERE date = "23 january 2009"
WHAT TEAM CLASSIFIED IN THE STAGE WHERE BRADLEY WIGGINS WON THE POINTS CLASSIFICATION ?
CREATE TABLE table_11667521_17 (team_classification VARCHAR,points_classification VARCHAR)
SELECT team_classification FROM table_11667521_17 WHERE points_classification = "Bradley Wiggins"
What group has a Population of see hoy?
CREATE TABLE table_name_23 (group VARCHAR,population VARCHAR)
SELECT group FROM table_name_23 WHERE population = "see hoy"
Was the record of 8-1 (1) a win or a loss?
CREATE TABLE table_41418 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Time" text,"Location" text)
SELECT "Res." FROM table_41418 WHERE "Record" = '8-1 (1)'
What is the population density in the Brighton area?
CREATE TABLE table_140297_1 (density VARCHAR,principal_town VARCHAR)
SELECT density FROM table_140297_1 WHERE principal_town = "Brighton"
in the last year has patient 007-10135 been prescribed glucagon (human recombinant) 1 mg/ml solution for injection.
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND medication.drugname = 'glucagon (human recombinant) 1 mg/...
what is the monthly average cerebral drain l ventricular drain of patient 462 on the first hospital visit?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num...
SELECT AVG(outputevents.value) 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 = 462 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputevents...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday.
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(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Which Game has a Record of 27 30?
CREATE TABLE table_45549 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text)
SELECT SUM("Game") FROM table_45549 WHERE "Record" = '27–30'
What is the School/Junior/Club Group (Class) that has a Nationality of canada, and a Place of goalie?
CREATE TABLE table_name_69 (college_junior_club_team__league_ VARCHAR,nationality VARCHAR,position VARCHAR)
SELECT college_junior_club_team__league_ FROM table_name_69 WHERE nationality = "canada" AND position = "goalie"
How many races that had any driver whose forename is Lewis? Show me a line chart, and order x-axis in descending order.
CREATE TABLE circuits (circuitId INTEGER,circuitRef TEXT,name TEXT,location TEXT,country TEXT,lat REAL,lng REAL,alt TEXT,url TEXT)CREATE TABLE drivers (driverId INTEGER,driverRef TEXT,number TEXT,code TEXT,forename TEXT,surname TEXT,dob TEXT,nationality TEXT,url TEXT)CREATE TABLE constructorStandings (constructorStandi...
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" ORDER BY year DESC
What did the home team score when the away team was Hawthorn and there was a crowd larger than 20,851?
CREATE TABLE table_55573 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_55573 WHERE "Crowd" > '20,851' AND "Away team" = 'hawthorn'
Which Opponent has an Event of jungle fight 5?
CREATE TABLE table_name_2 (opponent VARCHAR,event VARCHAR)
SELECT opponent FROM table_name_2 WHERE event = "jungle fight 5"
How many of the patients who had insertion of drug-eluting coronary artery stent(s) were discharged to rehab/distinct?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)"
For those employees who do not work in departments with managers that have ids between 100 and 200, find email and department_id , and visualize them by a bar chart, could you rank by the names in ascending?
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(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
Which Nebraska has 2004 year?
CREATE TABLE table_9950 ("Year" text,"Kansas" text,"Nebraska" text,"North Dakota" text,"Oklahoma" text,"South Dakota" text,"Texas" text)
SELECT "Nebraska" FROM table_9950 WHERE "Year" = '2004'
How many wins are there when the draws are less than 0?
CREATE TABLE table_name_52 (wins INTEGER,draws INTEGER)
SELECT SUM(wins) FROM table_name_52 WHERE draws < 0
What kind of Placement in Miss Universe that rosita cornell capuyon is in?
CREATE TABLE table_name_4 (placement_in_miss_universe VARCHAR,delegate VARCHAR)
SELECT placement_in_miss_universe FROM table_name_4 WHERE delegate = "rosita cornell capuyon"
What is the average Goals, when Team is 'Rah Ahan', and when Division is less than 1?
CREATE TABLE table_name_81 (goals INTEGER,team VARCHAR,division VARCHAR)
SELECT AVG(goals) FROM table_name_81 WHERE team = "rah ahan" AND division < 1
what was the dose of captopril patient 9566 was prescribed in the current hospital encounter?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9566 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'captopril'
What is the total number of captains in each rank and class? Let class as X-axis, and categorize by rank with a stacked bar chart.
CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text)
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class
What circuit did Juan Manuel Fangio have the fastest lap at the german grand prix?
CREATE TABLE table_11805 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Report" text)
SELECT "Circuit" FROM table_11805 WHERE "Fastest lap" = 'juan manuel fangio' AND "Race" = 'german grand prix'
with api level of 18, what's the code name?
CREATE TABLE table_name_71 (code_name VARCHAR,api_level VARCHAR)
SELECT code_name FROM table_name_71 WHERE api_level = 18
When was the University founded that joined in 1978?
CREATE TABLE table_255188_1 (founded INTEGER,joined VARCHAR)
SELECT MAX(founded) FROM table_255188_1 WHERE joined = 1978
What is the local name given to the capital of Anguilla?
CREATE TABLE table_1008653_1 (capital___endonym__ VARCHAR,country___endonym__ VARCHAR)
SELECT capital___endonym__ FROM table_1008653_1 WHERE country___endonym__ = "Anguilla"
How many times was the final score l 96 123 (ot)?
CREATE TABLE table_17341 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("Record") FROM table_17341 WHERE "Score" = 'L 96–123 (OT)'
Get the list of white-russian patients with a neb route of drug administration.
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "NEB"
What was the margin of victory when the winning score was 12 (66-67-64-71=268)?
CREATE TABLE table_39482 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Margin of victory" FROM table_39482 WHERE "Winning score" = '−12 (66-67-64-71=268)'
What is the name of the deity that the state of Bihar was named after?
CREATE TABLE table_44784 ("Name of Deity" text,"Bhuta(Tatwa)" text,"Name of the Stone (Sila)" text,"Name of the River" text,"Name of the State where found in India" text)
SELECT "Name of Deity" FROM table_44784 WHERE "Name of the State where found in India" = 'bihar'
Utenti ordinati per numero di posts.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score ...
SELECT * FROM (Users AS U INNER JOIN Posts AS P ON U.Id = P.OwnerUserId)
What are the rank/s of Eddie Guerrero?
CREATE TABLE table_73483 ("#" real,"Name" text,"Country" text,"1" real,"2" real,"3" real,"Other placings" real,"Total" real,"First appearance" real,"Last appearance" real,"Federation" text)
SELECT "#" FROM table_73483 WHERE "Name" = 'Eddie Guerrero'
What's the nickname of the school in Maryville, Tennessee?
CREATE TABLE table_1973842_2 (nickname VARCHAR,location VARCHAR)
SELECT nickname FROM table_1973842_2 WHERE location = "Maryville, Tennessee"
Compare the total number of different product type codes.
CREATE TABLE Addresses (Address_ID INTEGER,address_details VARCHAR(255))CREATE TABLE Parties (Party_ID INTEGER,Party_Details VARCHAR(255))CREATE TABLE Agreements (Document_ID INTEGER,Event_ID INTEGER)CREATE TABLE Products_in_Events (Product_in_Event_ID INTEGER,Event_ID INTEGER,Product_ID INTEGER)CREATE TABLE Locations ...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code
how much did it cost patient 010-5308 a hospital stay in the first hospital encounter?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-5308' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)
Create a scatter chart to show the correlation between relationship between minimum product price and maximum product price by each product type.
CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_purchased VARCHAR(80),total_value_purchased DECIMAL(19,4))CREATE TABLE Staff_Department_Assignments (staff_id INTEGER,department_id INTEGER,date_assigned_from DATETIME,job_title_code...
SELECT MAX(product_price), MIN(product_price), product_type_code FROM Products GROUP BY product_type_code
List all FTE middle school teachers in Sunnyvale.
CREATE TABLE table_1414743_1 (fte_teachers VARCHAR,school_level VARCHAR,city VARCHAR)
SELECT fte_teachers FROM table_1414743_1 WHERE school_level = "Middle" AND city = "Sunnyvale"
What dance was Leeza Gibbons the worst dancer for, receiving a score lower than 15?
CREATE TABLE table_name_9 (best_score INTEGER,worst_dancer VARCHAR,worst_score VARCHAR)
SELECT MIN(best_score) FROM table_name_9 WHERE worst_dancer = "leeza gibbons" AND worst_score < 15
Bar graph to show the total number from different formats, and I want to rank by the x axis in desc.
CREATE TABLE genre (g_name varchar2(20),rating varchar2(10),most_popular_in varchar2(50))CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre varchar2(50))CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country varchar2(20),f_id number(10),genre_is va...
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats DESC
what is the primary disease and diagnosis long title of subject name steven sepulveda?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Steven Sepulveda"
Return the dates of ceremony and the results of all music festivals
CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,famous_release_date text)CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,vo...
SELECT date_of_ceremony, result FROM music_festival
how many different species were released in south africa ?
CREATE TABLE table_204_869 (id number,"species" text,"country of origin" text,"total released" number,"first release" text,"last release" text,"areas of release" text,"areas established" text,"pasture type" text)
SELECT COUNT(DISTINCT "species") FROM table_204_869 WHERE "country of origin" = 'south africa'
what is the patient name and procedure of the patient with id 29961?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT demographic.name, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "29961"
Which circuit was held on 25 28 march?
CREATE TABLE table_28957 ("Rd." text,"Circuit" text,"City / State" text,"Date" text,"Championship" text,"Challenge" text,"Production" text)
SELECT "Circuit" FROM table_28957 WHERE "Date" = '25–28 March'
Which years have a Decile larger than 4, and an Area of thames?
CREATE TABLE table_70465 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT "Years" FROM table_70465 WHERE "Decile" > '4' AND "Area" = 'thames'
What is the Format and Special Notes for of the pact: ...of the gods?
CREATE TABLE table_name_23 (format VARCHAR,_special_notes VARCHAR,title VARCHAR)
SELECT format, _special_notes FROM table_name_23 WHERE title = "the pact: ...of the gods"
At what stadium was the game with the final score of 26-24 played?
CREATE TABLE table_15575 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text)
SELECT "Stadium" FROM table_15575 WHERE "Final Score" = '26-24'
Wha is the rank for 52 574 avg. att?
CREATE TABLE table_64617 ("Season" text,"Division" text,"Rank" text,"Avg.Att." text,"Europe" text,"Top Goalscorer" text,"Goals" real)
SELECT "Rank" FROM table_64617 WHERE "Avg.Att." = '52 574'
Top users by average score in a given tag (non-CW posts).
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time...
SELECT a.OwnerUserId AS "user_link", a.OwnerDisplayName, AVG(CAST(a.Score AS FLOAT)) AS "average_score", SUM(a.Score) AS "total_score", COUNT(a.Id) AS "num_answers" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.PostTypeId = 2 AND q.Tags LIKE '%<##tagName##>%' AND a.CommunityOwnedDate IS NULL GROUP BY a.O...
What is the class of the Middletown High School team that is in the DSHA league?
CREATE TABLE table_name_98 (class VARCHAR,league VARCHAR,school VARCHAR)
SELECT class FROM table_name_98 WHERE league = "dsha" AND school = "middletown high school"
did tie number 4 or tie number 6 have higher attendance ?
CREATE TABLE table_204_846 (id number,"tie no" number,"home team" text,"score" text,"away team" text,"attendance" number)
SELECT "tie no" FROM table_204_846 WHERE "tie no" IN (4, 6) ORDER BY "attendance" DESC LIMIT 1
Which series numbers were directed by Monte Young?
CREATE TABLE table_19531 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT "No. in series" FROM table_19531 WHERE "Directed by" = 'Monte Young'