instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what's party with result being retired to run for u. s. senate republican hold
CREATE TABLE table_704 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Party" FROM table_704 WHERE "Result" = 'Retired to run for U. S. Senate Republican hold'
What is the Player that has a Place of t2, and a Score of 74-70-68=212?
CREATE TABLE table_8464 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_8464 WHERE "Place" = 't2' AND "Score" = '74-70-68=212'
what is the number of patients whose admission year is less than 2145 and diagnoses icd9 code is 591?
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2145" AND diagnoses.icd9_code = "591"
What is the average rating of reviews written in year 2014 ?
CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TABLE user (uid int,user_id varchar,name varchar)CREATE TABLE tip (tip_id int,business_id varchar,text longtext,user_id varchar,likes int,year int,month varchar)CREATE TABLE category (id int,busines...
SELECT AVG(rating) FROM review WHERE year = 2014
What are the name of courses that have at least five enrollments?
CREATE TABLE course (cid text,cname text,credits number,instructor number,days text,hours text,dno number)CREATE TABLE member_of (facid number,dno number,appt_type text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE student (stuid number,lna...
SELECT T1.cname FROM course AS T1 JOIN enrolled_in AS T2 ON T1.cid = T2.cid GROUP BY T2.cid HAVING COUNT(*) >= 5
What is the Country of the T2 Place Player with a Score of 69-69-69=207?
CREATE TABLE table_12806 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_12806 WHERE "Place" = 't2' AND "Score" = '69-69-69=207'
What day is the grand prix de trois-rivi res?
CREATE TABLE table_53967 ("Year" real,"Date" text,"Drivers" text,"Distance/Duration" text,"Race Title" text)
SELECT "Date" FROM table_53967 WHERE "Race Title" = 'grand prix de trois-rivières'
find out the marital status and religious background of patient with patient id 2560.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT demographic.marital_status, demographic.religion FROM demographic WHERE demographic.subject_id = "2560"
how many female patients were hospitalized for more than 2 days?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "2"
Return a bar chart on what are the number of rooms for each bed type?, and I want to show from high to low by the bars.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
How many times this institution was founded that was nicknamed Beavers?
CREATE TABLE table_27738 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" text)
SELECT COUNT("Founded") FROM table_27738 WHERE "Nickname" = 'Beavers'
how many times was the episode 'the old maid of honor' originally aired?
CREATE TABLE table_30097 ("Series #" real,"Season #" real,"Title" text,"Written by" text,"Original air date" text,"U.S. Viewers (millions)" text)
SELECT COUNT("Original air date") FROM table_30097 WHERE "Title" = 'The Old Maid of Honor'
what's the model name with torque (nm@rpm) being 230@4500
CREATE TABLE table_16823 ("Model name" text,"Power (ps)" real,"Torque (Nm@rpm)" text,"Displacement (cm\u00b3)" real,"Engine code" text,"Comment" text)
SELECT "Model name" FROM table_16823 WHERE "Torque (Nm@rpm)" = '230@4500'
What is the Proto-Germanic origin associated with an allophone of [[[|k]]]?
CREATE TABLE table_14074 ("Gothic Letter" text,"Roman" text,"Sound (phoneme)" text,"Sound (allophone)" text,"Proto-Germanic origin" text)
SELECT "Proto-Germanic origin" FROM table_14074 WHERE "Sound (allophone)" = '[[[|k]]]'
Get all review tasks for a specific post ID or user's posts. For some of the post types, it probably isn't possible to have review tasks on them, but they're listed anyway.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId n...
SELECT 'site://review/' + CASE ReviewTaskTypes.Id WHEN 1 THEN 'suggested-edits' WHEN 2 THEN 'close' WHEN 3 THEN 'low-quality-posts' WHEN 4 THEN 'first-posts' WHEN 5 THEN 'late-answers' WHEN 6 THEN 'reopen' END + '/' + CAST(ReviewTasks.Id AS TEXT) + '| ' + ReviewTaskTypes.Name, PostId AS "post_link", ReviewTasks.Creatio...
What is the highest average a contestant from Iowa with a swimsuit smaller than 9.267 has?
CREATE TABLE table_10365 ("State" text,"Swimsuit" real,"Interview" real,"Evening Gown" real,"Average" real)
SELECT MAX("Average") FROM table_10365 WHERE "State" = 'iowa' AND "Swimsuit" < '9.267'
Which player has +2 to par?
CREATE TABLE table_name_45 (player VARCHAR,to_par VARCHAR)
SELECT player FROM table_name_45 WHERE to_par = "+2"
Can you tell me the Place that has the Score of 68, and the Player of christy o'connor jnr?
CREATE TABLE table_name_70 (place VARCHAR,score VARCHAR,player VARCHAR)
SELECT place FROM table_name_70 WHERE score = 68 AND player = "christy o'connor jnr"
what was the total number of patients on ward 489 until 2 years ago?
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 489 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year')
What was the lowest number of wins for the team that scored more than 14 points and had a position of 7?
CREATE TABLE table_name_78 (wins INTEGER,position VARCHAR,scored VARCHAR)
SELECT MIN(wins) FROM table_name_78 WHERE position = 7 AND scored > 14
How many athletes were named federico muller?
CREATE TABLE table_29521180_35 (quarterfinals VARCHAR,athlete VARCHAR)
SELECT COUNT(quarterfinals) FROM table_29521180_35 WHERE athlete = "Federico Muller"
aside from 316 , what was the other works number used in 1883 ?
CREATE TABLE table_204_30 (id number,"year built" text,"works number" number,"wheel arr." text,"gauge" text,"original owner" text,"name" text,"current location" text,"notes" text)
SELECT "works number" FROM table_204_30 WHERE "works number" <> 316 AND "year built" = 1883
i need the flights that leave DENVER after 1900 next monday and fly to PITTSBURGH
CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
Which station has a number less than 5 and an l stop?
CREATE TABLE table_38497 ("Number" real,"Station" text,"Japanese" text,"Distance (km)" real,"Stop" text,"Location" text)
SELECT "Station" FROM table_38497 WHERE "Number" < '5' AND "Stop" = 'l'
How many runtimes does episode 53 have?
CREATE TABLE table_73872 ("Episode #" real,"Airdate" text,"Movie Title and Year" text,"Main Cast" text,"Network TV Run Time" text)
SELECT COUNT("Network TV Run Time") FROM table_73872 WHERE "Episode #" = '53'
Who got the time of 7:52.04?
CREATE TABLE table_33419 ("Lane" real,"Swimmer" text,"Nationality" text,"100m" real,"200m" text,"300m" text,"400m" text,"500m" text,"600m" text,"700m" text,"Time" text)
SELECT "Swimmer" FROM table_33419 WHERE "Time" = '7:52.04'
Who was on the cover when the 20 questions subject was Scarlett Johansson?
CREATE TABLE table_20240 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text)
SELECT "Cover model" FROM table_20240 WHERE "20 Questions" = 'Scarlett Johansson'
How many events have a time of 1:48.322?
CREATE TABLE table_16308030_1 (event VARCHAR,time VARCHAR)
SELECT event FROM table_16308030_1 WHERE time = "1:48.322"
What was the To par when the Score was 67-68=135?
CREATE TABLE table_name_68 (to_par VARCHAR,score VARCHAR)
SELECT to_par FROM table_name_68 WHERE score = 67 - 68 = 135
What Time elapsed has 14 February 2011 as the Closest approach?
CREATE TABLE table_name_11 (time_elapsed VARCHAR,closest_approach VARCHAR)
SELECT time_elapsed FROM table_name_11 WHERE closest_approach = "14 february 2011"
who had papers at ACL 2014 ?
CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE...
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid
My Top Voted Answer Rate.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,Paren...
SELECT (SELECT CAST(COUNT(Id) AS FLOAT) FROM Posts AS a WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 AND Score > 0 AND (Score = (SELECT MAX(Score) FROM Posts AS b WHERE b.ParentId = a.ParentId))) / (SELECT COUNT(*) FROM Posts AS c WHERE c.OwnerUserId = @UserId AND c.PostTypeId = 2) * 100 AS "top_voted_answer_rate...
What college did jerry hackenbruck come from who had an overall pick less than 344?
CREATE TABLE table_47858 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "College" FROM table_47858 WHERE "Overall" < '344' AND "Name" = 'jerry hackenbruck'
What is the lowest jersey # that has evergreen park, illinois as the birthplace, with a weight (km) greater than 86?
CREATE TABLE table_7368 ("Position" text,"Jersey #" real,"Name" text,"Height (cm)" real,"Weight (kg)" real,"Birthdate" text,"Birthplace" text,"1983\u20131984 Team" text)
SELECT MIN("Jersey #") FROM table_7368 WHERE "Birthplace" = 'evergreen park, illinois' AND "Weight (kg)" > '86'
Name for me the tatsuhito takaiwa for Ryusuke Taguchi of taguchi (14:31)
CREATE TABLE table_10107 ("Block A" text,"Wataru Inoue" text,"Jushin Liger" text,"Minoru" text,"Ryusuke Taguchi" text,"Tatsuhito Takaiwa" text,"Yujiro" text)
SELECT "Tatsuhito Takaiwa" FROM table_10107 WHERE "Ryusuke Taguchi" = 'taguchi (14:31)'
What was the original title of the film directed by Lene Gr nlykke and Sven Gr nlykke?
CREATE TABLE table_15043 ("Country" text,"Film title used in nomination" text,"Language" text,"Original title" text,"Director" text)
SELECT "Original title" FROM table_15043 WHERE "Director" = 'lene grønlykke and sven grønlykke'
ground transportation for ST. PAUL
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ST. PAUL' AND ground_service.city_code = city.city_code
What is the Proto-Malayo-Polynesian word for the Proto-Oceanic word of *saqit, *turi?
CREATE TABLE table_name_71 (proto_malayo_polynesian VARCHAR,proto_oceanic VARCHAR)
SELECT proto_malayo_polynesian FROM table_name_71 WHERE proto_oceanic = "*saqit, *turi"
When was the ship tecumseh launched?
CREATE TABLE table_12592074_1 (launched VARCHAR,ship VARCHAR)
SELECT launched FROM table_12592074_1 WHERE ship = "Tecumseh"
What is the lowest attendance at Venue H in Round R2?
CREATE TABLE table_59831 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT MIN("Attendance") FROM table_59831 WHERE "Venue" = 'h' AND "Round" = 'r2'
what is the name of the report that lists the race name as long beach grand prix?
CREATE TABLE table_10707142_2 (report VARCHAR,race_name VARCHAR)
SELECT report FROM table_10707142_2 WHERE race_name = "Long Beach Grand Prix"
how many judges served as chief total ?
CREATE TABLE table_203_563 (id number,"#" number,"judge" text,"state" text,"born/died" text,"active" text,"chief" text,"senior" text,"appointed by" text,"reason for\ntermination" text)
SELECT COUNT("judge") FROM table_203_563 WHERE NOT "chief" IS NULL
give me the number of patients who underwent other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and have mesenteric ischemis primary disease.
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND procedures.short_title = "Clo endosc bx bile duct"
tell me about the top three most common procedures of patients of age 50s until 2 years ago?
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 yea...
What is the Crowd for the Venue of Princes Park?
CREATE TABLE table_51670 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Crowd" FROM table_51670 WHERE "Venue" = 'princes park'
Which 100 -level classes are there for Spring or Summer terms ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE requirement (require...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
the rtp/avp audio and video payload types include an audio type called qcelp and its frame size is how many ms ?
CREATE TABLE table_203_292 (id number,"payload type (pt)" text,"name" text,"type" text,"no. of channels" text,"clock rate (hz)" text,"frame size (ms)" text,"default packet size (ms)" text,"description" text,"references" text)
SELECT "frame size (ms)" FROM table_203_292 WHERE "name" = 'qcelp'
How many customers does Steve Johnson support?
CREATE TABLE employees (id VARCHAR,first_name VARCHAR,last_name VARCHAR)CREATE TABLE customers (support_rep_id VARCHAR)
SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson"
Find out the average age of patients who are 70 years or more that were admitted on or after 2194.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "70" AND demographic.admityear >= "2194"
Which average Crowd has a Home team of essendon?
CREATE TABLE table_51890 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT AVG("Crowd") FROM table_51890 WHERE "Home team" = 'essendon'
Which Round has a Player of damon jones?
CREATE TABLE table_name_49 (round INTEGER,player VARCHAR)
SELECT SUM(round) FROM table_name_49 WHERE player = "damon jones"
What are the ids and details for all organizations that have grants of more than 6000 dollars. Show a pie chart.
CREATE TABLE Document_Types (document_type_code VARCHAR(10),document_description VARCHAR(255))CREATE TABLE Organisations (organisation_id INTEGER,organisation_type VARCHAR(10),organisation_details VARCHAR(255))CREATE TABLE Organisation_Types (organisation_type VARCHAR(10),organisation_type_description VARCHAR(255))CREA...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details
What was the score of Johnny Miller (7)?
CREATE TABLE table_name_80 (score VARCHAR,winner VARCHAR)
SELECT score FROM table_name_80 WHERE winner = "johnny miller (7)"
how many total sports had silver medals awarded ?
CREATE TABLE table_204_103 (id number,"medal" text,"name" text,"sport" text,"event" text)
SELECT COUNT(DISTINCT "sport") FROM table_204_103
what is the number of patients whose death status is 0 and procedure short title is suture bladder lacerat?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Suture bladder lacerat"
What was the score for the game that kicked off at 6:00 p.m.?
CREATE TABLE table_24918268_2 (final_score VARCHAR,kickoff VARCHAR)
SELECT final_score FROM table_24918268_2 WHERE kickoff = "6:00 p.m."
What was the categoria when E.E.U.U was the country?
CREATE TABLE table_29565 ("A\u00f1o" real,"Trabajo nominado" text,"Premio" text,"Categor\u00eda" text,"Country" text,"Resultado" text)
SELECT "Categor\u00eda" FROM table_29565 WHERE "Country" = 'E.E.U.U'
How may players have a passing yard score of 208?
CREATE TABLE table_30689 ("Rank" real,"Player" text,"Year" real,"Opponent" text,"Passing yards" real,"Rushing yards" real,"Total offense" real)
SELECT COUNT("Player") FROM table_30689 WHERE "Passing yards" = '208'
Show the number of heads of departments born in each state with a bar chart, and order in desc by the total number.
CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)
SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state ORDER BY COUNT(born_state) DESC
calculate the number of patients who were tested for urine, voided specimen microbiology since 2104.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y', microlab.culturetakentime) >= '2104')
What team has a home city of Velika?
CREATE TABLE table_name_74 (team VARCHAR,home_city VARCHAR)
SELECT team FROM table_name_74 WHERE home_city = "velika"
What was the time in part 3 when Heikki Kovalainen was the driver?
CREATE TABLE table_2232 ("Pos" text,"No" text,"Driver" text,"Constructor" text,"Part 1" text,"Part 2" text,"Part 3" text,"Grid" text)
SELECT "Part 3" FROM table_2232 WHERE "Driver" = 'Heikki Kovalainen'
What is the Date with a Time of 17:37, and the Set 4 is 25 15?
CREATE TABLE table_6789 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Total" text,"Report" text)
SELECT "Date" FROM table_6789 WHERE "Time" = '17:37' AND "Set 4" = '25–15'
What is the total medals Austria and those with larger than rank 4 have?
CREATE TABLE table_name_76 (total VARCHAR,nation VARCHAR,rank VARCHAR)
SELECT COUNT(total) FROM table_name_76 WHERE nation = "austria" AND rank > 4
Name the visitor for october 19
CREATE TABLE table_67613 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Visitor" FROM table_67613 WHERE "Date" = 'october 19'
What was the home team score when the away team was Carlton?
CREATE TABLE table_53069 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_53069 WHERE "Away team" = 'carlton'
What is the party of the minister who left office on 26 November 2002?
CREATE TABLE table_68223 ("Name" text,"Entered office" text,"Left office" text,"Party" text,"First Minister" text)
SELECT "Party" FROM table_68223 WHERE "Left office" = '26 november 2002'
Which Power (MW) has a Voltage (kV) of 500, and a Country of argentina?
CREATE TABLE table_name_26 (power__mw_ INTEGER,voltage__kv_ VARCHAR,country VARCHAR)
SELECT AVG(power__mw_) FROM table_name_26 WHERE voltage__kv_ = 500 AND country = "argentina"
Who was the home team in the match that had an away team of Convoy Sun Hei Team B?
CREATE TABLE table_name_97 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_97 WHERE away_team = "convoy sun hei team b"
What position do the bc lions pick?
CREATE TABLE table_name_22 (position VARCHAR,cfl_team VARCHAR)
SELECT position FROM table_name_22 WHERE cfl_team = "bc lions"
what was the diagnosis of patient 98015 for the first time in this year?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom 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,langu...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 98015) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C...
What was the final score for the August 25, 1996 match?
CREATE TABLE table_name_29 (score_in_the_final VARCHAR,date VARCHAR)
SELECT score_in_the_final FROM table_name_29 WHERE date = "august 25, 1996"
Make sense of the acronym answers.
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 PostHistory (Id number,PostHistoryTypeId number,PostId number,R...
(SELECT Id AS "post_link" FROM Posts WHERE ParentId = @TargetPost)
active liver disease
CREATE TABLE table_train_102 ("id" int,"autoimmune_disease" bool,"stroke" bool,"renal_disease" bool,"hepatic_disease" bool,"liver_disease" bool,"serum_creatinine" float,"seizure_disorder" bool,"NOUSE" float)
SELECT * FROM table_train_102 WHERE liver_disease = 1
Tell me fourth place for year of 2010
CREATE TABLE table_name_36 (fourth_place VARCHAR,year VARCHAR)
SELECT fourth_place FROM table_name_36 WHERE year = 2010
provide the number of patients whose marital status is widowed and lab test name is albumin/creatinine, urine?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Albumin/Creatinine, Urine"
What was the score of the game that led to a 79-77 record?
CREATE TABLE table_name_64 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_64 WHERE record = "79-77"
Users who self-answered with a score of < 0. possibly newbies who don't know what they are doing
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Users (Id number,Reputation number,Creati...
SELECT q.Id AS "post_link" FROM Posts AS q JOIN Users AS u ON q.OwnerUserId = u.Id JOIN Posts AS a ON q.Id = a.ParentId AND q.OwnerUserId = a.OwnerUserId WHERE a.Score < 0 AND q.AcceptedAnswerId != a.Id AND u.Reputation < 15 ORDER BY a.CreationDate DESC
Who was the opponent on December 18, 2005?
CREATE TABLE table_43092 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_43092 WHERE "Date" = 'december 18, 2005'
Plot sum capacity over openning year in a line chart, I want to display by the X in descending.
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 Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year DESC
Just list the name and price of its most expensive product in a bar chart, and show in ascending by the Y.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY MAX(T1.Price)
what flights does DL have between BOSTON and SAN FRANCISCO
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name te...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
Prof. Catherine Sanok teaches what other courses besides 468 ?
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 WHERE course.course_id = course_offering.course_id AND course.number <> 468 AND instructor.name LIKE '%Catherine Sanok%' AND offering_instructor.instructor_id = instructor.instructor_id AND offeri...
What was the attendance for the game in Week 3?
CREATE TABLE table_47523 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_47523 WHERE "Week" = '3'
How many rooms in each building have a capacity of over 50 Visualize by bar chart, and sort by the total number in asc.
CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(2),end_min numeric(2))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity...
SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY COUNT(*)
What was the record when matt grice fought dennis bermudez with a time of 5:00?
CREATE TABLE table_name_36 (record VARCHAR,time VARCHAR,opponent VARCHAR)
SELECT record FROM table_name_36 WHERE time = "5:00" AND opponent = "dennis bermudez"
who is the runner(s)-up where 54 holes is tied for lead and margin is 5 strokes
CREATE TABLE table_72190 ("Year" real,"Championship" text,"54 holes" text,"Winning score" text,"Margin" text,"Runner(s)-up" text)
SELECT "Runner(s)-up" FROM table_72190 WHERE "54 holes" = 'Tied for lead' AND "Margin" = '5 strokes'
Who wrote the episode that was set in winter 1541/february 13, 1542?
CREATE TABLE table_10413597_5 (written_by VARCHAR,setting VARCHAR)
SELECT written_by FROM table_10413597_5 WHERE setting = "Winter 1541/February 13, 1542"
allergy to the contrast agent gadolinium
CREATE TABLE table_train_101 ("id" int,"systolic_blood_pressure_sbp" int,"uncontrolled_diabetes" bool,"hemoglobin_a1c_hba1c" float,"allergy_to_contrast_agent_gadolinium" bool,"diastolic_blood_pressure_dbp" int,"hypotension" bool,"hypertension" bool,"NOUSE" float)
SELECT * FROM table_train_101 WHERE allergy_to_contrast_agent_gadolinium = 1
in the last year, when did patient 16066 come for the first time to the hospital?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 16066 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
Which team had 7 losses and 55 goals?
CREATE TABLE table_name_80 (team VARCHAR,losses VARCHAR,goals_for VARCHAR)
SELECT team FROM table_name_80 WHERE losses = "7" AND goals_for = 55
Find meta requests/bugs there were declined or completed more than once.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR...
SELECT PostId AS "post_link", COUNT(PostId) AS RevisionCount FROM PostHistory WHERE 'comment' = 'edited tags' AND ('text' LIKE '%<status-completed>%' OR 'text' LIKE '%<status-declined>%') GROUP BY PostId HAVING COUNT(PostId) > 1 ORDER BY COUNT(PostId) DESC LIMIT 100
how many patients whose primary disease is atrial fibrillation\thoracoscopic maze procedure bilateral/sda and age is less than 68?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.age < "68"
What are the titles of all the Aerosmith albums?
CREATE TABLE employees (id number,last_name text,first_name text,title text,reports_to number,birth_date time,hire_date time,address text,city text,state text,country text,postal_code text,phone text,fax text,email text)CREATE TABLE invoice_lines (id number,invoice_id number,track_id number,unit_price number,quantity n...
SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"
Show me a bar chart about the number of races held in each year after 2014, and I want to display from low to high by the the number of year please.
CREATE TABLE pitStops (raceId INTEGER,driverId INTEGER,stop INTEGER,lap INTEGER,time TEXT,duration TEXT,milliseconds INTEGER)CREATE TABLE driverStandings (driverStandingsId INTEGER,raceId INTEGER,driverId INTEGER,points REAL,position INTEGER,positionText TEXT,wins INTEGER)CREATE TABLE races (raceId INTEGER,year INTEGER...
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 ORDER BY COUNT(year)
Who was the opponent on september 10, 1979?
CREATE TABLE table_64116 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_64116 WHERE "Date" = 'september 10, 1979'
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of revenue , and group by attribute name, and sort by the x axis from high to low.
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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
What shows for House 1950 when the Governors 1950 show governors 1995?
CREATE TABLE table_44775 ("1950" real,"General 1950" text,"Senate 1950" text,"House 1950" text,"Governors 1950" text)
SELECT "House 1950" FROM table_44775 WHERE "Governors 1950" = 'governors 1995'
What are the most popular tags..
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate ti...
SELECT TagName, 'Count' FROM Tags ORDER BY 'Count' DESC
Who are all the directors?
CREATE TABLE film (film_id number,rank_in_series number,number_in_season number,title text,directed_by text,original_air_date text,production_code text)CREATE TABLE schedule (cinema_id number,film_id number,date text,show_times_per_day number,price number)CREATE TABLE cinema (cinema_id number,name text,openning_year nu...
SELECT DISTINCT directed_by FROM film