instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What 10:00 has a 7:30 of da kink in my hair?
CREATE TABLE table_67976 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text,"10:30" text)
SELECT "10:00" FROM table_67976 WHERE "7:30" = 'da kink in my hair'
Which courses are required before I can take ANTHRARC 492 ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varc...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
Which Representative has a Termination of Mission as May 24, 1905?
CREATE TABLE table_15168 ("Representative" text,"Title" text,"Presentation of Credentials" text,"Termination of Mission" text,"Appointed by" text)
SELECT "Representative" FROM table_15168 WHERE "Termination of Mission" = 'may 24, 1905'
how many candidates with result being new seat democratic gain
CREATE TABLE table_1341604_10 (candidates VARCHAR,result VARCHAR)
SELECT COUNT(candidates) FROM table_1341604_10 WHERE result = "New seat Democratic gain"
What was the number of seasons that was directed by Joanna Kerns?
CREATE TABLE table_21623 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT COUNT("Season #") FROM table_21623 WHERE "Directed by" = 'Joanna Kerns'
When was a game played at 7:00 pm?
CREATE TABLE table_46220 ("Date" text,"Opponent" text,"Location" text,"Time" text,"Result" text)
SELECT "Date" FROM table_46220 WHERE "Time" = '7:00 pm'
Name the least clock rate mhz when designation is rimm 4200
CREATE TABLE table_142573_1 (clock_rate__mhz_ INTEGER,designation VARCHAR)
SELECT MIN(clock_rate__mhz_) FROM table_142573_1 WHERE designation = "RIMM 4200"
Show the number of the names of editors that are on the committee of journals with sales bigger than 3000, and display in descending by the total number.
CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE editor (Editor_ID int,Name text,Age real)
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name) DESC
Which conventional plan has a POS plan of 21%?
CREATE TABLE table_7113 ("Year" real,"Conventional plans" text,"HMOs" text,"PPOs" text,"POS plans" text)
SELECT "Conventional plans" FROM table_7113 WHERE "POS plans" = '21%'
What year was Ontario's first LLCR?
CREATE TABLE table_4028 ("Province" text,"First LLCR" real,"Appearances" real,"Championships" real,"Runner Up" real)
SELECT "First LLCR" FROM table_4028 WHERE "Province" = 'Ontario'
What is the Opponent on Week 11?
CREATE TABLE table_62022 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Attendance" text)
SELECT "Opponent" FROM table_62022 WHERE "Week" = '11'
How many patients with hypoxia are younger than 54 year of age?
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 WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "54"
what are the four most frequent microbiological tests that patients took in the same month after receiving ot cerv fusion post/post until 3 years ago?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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)C...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
When is mr. ryan's DOB?
CREATE TABLE table_37391 ("Surname" text,"First" text,"D.O.B." text,"Bats" text,"Throws" text,"Position" text)
SELECT "D.O.B." FROM table_37391 WHERE "Surname" = 'ryan'
What team was the opponent when there were 27,321 in attendance?
CREATE TABLE table_name_86 (opponent VARCHAR,attendance VARCHAR)
SELECT opponent FROM table_name_86 WHERE attendance = "27,321"
how many prescriptions for papain-urea ointment during this year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)C...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'papain-urea ointment' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
what flights land at MKE
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,mi...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
Who is the advisor of student with ID 1004?
CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)
SELECT advisor FROM student WHERE stuid = 1004
how many patients of asian ethnicity are under 48 years of age?
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 WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "48"
Who had a finish of t20?
CREATE TABLE table_60568 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Player" FROM table_60568 WHERE "Finish" = 't20'
How many penalties are there when Eric Vigeanel is the rider?
CREATE TABLE table_22555 ("Nation" text,"Rider" text,"Horse" text,"Cross Country Penalties" text,"Total Penalties" text,"Total Team Penalties" text,"Team Rank" real)
SELECT COUNT("Total Penalties") FROM table_22555 WHERE "Rider" = 'Eric Vigeanel'
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display by the bars in asc please.
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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID ...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd?
CREATE TABLE table_name_51 (record VARCHAR,finish VARCHAR,year VARCHAR,manager VARCHAR)
SELECT record FROM table_name_51 WHERE year > 1992 AND manager = "tom kotchman" AND finish = "2nd"
How many month names are there for the tenth numbered month?
CREATE TABLE table_28985631_1 (month_name VARCHAR,numbered_month VARCHAR)
SELECT COUNT(month_name) FROM table_28985631_1 WHERE numbered_month = "Tenth"
What is the score for Nick Faldo?
CREATE TABLE table_59420 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Score" FROM table_59420 WHERE "Player" = 'nick faldo'
In 2011, how many wins did Michael Meadows have?
CREATE TABLE table_33458 ("Year" real,"Drivers" text,"Wins" real,"Points" text,"D.C." text)
SELECT SUM("Wins") FROM table_33458 WHERE "Year" = '2011' AND "Drivers" = 'michael meadows'
Show me the proportion on how many assets can each parts be used in? List the part name and the number.
CREATE TABLE Parts (part_id INTEGER,part_name VARCHAR(255),chargeable_yn VARCHAR(1),chargeable_amount VARCHAR(20),other_part_details VARCHAR(255))CREATE TABLE Engineer_Skills (engineer_id INTEGER,skill_id INTEGER)CREATE TABLE Maintenance_Engineers (engineer_id INTEGER,company_id INTEGER,first_name VARCHAR(50),last_name...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name
What is the run 3 of the athlete with a run 1 more than 53.75 and a run 2 less than 52.91?
CREATE TABLE table_name_5 (run_3 INTEGER,run_1 VARCHAR,run_2 VARCHAR)
SELECT SUM(run_3) FROM table_name_5 WHERE run_1 > 53.75 AND run_2 < 52.91
List the pictorals from issues when lindsey roeper was the cover model.
CREATE TABLE table_1566852_8 (pictorials VARCHAR,cover_model VARCHAR)
SELECT pictorials FROM table_1566852_8 WHERE cover_model = "Lindsey Roeper"
what is the total rank on airdate march 30, 2011?
CREATE TABLE table_74220 ("Episode Number" text,"Episode Name" text,"Airdate" text,"Viewers (millions)" text,"Rank(Timeslot)" text,"Rank 18\u201349 (Night)" text)
SELECT COUNT("Rank(Timeslot)") FROM table_74220 WHERE "Airdate" = 'March 30, 2011'
For directors who had more than one movie, bin the year into Year interval and them compute the total number of movies in each year bucket, and group by title The result can be drawn as a trend line, and show x-axis in ascending order.
CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year
Who is the second for the curling team which has alternate Margarita Fomina?
CREATE TABLE table_name_48 (second VARCHAR,alternate VARCHAR)
SELECT second FROM table_name_48 WHERE alternate = "margarita fomina"
Which Genitive 1 has a Genitive 3 of *n(i)-ia?
CREATE TABLE table_40801 ("Free" text,"Free polite" text,"Genitive 1" text,"Genitive 2" text,"Genitive 3" text)
SELECT "Genitive 1" FROM table_40801 WHERE "Genitive 3" = '*n(i)-ia'
Do the Sky Calcio 5 channels have PPV?
CREATE TABLE table_1360 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"PPV" text,"Package/Option" text)
SELECT "PPV" FROM table_1360 WHERE "Television service" = 'Sky Calcio 5'
How many episodes have the production code 8.04
CREATE TABLE table_2226817_9 (directed_by VARCHAR,production_code VARCHAR)
SELECT COUNT(directed_by) FROM table_2226817_9 WHERE production_code = "8.04"
what school is scheduled to play first ?
CREATE TABLE table_204_718 (id number,"date" text,"opponent" text,"time" text,"score" text,"record" text)
SELECT "opponent" FROM table_204_718 ORDER BY "date" LIMIT 1
What school location had an enrollment of 12400?
CREATE TABLE table_1457 ("Institution" text,"Location" text,"Nickname" text,"Enrollment" real,"Established" real)
SELECT "Location" FROM table_1457 WHERE "Enrollment" = '12400'
Who was the opponent when the Seattle Seahawks had a record of 0-1?
CREATE TABLE table_80098 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text)
SELECT "Opponent" FROM table_80098 WHERE "Record" = '0-1'
urine albumin _ to _ creatinine ratio greater or equal to 300 mg / g
CREATE TABLE table_train_246 ("id" int,"allergy_to_dapagliflozin" bool,"allergy_to_exenatide" bool,"estimated_glomerular_filtration_rate_egfr" int,"fasting_c_peptide" float,"urine_albumin_to_creatinine_ratio_uacr" int,"fasting_triglyceride" int,"NOUSE" float)
SELECT * FROM table_train_246 WHERE urine_albumin_to_creatinine_ratio_uacr >= 300
What was the score when the opponent was Detroit Pistons?
CREATE TABLE table_38717 ("Date" text,"Opponent" text,"Result" text,"Score" text,"Record" text,"Streak" text)
SELECT "Score" FROM table_38717 WHERE "Opponent" = 'detroit pistons'
How many apartment bookings in each year? Show me a bar chart binning booking end date by year.
CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABL...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings
What is Player, when Year(s) Won is before 1961, and when To Par is 6?
CREATE TABLE table_name_42 (player VARCHAR,year_s__won VARCHAR,to_par VARCHAR)
SELECT player FROM table_name_42 WHERE year_s__won < 1961 AND to_par = 6
What is Time, when Ground is Waverley Park, and when Away Team is Footscray?
CREATE TABLE table_name_69 (time VARCHAR,ground VARCHAR,away_team VARCHAR)
SELECT time FROM table_name_69 WHERE ground = "waverley park" AND away_team = "footscray"
Opponent of @ braves, and a Loss of pelfrey (2 5) had what score?
CREATE TABLE table_75023 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_75023 WHERE "Opponent" = '@ braves' AND "Loss" = 'pelfrey (2–5)'
Show all locations and the total number of platforms and passengers for all train stations in each location.
CREATE TABLE station (LOCATION VARCHAR,number_of_platforms INTEGER,total_passengers INTEGER)
SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION
What is the low silver total associated with under 1 total?
CREATE TABLE table_36736 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Silver") FROM table_36736 WHERE "Total" < '1'
What is the INE code of the municipality whose official name is Berantevilla?
CREATE TABLE table_31421 ("Official name" text,"INE code" real,"Name in Spanish" text,"Name in Basque" text,"Population (2007)" real)
SELECT MAX("INE code") FROM table_31421 WHERE "Official name" = 'Berantevilla'
What's the average round the position of RB was drafted?
CREATE TABLE table_42183 ("Round" real,"Pick" real,"Name" text,"Position" text,"College" text)
SELECT AVG("Round") FROM table_42183 WHERE "Position" = 'rb'
Who is in July where February is linda forsythe?
CREATE TABLE table_name_8 (july VARCHAR,february VARCHAR)
SELECT july FROM table_name_8 WHERE february = "linda forsythe"
What venue has Scotland as the opposing teams?
CREATE TABLE table_59960 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT "Venue" FROM table_59960 WHERE "Opposing Teams" = 'scotland'
what was the drug that was prescribed to patient 002-58884 on the first hospital visit via the mucous mem route for the first time?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi...
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 = '002-58884' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p...
What is the date of the away game in week 8?
CREATE TABLE table_57326 ("Week" real,"Date" text,"Opponent" text,"Home/Away Game" text,"Result" text)
SELECT "Date" FROM table_57326 WHERE "Home/Away Game" = 'away' AND "Week" = '8'
Who's the Socialist ticket with a Republican ticket of john a. may?
CREATE TABLE table_name_2 (socialist_ticket VARCHAR,republican_ticket VARCHAR)
SELECT socialist_ticket FROM table_name_2 WHERE republican_ticket = "john a. may"
What is the highest capacity in Aslantepe in 2002-2005?
CREATE TABLE table_name_97 (capacity INTEGER,location VARCHAR,year VARCHAR)
SELECT MAX(capacity) FROM table_name_97 WHERE location = "aslantepe" AND year = "2002-2005"
How many records are there for the game on november 24?
CREATE TABLE table_27715173_6 (record VARCHAR,date VARCHAR)
SELECT COUNT(record) FROM table_27715173_6 WHERE date = "November 24"
How many deaths were there when the total casualties were 6?
CREATE TABLE table_name_33 (total_deaths VARCHAR,total_casualties VARCHAR)
SELECT total_deaths FROM table_name_33 WHERE total_casualties = "6"
Name the total number of episodes for s fire extinguisher
CREATE TABLE table_15187735_10 (episode VARCHAR,segment_a VARCHAR)
SELECT COUNT(episode) FROM table_15187735_10 WHERE segment_a = "s Fire Extinguisher"
how many patients belonging to white ethnic origin were admitted in the year less than or equal to 2120?
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2120"
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display X from low to high order please.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 ...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
Find the players' first name and last name who won award both in 1960 and in 1961.
CREATE TABLE player_award (year VARCHAR)CREATE TABLE player (name_first VARCHAR,name_last VARCHAR)
SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961
For those records from the products and each product's manufacturer, a scatter chart shows the correlation between price and revenue , and group by attribute name.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Price, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
flights between NEW YORK and MIAMI
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_dis...
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI...
What is Local Location, when Resident Country is 'Belgium', and when Mission is 'Poland'?
CREATE TABLE table_62109 ("Mission" text,"Resident Country" text,"Local Location" text,"Local Mission" text,"Non-Resident Head of Mission" text,"Local Position" text)
SELECT "Local Location" FROM table_62109 WHERE "Resident Country" = 'belgium' AND "Mission" = 'poland'
Most popular StackOverflow tags in May 2014.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)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 Tags (Id num...
SELECT num.TagName AS Tag, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(DISTINCT OwnerUserId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2014-05-01' AND Posts.CreationDate > '2014-04-01' GROUP BY TagName) AS rat...
What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?
CREATE TABLE staff (staff_id number,staff_address_id number,nickname text,first_name text,middle_name text,last_name text,date_of_birth time,date_joined_staff time,date_left_staff time)CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country te...
SELECT AVG(price) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
In which season did the vora settlements join the league?
CREATE TABLE table_61485 ("Clubs" text,"Seasons at this level" text,"Settlements" text,"Season joined league" text,"Position in 1959\u20131960" text)
SELECT "Season joined league" FROM table_61485 WHERE "Settlements" = 'évora'
Which is the total number in the 2010 Census in Oconee County where the area in square miles was less than 674?
CREATE TABLE table_name_9 (county VARCHAR,area__sq_mi_ VARCHAR)
SELECT SUM(2010 AS _census_population) FROM table_name_9 WHERE county = "oconee county" AND area__sq_mi_ < 674
give me the number of patients whose admission type is elective and drug type is additive.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug_type = "ADDITIVE"
All answers by deleted users.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)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 numb...
SELECT a.Id AS "post_id", a.OwnerDisplayName FROM Posts AS a WHERE a.OwnerUserId IS NULL ORDER BY a.CreationDate
Give me a histogram for how many documents are there of each type?, rank from high to low by the y axis.
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Budget_C...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC
Who's the Republican ticket with a Socialist ticket of edna mitchell blue?
CREATE TABLE table_42300 ("Office" text,"Democratic ticket" text,"Republican ticket" text,"American Labor ticket" text,"Socialist ticket" text)
SELECT "Republican ticket" FROM table_42300 WHERE "Socialist ticket" = 'edna mitchell blue'
For those employees who did not have any job in the past, find hire_date and the average of department_id bin hire_date by weekday, and visualize them by a bar chart, rank by the total number in descending.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
Top 20 most famous (viewed) questions.
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,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT Id AS "post_link", OwnerUserId AS "user_link", ViewCount FROM Posts WHERE PostTypeId = 1 ORDER BY ViewCount DESC LIMIT 20
Which Against has a Date of 30/05/1981?
CREATE TABLE table_name_63 (against VARCHAR,date VARCHAR)
SELECT COUNT(against) FROM table_name_63 WHERE date = "30/05/1981"
What year was the structure in greensboro, north carolina considered tallest?
CREATE TABLE table_name_16 (year VARCHAR,town VARCHAR)
SELECT year FROM table_name_16 WHERE town = "greensboro, north carolina"
Name the number of species with sepal width of 3.4 and sepal length of 5.4
CREATE TABLE table_10477224_1 (species VARCHAR,sepal_width VARCHAR,sepal_length VARCHAR)
SELECT COUNT(species) FROM table_10477224_1 WHERE sepal_width = "3.4" AND sepal_length = "5.4"
What is the Format of the release in Greece?
CREATE TABLE table_name_16 (format VARCHAR,region VARCHAR)
SELECT format FROM table_name_16 WHERE region = "greece"
What was the score of the game where the adelaide 36ers were the home team?
CREATE TABLE table_43905 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Crowd" real,"Box Score" text,"Report" text)
SELECT "Score" FROM table_43905 WHERE "Home team" = 'adelaide 36ers'
how many patients are admitted under elective type and diagnosed with icd9 code 42833?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "42833"
What is the Russian word for wine glass that contains 4.16 fl. oz.?
CREATE TABLE table_39047 ("Unit" text,"Russian" text,"Translation" text,"Ratio" text,"Cubic inches (exact)" text,"Metric value" text,"Imperial" text,"US Customary" text)
SELECT "Russian" FROM table_39047 WHERE "US Customary" = '4.16 fl. oz.'
what is the difference between suicides in poland and sudetendeutsch ?
CREATE TABLE table_203_234 (id number,"description" text,"total" number,"poland" number,"baltic states(resettled in poland during war)" number,"resettled in poland during war(from ussr and romania)" number,"sudetendeutsch" number,"se europe\n(hungary,romania,yugoslavia & slovakia)" number)
SELECT (SELECT "poland" FROM table_203_234 WHERE "description" = 'suicides') - (SELECT "sudetendeutsch" FROM table_203_234 WHERE "description" = 'suicides')
Which Opponent has a Round of 4, and a Rules of thai boxing?
CREATE TABLE table_name_16 (opponent VARCHAR,round VARCHAR,rules VARCHAR)
SELECT opponent FROM table_name_16 WHERE round = "4" AND rules = "thai boxing"
how many games had attendance of over 50,000 ?
CREATE TABLE table_203_598 (id number,"date" text,"time" text,"opponent" text,"site" text,"tv" text,"result" text,"attendance" number)
SELECT COUNT(*) FROM table_203_598 WHERE "attendance" > 50000
What is the status of the building with more than 28 floor and a year of 2013?
CREATE TABLE table_name_57 (status VARCHAR,floors VARCHAR,year VARCHAR)
SELECT status FROM table_name_57 WHERE floors > 28 AND year = 2013
Who were the candidates in the district first elected in 1998 whose incumbent ended up being Paul Ryan?
CREATE TABLE table_18132 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text)
SELECT "Candidates" FROM table_18132 WHERE "First elected" = '1998' AND "Incumbent" = 'Paul Ryan'
Return a histogram on what are the names and distances for all airplanes?
CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE T...
SELECT name, distance FROM aircraft
What game did Jets have an attendance of 78,722?
CREATE TABLE table_33035 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" text)
SELECT "Game site" FROM table_33035 WHERE "Attendance" = '78,722'
What is the lowest react of the athlete from the United States who has a lane less than 4?
CREATE TABLE table_63052 ("Rank" real,"Lane" real,"Athlete" text,"Country" text,"Time" real,"React" real)
SELECT MIN("React") FROM table_63052 WHERE "Country" = 'united states' AND "Lane" < '4'
count the number of patients whose admission type is urgent and who were admitted before 2190.
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)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2190"
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 phone_number and salary , and show by the bar from high to low.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STAT...
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
What is the attendance that has fedex field as the game site with 3 as the week?
CREATE TABLE table_37463 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text)
SELECT "Attendance" FROM table_37463 WHERE "Game site" = 'fedex field' AND "Week" = '3'
Who are the rowers with the time of 5:54.57?
CREATE TABLE table_name_96 (rowers VARCHAR,time VARCHAR)
SELECT rowers FROM table_name_96 WHERE time = "5:54.57"
Which Album title has a Title of ?
CREATE TABLE table_name_53 (album_title VARCHAR,title VARCHAR)
SELECT album_title FROM table_name_53 WHERE title = "滑板"
What is the Western Division of Wins with a 4th Finish?
CREATE TABLE table_name_95 (wins VARCHAR,division VARCHAR,finish VARCHAR)
SELECT wins FROM table_name_95 WHERE division = "western" AND finish = "4th"
give me the number of patients whose diagnoses long title is chronic kidney disease, stage iv (severe) and drug type is main?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic kidney disease, Stage IV (severe)" AND prescriptions.drug_type = "MAIN"
What was the highest crowd in Victoria Park?
CREATE TABLE table_78420 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT MAX("Crowd") FROM table_78420 WHERE "Venue" = 'victoria park'
Nickname of the school established in 1773
CREATE TABLE table_20801 ("Institution" text,"Location" text,"Nickname" text,"Enrollment" real,"Established" real)
SELECT "Nickname" FROM table_20801 WHERE "Established" = '1773'
What Dialcode has a location of Edmonton?
CREATE TABLE table_name_11 (dialcode VARCHAR,location VARCHAR)
SELECT dialcode FROM table_name_11 WHERE location = "edmonton"
what is patient 003-54278's height for the last time until 02/2103?
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,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54278') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-02' ORDER BY patient.unitadmittime DESC LIMIT...
Who is the vocal percussionist for Sex Bomb?
CREATE TABLE table_74314 ("Track no." real,"Track" text,"Original Artist" text,"Soloist(s)" text,"Vocal Percussionist" text,"Arranger(s)" text)
SELECT "Vocal Percussionist" FROM table_74314 WHERE "Track" = 'Sex Bomb'