instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What shows as the status for the name of de la red?
CREATE TABLE table_name_61 (status VARCHAR,name VARCHAR)
SELECT status FROM table_name_61 WHERE name = "de la red"
In what place did the player with a score of 66-67=133 come in?
CREATE TABLE table_48691 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_48691 WHERE "Score" = '66-67=133'
what are the AA flights from NEWARK to NASHVILLE
CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,ser...
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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW...
Sort the names of all counties in descending alphabetical order.
CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE election (election_id number,counties_represented text,district numb...
SELECT county_name FROM county ORDER BY county_name DESC
what is gender and lab test category of subject id 2560?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT demographic.gender, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
Who was sixth place when Hugo Salazar was fifth place?
CREATE TABLE table_56634 ("Series" real,"Year" text,"Winner" text,"Runner-up" text,"Third place" text,"Fourth place" text,"Fifth place" text,"Sixth place" text,"Host" text)
SELECT "Sixth place" FROM table_56634 WHERE "Fifth place" = 'hugo salazar'
when patient 97733 was prescribed for the last time polyethylene glycol in this hospital visit?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location te...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'polyethylene glycol' ORDER BY prescriptions.startdate DESC LIMIT 1
On what date did the game at Windy Hill take place?
CREATE TABLE table_53580 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_53580 WHERE "Venue" = 'windy hill'
What were the number of completions for James Vanderberg on Iowa when his yards were 45?
CREATE TABLE table_name_72 (completions VARCHAR,team VARCHAR,yards VARCHAR)
SELECT completions FROM table_name_72 WHERE team = "iowa" AND yards = "45"
Who is the Jockey for guadalcanal?
CREATE TABLE table_76512 ("Finished" text,"Horse" text,"Jockey" text,"Trainer" text,"Odds" text)
SELECT "Jockey" FROM table_76512 WHERE "Horse" = 'guadalcanal'
provide the number of patients whose days of hospital stay is greater than 16 and drug name is prismasate (b32 k2)?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "Prismasate (B32 K2)"
how many times did this team lose in the conference finals ?
CREATE TABLE table_203_521 (id number,"year" number,"division" number,"league" text,"regular season" text,"playoffs" text,"open cup" text)
SELECT COUNT(*) FROM table_203_521 WHERE "playoffs" = 'conference finals'
What's the name of train number 15647/48?
CREATE TABLE table_12095519_1 (train_name VARCHAR,train_no VARCHAR)
SELECT train_name FROM table_12095519_1 WHERE train_no = "15647/48"
What are the tries against when points against 287?
CREATE TABLE table_13564637_5 (tries_against VARCHAR,points_against VARCHAR)
SELECT tries_against FROM table_13564637_5 WHERE points_against = "287"
TOP 100 - Brazilian Users.
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 Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Rev...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR UPPER(Location) LIKE '%BRA' ORDER BY Reputation DESC LIMIT 100
Which team has Pick 13 in Round 2?
CREATE TABLE table_name_88 (team VARCHAR,round VARCHAR,pick VARCHAR)
SELECT team FROM table_name_88 WHERE round = "2" AND pick = "13"
what is the minimum total cost for the hospital involving a procedure called insulin this year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 nu...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'insulin')) AND DATETIME(cost.chargetime, 'st...
What was the cargo value in 2005 for all product carriers?
CREATE TABLE table_42585 ("Ship size" text,"Cargo" text,"2004" text,"2005" text,"2006" text)
SELECT "2005" FROM table_42585 WHERE "Cargo" = 'all product carriers'
Which Programming has a Video of audio only?
CREATE TABLE table_name_62 (programming VARCHAR,video VARCHAR)
SELECT programming FROM table_name_62 WHERE video = "audio only"
What is Score, when Country is 'United States', when Place is 'T3', and when Player is 'Phil Blackmar'?
CREATE TABLE table_62112 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Score" FROM table_62112 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Player" = 'phil blackmar'
Where was the tournament where the score was 1 6, 6 3, 3 6?
CREATE TABLE table_47282 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Tournament" FROM table_47282 WHERE "Score" = '1–6, 6–3, 3–6'
What's the Qual listed with a Rank of 27?
CREATE TABLE table_name_41 (qual VARCHAR,rank VARCHAR)
SELECT qual FROM table_name_41 WHERE rank = "27"
Which Silver has a Total smaller than 2 and a Rank larger than 8
CREATE TABLE table_7671 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Silver") FROM table_7671 WHERE "Total" < '2' AND "Rank" > '8'
In what country was the car with the z 171cc engine?
CREATE TABLE table_42313 ("Country" text,"Automobile Name" text,"Manufacturer" text,"Engine Make/Capacity" text,"Year" text)
SELECT "Country" FROM table_42313 WHERE "Engine Make/Capacity" = 'čz 171cc'
What is the home record for the Auxerre club?
CREATE TABLE table_62613 ("Season" text,"Competition" text,"Round" text,"Club" text,"Home" text,"Away" text,"Aggregate" text)
SELECT "Home" FROM table_62613 WHERE "Club" = 'auxerre'
Which Tie no has a Score of 0 1, and a Date of 9 march 1953?
CREATE TABLE table_76120 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Tie no" FROM table_76120 WHERE "Score" = '0–1' AND "Date" = '9 march 1953'
What is the set 3 when the total is 78 92?
CREATE TABLE table_58654 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Set 3" FROM table_58654 WHERE "Total" = '78–92'
Return the ids and details corresponding to projects for which there are more than two documents in a bar chart, and could you show from high to low by the X-axis?
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Descr...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details DESC
What is the earliest year when the points were more than 0?
CREATE TABLE table_70435 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MIN("Year") FROM table_70435 WHERE "Points" > '0'
i would like to fly from DALLAS to SAN FRANCISCO on saturday and arrive in SAN FRANCISCO before 1600
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airli...
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 = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
Average current reputation of users on site.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance te...
SELECT AVG(u1.Reputation) FROM Users AS u1 WHERE u1.Id IN (SELECT DISTINCT u.Id FROM Posts AS p LEFT JOIN Users AS u ON (p.OwnerUserId = u.Id) WHERE p.PostTypeId = 1)
List the nominees that have been nominated more than two musicals.
CREATE TABLE actor (actor_id number,name text,musical_id number,character text,duration text,age number)CREATE TABLE musical (musical_id number,name text,year number,award text,category text,nominee text,result text)
SELECT nominee FROM musical GROUP BY nominee HAVING COUNT(*) > 2
what is part 4 when the class is 5?
CREATE TABLE table_name_37 (part_4 VARCHAR,class VARCHAR)
SELECT part_4 FROM table_name_37 WHERE class = "5"
what is the position of pick #53?
CREATE TABLE table_55099 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Position" FROM table_55099 WHERE "Pick #" = '53'
what is the number of patients who have office admissions?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
What is the total number of stations with a line that is u 6?
CREATE TABLE table_name_86 (stations INTEGER,line VARCHAR)
SELECT SUM(stations) FROM table_name_86 WHERE line = "u 6"
Return a histogram on how many students live in each city?, and I want to display from low to high by the X.
CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code
What was the constructor for the fastest nelson piquet?
CREATE TABLE table_name_72 (constructor VARCHAR,fastest_lap VARCHAR)
SELECT constructor FROM table_name_72 WHERE fastest_lap = "nelson piquet"
Which film was released in the year 2002?
CREATE TABLE table_name_63 (film_name VARCHAR,year VARCHAR)
SELECT film_name FROM table_name_63 WHERE year = 2002
Count the number of people of each sex who have a weight higher than 85 by a bar chart.
CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)
SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex
What is the Third when the Lead was don bartlett, the Second was carter rycroft, and a Season of 2003 04?
CREATE TABLE table_41285 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Third" FROM table_41285 WHERE "Lead" = 'don bartlett' AND "Second" = 'carter rycroft' AND "Season" = '2003–04'
How many people enrolled a the school with an IHSAA Class of a, and the trojans as their mascot?
CREATE TABLE table_5568 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"# / County" text)
SELECT MIN("Enrollment") FROM table_5568 WHERE "IHSAA Class" = 'a' AND "Mascot" = 'trojans'
How many customers have an account?
CREATE TABLE customers (customer_id number,customer_first_name text,customer_last_name text,customer_address text,customer_phone text,customer_email text,other_customer_details text)CREATE TABLE accounts (account_id number,customer_id number,account_name text,other_account_details text)CREATE TABLE customers_cards (car...
SELECT COUNT(DISTINCT customer_id) FROM accounts
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the average of manager_id bin hire_date by weekday in a bar chart, and I want to order by the y-axis in asc please.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID)
how much does it cost for intracranial venous thrombosis - lateral sinus to be diagnosed?
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'intracranial venous thrombosis - lateral sinus')
count the number of patients whose discharge location is home and diagnoses short title is diabetic retinopathy nos?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME" AND diagnoses.short_title = "Diabetic retinopathy NOS"
What is the catalogue number for release dates of exactly 2005 and released by The Clear Spots?
CREATE TABLE table_27932399_1 (catalogue_number VARCHAR,release_date VARCHAR,artist VARCHAR)
SELECT catalogue_number FROM table_27932399_1 WHERE release_date = 2005 AND artist = "The Clear Spots"
Return a histogram on what are the types of competition and number of competitions for that type?, and list by the names from low to high.
CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type
What is the name of the professor teaching Other class next Winter ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
Which Front Side Bus has a Voltage of 1.4 v, and a Frequency of 1333 mhz?
CREATE TABLE table_8840 ("Model Number" text,"Frequency" text,"L2-Cache" text,"Front Side Bus" text,"Multiplier" text,"Voltage" text,"Socket" text)
SELECT "Front Side Bus" FROM table_8840 WHERE "Voltage" = '1.4 v' AND "Frequency" = '1333 mhz'
Show all book categories and the number of books in each category with a bar chart, and order by the the total number from high to low.
CREATE TABLE culture_company (Company_name text,Type text,Incorporated_in text,Group_Equity_Shareholding real,book_club_id text,movie_id text)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text,Book_Title text,Publisher text,Category text,Result text)CREATE TABLE movie (movie_id int,Title text,Year ...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) DESC
WHAT IS THE ERUPE WITH HEAD COACH vainauskas , sakalauskas AND WITH NEBL FINALIST?
CREATE TABLE table_name_68 (europe VARCHAR,head_coach VARCHAR,regional_competitions VARCHAR)
SELECT europe FROM table_name_68 WHERE head_coach = "vainauskas , sakalauskas" AND regional_competitions = "nebl finalist"
What Position has no College Hall of Fame?
CREATE TABLE table_34311 ("Position" text,"Name" text,"School" text,"Unanimous" text,"College Hall of Fame" text)
SELECT "Position" FROM table_34311 WHERE "College Hall of Fame" = 'no'
What is the height of the player born on June 24, 1964, with a weight over 84 kg?
CREATE TABLE table_41430 ("Position" text,"Jersey #" real,"Name" text,"Height (cm)" real,"Weight (kg)" real,"Birthdate" text,"Birthplace" text,"1986\u20131987 Team" text)
SELECT AVG("Height (cm)") FROM table_41430 WHERE "Weight (kg)" > '84' AND "Birthdate" = 'june 24, 1964'
Get data from all recent posts.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ...
SELECT Id, Score, ViewCount, AnswerCount FROM Posts WHERE PostTypeId = 2 AND YEAR(CreationDate) > 2015
For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart.
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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
Name the womens doubles for werner schlager
CREATE TABLE table_30327 ("Year Location" text,"Mens Singles" text,"Womens Singles" text,"Mens Doubles" text,"Womens Doubles" text)
SELECT "Womens Doubles" FROM table_30327 WHERE "Mens Singles" = 'Werner Schlager'
Find the name of the ship that is steered by the youngest captain.
CREATE TABLE captain (ship_id VARCHAR,age VARCHAR)CREATE TABLE ship (name VARCHAR,ship_id VARCHAR)
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
Name the record for 23 game
CREATE TABLE table_27722734_7 (record VARCHAR,game VARCHAR)
SELECT record FROM table_27722734_7 WHERE game = 23
What are the episode numbers in season that were titled 'The Consoler'?
CREATE TABLE table_30976 ("Season no." real,"Series no." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT "Season no." FROM table_30976 WHERE "Title" = 'The Consoler'
Name the most top 10s for 2 best finish
CREATE TABLE table_2112220_6 (top_10s INTEGER,best_finish VARCHAR)
SELECT MAX(top_10s) FROM table_2112220_6 WHERE best_finish = "2"
how much of a difference has patient 25814 in mcv second measured on the current hospital visit compared to the first value measured on the current hospital visit?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE labevents (row_i...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') ORDER BY labevents.charttime LIMI...
What was Galatasaray score when when he won in 1990 and Trabzonspor was the runner-up?
CREATE TABLE table_name_24 (score VARCHAR,year VARCHAR,winners VARCHAR,runners_up VARCHAR)
SELECT score FROM table_name_24 WHERE winners = "galatasaray" AND runners_up = "trabzonspor" AND year = 1990
how many days is it since patient 31854 has been admitted to icu?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND icustays.outtime IS NULL
had patient 28484 visited the er until 3 years ago?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 28484 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year')
what is the points for rank 12?
CREATE TABLE table_54548 ("Rank" real,"Name" text,"Nation" text,"Points" real,"Places" real)
SELECT SUM("Points") FROM table_54548 WHERE "Rank" = '12'
What is Postition, when Date of Birth (Age) is Example, and when Player is Mark Spencer?
CREATE TABLE table_name_59 (position VARCHAR,date_of_birth__age_ VARCHAR,player VARCHAR)
SELECT position FROM table_name_59 WHERE date_of_birth__age_ = "example" AND player = "mark spencer"
What is the line of Mangalore station?
CREATE TABLE table_14709 ("Name" text,"Line" text,"Location" text,"Closed" text,"Current Status" text)
SELECT "Line" FROM table_14709 WHERE "Name" = 'mangalore'
What is the maximum number of people in attendance on 16 August 2008 when the home team was Deportes Savio?
CREATE TABLE table_name_69 (attendance INTEGER,date VARCHAR,home VARCHAR)
SELECT MAX(attendance) FROM table_name_69 WHERE date = "16 august 2008" AND home = "deportes savio"
How many millions of viewers did watch Episode 5?
CREATE TABLE table_17869 ("#" real,"Episode" text,"Writer" text,"Director" text,"Viewers(millions)" text,"Original airdate" text)
SELECT "Viewers(millions)" FROM table_17869 WHERE "Episode" = 'Episode 5'
WHAT IS THE ROUND FOR ZACH BOYCHUK?
CREATE TABLE table_name_6 (round VARCHAR,player VARCHAR)
SELECT COUNT(round) FROM table_name_6 WHERE player = "zach boychuk"
how many wins did the 1987 syracuse football team have ?
CREATE TABLE table_203_720 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text)
SELECT COUNT(*) FROM table_203_720 WHERE "result" = 'w'
What are the highest points with 2012 as the year?
CREATE TABLE table_name_70 (points INTEGER,year VARCHAR)
SELECT MAX(points) FROM table_name_70 WHERE year = "2012"
What is the number of Dentists in ' Los Angeles ' ?
CREATE TABLE tip (tip_id int,business_id varchar,text longtext,user_id varchar,likes int,year int,month varchar)CREATE TABLE business (bid int,business_id varchar,name varchar,full_address varchar,city varchar,latitude varchar,longitude varchar,review_count bigint,is_open tinyint,rating float,state varchar)CREATE TABLE...
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Los Angeles' AND category.business_id = business.business_id AND category.category_name = 'Dentists'
Name the most year for conference finals
CREATE TABLE table_26193 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT MAX("Year") FROM table_26193 WHERE "Playoffs" = 'Conference Finals'
Visualize a bar chart that X-axis is the gender and compute the number of players in each gender as a Y-axis, and could you list y axis in ascending order?
CREATE TABLE coach (Coach_ID int,Coach_name text,Gender text,Club_ID int,Rank int)CREATE TABLE player_coach (Player_ID int,Coach_ID int,Starting_year int)CREATE TABLE match_result (Rank int,Club_ID int,Gold int,Big_Silver int,Small_Silver int,Bronze int,Points int)CREATE TABLE club (Club_ID int,Club_name text,Region te...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender)
What's the tries against count of the team with 396 points against?
CREATE TABLE table_914 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT COUNT("Tries against") FROM table_914 WHERE "Points against" = '396'
What is the venue on October 13, 2007?
CREATE TABLE table_name_60 (venue VARCHAR,date VARCHAR)
SELECT venue FROM table_name_60 WHERE date = "october 13, 2007"
What is Score, when Player is 'Brad Faxon'?
CREATE TABLE table_58713 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Score" FROM table_58713 WHERE "Player" = 'brad faxon'
what was the difference in points in week ones match up ?
CREATE TABLE table_204_662 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number,"bye" text)
SELECT ABS("result" - "result") FROM table_204_662 WHERE "week" = 1
Which opponent has a Date of 16 february 2003?
CREATE TABLE table_name_83 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_83 WHERE date = "16 february 2003"
What is the highest draw represented?
CREATE TABLE table_23065 ("Draw" real,"Artist" text,"Original" text,"English Meaning" text,"Language" text,"Authors" text)
SELECT MAX("Draw") FROM table_23065
What is the sigma (with 1.5 shift) when there are 69% defective?
CREATE TABLE table_2574 ("Sigma level" real,"Sigma (with 1.5\u03c3 shift)" text,"DPMO" text,"Percent defective" text,"Percentage yield" text,"Short-term C pk" text,"Long-term C pk" text)
SELECT "Sigma (with 1.5\u03c3 shift)" FROM table_2574 WHERE "Percent defective" = '69%'
What is the rank for Murphy Oil?
CREATE TABLE table_21926985_2 (state_rank_by_revenue VARCHAR,company_name VARCHAR)
SELECT state_rank_by_revenue FROM table_21926985_2 WHERE company_name = "Murphy Oil"
tell me whether d10w was given to patient 26057 in this month?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 prescriptio...
SELECT COUNT(*) > 0 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 = 26057)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AN...
Graham rahal for n/h/l racing has a qual 2 greater than 59.384 and how much lowest best?
CREATE TABLE table_69531 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" real,"Best" real)
SELECT MIN("Best") FROM table_69531 WHERE "Team" = 'n/h/l racing' AND "Name" = 'graham rahal' AND "Qual 2" > '59.384'
what is the average price range of hotels for each each star rating code?
CREATE TABLE Street_Markets (Market_ID INTEGER,Market_Details VARCHAR(255))CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR(15),Attraction_Type_Description VARCHAR(255))CREATE TABLE Tourist_Attractions (Tourist_Attraction_ID INTEGER,Attraction_Type_Code CHAR(15),Location_ID INTEGER,How_to_Get_There VARCHAR(...
SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code
Where is Shaq Thompson from?
CREATE TABLE table_17109 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "Hometown" FROM table_17109 WHERE "Player" = 'Shaq Thompson'
What is the average Year, when Start is '11'?
CREATE TABLE table_name_42 (year INTEGER,start VARCHAR)
SELECT AVG(year) FROM table_name_42 WHERE start = 11
for patient robert hyden, specify gender and language
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 demographic.gender, demographic.language FROM demographic WHERE demographic.name = "Robert Hyden"
What is the maximum number of assists for players named Anastasia Kostaki?
CREATE TABLE table_24913533_4 (assists INTEGER,player VARCHAR)
SELECT MAX(assists) FROM table_24913533_4 WHERE player = "Anastasia Kostaki"
Please give me a bar chart showing institution types, along with the total enrollment for each type, sort by the X from low to high.
CREATE TABLE Institution (Institution_id text,Institution text,Location text,Founded real,Type text,Enrollment int,Team text,Primary_Conference text,building_id text)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_t...
SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY Type
give me the first flight from BOSTON to ATLANTA
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE flight_fare (flight_id 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
what is the top three most frequent output event until 2100?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosi...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
How is Phenylephrine administered?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "PHENYLEPHrine"
What were the odds for the finish of 1/4h?
CREATE TABLE table_34665 ("Date" text,"Track" text,"Race" text,"Purse Hi" text,"Finish" text,"Time" text,"Last 1/4" real,"Odds" text,"Driver" text)
SELECT "Odds" FROM table_34665 WHERE "Finish" = '1/4h'
which party did jaime quintana belong to ?
CREATE TABLE table_203_447 (id number,"constituency" number,"region" text,"name" text,"party" text,"last elected" number)
SELECT "party" FROM table_203_447 WHERE "name" = 'jaime quintana'
what is the total number of events ?
CREATE TABLE table_203_505 (id number,"number" number,"event" text,"type" text,"matthew" text,"mark" text,"luke" text,"john" text)
SELECT COUNT("event") FROM table_203_505
What is the group a winner for vis pesaro?
CREATE TABLE table_16654 ("Season" text,"Group A Winner" text,"Group B Winner" text,"Group C Winner" text,"Group D Winner" text)
SELECT "Group A Winner" FROM table_16654 WHERE "Group C Winner" = 'Vis Pesaro'
Which nation has a heat of 4, and is ranked 8?
CREATE TABLE table_name_13 (nation VARCHAR,heat VARCHAR,rank VARCHAR)
SELECT nation FROM table_name_13 WHERE heat = 4 AND rank = 8