instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
please list all flights between INDIANAPOLIS and ORLANDO on the 27 of 12 | CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion va... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND date_day.day_number = 27 AND date_day.month_number = 12 AND ... |
Which Score has a Losing Team of sydney roosters, and a Total of 88? | CREATE TABLE table_name_77 (score VARCHAR,losing_team VARCHAR,total VARCHAR) | SELECT score FROM table_name_77 WHERE losing_team = "sydney roosters" AND total = 88 |
Show each employee's salary using a bar chart, note that use the last name of each employee, list from high to low by the bars please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25)... | SELECT LAST_NAME, SALARY FROM employees ORDER BY LAST_NAME DESC |
Which week has Game site of Candlestick Park? | CREATE TABLE table_11802 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Week" FROM table_11802 WHERE "Game site" = 'candlestick park' |
What location had the opponent Hiroyuki Abe? | CREATE TABLE table_name_56 (location VARCHAR,opponent VARCHAR) | SELECT location FROM table_name_56 WHERE opponent = "hiroyuki abe" |
Can you tell me the Money ( ) that has the Country of england, and the Player of malcolm mackenzie? | CREATE TABLE table_name_59 (money___£__ VARCHAR,country VARCHAR,player VARCHAR) | SELECT money___£__ FROM table_name_59 WHERE country = "england" AND player = "malcolm mackenzie" |
when was patient 18677 prescribed the drug pantoprazole and omeprazole at the same time for the last time since 10/2103? | 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_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE p... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'pantoprazole' AND admissions.subject_id = 18677 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-10') AS t1 JOIN (SELECT adm... |
What is the total number of field goals of Denan Kemp, who has more than 4 tries, more than 32 points, and 0 goals? | CREATE TABLE table_name_4 (Field VARCHAR,player VARCHAR,goals VARCHAR,tries VARCHAR,points VARCHAR) | SELECT COUNT(Field) AS goals FROM table_name_4 WHERE tries > 4 AND points > 32 AND goals = 0 AND player = "denan kemp" |
Which operator has a Reserve of 100 bbbl? | CREATE TABLE table_15218 ("Field" text,"Geological Trend" text,"Reserves" text,"Discovery" text,"Operator(s)" text) | SELECT "Operator(s)" FROM table_15218 WHERE "Reserves" = '100 bbbl' |
the patient is a male or female of at least 50 years of age and has a body mass index ( bmi ) >= 18.5 kg / m2. | CREATE TABLE table_train_129 ("id" int,"cerebral_neoplasia" bool,"gender" string,"mini_mental_state_examination_mmse" int,"multiple_lacunar_infarcts" bool,"neurodegenerative_disease" bool,"mri_abnormality" bool,"nervous_system_functioning" bool,"head_injury" bool,"serious_neurological_disorders" bool,"huntington_diseas... | SELECT * FROM table_train_129 WHERE (gender = 'male' OR gender = 'female') AND age >= 50 AND body_mass_index_bmi >= 18.5 |
Visualize a bar graph about the times and numbers of all trains that go to Chennai, ordered by time. | CREATE TABLE route (train_id int,station_id int)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE train (id int,train_number int,name t... | SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time |
What is the average number of rounds that Lance Gibson fought when his record was 1-1? | CREATE TABLE table_name_52 (round INTEGER,record VARCHAR) | SELECT AVG(round) FROM table_name_52 WHERE record = "1-1" |
The building with 48 floors has an address in Las Vegas of what? | CREATE TABLE table_69008 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real) | SELECT "Street address" FROM table_69008 WHERE "Floors" = '48' |
what is the name of the allergy patient 015-96048 has had on their last hospital visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid nu... | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... |
Name the 20 questions when centerfold model is cherie witter | CREATE TABLE table_1566848_6 (centerfold_model VARCHAR) | SELECT 20 AS _questions FROM table_1566848_6 WHERE centerfold_model = "Cherie Witter" |
Name the episode(s) that featured Duncan James and Johnny Vegas as Jason's team. | CREATE TABLE table_23292220_6 (episode VARCHAR,jasons_team VARCHAR) | SELECT episode FROM table_23292220_6 WHERE jasons_team = "Duncan James and Johnny Vegas" |
Most questions asked by a user. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number... | SELECT COUNT(Posts.Id) AS NoOfQueAsked, Users.Id FROM Posts, Users WHERE Users.Id = OwnerUserId AND Posts.PostTypeId = 1 GROUP BY Users.Id ORDER BY COUNT(Posts.Id) DESC |
What is the Frequency MHz of Trinidad, Colorado? | CREATE TABLE table_39209 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Height m (ft)" text,"Class" text,"FCC info" text) | SELECT "Frequency MHz" FROM table_39209 WHERE "City of license" = 'trinidad, colorado' |
Which player is a centre? | CREATE TABLE table_54677 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/junior/club team (league)" text) | SELECT "Player" FROM table_54677 WHERE "Position" = 'centre' |
What is the average round of the match in the Hero's 9 event with a time of 5:00? | CREATE TABLE table_name_7 (round INTEGER,time VARCHAR,event VARCHAR) | SELECT AVG(round) FROM table_name_7 WHERE time = "5:00" AND event = "hero's 9" |
When the phillies 1:15 pm played on April 9, what was the attendance? | CREATE TABLE table_name_21 (attendance VARCHAR,opponent VARCHAR,date VARCHAR) | SELECT attendance FROM table_name_21 WHERE opponent = "phillies 1:15 pm" AND date = "april 9" |
What is the highest population (2008) created earlier than 1857, and the county was Sinoe? | CREATE TABLE table_name_69 (population__2008_ INTEGER,created VARCHAR,county VARCHAR) | SELECT MAX(population__2008_) FROM table_name_69 WHERE created < 1857 AND county = "sinoe" |
What is the overall pick number for a draft pick smaller than 9, named buck mystrom from Michigan State college? | CREATE TABLE table_name_72 (overall VARCHAR,name VARCHAR,pick VARCHAR,college VARCHAR) | SELECT overall FROM table_name_72 WHERE pick < 9 AND college = "michigan state" AND name = "buck mystrom" |
What was the highest number of rebounds on February 6? | CREATE TABLE table_name_53 (high_rebounds VARCHAR,date VARCHAR) | SELECT high_rebounds FROM table_name_53 WHERE date = "february 6" |
What was the score when essendon was the home team? | CREATE TABLE table_32576 ("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_32576 WHERE "Home team" = 'essendon' |
Who has a place of T7 and is from the United States? | CREATE TABLE table_name_90 (player VARCHAR,place VARCHAR,country VARCHAR) | SELECT player FROM table_name_90 WHERE place = "t7" AND country = "united states" |
What is the highest total number of medals for a team ranked smaller than 1 and had 20 gold medals? | CREATE TABLE table_name_40 (total INTEGER,gold VARCHAR,rank VARCHAR) | SELECT MAX(total) FROM table_name_40 WHERE gold = 20 AND rank < 1 |
The record of 7-3 had the largest attendance of what? | CREATE TABLE table_10361453_2 (attendance INTEGER,record VARCHAR) | SELECT MAX(attendance) FROM table_10361453_2 WHERE record = "7-3" |
What is the average Money ( $ ), when Country is 'United States', and when To par is '+3'? | CREATE TABLE table_name_14 (money___ INTEGER,country VARCHAR,to_par VARCHAR) | SELECT AVG(money___) AS $__ FROM table_name_14 WHERE country = "united states" AND to_par = "+3" |
Rank of 5, and a Silver larger than 0 had what sum of total? | CREATE TABLE table_name_8 (total INTEGER,rank VARCHAR,silver VARCHAR) | SELECT SUM(total) FROM table_name_8 WHERE rank = "5" AND silver > 0 |
How many mileposts are there on Anne Street? | CREATE TABLE table_16168 ("County" text,"Location" text,"Street Names" text,"Milepost" text,"Roads Intersected" text,"Notes" text) | SELECT COUNT("Milepost") FROM table_16168 WHERE "Street Names" = 'Anne Street' |
provide the number of patients whose diagnoses long title is abnormal coagulation profile and lab test category is chemistry? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" AND lab."CATEGORY" = "Chemistry" |
What venue did the partnership of herschelle gibbs / justin kemp happen? | CREATE TABLE table_72017 ("Wicket" text,"Runs" text,"Partnerships" text,"Venue" text,"Date" text) | SELECT "Venue" FROM table_72017 WHERE "Partnerships" = 'herschelle gibbs / justin kemp' |
when was the first time the heart rate of patient 10855 was measured on the current intensive care unit visit at less than 71.0? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_procedur... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... |
What song had an index of m6? | CREATE TABLE table_39781 ("Index" text,"Name" text,"Song" text,"Group Song" text,"Score" text) | SELECT "Song" FROM table_39781 WHERE "Index" = 'm6' |
What is the 2nd leg that has 31-37 as the 1st leg? | CREATE TABLE table_42376 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_42376 WHERE "1st leg" = '31-37' |
What tag is most common for first posts?. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,Vo... | SELECT COUNT(*) AS N, TagName FROM PostTags JOIN Tags AS t ON (t.Id = 2032) WHERE PostId IN (SELECT MIN(p.Id) FROM Users AS u JOIN Posts AS p ON (u.Id = OwnerUserId) JOIN PostTypes AS type ON (type.Id = PostTypeId) WHERE type.Name IN ('Question', 'Answer') GROUP BY OwnerUserId) GROUP BY TagName ORDER BY COUNT(*) DESC |
Who was the director when the writer(s) was John W. Bloch? | CREATE TABLE table_24171 ("Series #" real,"Season #" real,"Title" text,"Director" text,"Writer(s)" text,"Original Airdate" text) | SELECT "Director" FROM table_24171 WHERE "Writer(s)" = 'John W. Bloch' |
count the number of patients whose admission type is newborn and admission year is less than 2157? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2157" |
What are the names of body builders in descending order of total scores? | CREATE TABLE body_builder (body_builder_id number,people_id number,snatch number,clean_jerk number,total number)CREATE TABLE people (people_id number,name text,height number,weight number,birth_date text,birth_place text) | SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.total DESC |
please show me all fares for flights from DENVER to OAKLAND | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description t... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... |
How many games were played on november 27? | CREATE TABLE table_25461946_5 (record VARCHAR,date VARCHAR) | SELECT COUNT(record) FROM table_25461946_5 WHERE date = "November 27" |
how much insulin human regular was prescribed to patient 40435 since 03/2104, for the first time? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numbe... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'insulin human regular' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-03' ORDER BY prescriptions.startdate LIMIT 1 |
What was the rate for 73 RYds? | CREATE TABLE table_7021 ("Year" text,"Team" text,"SckY" text,"Int%" text,"Rate" text,"RAtt" text,"RYds" text,"RAvg" text,"RLng" text,"R1st" text) | SELECT "Rate" FROM table_7021 WHERE "RYds" = '73' |
On what Date is there a race on the Circuit of brands hatch? | CREATE TABLE table_57915 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text) | SELECT "Date" FROM table_57915 WHERE "Circuit" = 'brands hatch' |
count the number of patients who have received an gastroenterology consultation procedure during the same hospital encounter after getting a wound care procedure since 2105. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,p... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'wound care' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') AS t1 ... |
Which home team has the Brunswick Street Oval venue? | CREATE TABLE table_32358 ("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_32358 WHERE "Venue" = 'brunswick street oval' |
what was the average value of patient 027-185580's triglycerides in the first hospital visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult nu... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-185580' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospita... |
What is the dissolved date of the parliament assembled on 4 November 1461 with an unknown 2nd member? | CREATE TABLE table_61936 ("Summoned" text,"Elected" text,"Assembled" text,"Dissolved" text,"1st member" text,"2nd member" text) | SELECT "Dissolved" FROM table_61936 WHERE "2nd member" = 'unknown' AND "Assembled" = '4 november 1461' |
What is Distance, when Athlete is 'Irving Saladino'? | CREATE TABLE table_name_57 (distance VARCHAR,athlete VARCHAR) | SELECT distance FROM table_name_57 WHERE athlete = "irving saladino" |
Median time of getting accepted answers. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHos... | WITH diffs AS (SELECT CAST(a.CreationDate - q.CreationDate AS FLOAT) AS d FROM Posts AS q JOIN Posts AS a ON a.Id = q.AcceptedAnswerId) SELECT ((SELECT MAX(d) FROM (SELECT PERCENT AS d FROM diffs ORDER BY d LIMIT 50) AS BottomHalf) + (SELECT MIN(d) FROM (SELECT PERCENT AS d FROM diffs ORDER BY d DESC LIMIT 50) AS TopHa... |
when had patient 010-32430 first been prescribed for metoprolol (lopressor) tab 25 mg and albuterol 2.5 mg/0.5ml ud inh soln at the same time until 04/2100? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (cos... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'metoprolol (lopressor) tab 25 mg' AND patient.uniquepid = '010-32430' AND STRFTIME('%y-%m', medication.drugstarttime) <= ... |
Which ranking has money of $82 and Al Watrous as the player? | CREATE TABLE table_name_64 (place VARCHAR,money___$__ VARCHAR,player VARCHAR) | SELECT place FROM table_name_64 WHERE money___$__ = 82 AND player = "al watrous" |
What is the last issue entry for Aron's Absurd Armada? | CREATE TABLE table_name_49 (last_issue VARCHAR,title VARCHAR) | SELECT last_issue FROM table_name_49 WHERE title = "aron's absurd armada" |
Who did Abdelhafid Benchebla face in the quarterfinals? | CREATE TABLE table_21689 ("Athlete" text,"Event" text,"Round of 32" text,"Round of 16" text,"Quarterfinals" text,"Semifinals" text) | SELECT "Quarterfinals" FROM table_21689 WHERE "Athlete" = 'Abdelhafid Benchebla' |
What was the average attendance of a team with a 38 31 8 record? | CREATE TABLE table_name_16 (attendance INTEGER,record VARCHAR) | SELECT AVG(attendance) FROM table_name_16 WHERE record = "38–31–8" |
What home team plays at Arden Street Oval? | CREATE TABLE table_name_72 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_72 WHERE venue = "arden street oval" |
count the number of patients whose admission location is trsf within this facility and primary disease is copd exacerbation? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "COPD EXACERBATION" |
What is the lowest Points with an against of 20 and less than 1 lost? | CREATE TABLE table_7551 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MIN("Points") FROM table_7551 WHERE "Against" = '20' AND "Lost" < '1' |
What is the highest population of Trondra Island in the Scalloway Islands? | CREATE TABLE table_71653 ("Island" text,"Location" text,"Area (ha)" real,"Population" real,"Height (m)" real) | SELECT MAX("Population") FROM table_71653 WHERE "Location" = 'scalloway islands' AND "Island" = 'trondra' |
Show the booking status code and the corresponding number of bookings Show bar chart, and could you order by the total number in descending? | CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABL... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC |
until 09/2105 has patient 5395 received a rdw test? | 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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-09' |
did magnesium sulfate, hydralazine, or ns have been prescribed for patient 80555 in 12/2105? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND prescriptions.drug IN ('magnesium sulfate', 'hydralazine', 'ns') AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' |
what was patient 59275's first careunit of the ward until 2102? | 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 transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59275) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) <= '2102' ORDER BY transfers.intime LIMIT 1 |
Reciprocal accepting of answers for user questions. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment ... | WITH questions AS (SELECT p1.OwnerUserId AS question_userid, p2.OwnerUserId AS answer_userid, p1.Id FROM Posts AS p1 INNER JOIN Posts AS p2 ON p1.AcceptedAnswerId = p2.Id) SELECT q1.question_userid AS userid1, q1.answer_userid AS userid2, q1.Id, q2.Id FROM questions AS q1 INNER JOIN questions AS q2 ON q1.question_useri... |
In which venue did the away team score 9.11 (65)? | CREATE TABLE table_33032 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_33032 WHERE "Away team score" = '9.11 (65)' |
which tournament had a prize no less than $ 1,100,000 ? | CREATE TABLE table_203_531 (id number,"date" text,"tournament" text,"location" text,"winner" text,"score" text,"1st prize ($)" number) | SELECT "tournament" FROM table_203_531 WHERE "1st prize ($)" >= 1100000 |
Which order's shipment tracking number is '3452'? Give me the id of the order. | CREATE TABLE invoices (invoice_number number,invoice_date time,invoice_details text)CREATE TABLE orders (order_id number,customer_id number,order_status text,date_order_placed time,order_details text)CREATE TABLE order_items (order_item_id number,product_id number,order_id number,order_item_status text,order_item_detai... | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" |
what's the cost of a drug named insulin-regular (human) *unit* inj? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,pati... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'insulin-regular (human) *unit* inj') |
What was the listed crowd at junction oval? | CREATE TABLE table_name_28 (crowd VARCHAR,venue VARCHAR) | SELECT crowd FROM table_name_28 WHERE venue = "junction oval" |
oxygen saturation < 91 % on room air | CREATE TABLE table_test_17 ("id" int,"anemia" bool,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"active_infection" bool,"fever" bool,"bradycardia" int,"renal_disease" bool,"oliguria" bool,"creatinine_clearance_cl" float,"left_ventricular_failure" bool,"hgb" int,"platelet_count" float,... | SELECT * FROM table_test_17 WHERE oxygen_saturation < 91 |
Who did the Browns play on October 13, 1968? | CREATE TABLE table_33797 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Opponent" FROM table_33797 WHERE "Date" = 'october 13, 1968' |
Tell me the constructor for zolder | CREATE TABLE table_name_64 (constructor VARCHAR,location VARCHAR) | SELECT constructor FROM table_name_64 WHERE location = "zolder" |
what was the total number of friendly 's played ? | CREATE TABLE table_204_275 (id number,"date" text,"city" text,"opponent" text,"results" text,"scorers" text,"type of game" text) | SELECT COUNT(*) FROM table_204_275 WHERE "type of game" = 'friendly' |
How many televotes are there for 'Lujuria'? | CREATE TABLE table_23288 ("Draw" real,"Artist" text,"Song" text,"Jury votes" real,"Televotes" real,"Total votes" real,"Result" text) | SELECT "Televotes" FROM table_23288 WHERE "Song" = 'Lujuria' |
provide the number of patients whose discharge location is long term care hospital and diagnoses short title is neuropathy in diabetes? | 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 text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.short_title = "Neuropathy in diabetes" |
What is the region for Catalog amlh 66078 in stereo lp format? | CREATE TABLE table_name_68 (region VARCHAR,format VARCHAR,catalog VARCHAR) | SELECT region FROM table_name_68 WHERE format = "stereo lp" AND catalog = "amlh 66078" |
Name the Runs which has Venue of adelaide oval , adelaide? | CREATE TABLE table_name_47 (runs VARCHAR,venue VARCHAR) | SELECT runs FROM table_name_47 WHERE venue = "adelaide oval , adelaide" |
Show the relationship between average age and minimum age in a scatter chart. | CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))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 Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Spor... | SELECT AVG(Age), MIN(Age) FROM Student GROUP BY Major |
what was the last height of patient 19428 since 06/2100. | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... |
how many did alain prost have the fastest lap ? | CREATE TABLE table_204_455 (id number,"rd." number,"grand prix" text,"date" text,"location" text,"pole position" text,"fastest lap" text,"winning driver" text,"constructor" text,"report" text) | SELECT COUNT(*) FROM table_204_455 WHERE "fastest lap" = 'alain prost' |
What is the crystal structure for the formula yba 2 cu 3 o 7? | CREATE TABLE table_101336_1 (crystal_structure VARCHAR,formula VARCHAR) | SELECT crystal_structure FROM table_101336_1 WHERE formula = "YBa 2 Cu 3 O 7" |
what is average age of patients whose age is greater than or equal to 79 and admission year is greater than or equal to 2111? | 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 text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "79" AND demographic.admityear >= "2111" |
What was the lowest round for a tight end position? | CREATE TABLE table_name_94 (round INTEGER,position VARCHAR) | SELECT MIN(round) FROM table_name_94 WHERE position = "tight end" |
What is the number of March that has 25-10-9 record and a Game more than 44? | CREATE TABLE table_38451 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text) | SELECT COUNT("March") FROM table_38451 WHERE "Record" = '25-10-9' AND "Game" > '44' |
how many articles were published in the 6th volume ? | CREATE TABLE table_204_843 (id number,"volume" number,"year" text,"names" text,"articles" number,"pages" number,"images" number,"maps" number,"number of copies" number) | SELECT "articles" FROM table_204_843 WHERE "volume" = 6 |
Name the company for desha county | CREATE TABLE table_28107 ("Company" text,"Name" text,"County" text,"Militia Regiment" text,"Commander" text,"Organization Date" text) | SELECT "Company" FROM table_28107 WHERE "County" = 'Desha' |
When the scoring rank was 117, what was the best finish? | CREATE TABLE table_10021158_3 (best_finish VARCHAR,scoring_rank VARCHAR) | SELECT best_finish FROM table_10021158_3 WHERE scoring_rank = "117" |
what is patient 027-81062's minimum value of pt - inr in 09/2103? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (... | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-81062')) AND lab.labname = 'pt - inr' AND STRFTIME('%y-%m', lab.labresulttime)... |
What percentage of voters chose McCain in the county where 1.1% of voters voted third party? | CREATE TABLE table_20278716_2 (mccain__percentage VARCHAR,others__percentage VARCHAR) | SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "1.1%" |
In the game that took place at junction oval, how much did the home team score? | CREATE TABLE table_name_24 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_24 WHERE venue = "junction oval" |
Which Report has a Winning driver of emerson fittipaldi? | CREATE TABLE table_49883 ("Race Name" text,"Circuit" text,"City/Location" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT "Report" FROM table_49883 WHERE "Winning driver" = 'emerson fittipaldi' |
What functions were released on 2011-06-23? | CREATE TABLE table_22164 ("Title" text,"Developer" text,"Category" text,"Function" text,"Release date" text,"Version" text) | SELECT "Function" FROM table_22164 WHERE "Release date" = '2011-06-23' |
Name the current womens lacrosse conference for bison | CREATE TABLE table_27378582_1 (current_womens_lacrosse_conference VARCHAR,nickname VARCHAR) | SELECT current_womens_lacrosse_conference FROM table_27378582_1 WHERE nickname = "Bison" |
What was the score in game 6? | CREATE TABLE table_23248910_11 (score VARCHAR,game VARCHAR) | SELECT score FROM table_23248910_11 WHERE game = 6 |
How many draws correspond to more than 11 losses in a match less than 14? | CREATE TABLE table_name_36 (draw VARCHAR,lost VARCHAR,match VARCHAR) | SELECT COUNT(draw) FROM table_name_36 WHERE lost > 11 AND match < 14 |
In how many different states are banks located? | CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,state text)CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount number)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,stat... | SELECT COUNT(DISTINCT state) FROM bank |
Percentage of Questions wiuthout the Accepted Answer @until. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,... | SELECT (CAST(COUNT(q.Id) AS FLOAT) / (SELECT COUNT(*) FROM Posts WHERE Posts.CreationDate < @until AND PostTypeId = 1) * 100) AS AcceptedPercentage FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2 AND q.CreationDate < @until |
what was the first coronary artery disease - significant risk factors diagnosis time of patient 005-18714 in 2104? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714')) AND diagnosis.diagnosisname = 'coronary artery disea... |
What did the home team score when playing at Western Oval? | CREATE TABLE table_name_41 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_41 WHERE venue = "western oval" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.