instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is Date, when Athlete is 'Yussuf Alli'?
CREATE TABLE table_60370 ("Nation" text,"Distance" text,"Athlete" text,"Venue" text,"Date" text)
SELECT "Date" FROM table_60370 WHERE "Athlete" = 'yussuf alli'
WHAT IS THE SCORE WITH A TIE NUMBER OF 13?
CREATE TABLE table_name_86 (score VARCHAR,tie_no VARCHAR)
SELECT score FROM table_name_86 WHERE tie_no = "13"
I haven 't taken 373 , which upper classes can I take ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)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 va...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
which single was released after song i hate ?
CREATE TABLE table_203_751 (id number,"year" number,"title" text,"peak chart positions\nus\nair" number,"peak chart positions\nus\nmain" number,"peak chart positions\nus\nmod" number,"album" text)
SELECT "title" FROM table_203_751 WHERE "year" > (SELECT "year" FROM table_203_751 WHERE "title" = '"song i hate"') ORDER BY "year" LIMIT 1
who was in the 2005 role when the original broadway cast was played by jesse l. martin?
CREATE TABLE table_26436_2 (original_broadway_cast VARCHAR)
SELECT 2005 AS _film FROM table_26436_2 WHERE original_broadway_cast = "Jesse L. Martin"
Give the date of games against minnesota wild
CREATE TABLE table_21642 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Date" FROM table_21642 WHERE "Opponent" = 'Minnesota Wild'
what is the number of patients whose admission year is less than 2138 and lab test name is folate?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2138" AND lab.label = "Folate"
How many pick # are there for the goaltender position?
CREATE TABLE table_24976 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT MIN("Pick #") FROM table_24976 WHERE "Position" = 'Goaltender'
Name the character for sophie arthuys
CREATE TABLE table_19725 ("Character" text,"French voice actor" text,"Italian voice actor" text,"German voice actor" text,"Spanish voice actor" text)
SELECT "Character" FROM table_19725 WHERE "French voice actor" = 'Sophie Arthuys'
Name the total number of chapter for chinese of
CREATE TABLE table_80081 ("Chapter" real,"Chinese" text,"Pinyin" text,"Translation" text,"Subject" text)
SELECT COUNT("Chapter") FROM table_80081 WHERE "Chinese" = '釋宮'
Which classes will Prof. George Bornstein instruct this coming year ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%George Bornstein%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor....
What type has an unspecified species and less than 367 genes?
CREATE TABLE table_53848 ("Species" text,"Strain" text,"Type" text,"Base Pairs" real,"Genes" real)
SELECT "Type" FROM table_53848 WHERE "Species" = 'unspecified' AND "Genes" < '367'
What is the lowest value for Events, when the value for Top-5 is greater than 1?
CREATE TABLE table_15570 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MIN("Events") FROM table_15570 WHERE "Top-5" > '1'
is the potassium of patient 51858 last measured on the current hospital visit less than the value second to last measured on the current hospital visit.
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') ORDER BY labevents.charttim...
Top Oracle PL/SQL from India.
CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Descriptio...
SELECT DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE (TagName LIKE '%java%') AND LOWER(Location) LIKE '%...
What is City of License, when Frequency is greater than 1380?
CREATE TABLE table_59394 ("Frequency" real,"Callsign" text,"Brand" text,"City of License" text,"Type" text)
SELECT "City of License" FROM table_59394 WHERE "Frequency" > '1380'
What was the away team score at Hawthorn?
CREATE TABLE table_name_26 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team AS score FROM table_name_26 WHERE home_team = "hawthorn"
Between 429 and 311 , which course is harder ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_...
SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 429 OR course.number = 311) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1
Return the names and ids of customers who have TN in their address by a bar chart.
CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Department_Store_Chain (dept_store_chain_id INTEGER,dept_store_chain_name VARCHAR(80))CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(10),customer_code VARCHAR(20),customer_na...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
Top 10 Tags on SO by count.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)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 ReviewTaskResults (Id number,ReviewTaskId number,...
SELECT TagName, Count FROM Tags ORDER BY Count DESC LIMIT 10
What platform is nds4droid on for the nintendo ds with a license of gpl v2?
CREATE TABLE table_name_93 (platform VARCHAR,name VARCHAR,system VARCHAR,license VARCHAR)
SELECT platform FROM table_name_93 WHERE system = "nintendo ds" AND license = "gpl v2" AND name = "nds4droid"
What is the fewest gold medals won by Greece?
CREATE TABLE table_65909 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Gold") FROM table_65909 WHERE "Nation" = 'greece'
What is the total number of Raiders First Downs, when Date is 'Nov. 2', and when Raiders Points is greater than 42?
CREATE TABLE table_name_21 (raiders_first_downs VARCHAR,date VARCHAR,raiders_points VARCHAR)
SELECT COUNT(raiders_first_downs) FROM table_name_21 WHERE date = "nov. 2" AND raiders_points > 42
which year in this golfer 's career saw her have the most 2nd place finishes ?
CREATE TABLE table_204_940 (id number,"year" number,"tournaments\nplayed" number,"cuts\nmade" number,"wins" number,"2nd" number,"3rd" number,"top 10s" number,"best\nfinish" text,"earnings\n(\u20ac)" number,"money\nlist rank" number,"scoring\naverage" number,"scoring\nrank" number,"rolex\nranking" number)
SELECT "year" FROM table_204_940 ORDER BY "2nd" DESC LIMIT 1
What is the name of the plaza where the toll for heavy vehicles with 2 axles is r87.00?
CREATE TABLE table_72277 ("Name" text,"Location" text,"Light vehicle" text,"Heavy vehicle (2 axles)" text,"Heavy vehicle (3/4 axles)" text,"Heavy vehicle (5+ axles)" text)
SELECT "Name" FROM table_72277 WHERE "Heavy vehicle (2 axles)" = 'R87.00'
count the number of patients who received a antiemetic - serotonin antagonist procedure within 2 months after they had received a stress ulcer prophylaxis - pantoprazole procedure until 2 years ago.
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,orga...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer prophylaxis - pantoprazole' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '...
what was the prescription drug that was prescribed to patient 007-8693 within 2 days after the diagnosis of sedated?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE medication (medicationid number,patientunitstayid number,drugn...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8693') AND diagnosis.diagnosi...
what is the average age for each dorm and what are the names of each dorm?
CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1)...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name
What is the rank when there are more than 107 laps and the qual is 137.825?
CREATE TABLE table_name_26 (rank VARCHAR,laps VARCHAR,qual VARCHAR)
SELECT rank FROM table_name_26 WHERE laps > 107 AND qual = "137.825"
Show total number of id from each nationality, sort Nationality in desc order.
CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE 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 TABLE stadiu...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
For those employees who was hired before 2002-06-21, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, could you order x-axis in desc order?
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 JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
What is the Capacity in use with an Annual change that is 21.8%?
CREATE TABLE table_42077 ("Rank" real,"Location" text,"Total Passengers" real,"Annual change" text,"Capacity in use" text)
SELECT "Capacity in use" FROM table_42077 WHERE "Annual change" = '21.8%'
What is the lowest first elected?
CREATE TABLE table_18108 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text)
SELECT MIN("First elected") FROM table_18108
get me the dosage and code of drug taken by patient brian taylor.
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 prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Brian Taylor"
Who are all the stage winners where the team classification is Caisse D'epargne?
CREATE TABLE table_1755 ("Stage (Winner)" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text,"Team classification" text)
SELECT "Stage (Winner)" FROM table_1755 WHERE "Team classification" = 'Caisse d''Epargne'
Recent questions with specific word in the title (case insensitive).
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTask...
SELECT Id AS "post_link", Title, OwnerUserId AS "user_link", Score, Tags, CreationDate FROM Posts WHERE (PostTypeId = 1) AND (Title LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY Id DESC LIMIT 100
Who was the arranger for the track written by Nizar Francis ?
CREATE TABLE table_14778650_1 (arranger VARCHAR,writer VARCHAR)
SELECT arranger FROM table_14778650_1 WHERE writer = "Nizar Francis"
What is the highest value for multi lane if category wise is major district roads?
CREATE TABLE table_28723146_2 (multi_lane INTEGER,category_wise VARCHAR)
SELECT MAX(multi_lane) FROM table_28723146_2 WHERE category_wise = "Major district roads"
Who won the 2010 Kids' Choice Awards?
CREATE TABLE table_42897 ("Year" real,"Award" text,"Category" text,"Recipient" text,"Result" text)
SELECT "Recipient" FROM table_42897 WHERE "Award" = '2010 kids'' choice awards' AND "Result" = 'won'
What's Luis Siri's shooting score?
CREATE TABLE table_12407546_1 (shooting VARCHAR,athlete__noc_ VARCHAR)
SELECT shooting FROM table_12407546_1 WHERE athlete__noc_ = "Luis Siri"
When was the new manager of the team on 21st position appointed?
CREATE TABLE table_19359427_6 (date_of_appointment VARCHAR,position_in_table VARCHAR)
SELECT date_of_appointment FROM table_19359427_6 WHERE position_in_table = "21st"
Name the typed for formed from 6-pul trailer third in res unit
CREATE TABLE table_name_40 (type VARCHAR,formed_from VARCHAR)
SELECT type FROM table_name_40 WHERE formed_from = "6-pul trailer third in res unit"
when was the first time the respiratory rate of patient 3125 was measured today at greater than 14.0?
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 TABLE microbiologyevents (row_id number,subject_id number,hadm_id nu...
SELECT chartevents.charttime 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 = 3125)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirato...
What is the phone number and postal code of the address 1031 Daugavpils Parkway?
CREATE TABLE film_actor (actor_id number,film_id number,last_update time)CREATE TABLE film_category (film_id number,category_id number,last_update time)CREATE TABLE customer (customer_id number,store_id number,first_name text,last_name text,email text,address_id number,active boolean,create_date time,last_update time)C...
SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'
What country is in the region of France?
CREATE TABLE table_29487895_2 (title_in_country VARCHAR,country___region VARCHAR)
SELECT title_in_country FROM table_29487895_2 WHERE country___region = "France"
What is the average of the swimsuit smaller than 9.545 , of Iowa, with an evening gown larger than 9.625?
CREATE TABLE table_54692 ("State" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real)
SELECT AVG("Average") FROM table_54692 WHERE "Swimsuit" < '9.545' AND "State" = 'iowa' AND "Evening Gown" > '9.625'
A line chart for what are the number of the dates that have an average sea level pressure between 303 and 31?, and list by the X-axis in descending.
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date DESC
List the hosts of performances in ascending order of attendance.
CREATE TABLE performance (HOST VARCHAR,Attendance VARCHAR)
SELECT HOST FROM performance ORDER BY Attendance
How many courses for each course description? Show me a stacked bar chart. The x-axis is course description and group by instructor's first name.
CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TAB...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME, CRS_DESCRIPTION
I want to know the proportion of sum school id for each all home.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home
Site Info: Score - Post Count.
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 Score, COUNT(Score) AS count FROM Posts GROUP BY Score ORDER BY Score
What date did the Boston Celtics play at Richfield Coliseum?
CREATE TABLE table_name_99 (date VARCHAR,location VARCHAR)
SELECT date FROM table_name_99 WHERE location = "richfield coliseum"
how many elements have data that is below the 25th ?
CREATE TABLE table_204_39 (id number,"number" number,"symbol" text,"name" text,"21st" number,"22nd" number,"23rd" number,"24th" number,"25th" number,"26th" number,"27th" number,"28th" number,"29th" number,"30th" number)
SELECT COUNT("name") FROM table_204_39 WHERE "number" > 25
What is the Away Team Score of the Collingwood Home Team?
CREATE TABLE table_52066 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_52066 WHERE "Away team" = 'collingwood'
List the number of enginners and group by last name in a bar chart, sort in asc by the bar.
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 Fault_Log_Parts (fault_log_entry_id INTEGER,part_fault_id INTEGER,fault_status VARCHAR(10))CREATE TABLE Staff (staff_id INTEGER,staff_name VARCHAR(255),gender VA...
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY last_name
What is the total number of the crowd at Glenferrie Oval?
CREATE TABLE table_33559 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT COUNT("Crowd") FROM table_33559 WHERE "Venue" = 'glenferrie oval'
What is the highest lane with a rank larger than 2 in Guyana?
CREATE TABLE table_64383 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real)
SELECT MAX("Lane") FROM table_64383 WHERE "Rank" > '2' AND "Nationality" = 'guyana'
What's the average Week with the Result l 23 3?
CREATE TABLE table_7135 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT AVG("Week") FROM table_7135 WHERE "Result" = 'l 23–3'
papers written by oren etzioni
CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'oren etzioni' AND writes.authorid = author.authorid
How many hours do the students spend studying in each department?
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 professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CR...
SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code
Return a histogram on how old is each gender, on average?, and could you show bars in asc order please?
CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender
How many overalls have E as the position, buddy payne as the name, and a pick less than 5?
CREATE TABLE table_name_29 (overall VARCHAR,pick VARCHAR,position VARCHAR,name VARCHAR)
SELECT COUNT(overall) FROM table_name_29 WHERE position = "e" AND name = "buddy payne" AND pick < 5
On what date was the Ed Remaster CD and TOCT-24365 Catalog released?
CREATE TABLE table_name_88 (date VARCHAR,format VARCHAR,catalog VARCHAR)
SELECT date FROM table_name_88 WHERE format = "ed remaster cd" AND catalog = "toct-24365"
What is the christian amount where work participation rate is the composition?
CREATE TABLE table_1077 ("Composition" text,"s Hindu" text,"s Muslim" text,"Christians" text,"s Sikh" text,"Buddhist" text,"s Jain" text,"Others" text)
SELECT "Christians" FROM table_1077 WHERE "Composition" = 'Work Participation Rate'
What place did the Nashville Metros place in the 1994/95 Season?
CREATE TABLE table_name_64 (regular_season VARCHAR,year VARCHAR)
SELECT regular_season FROM table_name_64 WHERE year = "1994/95"
Writing SQL with SQL example INPUT..
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 PostTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text...
SELECT 'SELECT CAST(''' + Badges.Name + '''AS VARCHAR(50)), COUNT(1) FROM BADGES WHERE BADGES.NAME = ''' + Badges.Name + ''' UNION ALL' FROM Badges GROUP BY Badges.Name
Name the record on june 22
CREATE TABLE table_name_89 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_89 WHERE date = "june 22"
How many statements do we have?
CREATE TABLE Statements (Id VARCHAR)
SELECT COUNT(*) FROM Statements
How many have a class of 330?
CREATE TABLE table_name_97 (quantity_made VARCHAR,class VARCHAR)
SELECT quantity_made FROM table_name_97 WHERE class = "330"
What is the average Bronze, when Total is 7, and when Silver is greater than 1?
CREATE TABLE table_name_23 (bronze INTEGER,total VARCHAR,silver VARCHAR)
SELECT AVG(bronze) FROM table_name_23 WHERE total = 7 AND silver > 1
What country was Brage, built by karljohansverns verft, from?
CREATE TABLE table_name_23 (country VARCHAR,builder VARCHAR,ship VARCHAR)
SELECT country FROM table_name_23 WHERE builder = "karljohansverns verft" AND ship = "brage"
how much is the total hospital cost of patient 8245 in the last year?
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 TABLE patients (row_id number,subject_id number,gender text,dob time...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8245) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
What event did Soa Palelei fight against son hai suk?
CREATE TABLE table_name_31 (event VARCHAR,opponent VARCHAR)
SELECT event FROM table_name_31 WHERE opponent = "son hai suk"
What is the loss with 319 points?
CREATE TABLE table_name_66 (lost VARCHAR,points_for VARCHAR)
SELECT lost FROM table_name_66 WHERE points_for = "319"
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID var...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
What are the customer name and date of the orders whose status is 'Delivered'.
CREATE TABLE customer_orders (order_id number,customer_id number,order_status text,order_date time,order_details text)CREATE TABLE customer_contact_channels (customer_id number,channel_code text,active_from_date time,active_to_date time,contact_number text)CREATE TABLE products (product_id number,product_details text)C...
SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
What is the final result of the team that has Simara as No.5?
CREATE TABLE table_67500 ("No.1" text,"No.2" text,"No.3" text,"No.4" text,"No.5" text,"No.6" text,"No.7" text,"No.8" text,"FINAL" text)
SELECT "FINAL" FROM table_67500 WHERE "No.5" = 'simara'
What were the results for mens 40 when the mens u20 was Southern Suns def Gold Coast Sharks?
CREATE TABLE table_20995 ("Year" real,"Mens Open" text,"Womens Open" text,"Mixed Open" text,"Mens u20" text,"Womens u20" text,"Senior Mixed" text,"Mens 30" text,"Womens 30" text,"Mens 35" text,"Womens 35" text,"Mens 40" text,"Womens 40" text,"Mens 45" text,"Mens 50" text)
SELECT "Mens 40" FROM table_20995 WHERE "Mens u20" = 'Southern Suns def Gold Coast Sharks'
What is the lowest bronze total that has a silver total of 13 medals?
CREATE TABLE table_name_72 (bronze INTEGER,silver VARCHAR)
SELECT MIN(bronze) FROM table_name_72 WHERE silver = "13"
Name who wrote number 47
CREATE TABLE table_20158 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT "Written by" FROM table_20158 WHERE "No. in series" = '47'
Before 1979, what position was the European Indoor Championships?
CREATE TABLE table_name_78 (position VARCHAR,competition VARCHAR,year VARCHAR)
SELECT position FROM table_name_78 WHERE competition = "european indoor championships" AND year < 1979
give the number of patients who had colonscopy.
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Colonoscopy"
Number of individual users who have asked questions.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLice...
SELECT COUNT(DISTINCT Id) FROM Users
Which label's year is 1993?
CREATE TABLE table_42519 ("Year" text,"Title" text,"Genre" text,"Label" text,"Result" text)
SELECT "Label" FROM table_42519 WHERE "Year" = '1993'
What was the attendance when they had a ranking of #4?
CREATE TABLE table_61714 ("Date" text,"Opponent#" text,"Rank #" text,"Site" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_61714 WHERE "Rank #" = '4'
what is the admission type and discharge location of subject id 990?
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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "990"
What's the lowest number of points with fewer than 8 losses and fewer than 24 games for the vancouver burrards?
CREATE TABLE table_name_66 (points INTEGER,games VARCHAR,losses VARCHAR,team_name VARCHAR)
SELECT MIN(points) FROM table_name_66 WHERE losses < 8 AND team_name = "vancouver burrards" AND games < 24
Name the authority for te akau with roll less than 254 and decile of 8
CREATE TABLE table_71181 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" text,"Roll" real)
SELECT "Authority" FROM table_71181 WHERE "Roll" < '254' AND "Decile" = '8' AND "Area" = 'te akau'
What is Result, when Original Title is 'Ti nm Ch f ng ( )'?
CREATE TABLE table_name_47 (result VARCHAR,original_title VARCHAR)
SELECT result FROM table_name_47 WHERE original_title = "tiānmǎ cháfáng (天馬茶房)"
Who was the opponent in the mallorca 2, spain tournament?
CREATE TABLE table_name_54 (opponent VARCHAR,tournament VARCHAR)
SELECT opponent FROM table_name_54 WHERE tournament = "mallorca 2, spain"
What was the opponents score when Geelong played as home team?
CREATE TABLE table_53647 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_53647 WHERE "Home team" = 'geelong'
i need a flight from SAN DIEGO to INDIANAPOLIS leaving in the afternoon on tuesday
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE restriction (restriction_code text,advance_purchase int...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND date_day.day_number = 22 AND date_day.month_number = 3...
what is enfield's tie number?
CREATE TABLE table_78866 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Tie no" FROM table_78866 WHERE "Home team" = 'enfield'
Number of votes on answers in past 30 days.
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 COUNT(*) FROM Votes JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId IN (2, 3) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.PostTypeId IN (2)
give me the number of patients whose diagnoses short title is choledocholithiasis nos and lab test abnormal status is delta?
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 (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Choledocholithiasis NOS" AND lab.flag = "delta"
cardiopulmonary resuscitation ( chest compression or defibrillation ) prior to enrollment;
CREATE TABLE table_train_30 ("id" int,"serum_potassium" float,"hyperkalemia" bool,"renal_disease" bool,"cardiopulmonary_resuscitation" bool,"receiving_vasopressor" bool,"age" float,"NOUSE" float)
SELECT * FROM table_train_30 WHERE cardiopulmonary_resuscitation = 1
What is the population of the year featuring an 87.5% German population?
CREATE TABLE table_52541 ("Year" text,"Population" text,"Romanians" text,"Hungarians" text,"Germans" text)
SELECT "Population" FROM table_52541 WHERE "Germans" = '87.5%'
count the number of patients whose gender is f and admission type is elective?
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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "ELECTIVE"
Show the types of schools that have two schools.
CREATE TABLE school_bus (school_id number,driver_id number,years_working number,if_full_time others)CREATE TABLE school (school_id number,grade text,school text,location text,type text)CREATE TABLE driver (driver_id number,name text,party text,home_city text,age number)
SELECT type FROM school GROUP BY type HAVING COUNT(*) = 2
Which range includes Mount Fukushima, and is ranked 38?
CREATE TABLE table_name_7 (range VARCHAR,name VARCHAR,rank VARCHAR)
SELECT range FROM table_name_7 WHERE name = "mount fukushima" AND rank = 38