instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Name the trucks for scott neal
CREATE TABLE table_24665 ("Team" text,"Truck(s)" text,"#" real,"Driver(s)" text,"Primary Sponsor(s)" text,"Listed Owner(s)" text,"Crew Chief" text)
SELECT "Truck(s)" FROM table_24665 WHERE "Crew Chief" = 'Scott Neal'
what was patient 030-3247's first output time of the urine catheter until 04/26/2104?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-3247')) AND intakeoutput.cellpath LIKE '%output%'...
What is the highest loss with points less than 7?
CREATE TABLE table_name_16 (lost INTEGER,points INTEGER)
SELECT MAX(lost) FROM table_name_16 WHERE points < 7
how many patients whose lab test category is chemistry?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Chemistry"
when was the last time patient 027-140654 got a lab test in this month for chloride?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,d...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654')) AND lab.labname = 'chloride' AND DATETIME(lab.labresulttime, 'start o...
which candidates had the most votes listed ?
CREATE TABLE table_203_354 (id number,"party" text,"candidate(s)" text,"votes" number,"percentage" number)
SELECT "candidate(s)" FROM table_203_354 ORDER BY "votes" DESC LIMIT 1
How many companies without a gas station in each main industry? Draw a bar chart, and display by the total number in asc.
CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location t...
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY COUNT(Main_Industry)
provide the number of patients whose lab test category is hematology?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Hematology"
count the number of patients who were diagnosed with valvular insufficiency - mitral valve and that did not return to the hospital within the same month during this year.
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATE...
How many points for the simtek s951 chassis?
CREATE TABLE table_name_92 (points VARCHAR,chassis VARCHAR)
SELECT COUNT(points) FROM table_name_92 WHERE chassis = "simtek s951"
What were the total number of 2012 births for the January December 2012 Tver Oblast region?
CREATE TABLE table_25703_2 (birth_2012 INTEGER,january_december_2012 VARCHAR)
SELECT MIN(birth_2012) FROM table_25703_2 WHERE january_december_2012 = "Tver Oblast"
what is the home team when the away team is frickley colliery?
CREATE TABLE table_49267 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Home team" FROM table_49267 WHERE "Away team" = 'frickley colliery'
What example for did- is shown for a Consonant final stem of - ?
CREATE TABLE table_8899 ("Consonant final stem" text,"Example: did-" text,"Vowel final stem" text,"Example: ch'aghara-" text,"Noun example: datv-" text)
SELECT "Example: did-" FROM table_8899 WHERE "Consonant final stem" = '-ø'
Find the dates of the tests taken with result 'Pass', and count them by a line chart, and order by the x-axis from low to high.
CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken
Name the team classification for thomas de gendt
CREATE TABLE table_30925 ("Stage" real,"Winner" text,"General classification" text,"Mountains Classification" text,"Points classification" text,"Sprints Classification" text,"Team Classification" text)
SELECT "Team Classification" FROM table_30925 WHERE "Winner" = 'Thomas De Gendt'
following the world championships in seville , what was the next venue for the world championships ?
CREATE TABLE table_203_646 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT "venue" FROM table_203_646 WHERE "competition" = 'world championships' AND "year" > (SELECT "year" FROM table_203_646 WHERE "competition" = 'world championships' AND "venue" = 'seville') ORDER BY "year" LIMIT 1
What was the score of the game that led to a 79-77 record?
CREATE TABLE table_37730 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Score" FROM table_37730 WHERE "Record" = '79-77'
how much was the total amount patient 30460 had received?
CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id n...
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 = 30460))
What is Aberdeen team's date of vacancy?
CREATE TABLE table_7209 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Date of vacancy" FROM table_7209 WHERE "Team" = 'aberdeen'
How many points for the skater from club btsc?
CREATE TABLE table_name_43 (points VARCHAR,club VARCHAR)
SELECT COUNT(points) FROM table_name_43 WHERE club = "btsc"
Find the name and training hours of players whose hours are below 1500. Plot them as pie chart.
CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))
SELECT pName, HS FROM Player WHERE HS < 1500
what is the name when the displacement is 8,305 t?
CREATE TABLE table_name_12 (name VARCHAR,displacement VARCHAR)
SELECT name FROM table_name_12 WHERE displacement = "8,305 t"
how many gold medals does poland have ?
CREATE TABLE table_203_374 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "gold" FROM table_203_374 WHERE "nation" = 'poland'
Top 100 users from Hyderbad India.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Location LIKE '%Hyderabad%' ORDER BY Reputation DESC LIMIT 1000
who is the only cyclist from brazil ?
CREATE TABLE table_204_155 (id number,"rank" number,"heat" number,"athlete" text,"nationality" text,"time" number,"notes" text)
SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'brazil'
What's the name of the city whose first season was in 1996?
CREATE TABLE table_68791 ("Institution" text,"Team" text,"City" text,"Province" text,"First season" real,"Head coach" text,"Enrollment" real,"Football stadium" text,"Capacity" real)
SELECT "City" FROM table_68791 WHERE "First season" = '1996'
What is average prize for first place with a $500,000 purse in the Franklin Quest Championship?
CREATE TABLE table_10472 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real)
SELECT AVG("1st Prize( $ )") FROM table_10472 WHERE "Purse( $ )" = '500,000' AND "Tournament" = 'franklin quest championship'
What is Team 1, when Team 2 is Saint Louis?
CREATE TABLE table_name_84 (team_1 VARCHAR,team_2 VARCHAR)
SELECT team_1 FROM table_name_84 WHERE team_2 = "saint louis"
what is the grid when the laps is more than 0, the time/retired is engine and the driver is pedro de la rosa?
CREATE TABLE table_51933 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Grid" FROM table_51933 WHERE "Laps" > '0' AND "Time/Retired" = 'engine' AND "Driver" = 'pedro de la rosa'
what microcontroller has the same flash size as at90s4414
CREATE TABLE table_204_416 (id number,"chip" text,"flash size" text,"eeprom" number,"sram" number,"frequency\n[mhz]" number,"package" text)
SELECT "chip" FROM table_204_416 WHERE "chip" <> 'at90s4414' AND "flash size" = (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414')
Municipality of tampere involves which party?
CREATE TABLE table_name_1 (party VARCHAR,municipality VARCHAR)
SELECT party FROM table_name_1 WHERE municipality = "tampere"
which year was the most pos .
CREATE TABLE table_204_179 (id number,"season" number,"division" number,"tms." number,"pos." number,"fa cup" text,"afc cl" number)
SELECT "season" FROM table_204_179 WHERE "pos." = (SELECT MAX("pos.") FROM table_204_179)
what is the total number of playoffs where regular season is 6th, southwest
CREATE TABLE table_16119 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT COUNT("Playoffs") FROM table_16119 WHERE "Regular Season" = '6th, Southwest'
Show the total number of each type of each thing using a pie chart.
CREATE TABLE Timed_Status_of_Things (thing_id INTEGER,Date_and_Date DATETIME,Status_of_Thing_Code CHAR(15))CREATE TABLE Customer_Event_Notes (Customer_Event_Note_ID INTEGER,Customer_Event_ID INTEGER,service_type_code CHAR(15),resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME)CREATE TABLE Organizations (org...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY Type_of_Thing_Code
What is the total number of gold medals of slovakia, which has less than 1 silver medal?
CREATE TABLE table_name_61 (gold VARCHAR,silver VARCHAR,nation VARCHAR)
SELECT COUNT(gold) FROM table_name_61 WHERE silver < 1 AND nation = "slovakia"
Who is the high rebounds for game 64?
CREATE TABLE table_2832 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_2832 WHERE "Game" = '64'
When did the film 'Monsters' come out?
CREATE TABLE table_name_96 (date VARCHAR,film VARCHAR)
SELECT date FROM table_name_96 WHERE film = "monsters"
How many Times have a Reaction Time larger than 0.17500000000000002, and a Lane of 3?
CREATE TABLE table_13693 ("Lane" real,"Name" text,"Country" text,"Reaction Time" real,"Time" real)
SELECT COUNT("Time") FROM table_13693 WHERE "Reaction Time" > '0.17500000000000002' AND "Lane" = '3'
Bar chart x axis date y axis the number of date, could you display by the total number from high to low?
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_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INT...
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC
What week had an attendance more than 63,268 and Kansas City Chiefs as the opponent?
CREATE TABLE table_62382 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT COUNT("Week") FROM table_62382 WHERE "Attendance" > '63,268' AND "Opponent" = 'kansas city chiefs'
Which Opponent has a Location of gold coast , australia, and a Method of submission (punches)?
CREATE TABLE table_46523 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Opponent" FROM table_46523 WHERE "Location" = 'gold coast , australia' AND "Method" = 'submission (punches)'
What is the 2002 result where 2011 and 2000 are 1R?
CREATE TABLE table_name_22 (Id VARCHAR)
SELECT 2002 FROM table_name_22 WHERE 2011 = "1r" AND 2000 = "1r"
gg test of poorly answer questions for apps.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEdit...
SELECT * FROM Posts WHERE AnswerCount > 5 AND CommentCount > 5 AND ViewCount > 50 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND Tags LIKE '%##Tag1##%' AND CreationDate > '2015-12-21'
With a Rank of 19, and a Start of 14, what was the finish?
CREATE TABLE table_80231 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Finish" FROM table_80231 WHERE "Rank" = '19' AND "Start" = '14'
What is the Engine with 3 as the start in the year of 2007?
CREATE TABLE table_6326 ("Year" real,"Chassis" text,"Engine" text,"Start" text,"Finish" text,"Team" text)
SELECT "Engine" FROM table_6326 WHERE "Start" = '3' AND "Year" = '2007'
What Weblink has a College or Campus Name of anna university college of engineering tindivanam?
CREATE TABLE table_name_76 (weblink VARCHAR,college_or_campus_name VARCHAR)
SELECT weblink FROM table_name_76 WHERE college_or_campus_name = "anna university college of engineering tindivanam"
What is Hon. Vicente Q. Roxas appointment date?
CREATE TABLE table_13886 ("Name" text,"Position" text,"Date of Appointment" text,"Date of Birth" text,"Date of Retirement" text)
SELECT "Date of Appointment" FROM table_13886 WHERE "Name" = 'hon. vicente q. roxas'
Which Delegate has a Placement in Miss Universe of fourth runner-up, and a Hometown of makati , rizal?
CREATE TABLE table_name_96 (delegate VARCHAR,placement_in_miss_universe VARCHAR,hometown VARCHAR)
SELECT delegate FROM table_name_96 WHERE placement_in_miss_universe = "fourth runner-up" AND hometown = "makati , rizal"
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, and I want to sort y axis in descending order.
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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC
Where Date is october 14 what is the attendance?
CREATE TABLE table_name_40 (attendance VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_40 WHERE date = "october 14"
how many total number of points margin when brive is the winners
CREATE TABLE table_27987767_2 (points_margin VARCHAR,winners VARCHAR)
SELECT COUNT(points_margin) FROM table_27987767_2 WHERE winners = "Brive"
what is the name of the level for the 7th position
CREATE TABLE table_31289 ("Season" text,"Level" text,"Division" text,"Section" text,"Position" text,"Movements" text)
SELECT "Level" FROM table_31289 WHERE "Position" = '7th'
What is Score, when Game is less than 61, when February is less than 11, and when Opponent is '@ Buffalo Sabres'?
CREATE TABLE table_name_25 (score VARCHAR,opponent VARCHAR,game VARCHAR,february VARCHAR)
SELECT score FROM table_name_25 WHERE game < 61 AND february < 11 AND opponent = "@ buffalo sabres"
Will Dr. Emily Zinnemann be teaching any classes next semester ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program_course (program_id int,cour...
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 '%Emily Zinnemann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
What is the largest average for the episode with 1.97 million Hong Kong viewers?
CREATE TABLE table_3148 ("Rank" real,"English title" text,"Chinese title" text,"Average" real,"Peak" real,"Premiere" real,"Finale" real,"HK viewers" text)
SELECT MAX("Average") FROM table_3148 WHERE "HK viewers" = '1.97 million'
What is the best finish for the player whose earnings was $421050?
CREATE TABLE table_29504351_2 (best_finish VARCHAR,earnings__$_ VARCHAR)
SELECT best_finish FROM table_29504351_2 WHERE earnings__$_ = 421050
which driver scored the least amount of points ?
CREATE TABLE table_203_452 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_203_452 ORDER BY "points" LIMIT 1
What are dates of birth of all the guests whose gender is 'Male', and count them by a bar chart, sort in ascending by the total number please.
CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATET...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth)
what is the sponsor of motorola
CREATE TABLE table_name_12 (team VARCHAR,sponsor VARCHAR)
SELECT team FROM table_name_12 WHERE sponsor = "motorola"
Which Opponent has a Type of tko, and a Round of 2 (6) on 2006-09-20?
CREATE TABLE table_name_67 (opponent VARCHAR,date VARCHAR,type VARCHAR,round VARCHAR)
SELECT opponent FROM table_name_67 WHERE type = "tko" AND round = "2 (6)" AND date = "2006-09-20"
What is Opponent, when January is greater than 19, and when Score is '7 - 2'?
CREATE TABLE table_name_94 (opponent VARCHAR,january VARCHAR,score VARCHAR)
SELECT opponent FROM table_name_94 WHERE january > 19 AND score = "7 - 2"
What is the Standings of Eintracht Braunschweig?
CREATE TABLE table_name_28 (standings VARCHAR,champions VARCHAR)
SELECT standings FROM table_name_28 WHERE champions = "eintracht braunschweig"
How many Top 10s have Wins larger than 0, and Poles larger than 0?
CREATE TABLE table_name_35 (top_10 VARCHAR,wins VARCHAR,poles VARCHAR)
SELECT COUNT(top_10) FROM table_name_35 WHERE wins > 0 AND poles > 0
In next term is 463 available ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req 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...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 463 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
For each record in schedule, show average of the price for each day in a bar chart, and show in desc by the X.
CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod...
SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date DESC
list the time of the hospital admission of patient 30267 in this year.
CREATE TABLE d_labitems (row_id number,itemid number,label 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)CREATE TABL...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 30267 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
What is the highest rank when Garry Kasparov, 2879 is the 1-year peak?
CREATE TABLE table_21322 ("Rank" real,"1-year peak" text,"5-year peak" text,"10-year peak" text,"15-year peak" text,"20-year peak" text)
SELECT MAX("Rank") FROM table_21322 WHERE "1-year peak" = 'Garry Kasparov, 2879'
Which top ten, having less than 12 cuts less than 2 top five, and events smaller than 14, is the highest?
CREATE TABLE table_51446 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MAX("Top-10") FROM table_51446 WHERE "Cuts made" < '12' AND "Top-5" < '2' AND "Events" < '14'
Count the number of characteristics of the 'flax' product.
CREATE TABLE ref_characteristic_types (characteristic_type_code text,characteristic_type_description text)CREATE TABLE ref_product_categories (product_category_code text,product_category_description text,unit_of_measure text)CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteri...
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax"
Name the highest Bronze which has a Gold larger than 2 and a Rank of total?
CREATE TABLE table_14273 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_14273 WHERE "Gold" > '2' AND "Rank" = 'total'
How many attended the game with north melbourne as the away side?
CREATE TABLE table_name_58 (crowd VARCHAR,away_team VARCHAR)
SELECT crowd FROM table_name_58 WHERE away_team = "melbourne"
What grid has 78 laps, and Ronnie Bremer as driver?
CREATE TABLE table_76017 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real)
SELECT "Grid" FROM table_76017 WHERE "Laps" = '78' AND "Driver" = 'ronnie bremer'
Show me about the correlation between School_ID and ACC_Percent , and group by attribute ACC_Home in a scatter chart.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
Answers: Zero-score accepted - Tag parameter.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidan...
SELECT a.Id AS "post_link", q.Tags FROM Posts AS q, Posts AS a WHERE a.Score = 0 AND q.AcceptedAnswerId = a.Id AND q.Tags LIKE LOWER('%##Tag##%') ORDER BY q.Id LIMIT 100
What team was the winner when the runner-up shows both teams awarded championship after a draw.?
CREATE TABLE table_name_26 (winner VARCHAR,runner_up VARCHAR)
SELECT winner FROM table_name_26 WHERE runner_up = "both teams awarded championship after a draw."
Which lane is Goksu Bicer in?
CREATE TABLE table_name_37 (lane VARCHAR,swimmer VARCHAR)
SELECT lane FROM table_name_37 WHERE swimmer = "goksu bicer"
Show the number of faculty members for each rank in a bar chart, I want to order by the y-axis from low to high.
CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5)...
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank)
Name the current club for player sacha giffa
CREATE TABLE table_12962773_13 (current_club VARCHAR,player VARCHAR)
SELECT current_club FROM table_12962773_13 WHERE player = "Sacha Giffa"
What links were used on flight day 16?
CREATE TABLE table_12786 ("Flight Day" text,"Song" text,"Artist" text,"Played for" text,"Links" text)
SELECT "Links" FROM table_12786 WHERE "Flight Day" = 'day 16'
How many courses are offered?
CREATE TABLE CLASS (crs_code VARCHAR)
SELECT COUNT(DISTINCT crs_code) FROM CLASS
On what day was the game that ended in a score of 97-38?
CREATE TABLE table_name_17 (date VARCHAR,score VARCHAR)
SELECT date FROM table_name_17 WHERE score = "97-38"
What is Date, when Home Team is 'Chester City'?
CREATE TABLE table_12438 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_12438 WHERE "Home team" = 'chester city'
Which unite had the type wwer-440/213?
CREATE TABLE table_name_31 (unit VARCHAR,type VARCHAR)
SELECT unit FROM table_name_31 WHERE type = "wwer-440/213"
How many rebounds did Rhonda Mapp make?
CREATE TABLE table_23191 ("Player" text,"Games Played" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real)
SELECT MAX("Rebounds") FROM table_23191 WHERE "Player" = 'Rhonda Mapp'
give me the number of patients whose ethnicity is white - russian and admission year is less than 2154?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2154"
Tell me the power when the torque is n m (lb ft)/*n m (lb ft) @1750
CREATE TABLE table_name_37 (power_rpm VARCHAR,torque__nm__rpm VARCHAR)
SELECT power_rpm FROM table_name_37 WHERE torque__nm__rpm = "n·m (lb·ft)/*n·m (lb·ft) @1750"
What are the roles with three or more employees? Give me the role codes.
CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREATE TABLE employees (employee_id number,role_code text,employee_name text,gender_mfu text,date_of_birth time,other_details text)CREATE TABLE document_locations (document_id number,location_code text,date_i...
SELECT role_code FROM employees GROUP BY role_code HAVING COUNT(*) >= 3
In what season was the pct % 0.552?
CREATE TABLE table_2110959_1 (season VARCHAR,pct__percentage VARCHAR)
SELECT season FROM table_2110959_1 WHERE pct__percentage = "0.552"
Is Jasper being producted?
CREATE TABLE table_name_66 (in_production VARCHAR,codename VARCHAR)
SELECT in_production FROM table_name_66 WHERE codename = "jasper"
What is the Australian for the American ?
CREATE TABLE table_60033 ("Letter" text,"American" text,"British" text,"Australian" text,"Examples" text)
SELECT "Australian" FROM table_60033 WHERE "American" = 'ɑ'
Which Player has a Draft of 1994, a Pick larger than 8, a Round of 10, and a Nationality of canada?
CREATE TABLE table_60049 ("Draft" real,"Round" text,"Pick" real,"Player" text,"Nationality" text)
SELECT "Player" FROM table_60049 WHERE "Draft" = '1994' AND "Pick" > '8' AND "Round" = '10' AND "Nationality" = 'canada'
What is the record of the match on 2009-07-18?
CREATE TABLE table_67650 ("Res." text,"Record" text,"Opponent" text,"Type" text,"Rd.,Time" text,"Date" text)
SELECT "Record" FROM table_67650 WHERE "Date" = '2009-07-18'
Show all origins and the number of flights from each origin with a pie chart.
CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))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),dep...
SELECT origin, COUNT(*) FROM flight GROUP BY origin
Out of total number of patients admitted before 2198, how many of them were married.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2198"
What company constructed the vehicle when the driver shows as not held?
CREATE TABLE table_57939 ("Year" text,"Driver" text,"Constructor" text,"Category" text,"Location" text,"Report" text)
SELECT "Constructor" FROM table_57939 WHERE "Driver" = 'not held'
how many arabic scottish is afghan
CREATE TABLE table_24807774_1 (afghan VARCHAR,arabic VARCHAR)
SELECT afghan FROM table_24807774_1 WHERE arabic = "Scottish"
List the id of students who attended statistics courses in the order of attendance date.
CREATE TABLE student_course_attendance (student_id VARCHAR,course_id VARCHAR,date_of_attendance VARCHAR)CREATE TABLE courses (course_id VARCHAR,course_name VARCHAR)
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
What is the sum shot % when the country is finland, and an ends lost is larger than 49?
CREATE TABLE table_name_72 (shot__percentage INTEGER,country VARCHAR,ends_lost VARCHAR)
SELECT SUM(shot__percentage) FROM table_name_72 WHERE country = "finland" AND ends_lost > 49
What is the position of Allen Gamboa?
CREATE TABLE table_name_50 (position VARCHAR,name VARCHAR)
SELECT position FROM table_name_50 WHERE name = "allen gamboa"
find the diagnoses title and description of diagnoses icd9 code 7761.
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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7761"