instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
give me the number of patients whose age is less than 79 and drug code is labe100i?
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "79" AND prescriptions.formulary_drug_cd = "LABE100I"
what's the minimum 180s value
CREATE TABLE table_13535824_2 (Id VARCHAR)
SELECT MIN(180 AS s) FROM table_13535824_2
What episode is titled 'Authority Vested'?
CREATE TABLE table_2293 ("No. in series" real,"No. in season" real,"Title" text,"Directedby" text,"Writtenby" text,"Originalairdate" text,"Production code" text,"U.S. viewers (million)" text)
SELECT MAX("No. in season") FROM table_2293 WHERE "Title" = 'Authority Vested'
Who were the opponents in the match or matches that ended in a score of W/O?
CREATE TABLE table_name_72 (opponents_in_final VARCHAR,score_in_final VARCHAR)
SELECT opponents_in_final FROM table_name_72 WHERE score_in_final = "w/o"
count the number of private health insurance patients who have diagnoses icd9 code 45341.
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "45341"
For airlines named Aeroflot Group, what is the alliance?
CREATE TABLE table_54138 ("Rank" real,"Airline/Holding" text,"Passenger Fleet" real,"Current Destinations" real,"Alliance/ Association" text)
SELECT "Alliance/ Association" FROM table_54138 WHERE "Airline/Holding" = 'aeroflot group'
How many were the US viewers (in millions) of the episode that was written by Gordon C. Lonsdale?
CREATE TABLE table_26826304_1 (us_viewers__millions_ VARCHAR,directed_by VARCHAR)
SELECT us_viewers__millions_ FROM table_26826304_1 WHERE directed_by = "Gordon C. Lonsdale"
what is the minimum total hospital cost that involves 1 int mam-cor art bypass in this year?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = '1 int mam-cor art bypass')) AND DATETIME(cost.chargetime,...
What round was Nick Gillis?
CREATE TABLE table_54740 ("Round" real,"Overall" real,"Player" text,"Nationality" text,"Club team" text)
SELECT "Round" FROM table_54740 WHERE "Player" = 'nick gillis'
which driver had the least number of laps ?
CREATE TABLE table_204_477 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_204_477 ORDER BY "laps" LIMIT 1
What is the lost for span 2006- when conv is 0?
CREATE TABLE table_4926 ("Player" text,"Span" text,"Lost" text,"Draw" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text)
SELECT "Lost" FROM table_4926 WHERE "Conv" = '0' AND "Span" = '2006-'
Which irrigation district has 4733 users?
CREATE TABLE table_2211 ("Irrigation District" text,"Juntas de Regantes (WUB)" text,"Asociaciones (WUA) (#)" real,"Tareas (15.9 tareas = 1 ha)" real,"Users (#)" real)
SELECT "Irrigation District" FROM table_2211 WHERE "Users (#)" = '4733'
Which Relation has a Type of tv, and a Name of ohanami?
CREATE TABLE table_13428 ("Name" text,"Type" text,"Relation" text,"Length" text,"Year" real)
SELECT "Relation" FROM table_13428 WHERE "Type" = 'tv' AND "Name" = 'ohanami'
What was the playoff result when they finished 5th, north in the regular sesason?
CREATE TABLE table_1169 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Playoffs" FROM table_1169 WHERE "Regular Season" = '5th, North'
Which stadium has the date/year of Fri 06/25/82?
CREATE TABLE table_21436373_6 (stadium VARCHAR,date_year VARCHAR)
SELECT stadium FROM table_21436373_6 WHERE date_year = "Fri 06/25/82"
Name the classes that will be offered over the next 6 semester .
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cr...
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
What was the record of the game with a score of 12 6?
CREATE TABLE table_75115 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Record" FROM table_75115 WHERE "Score" = '12–6'
What is the average last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins?
CREATE TABLE table_name_44 (last_cf INTEGER,team VARCHAR,cf_appearances VARCHAR,cf_wins VARCHAR)
SELECT AVG(last_cf) FROM table_name_44 WHERE cf_appearances < 4 AND cf_wins < 1 AND team = "st. louis blues"
What is the lowest Week when the result was l 6 0?
CREATE TABLE table_76130 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MIN("Week") FROM table_76130 WHERE "Result" = 'l 6–0'
What was the result of the election of doc hastings (r) 53.3% jay inslee (d) 46.7%
CREATE TABLE table_1341522_50 (status VARCHAR,opponent VARCHAR)
SELECT status FROM table_1341522_50 WHERE opponent = "Doc Hastings (R) 53.3% Jay Inslee (D) 46.7%"
Name the lowest version with a code of u+1034a that began after 2001.
CREATE TABLE table_name_85 (version INTEGER,code VARCHAR,year VARCHAR)
SELECT MIN(version) FROM table_name_85 WHERE code = "u+1034a" AND year > 2001
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, show in ascending by the y axis please.
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),COUNTRY_ID varchar(2))CREATE TABLE countries (COUNTRY_ID varchar(2),...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)
how many patients have born before the year 2134 with the primary disease transient ischemic attack?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.dob_year < "2134"
How many characters where actor/actress is larry lamb?
CREATE TABLE table_25831483_1 (character VARCHAR,actor_actress VARCHAR)
SELECT COUNT(character) FROM table_25831483_1 WHERE actor_actress = "Larry Lamb"
What was the final score in 1986?
CREATE TABLE table_73941 ("Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in final" text,"Score in final" text)
SELECT "Score in final" FROM table_73941 WHERE "Year" = '1986'
For those records from the products and each product's manufacturer, find name and the average of price , and group by attribute name, and visualize them by a bar chart.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
What is the away team that had a score of 15.9 (99)?
CREATE TABLE table_4619 ("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_4619 WHERE "Away team score" = '15.9 (99)'
Who retired at lap 77 and was grid 11?
CREATE TABLE table_name_22 (time_retired VARCHAR,laps VARCHAR,grid VARCHAR)
SELECT time_retired FROM table_name_22 WHERE laps = "77" AND grid = "11"
how many actors were nominated but did n't win ?
CREATE TABLE table_203_782 (id number,"year" number,"actor" text,"award" text,"category" text,"role" text,"episode" text,"result" text)
SELECT COUNT("award") FROM table_203_782 WHERE "result" = 'nominated'
With which kind of payment method were the least number of payments processed?
CREATE TABLE Payments (Payment_Method_Code VARCHAR)
SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) LIMIT 1
Name the most year with start less than 2
CREATE TABLE table_68215 ("Year" real,"Manufacturer" text,"Start" real,"Finish" real,"Team" text)
SELECT MAX("Year") FROM table_68215 WHERE "Start" < '2'
Which Home is on january 11?
CREATE TABLE table_name_82 (home VARCHAR,date VARCHAR)
SELECT home FROM table_name_82 WHERE date = "january 11"
What is the greatest number of losses when the against is 1465 and there are more than 7 wins?
CREATE TABLE table_name_80 (losses INTEGER,against VARCHAR,wins VARCHAR)
SELECT MAX(losses) FROM table_name_80 WHERE against = 1465 AND wins > 7
what was patient 016-19759's last prescribed time for ondansetron 2 mg/1 ml 2ml sdv inj during their first hospital visit?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-19759' AND NOT patient.hospitaldischargetime IS NULL ORDER...
how many of the patients were discharged to home after a hospital stay of more than 26 days?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "26"
What is the average rank for Group A athlete Yanina Karolchyk, and a result higher than 18?
CREATE TABLE table_79340 ("Rank" real,"Group" text,"Athlete" text,"Nationality" text,"Result" real)
SELECT AVG("Rank") FROM table_79340 WHERE "Group" = 'a' AND "Athlete" = 'yanina karolchyk' AND "Result" > '18'
What is the minimum number of f/laps?
CREATE TABLE table_26222468_1 (f_laps INTEGER)
SELECT MIN(f_laps) FROM table_26222468_1
posts from a user containing images. Find all posts from a specific user containing imgur images
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 PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number...
SELECT p.Id, p.Id AS "post_link", pt.Name AS "type", p.Score, p.CreationDate, p.Tags FROM Posts AS p INNER JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p.Body LIKE '%imgur%' ORDER BY p.CreationDate DESC LIMIT 1000
What is the record when the Nuggets are the home team?
CREATE TABLE table_name_33 (record VARCHAR,home VARCHAR)
SELECT record FROM table_name_33 WHERE home = "nuggets"
Count the number of voting records for each election cycle.
CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote number,class_senator_vote number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number...
SELECT election_cycle, COUNT(*) FROM voting_record GROUP BY election_cycle
What is John Curtice's position?
CREATE TABLE table_name_35 (position VARCHAR,player VARCHAR)
SELECT position FROM table_name_35 WHERE player = "john curtice"
What is the number of laps with a Constructor of renault, and a driver of jacques villeneuve?
CREATE TABLE table_name_73 (laps VARCHAR,constructor VARCHAR,driver VARCHAR)
SELECT laps FROM table_name_73 WHERE constructor = "renault" AND driver = "jacques villeneuve"
what 's the earliest flight from SAN JOSE to HOUSTON
CREATE TABLE code_description (code varchar,description text)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 ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN JOSE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUS...
What is the Latin motto of the sign that translates to spouse?
CREATE TABLE table_name_94 (latin_motto VARCHAR,translation VARCHAR)
SELECT latin_motto FROM table_name_94 WHERE translation = "spouse"
How many people had the high assists @ minnesota?
CREATE TABLE table_13619135_7 (high_assists VARCHAR,team VARCHAR)
SELECT COUNT(high_assists) FROM table_13619135_7 WHERE team = "@ Minnesota"
IN which year did city 'Taizhou ( Zhejiang )' serve as a host city?
CREATE TABLE city (city_id number,city text,hanzi text,hanyu_pinyin text,regional_population number,gdp number)CREATE TABLE hosting_city (year number,match_id number,host_city text)CREATE TABLE temperature (city_id number,jan number,feb number,mar number,apr number,jun number,jul number,aug number,sep number,oct number...
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
Which Player has a Round of 7, a Pick larger than 187, a Nationality of united states, and a Draft larger than 2000?
CREATE TABLE table_60050 ("Draft" real,"Round" text,"Pick" real,"Player" text,"Nationality" text)
SELECT "Player" FROM table_60050 WHERE "Round" = '7' AND "Pick" > '187' AND "Nationality" = 'united states' AND "Draft" > '2000'
What are the different types of forms?
CREATE TABLE addresses (address_id number,line_1_number_building text,town_city text,zip_postcode text,state_province_county text,country text)CREATE TABLE individuals (individual_id number,individual_first_name text,individual_middle_name text,inidividual_phone text,individual_email text,individual_address text,indivi...
SELECT DISTINCT form_type_code FROM forms
How many starts are there?
CREATE TABLE table_23239946_3 (starts INTEGER)
SELECT MIN(starts) FROM table_23239946_3
Which term in office has an Electorate of hinkler?
CREATE TABLE table_68659 ("Member" text,"Party" text,"Electorate" text,"State" text,"Term in office" text)
SELECT "Term in office" FROM table_68659 WHERE "Electorate" = 'hinkler'
Count job title of all people ordered by their names using a bar chart.
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT job, COUNT(job) FROM Person GROUP BY job ORDER BY name
What is the receipt date of the document with id 3?
CREATE TABLE Documents (receipt_date VARCHAR,document_id VARCHAR)
SELECT receipt_date FROM Documents WHERE document_id = 3
For which to par was the score 71-74-68=213?
CREATE TABLE table_name_11 (to_par VARCHAR,score VARCHAR)
SELECT to_par FROM table_name_11 WHERE score = 71 - 74 - 68 = 213
How many lost when goals for is 43 and the position number is higher than 15?
CREATE TABLE table_48814 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT AVG("Lost") FROM table_48814 WHERE "Goals For" = '43' AND "Position" > '15'
On what date did the episode with a series number 31, with a story written by William Reiss, air for the first time?
CREATE TABLE table_14035132_3 (original_air_date VARCHAR,storyboarded_by VARCHAR,no_in_series VARCHAR)
SELECT original_air_date FROM table_14035132_3 WHERE storyboarded_by = "William Reiss" AND no_in_series = "31"
What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?
CREATE TABLE medicine (id number,name text,trade_name text,fda_approved text)CREATE TABLE medicine_enzyme_interaction (enzyme_id number,medicine_id number,interaction_type text)CREATE TABLE enzyme (id number,name text,location text,product text,chromosome text,omim number,porphyria text)
SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
what the tier before 2006/7 ?
CREATE TABLE table_204_524 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT "tier" FROM table_204_524 WHERE "season" < '2006/07' ORDER BY "season" DESC LIMIT 1
What is the earliest game that had 42,707 attending?
CREATE TABLE table_57319 ("Game" real,"Date" text,"Score" text,"Location" text,"Time" text,"Attendance" real)
SELECT MIN("Game") FROM table_57319 WHERE "Attendance" = '42,707'
Who was featured in 20 questions when the subject of the interview was Mike Piazza?
CREATE TABLE table_1566852_4 (interview_subject VARCHAR)
SELECT 20 AS _questions FROM table_1566852_4 WHERE interview_subject = "Mike Piazza"
What is the Venue before 2003 with Notes of 57.73 m?
CREATE TABLE table_name_63 (venue VARCHAR,year VARCHAR,notes VARCHAR)
SELECT venue FROM table_name_63 WHERE year < 2003 AND notes = "57.73 m"
count the number of patients taking sodium chloride nasal medication who are diagnosed with unspecified fall.
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 demographic (subject_id text,hadm_id t...
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 = "Unspecified fall" AND prescriptions.drug = "Sodium Chloride Nasal"
Which ERP W has a Frequency MHz larger than 89.1, and a City of license of de queen, arkansas?
CREATE TABLE table_name_54 (erp_w VARCHAR,frequency_mhz VARCHAR,city_of_license VARCHAR)
SELECT erp_w FROM table_name_54 WHERE frequency_mhz > 89.1 AND city_of_license = "de queen, arkansas"
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of commission_pct over hire_date .
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
What is Try Bonus, when Tries For is '39'?
CREATE TABLE table_name_98 (try_bonus VARCHAR,tries_for VARCHAR)
SELECT try_bonus FROM table_name_98 WHERE tries_for = "39"
What's the black with 24 moves in the dortmund tournament?
CREATE TABLE table_name_56 (black VARCHAR,moves VARCHAR,tournament VARCHAR)
SELECT black FROM table_name_56 WHERE moves = 24 AND tournament = "dortmund"
What Label has a Format of cd, and a Catalog of crgd 86136?
CREATE TABLE table_59825 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Label" FROM table_59825 WHERE "Format" = 'cd' AND "Catalog" = 'crgd 86136'
What is the episode number of the episode whose production code is 226407?
CREATE TABLE table_29799 ("No(s). in series" real,"No(s). in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code(s)" real,"U.S. viewers (millions)" text)
SELECT MIN("No(s). in season") FROM table_29799 WHERE "Production code(s)" = '226407'
What is Probate Activities, when Reserved Instruments is No, and when Regulator is Chartered Institute of Legal Executives?
CREATE TABLE table_name_6 (probate_activities VARCHAR,reserved_instruments VARCHAR,regulator VARCHAR)
SELECT probate_activities FROM table_name_6 WHERE reserved_instruments = "no" AND regulator = "chartered institute of legal executives"
very well i'm working on scenario three i'm interested in a flight on a 727 from WASHINGTON to ATLANTA GA
CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE equipment_sequence (aircraft_code_sequence v...
SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = '727' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_1.state_c...
let me know the number of patients born before 2126 who had drug code fent25p.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2126" AND prescriptions.formulary_drug_cd = "FENT25P"
What was the overall score when the score of set 3 was 29 27?
CREATE TABLE table_name_63 (score VARCHAR,set_3 VARCHAR)
SELECT score FROM table_name_63 WHERE set_3 = "29–27"
What is Designation, when Launch Date/Time ( GMT ) is 29 June 1972, 03:47?
CREATE TABLE table_12860 ("Designation" text,"Launch date/time (GMT)" text,"Mass" text,"Apogee" text,"Inclination" text)
SELECT "Designation" FROM table_12860 WHERE "Launch date/time ( GMT )" = '29 june 1972, 03:47'
Can you tell me the Record that has the Location of fleetcenter, and the Date of fri. apr. 5?
CREATE TABLE table_46776 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text)
SELECT "Record" FROM table_46776 WHERE "Location" = 'fleetcenter' AND "Date" = 'fri. apr. 5'
among patients diagnosed with malnutrition mod degree, show me the three year survival probability.
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE microbiologyevents (row_id number,subject_id number,...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
How many drops occurred with 0 pens and Fangatapu Apikotoa playing?
CREATE TABLE table_32794 ("Player" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text,"Venue" text,"Date" text)
SELECT "Drop" FROM table_32794 WHERE "Pens" = '0' AND "Player" = 'fangatapu apikotoa'
What is the stadium of melbourne?
CREATE TABLE table_52968 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_52968 WHERE "Home team" = 'melbourne'
3488 is the enrollment amount of what college?
CREATE TABLE table_1183842_1 (institution VARCHAR,enrollment VARCHAR)
SELECT institution FROM table_1183842_1 WHERE enrollment = 3488
What are the mm dimensions for the Fujitsu fi-6130 a4 Series Scanner?
CREATE TABLE table_20791 ("product" text,"dimensions (mm)" text,"dpi" real,"pages per minute (color)" real,"max page size" text,"interface" text)
SELECT "dimensions (mm)" FROM table_20791 WHERE "product" = 'Fujitsu fi-6130 A4 Series Scanner'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a scatter chart about the correlation between employee_id and manager_id .
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,...
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
how many married patients had done the lab test thyroxine (t4)?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Thyroxine (T4)"
What year has american music awards?
CREATE TABLE table_name_97 (year VARCHAR,award VARCHAR)
SELECT COUNT(year) FROM table_name_97 WHERE award = "american music awards"
Find the names of all instructors whose name includes the substring dar .
CREATE TABLE instructor (name VARCHAR)
SELECT name FROM instructor WHERE name LIKE '%dar%'
What is the lowest Goals Against by a team with more than 5 wins?
CREATE TABLE table_56807 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real)
SELECT MIN("Goals Against") FROM table_56807 WHERE "Wins" > '5'
what are patient 033-2671's gender?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin te...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '033-2671'
what time is the first time patient 006-167444 was prescribed a medicine via intravenous route until 64 months ago?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname t...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444')) AND medication.routeadmin = 'intravenous' AND DA...
Who is the Winnning driver in which lorenzo bandini has the fastest lap as well as the Pole position?
CREATE TABLE table_57916 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text)
SELECT "Winning driver" FROM table_57916 WHERE "Fastest lap" = 'lorenzo bandini' AND "Pole position" = 'lorenzo bandini'
Name the gene name for methylobacterium nodulans
CREATE TABLE table_29343 ("Genus/Species" text,"Gene Name" text,"Accession number" text,"Sequence Length" text,"Sequence similarity" real)
SELECT "Gene Name" FROM table_29343 WHERE "Genus/Species" = 'Methylobacterium nodulans'
tell me about ground transportation in ST. PETERSBURG airport
CREATE TABLE code_description (code varchar,description text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ST. PETERSBURG' AND ground_service.airport_code = airport.airport_code
Give me the comparison about the amount of date_address_to over the date_address_to bin date_address_to by weekday.
CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Detention (detention_id INTEGER,detention_type_code VARCHAR(10),teacher_id INTEGER,datetime_detention_start DATETIME,datetime_detention_end DATETIME,detention_summary VARCHAR(255),other_details VARCHAR(255))CREA...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC
Name the least lane for kasey giteau and rank less than 18
CREATE TABLE table_80216 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT MIN("Lane") FROM table_80216 WHERE "Name" = 'kasey giteau' AND "Rank" < '18'
What is the lowest Bronze with a Ranking of 22nd of 32 and Gold larger than 4?
CREATE TABLE table_name_2 (bronze INTEGER,ranking VARCHAR,gold VARCHAR)
SELECT MIN(bronze) FROM table_name_2 WHERE ranking = "22nd of 32" AND gold > 4
What is the original artist that has 11 as the order number?
CREATE TABLE table_name_69 (original_artist VARCHAR,order__number VARCHAR)
SELECT original_artist FROM table_name_69 WHERE order__number = "11"
What is the name of the home team that scored 11.16 (82)?
CREATE TABLE table_55167 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_55167 WHERE "Home team score" = '11.16 (82)'
what is the average number of gold medals won by the top 5 nations ?
CREATE TABLE table_204_595 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT AVG("gold") FROM table_204_595 WHERE "rank" <= 5
Record of 21 29 10 had what total number of points?
CREATE TABLE table_74910 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT COUNT("Points") FROM table_74910 WHERE "Record" = '21–29–10'
Scatter chart for employee id and their salaries.
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 varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),CO...
SELECT EMPLOYEE_ID, SALARY FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
What is the date for the name of Granville?
CREATE TABLE table_55913 ("Date" text,"Name" text,"Flag" text,"Tonnage (GRT)" real,"Sunk by" text)
SELECT "Date" FROM table_55913 WHERE "Name" = 'granville'
give me the number of patients whose death status is 0 and year of birth is less than 2107?
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 WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2107"
What is the country that has a place of T6, a socre of 69-69=138, and where Niclas Fasth played?
CREATE TABLE table_name_17 (country VARCHAR,player VARCHAR,place VARCHAR,score VARCHAR)
SELECT country FROM table_name_17 WHERE place = "t6" AND score = 69 - 69 = 138 AND player = "niclas fasth"
Who drive the car that went under 60 laps and spun off?
CREATE TABLE table_name_25 (driver VARCHAR,laps VARCHAR,time_retired VARCHAR)
SELECT driver FROM table_name_25 WHERE laps < 60 AND time_retired = "spun off"