instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
How many caps figures for the Doncaster Rovers?
CREATE TABLE table_74262 ("Player" text,"Cap(s)" real,"Goal(s)" real,"International Debut" text,"Club(s)" text)
SELECT COUNT("Cap(s)") FROM table_74262 WHERE "Club(s)" = 'Doncaster Rovers'
what is the average total cost of a hospital visit that includes embolectomy since 4 years ago?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,...
SELECT AVG(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 = 'embolectomy')) AND DATETIME(cost.chargetime)...
who published the most in semantic parsing after 2005 ?
CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperdataset...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2005 AND writes.paperid = paper.paperid GROUP BY write...
Who had the fastest lap in the Monaco Grand Prix?
CREATE TABLE table_52286 ("Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text)
SELECT "Fastest Lap" FROM table_52286 WHERE "Race" = 'monaco grand prix'
What is the played number when the tries against shows correct as of 18:13 26 May 2008?
CREATE TABLE table_47108 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text)
SELECT "Played" FROM table_47108 WHERE "Tries against" = 'correct as of 18:13 26 may 2008'
Name the start for finish being 21st
CREATE TABLE table_name_39 (start VARCHAR,finish VARCHAR)
SELECT start FROM table_name_39 WHERE finish = "21st"
get the number of male patients who have white-russian ethnic background.
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE - RUSSIAN"
what's the vineyard surface (2010) with grand cru being bienvenues-b tard-montrachet
CREATE TABLE table_19044 ("Grand Cru" text,"Region" text,"Village" text,"Wine style" text,"Vineyard surface (2010)" text)
SELECT "Vineyard surface (2010)" FROM table_19044 WHERE "Grand Cru" = 'Bienvenues-Bâtard-Montrachet'
When the pole is larger than 0 and the podium is less than 44, with a race number less than 16, what is the FLap?
CREATE TABLE table_name_79 (flap VARCHAR,race VARCHAR,pole VARCHAR,podium VARCHAR)
SELECT flap FROM table_name_79 WHERE pole > 0 AND podium < 44 AND race < 16
What country does Greg Norman represent?
CREATE TABLE table_name_26 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_26 WHERE player = "greg norman"
count the number of patients whose diagnoses short title is accident in place nec and drug route is sl?
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Accident in place NEC" AND prescriptions.route = "SL"
WHAT IS THE SIXTH WITH A SECOND OF WHITE LIES?
CREATE TABLE table_name_66 (sixth VARCHAR,second VARCHAR)
SELECT sixth FROM table_name_66 WHERE second = "white lies"
For those records from the products and each product's manufacturer, give me the comparison about the average of price over the name , and group by attribute name by a bar chart, and sort from low to high by the bar.
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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
What is the venue of the napa auto parts 200 race with a mrn radio?
CREATE TABLE table_name_79 (venue VARCHAR,radio VARCHAR,race VARCHAR)
SELECT venue FROM table_name_79 WHERE radio = "mrn" AND race = "napa auto parts 200"
What is the name of the country with less than 9.033 for swimsuit, 8.611 for interview and preliminary is less than 8.87?
CREATE TABLE table_48251 ("Country" text,"Preliminary" real,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real)
SELECT "Country" FROM table_48251 WHERE "Swimsuit" < '9.033' AND "Interview" = '8.611' AND "Preliminary" < '8.87'
what is the least expensive airfare between BOSTON and BALTIMORE
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 int,to_airport varchar)CREATE TABLE state (state_cod...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
What city had a july high below 84, and a january low of 34.3?
CREATE TABLE table_name_84 (city VARCHAR,july__avg_high_°f_ VARCHAR,january__avg_low_°f_ VARCHAR)
SELECT city FROM table_name_84 WHERE july__avg_high_°f_ < 84 AND january__avg_low_°f_ = "34.3"
What is the holmenkollen for the 1982 FIS Nordic World Ski Championships?
CREATE TABLE table_21695 ("Winner" text,"Country" text,"Winter Olympics" text,"FIS Nordic World Ski Championships" text,"Holmenkollen" text)
SELECT "Holmenkollen" FROM table_21695 WHERE "FIS Nordic World Ski Championships" = '1982'
What is the average Caboolture population with a Redcliffe population greater than 27,327, a Pine Rivers population greater than 119,236, and a total population greater than 344,878 after 1971?
CREATE TABLE table_71058 ("Year" real,"Population (Total)" real,"(Caboolture)" real,"(Pine Rivers)" real,"(Redcliffe)" real)
SELECT AVG("(Caboolture)") FROM table_71058 WHERE "(Redcliffe)" > '27,327' AND "(Pine Rivers)" > '119,236' AND "Year" > '1971' AND "Population (Total)" > '344,878'
What was the constructor of the car that Achille Varzi drove before 1937?
CREATE TABLE table_58103 ("Year" real,"Driver" text,"Constructor" text,"Location" text,"Report" text)
SELECT "Constructor" FROM table_58103 WHERE "Year" < '1937' AND "Driver" = 'achille varzi'
what is admission time of subject name herlinda thomson?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Herlinda Thomson"
What are the names of representatives and the dates of elections they participated in.
CREATE TABLE election (Date VARCHAR,Representative_ID VARCHAR)CREATE TABLE representative (Name VARCHAR,Representative_ID VARCHAR)
SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
What School did Player Billy Owens attend?
CREATE TABLE table_54862 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text)
SELECT "School" FROM table_54862 WHERE "Player" = 'billy owens'
In which district is the incumbent John Breaux?
CREATE TABLE table_18344 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_18344 WHERE "Incumbent" = 'John Breaux'
Number of votes in the last year.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text...
SELECT COUNT(*) FROM Votes WHERE CreationDate > DATEADD(year, -1, GETDATE()) AND UserId > -1
Bar chart x axis name y axis how many name, list in desc by the names.
CREATE TABLE media_types (id INTEGER,name VARCHAR(120))CREATE TABLE sqlite_sequence (name any,seq any)CREATE TABLE invoice_lines (id INTEGER,invoice_id INTEGER,track_id INTEGER,unit_price NUMERIC(10,2),quantity INTEGER)CREATE TABLE playlist_tracks (playlist_id INTEGER,track_id INTEGER)CREATE TABLE customers (id INTEGER...
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY name DESC
Are there any morning CHEM 521 classes ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,go...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CHEM' AND course.number = 521 AND semester.semester = 'WN' AND semester.semester_id = course_off...
what is the minimum total hospital cost that includes the calcium during the last year?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE medication (medicationid number,patientunitstayid number,drugna...
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 lab.patientunitstayid FROM lab WHERE lab.labname = 'calcium')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME...
count the number of patients whose diagnoses long title is venous (peripheral) insufficiency, unspecified and drug route is iv?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Venous (peripheral) insufficiency, unspecified" AND prescriptions.route = "IV"
other nation to earn no bronze medals besides peru
CREATE TABLE table_204_232 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_204_232 WHERE "nation" <> 'peru' AND "bronze" = 0
What is the grid associated with a Time/Retired of + 1 lap, and under 7 points?
CREATE TABLE table_67754 ("Name" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real)
SELECT MIN("Grid") FROM table_67754 WHERE "Time/Retired" = '+ 1 lap' AND "Points" < '7'
how much does it cost to get checked for central diabetes insipidus - from trauma?
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 medication (medicationid number,patientunitstayid number,drugname te...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'central diabetes insipidus - from trauma')
When godstone is in division five who is in division four?
CREATE TABLE table_24575253_4 (division_four VARCHAR,division_five VARCHAR)
SELECT division_four FROM table_24575253_4 WHERE division_five = "Godstone"
Show storm name with at least two regions and 10 cities affected.
CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number)CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE region (region_id number,region_code text,region_name text)
SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10
how many times was the round result higher than 11th ?
CREATE TABLE table_204_115 (id number,"year" number,"track" text,"number" number,"team" text,"car" text,"round result" text)
SELECT COUNT(*) FROM table_204_115 WHERE "round result" < 11
What television service has italian as the language, and sky famiglia as the package option?
CREATE TABLE table_name_20 (television_service VARCHAR,language VARCHAR,package_option VARCHAR)
SELECT television_service FROM table_name_20 WHERE language = "italian" AND package_option = "sky famiglia"
What is the Established date of the Ontario Provincial Junior A Hockey League with more than 1 Championship?
CREATE TABLE table_name_58 (established VARCHAR,league VARCHAR,championships VARCHAR)
SELECT COUNT(established) FROM table_name_58 WHERE league = "ontario provincial junior a hockey" AND championships > 1
Calculate the average age of male patients who have sternal wound infection as their primary disease.
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.gender = "M" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
Which Number of electorates (2009) has 188 Constituents?
CREATE TABLE table_name_93 (number_of_electorates__2009_ VARCHAR,constituency_number VARCHAR)
SELECT number_of_electorates__2009_ FROM table_name_93 WHERE constituency_number = "188"
what is the earliest year with the best finish t-65?
CREATE TABLE table_name_82 (year INTEGER,best_finish VARCHAR)
SELECT MIN(year) FROM table_name_82 WHERE best_finish = "t-65"
Get counts of post feedback votes.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDa...
SELECT CASE IsAnonymous WHEN 1 THEN 'Yes' ELSE 'No' END AS "anonymous?", CASE VoteTypeId WHEN 2 THEN 'Upvotes' ELSE 'Downvotes' END AS "votes_type", COUNT(Id) AS "total_votes" FROM PostFeedback GROUP BY IsAnonymous, VoteTypeId
is there any organisms found in patient 65741's last sputum test since 2105?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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,...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65741) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y', microbiologyevents.charttime) >= '2105' ORDER BY...
What is the sum of Weight for the person with a height of 6'6'?
CREATE TABLE table_41654 ("Name" text,"Height" text,"Weight (lbs.)" real,"Position" text,"Class" text,"Hometown" text)
SELECT SUM("Weight (lbs.)") FROM table_41654 WHERE "Height" = '6''6'
What is the to par for the player who scored 73-68=141?
CREATE TABLE table_name_91 (to_par VARCHAR,score VARCHAR)
SELECT to_par FROM table_name_91 WHERE score = 73 - 68 = 141
which other people are in class c besides rose washington ?
CREATE TABLE table_204_325 (id number,"class" text,"name" text,"company" text,"residence" text,"term expires dec 31" number,"notes" text)
SELECT "name" FROM table_204_325 WHERE "name" <> 'rose washington' AND "class" = 'c'
provide the number of patients whose age is less than 43 and lab test fluid is other body fluid?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Other Body Fluid"
Bar chart of minimal salary from each dept name, and list by the total number in descending.
CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE department (dept_name varchar(20),building...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) DESC
what is admission time of subject id 94762?
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 demographic.admittime FROM demographic WHERE demographic.subject_id = "94762"
what are the three most commonly ordered procedures for patients who had previously received temporary tracheostomy within the same month, until 3 years ago?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME var...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
How many roles include George Broderick in the casino 1888 theater?
CREATE TABLE table_148386_2 (role VARCHAR,casino_theatre_1888 VARCHAR)
SELECT role FROM table_148386_2 WHERE casino_theatre_1888 = "George Broderick"
After the year 2011, when the Canada - USA Rank was 46th, what was the League Rank?
CREATE TABLE table_name_54 (league VARCHAR,year VARCHAR,canada___usa_rank VARCHAR)
SELECT league AS Rank FROM table_name_54 WHERE year > 2011 AND canada___usa_rank = "46th"
What is the lowest rank of Gatwick Airport?
CREATE TABLE table_18118221_1 (rank INTEGER,railway_station VARCHAR)
SELECT MIN(rank) FROM table_18118221_1 WHERE railway_station = "Gatwick Airport"
give me the number of patients whose days of hospital stay is greater than 5 and diagnoses short title is personality disorder nos?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.short_title = "Personality disorder NOS"
Which Reactortype has a gross capacity of 417 mw and an Electricity Grid of 27.12.1971?
CREATE TABLE table_name_64 (reactortype VARCHAR,gross_capacity VARCHAR,electricity_grid VARCHAR)
SELECT reactortype FROM table_name_64 WHERE gross_capacity = "417 mw" AND electricity_grid = "27.12.1971"
What is Tries Against, when Try Diff is +15?
CREATE TABLE table_44489 ("Team" text,"Tries for" text,"Tries against" text,"Try diff" text,"Points for" text,"Points against" text,"Points diff" text)
SELECT "Tries against" FROM table_44489 WHERE "Try diff" = '+15'
What park opened in 1999?
CREATE TABLE table_71835 ("Park" text,"Tower height" text,"Drop height*" text,"Speed" text,"Model" text,"Opened" text,"Height requirement" text)
SELECT "Park" FROM table_71835 WHERE "Opened" = '1999'
Who is the elevator from crema?
CREATE TABLE table_66282 ("Elector" text,"Nationality" text,"Cardinalatial order and title" text,"Elevated" text,"Elevator" text)
SELECT "Elevator" FROM table_66282 WHERE "Nationality" = 'crema'
Name who directed the episode 'bro-lo el cu ado
CREATE TABLE table_30485 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Directed by" FROM table_30485 WHERE "Title" = 'Bro-Lo El Cuñado'
serum creatinine > 1.5 mg / dl or greater than 1.5x the upper limit of normal for age
CREATE TABLE table_train_160 ("id" int,"alt" float,"systolic_blood_pressure_sbp" int,"ast" float,"platelet_count" float,"diastolic_blood_pressure_dbp" int,"serum_creatinine" float,"triglyceride_tg" float,"hypertension" bool,"NOUSE" float)
SELECT * FROM table_train_160 WHERE serum_creatinine > 1.5
What is the Date of the game with a Record of 8 10 6?
CREATE TABLE table_name_99 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_99 WHERE record = "8–10–6"
What is the largest number of silver that had 0 bronzes and total less than 1?
CREATE TABLE table_7456 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Silver") FROM table_7456 WHERE "Bronze" = '0' AND "Total" < '1'
Find products with max page size as 'A4' or pages per minute color smaller than 5.
CREATE TABLE product (product VARCHAR,max_page_size VARCHAR,pages_per_minute_color VARCHAR)
SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5
How many posts have the exact same number of answers.
CREATE TABLE PostTypes (Id number,Name text)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 ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate...
SELECT AcceptedAnswerId FROM Posts WHERE NOT AcceptedAnswerId IS NULL
What is the name of the swimmer from Australia in lane 4 with a heat larger than 4?
CREATE TABLE table_66283 ("Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT "Name" FROM table_66283 WHERE "Heat" > '4' AND "Lane" = '4' AND "Nationality" = 'australia'
Count the total number of roles listed.
CREATE TABLE all_documents (document_id number,date_stored time,document_type_code text,document_name text,document_description text,other_details text)CREATE TABLE employees (employee_id number,role_code text,employee_name text,gender_mfu text,date_of_birth time,other_details text)CREATE TABLE document_locations (docu...
SELECT COUNT(*) FROM roles
Which province has an elevation of 4550?
CREATE TABLE table_25087 ("#" real,"District" text,"Province" text,"Region" text,"UBIGEO" real,"Elevation (m)" real)
SELECT "Province" FROM table_25087 WHERE "Elevation (m)" = '4550'
Tell me the lowest week for attendance of 60,894
CREATE TABLE table_name_37 (week INTEGER,attendance VARCHAR)
SELECT MIN(week) FROM table_name_37 WHERE attendance = "60,894"
information on AA from WASHINGTON to FORT WORTH
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time in...
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 = 'FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WA...
Name the party for virginia 12
CREATE TABLE table_74011 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Party" FROM table_74011 WHERE "District" = 'Virginia 12'
A bar chart for what are the number of the names of races held between 2009 and 2011?
CREATE TABLE lapTimes (raceId INTEGER,driverId INTEGER,lap INTEGER,position INTEGER,time TEXT,milliseconds INTEGER)CREATE TABLE constructorResults (constructorResultsId INTEGER,raceId INTEGER,constructorId INTEGER,points REAL,status TEXT)CREATE TABLE qualifying (qualifyId INTEGER,raceId INTEGER,driverId INTEGER,constru...
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name
What player was selected in Round 6?
CREATE TABLE table_name_96 (player VARCHAR,round VARCHAR)
SELECT player FROM table_name_96 WHERE round = 6
On which week was the opponent the oakland raiders?
CREATE TABLE table_51128 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT SUM("Week") FROM table_51128 WHERE "Opponent" = 'oakland raiders'
WHAT IS THE ELEVATION OF THE UNAKA MOUNTAINS, IN ROAN HIGH BLUFF PEAK, AND ISOLATION LARGER THAN 1.54?
CREATE TABLE table_9778 ("Rank" real,"Peak Name" text,"Elevation (ft)" real,"Range" text,"Isolation" real)
SELECT AVG("Elevation (ft)") FROM table_9778 WHERE "Range" = 'unaka mountains' AND "Peak Name" = 'roan high bluff' AND "Isolation" > '1.54'
Who is the driver when the grid is 18?
CREATE TABLE table_name_18 (driver VARCHAR,grid VARCHAR)
SELECT driver FROM table_name_18 WHERE grid = "18"
What institution is a NCAA Division i school and part of the NEC conference with a nickname the Blue Devils?
CREATE TABLE table_name_48 (institution VARCHAR,nickname VARCHAR,classification VARCHAR,current_conference VARCHAR)
SELECT institution FROM table_name_48 WHERE classification = "ncaa division i" AND current_conference = "nec" AND nickname = "blue devils"
What is the maximum download speed for the Internet basic plan with 3G?
CREATE TABLE table_15241 ("Company" text,"Plan name" text,"Technology" text,"Maximum download speed/ kbps" text,"Data limit/ GB" text,"Monthly price incl. VAT/ CZK" text)
SELECT "Maximum download speed/ kbps" FROM table_15241 WHERE "Technology" = '3g' AND "Plan name" = 'internet basic'
Who was in Second Place with Isabelle Brayley came in Fourth?
CREATE TABLE table_76021 ("Event" text,"Winner" text,"Second" text,"Third" text,"Fourth" text)
SELECT "Second" FROM table_76021 WHERE "Fourth" = 'isabelle brayley'
provide the number of patients whose insurance is medicare and lab test name is wbc?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "WBC"
what is the number of patients who take drug via oral route and have diabetes mellitus without mention of complication, type ii or unspecified type, not stated as uncontrolled diagnoses?
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Diabetes mellitus without mention of complication, type II or unspecified type, not stated ...
how many patients whose age is less than 80 and procedure icd9 code is 4610?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "80" AND procedures.icd9_code = "4610"
what is the number of patients whose marital status is married and diagnoses short title is bleed esoph var oth dis?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Bleed esoph var oth dis"
How many values of up/down have a total value of exactly 301470?
CREATE TABLE table_3118 ("Venue" text,"Hosted" real,"Average" real,"Highest" real,"Lowest" real,"Total" real,"Last Year" text,"Up/Down" text)
SELECT COUNT("Up/Down") FROM table_3118 WHERE "Total" = '301470'
Compare the distribution of the players' gender using a bar chart, rank by the total number in ascending.
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 text,Start_year int)CREATE TABLE player (Player_ID int,Sponsor_name text,Player_name text,Gender text,Residence text,Occupation text,Votes int,Rank text)CRE...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender)
what were the three most common medicines that patients were prescribed within 2 months after receiving a insert spinal canal cath procedure in this year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)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_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_i...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
Search for a specific code string.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,U...
SELECT Id AS "post_link", * FROM Posts WHERE (OwnerUserId = 101651) AND (Body LIKE '%multicolumn{1}%')
what are the new prescriptions of patient 005-4471 today compared to those given yesterday?
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 microlab ...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-4471') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat...
How many medications are prescribed for each brand Visualize by bar chart, and could you list Y-axis in asc order?
CREATE TABLE Room (RoomNumber INTEGER,RoomType VARCHAR(30),BlockFloor INTEGER,BlockCode INTEGER,Unavailable BOOLEAN)CREATE TABLE Block (BlockFloor INTEGER,BlockCode INTEGER)CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Trained_In (Physician INTEGER,Treatment ...
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY COUNT(*)
What is the commenced operation where the ICAO is KAL?
CREATE TABLE table_40825 ("AIRLINE" text,"ICAO" text,"IATA" text,"CALLSIGN" text,"COMMENCED OPERATIONS" text)
SELECT "COMMENCED OPERATIONS" FROM table_40825 WHERE "ICAO" = 'kal'
What were the notes in 2011?
CREATE TABLE table_name_89 (notes VARCHAR,year VARCHAR)
SELECT notes FROM table_name_89 WHERE year = 2011
who is the constructor when the grid is more than 10 and the time/retired is +1 lap?
CREATE TABLE table_10744 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Constructor" FROM table_10744 WHERE "Grid" > '10' AND "Time/Retired" = '+1 lap'
what were the four most commonly given diagnoses for patients that had previously received a other pleural incision within 2 months, since 2102?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
Show me about the distribution of meter_200 and the average of meter_100 , and group by attribute meter_200 in a bar chart, and could you show mean meter 100 from low to high order?
CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY AVG(meter_100)
Return the name, location, and seating of the track that was opened in the most recent year.
CREATE TABLE track (track_id number,name text,location text,seating number,year_opened number)CREATE TABLE race (race_id number,name text,class text,date text,track_id text)
SELECT name, location, seating FROM track ORDER BY year_opened DESC LIMIT 1
has patient 002-4486 been prescribed with magnesium sulfate 2 g in ns premix, sodium chloride 0.9% 500 ml lvp or enoxaparin inj during their current hospital visit?
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 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 = '002-4486' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn...
Tell me the sum of year for extra of junior team competition
CREATE TABLE table_name_31 (year INTEGER,extra VARCHAR)
SELECT SUM(year) FROM table_name_31 WHERE extra = "junior team competition"
Compare the number of the names of phones by a bar chart.
CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name
What is the score of the tournament on 25 July 1994 with a clay surface and Patricia Tarabini as the partner?
CREATE TABLE table_name_83 (score VARCHAR,date VARCHAR,surface VARCHAR,partner VARCHAR)
SELECT score FROM table_name_83 WHERE surface = "clay" AND partner = "patricia tarabini" AND date = "25 july 1994"
Who was the champion in the game played at the St. Andrews Links with Dick Chapman as the runner-up?
CREATE TABLE table_42941 ("Year" text,"Venue" text,"Champion" text,"Country" text,"Score" text,"Runner-up" text)
SELECT "Champion" FROM table_42941 WHERE "Runner-up" = 'dick chapman' AND "Venue" = 'st. andrews links'
What name has gen et sp nov as the novelty?
CREATE TABLE table_41238 ("Name" text,"Novelty" text,"Status" text,"Authors" text,"Unit" text,"Location" text)
SELECT "Name" FROM table_41238 WHERE "Novelty" = 'gen et sp nov'