instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What's the fastest laps during the 1995 season having poles & podiums at 0? | CREATE TABLE table_name_2 (fastest_laps INTEGER,seasons VARCHAR,poles VARCHAR,podiums VARCHAR) | SELECT SUM(fastest_laps) FROM table_name_2 WHERE poles = 0 AND podiums = 0 AND seasons = "1995" |
What country is Bob Tway from? | CREATE TABLE table_50058 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_50058 WHERE "Player" = 'bob tway' |
What tires did BFM Enterprises run on their Offy engine and manta chassis? | CREATE TABLE table_4608 ("Team" text,"Chassis" text,"Engine" text,"Tires" text,"Drivers" text) | SELECT "Tires" FROM table_4608 WHERE "Engine" = 'offy' AND "Chassis" = 'manta' AND "Team" = 'bfm enterprises' |
what is the number of companies presented ? | CREATE TABLE table_204_325 (id number,"class" text,"name" text,"company" text,"residence" text,"term expires dec 31" number,"notes" text) | SELECT COUNT("company") FROM table_204_325 |
what is the most lost games when the percentage is 50.00% and games played is less than 2? | CREATE TABLE table_name_95 (lost INTEGER,percentage VARCHAR,played VARCHAR) | SELECT MAX(lost) FROM table_name_95 WHERE percentage = "50.00%" AND played < 2 |
what is the space where the next winner is skee riegel | CREATE TABLE table_28457 ("Year" real,"Championship" text,"54 holes" text,"Winning score" text,"Margin" text,"Runner(s)-up" text) | SELECT "Margin" FROM table_28457 WHERE "Runner(s)-up" = 'Skee Riegel' |
Which team scored 9.8 (62) points against Fitzroy? | CREATE TABLE table_10164 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_10164 WHERE "Away team score" = '9.8 (62)' |
what is the maximum amount of the total hospital cost which involves calculus of kidney during this year? | 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob ... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'calculus of kidney')) AND DATETIME(cost.chargetime, 'start of y... |
Return a bar chart showing how many shops in each location, and order in ascending by the x-axis. | CREATE TABLE shop (Shop_ID int,Shop_Name text,Location text,Open_Date text,Open_Year int)CREATE TABLE device (Device_ID int,Device text,Carrier text,Package_Version text,Applications text,Software_Platform text)CREATE TABLE stock (Shop_ID int,Device_ID int,Quantity int) | SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY Location |
What School did Terrence Jones play for? | CREATE TABLE table_51717 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "School" FROM table_51717 WHERE "Player" = 'terrence jones' |
What actor has goede tijden, slechte tijden, as the soap opera, 11 years as the duration, with rosa gonzalez as the character? | CREATE TABLE table_name_91 (actor VARCHAR,character VARCHAR,soap_opera VARCHAR,duration VARCHAR) | SELECT actor FROM table_name_91 WHERE soap_opera = "goede tijden, slechte tijden" AND duration = "11 years" AND character = "rosa gonzalez" |
what region is listed before the midwest ? | CREATE TABLE table_203_200 (id number,"region" text,"seed" number,"team" text,"coach" text,"finished" text,"final opponent" text,"score" text) | SELECT "region" FROM table_203_200 WHERE id < (SELECT id FROM table_203_200 WHERE "region" = 'midwest') ORDER BY id DESC LIMIT 1 |
Users from the Zwolle, the Netherlands. Lists every user (ranked by reputation) that is located in the Zwolle based on their profile info | CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT Users.Id, Users.Id AS "user_link", Reputation, WebsiteUrl, Location FROM Users INNER JOIN PostHistory AS ph ON ph.UserId = Users.Id INNER JOIN Posts ON Posts.Id = ph.PostId WHERE Location LIKE '%Zwolle%' AND Tags LIKE '%php%' ORDER BY Reputation DESC |
Which Long is the highest one that has a Loss larger than 3, and a Gain larger than 2,894? | CREATE TABLE table_76773 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/G" real) | SELECT MAX("Long") FROM table_76773 WHERE "Loss" > '3' AND "Gain" > '2,894' |
What is the Location and Attendance with a Record of 21 22? | CREATE TABLE table_name_16 (location_attendance VARCHAR,record VARCHAR) | SELECT location_attendance FROM table_name_16 WHERE record = "21–22" |
How many locations have #12 Michigan State as the big ten team? | CREATE TABLE table_21330550_2 (location VARCHAR,big_ten_team VARCHAR) | SELECT COUNT(location) FROM table_21330550_2 WHERE big_ten_team = "#12 Michigan State" |
count the number of patients whose admission location is trsf within this facility and lab test fluid is ascites? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Ascites" |
Show me about the distribution of Date_of_Birth and Height in a bar chart, show X in descending order. | 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 Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC |
What is the total gdp world rank when the gdp per capita was listed at $1,163? | CREATE TABLE table_2248991_2 (total_gdp_world_rank INTEGER,gdp_per_capita VARCHAR) | SELECT MIN(total_gdp_world_rank) FROM table_2248991_2 WHERE gdp_per_capita = "$1,163" |
what is the name of the team which aggregate score is l 1 2 | CREATE TABLE table_31017 ("Team" text,"Contest and round" text,"Opponent" text,"1st leg score*" text,"2nd leg score**" text,"Aggregate score" text) | SELECT "Team" FROM table_31017 WHERE "Aggregate score" = 'L 1–2' |
count the number of people who were discharged during the last year from the hospital. | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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,l... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
What is the average for the year 2008 of the team that in 2010 had an average of 240,735 with rank lower than 5? | CREATE TABLE table_67115 ("Rank" real,"Airport" text,"City" text,"Code (IATA/ICAO)" text,"2008" real,"2009" real,"2010" real) | SELECT AVG("2008") FROM table_67115 WHERE "2010" = '240,735' AND "Rank" < '5' |
What is the production code of the episode written by Jos Molina that aired on October 12, 2004? | CREATE TABLE table_10935548_1 (production_code VARCHAR,written_by VARCHAR,original_air_date VARCHAR) | SELECT production_code FROM table_10935548_1 WHERE written_by = "José Molina" AND original_air_date = "October 12, 2004" |
i would like to fly from DENVER to BOSTON | 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,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'... |
What time did the game start during week 1? | CREATE TABLE table_name_9 (time___et__ VARCHAR,week VARCHAR) | SELECT time___et__ FROM table_name_9 WHERE week = 1 |
which one has the most vote | CREATE TABLE table_204_982 (id number,"party/electoral alliance" text,"seats" number,"change" number,"votes" number,"%" text) | SELECT "party/electoral alliance" FROM table_204_982 ORDER BY "votes" DESC LIMIT 1 |
For those records from the products and each product's manufacturer, show me about the correlation between manufacturer and code in a scatter 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 T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code |
In what series did he have the 7th position? | CREATE TABLE table_27259 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F.L." real,"Podiums" real,"Points" text,"Position" text) | SELECT "Series" FROM table_27259 WHERE "Position" = '7th' |
In what year did the team of aston martin racing have a position of 6th? | CREATE TABLE table_62620 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT COUNT("Year") FROM table_62620 WHERE "Team" = 'aston martin racing' AND "Pos." = '6th' |
What is the origin of the name of Keller Patera? | CREATE TABLE table_72815 ("Name" text,"Latitude" text,"Longitude" text,"Diameter (km)" text,"Year named" real,"Name origin" text) | SELECT "Name origin" FROM table_72815 WHERE "Name" = 'Keller Patera' |
Name the team for june 20 | CREATE TABLE table_24334 ("Year" real,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text) | SELECT "Team" FROM table_24334 WHERE "Date" = 'June 20' |
provide the number of patients whose primary disease is bladder cancer/sda? | 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.diagnosis = "BLADDER CANCER/SDA" |
What league has 2-3 as the away? | CREATE TABLE table_name_18 (league VARCHAR,away VARCHAR) | SELECT league FROM table_name_18 WHERE away = "2-3" |
Who directed episode number 626 in the series? | CREATE TABLE table_25800134_19 (director VARCHAR,series__number VARCHAR) | SELECT director FROM table_25800134_19 WHERE series__number = 626 |
Which tennis team is from the United States? | CREATE TABLE table_53618 ("Year of award" real,"Athlete" text,"Nation of citizenship" text,"Team" text,"Competition,governing body,or league" text,"Sport" text) | SELECT "Team" FROM table_53618 WHERE "Sport" = 'tennis' AND "Nation of citizenship" = 'united states' |
provide the number of patients whose days of hospital stay is greater than 15 and item id is 50904? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.itemid = "50904" |
what is the minimum attendance with record being 4 6 | CREATE TABLE table_14102379_4 (attendance INTEGER,record VARCHAR) | SELECT MIN(attendance) FROM table_14102379_4 WHERE record = "4–6" |
Which motor's quantity was more than 8, and a class of bs 1915? | CREATE TABLE table_41252 ("Class" text,"Quantity" real,"Manufacturer" text,"Motor" text,"Seats" real) | SELECT "Motor" FROM table_41252 WHERE "Quantity" > '8' AND "Class" = 'bs 1915' |
What is the Hazmat, when the Type is Rural, and when the number of Tankers is 1? | CREATE TABLE table_name_98 (hazmat VARCHAR,type VARCHAR,tankers VARCHAR) | SELECT hazmat FROM table_name_98 WHERE type = "rural" AND tankers = 1 |
What is Original Album, when Time is '3:39'? | CREATE TABLE table_60617 ("English translation" text,"Original album" text,"Lyricist(s)" text,"Composer(s)" text,"Time" text) | SELECT "Original album" FROM table_60617 WHERE "Time" = '3:39' |
View Questions from Tag in Last 2 Weeks. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId nu... | SELECT CONCAT('http://stackoverflow.com/q/', Posts.Id) AS "Question ID", Posts.Title AS "Post Title", Posts.Body AS "Question Text", Posts.CreationDate AS "Post Date", Posts.Tags AS "Tags" FROM Posts JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = 'office-2013' AND... |
Which Tournament has a Date of january 10, 1994? | CREATE TABLE table_name_10 (tournament VARCHAR,date VARCHAR) | SELECT tournament FROM table_name_10 WHERE date = "january 10, 1994" |
Tell me the region for catalog of 576 096-2 | CREATE TABLE table_name_61 (region VARCHAR,catalog VARCHAR) | SELECT region FROM table_name_61 WHERE catalog = "576 096-2" |
What is the real name of the person whose primary military specialty is shock paratrooper? | CREATE TABLE table_name_51 (real_name VARCHAR,primary_military_speciality VARCHAR) | SELECT real_name FROM table_name_51 WHERE primary_military_speciality = "shock paratrooper" |
provide the number of patients whose year of birth is less than 2168 and procedure long title is continuous invasive mechanical ventilation for 96 consecutive hours or more? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2168" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more" |
What is the title of every song, and how many weeks was each song at #1 for Rihanna in 2012? | CREATE TABLE table_73125 ("Number One(s)" real,"Artist(s)" text,"Song(s) \u2014 Weeks" text,"Issue Years" real,"Whole Weeks" real) | SELECT "Song(s) \u2014 Weeks" FROM table_73125 WHERE "Issue Years" = '2012' AND "Artist(s)" = 'Rihanna' |
What did the away team score when Carlton was the home team? | CREATE TABLE table_56650 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_56650 WHERE "Home team" = 'carlton' |
Which Music has a Score of 30 (10, 10, 10), and a Style of cha-cha-cha? | CREATE TABLE table_name_22 (music VARCHAR,score VARCHAR,style VARCHAR) | SELECT music FROM table_name_22 WHERE score = "30 (10, 10, 10)" AND style = "cha-cha-cha" |
Count the number of exhibitions that happened in or after 2005. | CREATE TABLE exhibition_record (exhibition_id number,date text,attendance number)CREATE TABLE exhibition (exhibition_id number,year number,theme text,artist_id number,ticket_price number)CREATE TABLE artist (artist_id number,name text,country text,year_join number,age number) | SELECT COUNT(*) FROM exhibition WHERE year >= 2005 |
count the number of patients whose admission type is elective and procedure long title is other endoscopy of small intestine? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other endoscopy of small intestine" |
how can i go from the SAN FRANCISCO airport to downtown SAN FRANCISCO | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed ... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code |
what is marital status and procedure short title of subject id 74032? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.marital_status, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74032" |
tommy taylor had the same number of goals as which other player -lrb- s -rrb- ? | CREATE TABLE table_203_753 (id number,"rank" number,"name" text,"caps" number,"goals" number,"years" text) | SELECT "name" FROM table_203_753 WHERE "name" <> 'tommy taylor' AND "goals" = (SELECT "goals" FROM table_203_753 WHERE "name" = 'tommy taylor') |
What's the product that has less than 98.6 melamine content, more than 1 sample failed and took less than 3 samples? | CREATE TABLE table_66322 ("Producer" text,"Product" text,"Samples taken" real,"Samples failed" real,"Melamine content(mg/kg)" real) | SELECT "Product" FROM table_66322 WHERE "Melamine content(mg/kg)" < '98.6' AND "Samples failed" > '1' AND "Samples taken" < '3' |
i'm looking for a flight that goes from ONTARIO to WESTCHESTER COUNTY and stops in CHICAGO | CREATE TABLE airline (airline_code varchar,airline_name text,note text)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 code_description (code varchar,description text)CREATE ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WESTCHESTER COUNTY' AN... |
Find the names of customers who are not living in the state of California. | CREATE TABLE addresses (address_id VARCHAR,state_province_county VARCHAR)CREATE TABLE customer_addresses (customer_id VARCHAR,address_id VARCHAR)CREATE TABLE customers (customer_name VARCHAR,customer_id VARCHAR) | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' |
Which new conference is the Toreros Western Collegiate Lacrosse team playing in? | CREATE TABLE table_14976504_2 (new_conference VARCHAR,team_nickname VARCHAR) | SELECT new_conference FROM table_14976504_2 WHERE team_nickname = "Toreros" |
What is the 2013-2014 division for the Wolverhampton Wildcats? | CREATE TABLE table_name_60 (team VARCHAR) | SELECT 2013 AS _14_division FROM table_name_60 WHERE team = "wolverhampton wildcats" |
Which Nominated work has a Year of 1997? | CREATE TABLE table_name_96 (nominated_work VARCHAR,year VARCHAR) | SELECT nominated_work FROM table_name_96 WHERE year = 1997 |
Name the date for espn | CREATE TABLE table_26842217_18 (date VARCHAR,broadcast VARCHAR) | SELECT date FROM table_26842217_18 WHERE broadcast = "ESPN" |
Which Location has a Year Joined of 1966, and a Previous Conference of noble county, and a School of wawaka? | CREATE TABLE table_63618 ("School" text,"Location" text,"Mascot" text,"# / County" text,"Year Joined" real,"Previous Conference" text,"Year Left" real,"Conference Joined" text) | SELECT "Location" FROM table_63618 WHERE "Year Joined" = '1966' AND "Previous Conference" = 'noble county' AND "School" = 'wawaka' |
how many tournaments has he won by 3 or more strokes ? | CREATE TABLE table_203_151 (id number,"no." number,"date" text,"tournament" text,"winning score" text,"margin of\nvictory" text,"runner(s)-up" text) | SELECT COUNT("tournament") FROM table_203_151 WHERE "margin of\nvictory" >= 3 |
2 or more among 1 ) 4 ) 1 ) body temperature > 38 c or < 36 c 2 ) heart rate > 90 / min 3 ) respiratory rate > 20 / min or paco2 < 32 mmhg 4 ) wbc > 12000 / mm3, < 4000 / mm3, or band forms > 10 % ; | CREATE TABLE table_train_19 ("id" int,"white_blood_cell_count_wbc" int,"active_infection" bool,"heart_disease" bool,"temperature" float,"skin_lesion" bool,"heart_rate" int,"paco2" float,"immature_form" int,"respiratory_rate" int,"age" float,"NOUSE" float) | SELECT * FROM table_train_19 WHERE (CASE WHEN temperature > 38 OR temperature < 36 THEN 1 ELSE 0 END + CASE WHEN heart_rate > 90 THEN 1 ELSE 0 END + CASE WHEN respiratory_rate > 20 OR paco2 < 32 THEN 1 ELSE 0 END + CASE WHEN white_blood_cell_count_wbc > 12000 OR white_blood_cell_count_wbc < 4000 OR immature_form > 10 T... |
What was the latest year that the Atlanta Braves won and the St. Louis Cardinals lost? | CREATE TABLE table_40440 ("Year" real,"Series" text,"Winning team" text,"Losing team" text,"Score" text,"Site" text) | SELECT MAX("Year") FROM table_40440 WHERE "Winning team" = 'atlanta braves' AND "Losing team" = 'st. louis cardinals' |
What is the score when the tie number is 4? | CREATE TABLE table_name_47 (score VARCHAR,tie_no VARCHAR) | SELECT score FROM table_name_47 WHERE tie_no = "4" |
What was the lowest total of medals won by Croatia? | CREATE TABLE table_name_12 (total INTEGER,nation VARCHAR) | SELECT MIN(total) FROM table_name_12 WHERE nation = "croatia" |
What is the city in Alabama that opened in 1996? | CREATE TABLE table_79193 ("Rank" text,"Capacity" real,"City" text,"State" text,"Year opened" text) | SELECT "City" FROM table_79193 WHERE "Year opened" = '1996' AND "State" = 'alabama' |
Return the famous titles of the artist called 'Triumfall'. | CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,f... | SELECT famous_title FROM artist WHERE artist = "Triumfall" |
has albuterol concentrated 0.5%, acetaminophen 325 mg po tabs, or insulin lispro, recombinant been ordered for patient 021-25705 during this year? | 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 diagnosis (diagnosisid number,patientun... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND medication.drugname IN ('albuterol concentrated 0.5%', 'a... |
what is the daily average dose of volume (ml)-antithrombin iii (human) (thrombate iii) 1,208 units in sterile iv diluent 22 ml infusion syringe given to patient 015-7988 until 1592 days ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labi... | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND intakeoutput.celllabel = 'volume... |
Show the name of colleges that have at least two players in descending alphabetical order. | CREATE TABLE match_season (College VARCHAR) | SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC |
On what date did the away team Melbourne play? | CREATE TABLE table_56565 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_56565 WHERE "Away team" = 'melbourne' |
What is the away where the round is the second round? | CREATE TABLE table_name_40 (away VARCHAR,round VARCHAR) | SELECT away FROM table_name_40 WHERE round = "second round" |
Show the price of each product supplied by supplier id 3 in a bar chart. | CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE Departments (department_id INTEGER,dept_store_id INTEGER,department_name VARCHAR(80))CREATE TABLE Customer_Orders (order_id INT... | SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 |
what's the boiling point of diethyl ether? | CREATE TABLE table_name_74 (boiling_point VARCHAR,solvent VARCHAR) | SELECT boiling_point FROM table_name_74 WHERE solvent = "diethyl ether" |
How many editions did Club Q-base concept have ? | CREATE TABLE table_29788320_2 (number_of_editions VARCHAR,concept VARCHAR) | SELECT COUNT(number_of_editions) FROM table_29788320_2 WHERE concept = "Club Q-BASE" |
what is the five most frequent drugs prescribed within the same month to the female patient with age 20s after they have been diagnosed with aortic valve disorder? | CREATE TABLE d_icd_procedures (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 text,discharge_location text,insurance text,language text,marital_status text,ethnicit... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
what is the crude birth rate (per 1000) when the crude death rate (per 1000) is less than 6.2, the average population (x1000) is larger than 2,770 and the natural change (per 1000) is 17.2? | CREATE TABLE table_11432 ("Average population (x 1000)" real,"Live births" real,"Deaths" text,"Natural change" real,"Crude birth rate (per 1000)" real,"Crude death rate (per 1000)" real,"Natural change (per 1000)" real) | SELECT SUM("Crude birth rate (per 1000)") FROM table_11432 WHERE "Crude death rate (per 1000)" < '6.2' AND "Average population (x 1000)" > '2,770' AND "Natural change (per 1000)" = '17.2' |
What is the Enrollment for the Pilots? | CREATE TABLE table_7062 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Team Nickname" text,"Primary conference" text) | SELECT MIN("Enrollment") FROM table_7062 WHERE "Team Nickname" = 'pilots' |
What is the title of the episode that aired on december 12, 1953? | CREATE TABLE table_20318 ("Series #" real,"Season #" real,"Title" text,"Directed by:" text,"Written by:" text,"Original air date" text) | SELECT "Title" FROM table_20318 WHERE "Original air date" = 'December 12, 1953' |
How many seasons have a premier date of January 6, 2005? | CREATE TABLE table_24336 ("Season" real,"Episode" real,"Episode Summary" text,"Premier date" text,"External Link" text,"Coach" text) | SELECT COUNT("Season") FROM table_24336 WHERE "Premier date" = 'January 6, 2005' |
what are the top four most frequent diagnoses among patients of age 20s until 4 years ago? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientu... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 yea... |
What is the venue of the match with the cronulla sharks as the opponent? | CREATE TABLE table_60157 ("Team" text,"Opponent" text,"Score" text,"Venue" text,"Round" text) | SELECT "Venue" FROM table_60157 WHERE "Opponent" = 'cronulla sharks' |
provide the number of patients whose marital status is divorced and diagnoses icd9 code is 2764? | 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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.icd9_code = "2764" |
What are the number of the last names for all scholarship students? | CREATE TABLE SportsInfo (StuID INTEGER,SportName VARCHAR(32),HoursPerWeek INTEGER,GamesPlayed INTEGER,OnScholarship VARCHAR(1))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advi... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName |
Is BIOPHYS 417 available to take in Spring 2013 ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIOPHYS' AND course.number = 417 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2013 |
What is the report for round 9? | CREATE TABLE table_13754 ("Round" real,"Opposition Team" text,"Venue" text,"Result" text,"Report" text) | SELECT "Report" FROM table_13754 WHERE "Round" = '9' |
find out the average age of newborn patients with self pay insurance. | 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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Self Pay" |
What was the Opponent on August 31, 1997? | CREATE TABLE table_49314 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Opponent" FROM table_49314 WHERE "Date" = 'august 31, 1997' |
What is the average age of patients whose marital status is married and are aged 44 years or older? | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "44" |
What are the first name, last name, and phone number of all the female faculty members? | CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE activity (... | SELECT fname, lname, phone FROM faculty WHERE sex = 'F' |
how many russians finished at least 3rd in the 20km walk ? | CREATE TABLE table_204_712 (id number,"rank" number,"athlete" text,"nationality" text,"time" text,"notes" text) | SELECT COUNT(*) FROM table_204_712 WHERE "nationality" = 'russia' AND id <= 3 |
What lane has a time of 24.83 and a heat less than 11? | CREATE TABLE table_name_73 (lane INTEGER,time VARCHAR,heat VARCHAR) | SELECT SUM(lane) FROM table_name_73 WHERE time = "24.83" AND heat < 11 |
What is the Total of the 24:26 Set 1? | CREATE TABLE table_name_41 (total VARCHAR,set_1 VARCHAR) | SELECT total FROM table_name_41 WHERE set_1 = "24:26" |
What is the full number of Total Seats with a constituency seat number bigger than 0 with the Liberal Democrat party, and the Regional seat number is smaller than 6? | CREATE TABLE table_77552 ("Party" text,"Constituency Seats" real,"Regional Seats" real,"Total Seats" real,"Seat Change" text) | SELECT SUM("Total Seats") FROM table_77552 WHERE "Constituency Seats" > '0' AND "Party" = 'liberal democrat' AND "Regional Seats" < '6' |
Name the number of episode summary for jesse csincsak | CREATE TABLE table_24331 ("Season" real,"Episode" real,"Episode Summary" text,"Premier date" text,"External Link" text,"Coach" text) | SELECT COUNT("Episode Summary") FROM table_24331 WHERE "Coach" = 'Jesse Csincsak' |
what was the last year they did not qualify ? | CREATE TABLE table_204_58 (id number,"year" number,"position" text) | SELECT MAX("year") FROM table_204_58 WHERE "position" = 'did not qualify' |
Kendo React UI Top 100. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationI... | SELECT Posts.Id FROM Posts WHERE Posts.Tags LIKE '%kendo-react-ui%' LIMIT 1000 |
If the player is Marcelo, what is the position? | CREATE TABLE table_25569 ("R" real,"Player" text,"Position" text,"League" real,"Champions League" real,"Copa del Rey" real,"Total" real) | SELECT "Position" FROM table_25569 WHERE "Player" = 'Marcelo' |
What is total number of the to par of player john mahaffey, who has a total less than 298? | CREATE TABLE table_name_9 (to_par VARCHAR,player VARCHAR,total VARCHAR) | SELECT COUNT(to_par) FROM table_name_9 WHERE player = "john mahaffey" AND total < 298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.