instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the area when the poor law union is skibbereen and the townland is knockmore?
CREATE TABLE table_30121075_1 (area__acres__ VARCHAR,poor_law_union VARCHAR,townland VARCHAR)
SELECT area__acres__ FROM table_30121075_1 WHERE poor_law_union = "Skibbereen" AND townland = "Knockmore"
What's the 2005 result when 2001 is sf?
CREATE TABLE table_name_64 (Id VARCHAR)
SELECT 2005 FROM table_name_64 WHERE 2001 = "sf"
How many cores does the processor released in April 2012 with a price of $393 and part number av8063801117503 have?
CREATE TABLE table_63213 ("Model number" text,"sSpec number" text,"Cores" text,"Frequency" text,"Turbo" text,"L2 cache" text,"L3 cache" text,"GPU model" text,"GPU frequency" text,"Socket" text,"I/O bus" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text)
SELECT "Cores" FROM table_63213 WHERE "Release date" = 'april 2012' AND "Release price ( USD )" = '$393' AND "Part number(s)" = 'av8063801117503'
What is the highest no. in season?
CREATE TABLE table_16243 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Featured character(s)" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT MAX("No. in season") FROM table_16243
What is the smallest number of total medals for Georgia with 0 silver and 1 bronze?
CREATE TABLE table_name_87 (total INTEGER,bronze VARCHAR,silver VARCHAR,nation VARCHAR)
SELECT MIN(total) FROM table_name_87 WHERE silver > 0 AND nation = "georgia" AND bronze < 1
What is the type of disc by Logistics after 2004?
CREATE TABLE table_10359 ("Catalogue Number" text,"Artist" text,"Tracks" text,"Type" text,"Year" real)
SELECT "Type" FROM table_10359 WHERE "Year" > '2004' AND "Artist" = 'logistics'
Give me the comparison about the sum of monthly_rental over the date_address_to bin date_address_to by weekday.
CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50),other_address_details VARCHAR(255))CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),stu...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
What was the highest season number?
CREATE TABLE table_23105 ("Season #" real,"Episode #" real,"Title" text,"Director(s)" text,"Writer(s)" text,"Original Air Date" text)
SELECT MAX("Season #") FROM table_23105
Who played Richmond at home?
CREATE TABLE table_19242 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Report" text)
SELECT "Home team" FROM table_19242 WHERE "Away team" = 'Richmond'
Name the parish for 1908
CREATE TABLE table_178399_1 (parish__prestegjeld_ VARCHAR,year_built VARCHAR)
SELECT parish__prestegjeld_ FROM table_178399_1 WHERE year_built = 1908
Which player plays for the Winnipeg Blue Bombers?
CREATE TABLE table_24280 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Player" FROM table_24280 WHERE "CFL Team" = 'Winnipeg Blue Bombers'
Who played in the 1991 Broadway before Barbara McCulloh played the part in the 1999 Broadway?
CREATE TABLE table_16039 ("Character" text,"1954 Broadway" text,"1955 broadcast" text,"1960 broadcast" text,"1979 Broadway" text,"1990 Broadway" text,"1991 Broadway" text,"1998 Broadway" text,"1999 Broadway" text)
SELECT "1991 Broadway" FROM table_16039 WHERE "1999 Broadway" = 'Barbara McCulloh'
Name the years when decile was less than 7 for waitoa school
CREATE TABLE table_name_67 (years VARCHAR,decile VARCHAR,name VARCHAR)
SELECT years FROM table_name_67 WHERE decile < 7 AND name = "waitoa school"
What home team played Fitzroy?
CREATE TABLE table_name_57 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_57 WHERE away_team = "fitzroy"
Who made the decision when detroit was the home team and boston was the visitor?
CREATE TABLE table_46336 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Record" text)
SELECT "Decision" FROM table_46336 WHERE "Home" = 'detroit' AND "Visitor" = 'boston'
whats the unabbreviated version of tox ef hydrocarb gas nec.
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,disc...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tox ef hydrocarb gas nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tox ef hydrocarb gas nec'
How many Laps did Team Primagaz Competition have?
CREATE TABLE table_45653 ("Class" text,"Team" text,"Driver" text,"Chassis \u2013 Engine" text,"Laps" real)
SELECT "Laps" FROM table_45653 WHERE "Team" = 'primagaz competition'
HOW MANY POINTS DOES ALEX SPERAFICO HAVE WITH A GRID LARGER THAN 17?
CREATE TABLE table_47852 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real)
SELECT MIN("Points") FROM table_47852 WHERE "Driver" = 'alex sperafico' AND "Grid" > '17'
How much uranium did Russia use in 2006 to 2008?
CREATE TABLE table_1295 ("Country" text,"Uranium required 2006-08" text,"% of world demand" text,"Indigenous mining production 2006" text,"Deficit (-surplus)" text)
SELECT "Uranium required 2006-08" FROM table_1295 WHERE "Country" = 'Russia'
Find the name of scientists who are not assigned to any project.
CREATE TABLE scientists (Name VARCHAR,ssn VARCHAR,scientist VARCHAR)CREATE TABLE AssignedTo (Name VARCHAR,ssn VARCHAR,scientist VARCHAR)
SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
For all storms with at least 1 death, compare the number of deaths by dates active with a bar graph, and could you rank by the y-axis in asc?
CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)
SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths
How much Total has a Rank of 5, and a Bronze larger than 3?
CREATE TABLE table_name_44 (total INTEGER,rank VARCHAR,bronze VARCHAR)
SELECT SUM(total) FROM table_name_44 WHERE rank = "5" AND bronze > 3
Which Barrel twist has a Stock of canadian 3rd generation and a Hand guards of short ribbed?
CREATE TABLE table_name_33 (barrel_twist VARCHAR,stock VARCHAR,hand_guards VARCHAR)
SELECT barrel_twist FROM table_name_33 WHERE stock = "canadian 3rd generation" AND hand_guards = "short ribbed"
What is the Tournament when the 2013 is 2r, and a 2006 is 1r?
CREATE TABLE table_75957 ("Tournament" text,"2006" text,"2009" text,"2012" text,"2013" text)
SELECT "Tournament" FROM table_75957 WHERE "2013" = '2r' AND "2006" = '1r'
what is the number of patients with s/p fall primary disease who had cerebrospinal fluid lab test?
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 diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
what are the total amount of times italy appears on this chart ?
CREATE TABLE table_204_4 (id number,"date" text,"race" text,"competition" text,"rider" text,"country" text,"location" text)
SELECT COUNT(*) FROM table_204_4 WHERE "country" = 'italy'
Name the number of total for 3 gold and rank less than 3
CREATE TABLE table_name_25 (total VARCHAR,gold VARCHAR,rank VARCHAR)
SELECT COUNT(total) FROM table_name_25 WHERE gold = 3 AND rank < 3
What is the flag for Terkoeli?
CREATE TABLE table_10747 ("Date" text,"Name" text,"Flag" text,"Tonnage (GRT)" real,"Sunk by" text)
SELECT "Flag" FROM table_10747 WHERE "Name" = 'terkoeli'
Who are the players from Indonesia?
CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE match_season (season number,player text,position text,country number,team number,draft_pick_number number,draft_class text,college text)CREATE TABLE country (country_id number,count...
SELECT T2.player FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T1.country_name = "Indonesia"
What is the average silver for a rank less than 8, were there were no more than 4 bronze and 12 in total?
CREATE TABLE table_66889 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Silver") FROM table_66889 WHERE "Rank" < '8' AND "Total" = '12' AND "Bronze" < '4'
in which season the position was center
CREATE TABLE table_19897896_7 (season VARCHAR,position VARCHAR)
SELECT season FROM table_19897896_7 WHERE position = "Center"
Who is nominated for the film Rugrats Go Wild?
CREATE TABLE table_name_44 (winner_nominee_s_ VARCHAR,result VARCHAR,film VARCHAR)
SELECT winner_nominee_s_ FROM table_name_44 WHERE result = "nominated" AND film = "rugrats go wild"
who has scored more goals than any other melbourne player ?
CREATE TABLE table_203_221 (id number,"name" text,"nationality" text,"matches played" number,"goals scored" number,"notes" text)
SELECT "name" FROM table_203_221 ORDER BY "goals scored" DESC LIMIT 1
how many white patients were diagnosed under icd9 code 7660?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "7660"
Which tournament included an opponent of Marinko Matosevic?
CREATE TABLE table_36568 ("Outcome" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Tournament" FROM table_36568 WHERE "Opponent" = 'marinko matosevic'
Who was the leader in Steals when Travis Watson (9) was the leader in Rebounds?
CREATE TABLE table_name_87 (steals VARCHAR,rebounds VARCHAR)
SELECT steals FROM table_name_87 WHERE rebounds = "travis watson (9)"
how many patients were admitted before the year 2121 whose lab test category was hematology ?
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.admityear < "2121" AND lab."CATEGORY" = "Hematology"
Show me some Design Science Colloquium courses with 8 credits .
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Design Science Colloquium%' OR name LIKE '%Design Science Colloquium%') AND credits = 8
What is the fixed charge for the user who had a tariff of 11.30?
CREATE TABLE table_25479607_3 (fixed_charge___rs__kwh_ VARCHAR,tariff___rs__kwh_ VARCHAR)
SELECT fixed_charge___rs__kwh_ FROM table_25479607_3 WHERE tariff___rs__kwh_ = "11.30"
Tell me the date for warsaw 1929
CREATE TABLE table_name_50 (date VARCHAR,location VARCHAR,year VARCHAR)
SELECT date FROM table_name_50 WHERE location = "warsaw" AND year = 1929
What's the odds for draw on Bet365 for the game Swindon v.s. Millwall for 2016/2017 season?
CREATE TABLE football_data (season text,datetime time,div text,country text,league text,referee text,hometeam text,awayteam text,fthg number,ftag number,ftr text,hthg number,htag number,htr text,psh number,psd number,psa number,b365h number,b365d number,b365a number,lbh number,lbd number,lba number,bwh number,bwd numbe...
SELECT b365d FROM football_data WHERE hometeam = "Swindon" AND awayteam = "Millwall" AND season = "2016/2017"
has ever been the sao2 of patient 002-2584 been ever greater than 94.0 since 12/02/2102?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-2584')) AND vitalperiodic.sao2 > 94.0 AND NOT vitalperiodic.sao2...
What is the sum of the heights in meters for the commerzbank tower built after 1984?
CREATE TABLE table_name_70 (height__m_ INTEGER,year_built VARCHAR,name VARCHAR)
SELECT SUM(height__m_) FROM table_name_70 WHERE year_built > 1984 AND name = "commerzbank tower"
What is the Datacenter for the Memory modules: hot addition Feature that has Yes listed for Itanium?
CREATE TABLE table_name_85 (datacenter VARCHAR,itanium VARCHAR,features VARCHAR)
SELECT datacenter FROM table_name_85 WHERE itanium = "yes" AND features = "memory modules: hot addition"
What is the lowest attendance at Venue H in Round R2?
CREATE TABLE table_name_27 (attendance INTEGER,venue VARCHAR,round VARCHAR)
SELECT MIN(attendance) FROM table_name_27 WHERE venue = "h" AND round = "r2"
had patient 60763 undergone any procedure?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60763)
TOP 150 Users from Bulgaria.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)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 CloseReasonTypes (Id numb...
SELECT Id, DisplayName, Reputation, Location FROM Users WHERE Location LIKE '%Sofia%' OR Location LIKE '%Bulgaria%' ORDER BY Reputation DESC LIMIT 150
Who was the deceased spouse who was married for 4 years?
CREATE TABLE table_24143253_5 (deceased_spouse VARCHAR,length_of_marriage VARCHAR)
SELECT deceased_spouse FROM table_24143253_5 WHERE length_of_marriage = "4 years"
What was the year when Ch nqi Ch sh ( ) was submitted?
CREATE TABLE table_21595 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text)
SELECT "Year (Ceremony)" FROM table_21595 WHERE "Original title" = 'Chūnqiū cháshì (春秋茶室)'
What was the term of Bruce Biers Kendall whose hometown is Anchorage?
CREATE TABLE table_67310 ("Name" text,"Party" text,"Hometown" text,"District" text,"Term" text,"Legislatures" text)
SELECT "Term" FROM table_67310 WHERE "Hometown" = 'anchorage' AND "Name" = 'bruce biers kendall'
Name the most pick # for overall of 204
CREATE TABLE table_14583 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_14583 WHERE "Overall" = '204'
What is the municipality that has an area of exactly 214.44 sq. km?
CREATE TABLE table_27799 ("Municipality" text,"No. of s Barangay" real,"Area (km\u00b2)" text,"Population (2007)" real,"Population (2010)" real)
SELECT "Municipality" FROM table_27799 WHERE "Area (km\u00b2)" = '214.44'
What score did the opposing home team have against Melbourne
CREATE TABLE table_name_74 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team AS score FROM table_name_74 WHERE away_team = "melbourne"
what is the number of patients who are taking base type drug prescription and have diagnoses icd9 code 41031?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "41031" AND prescriptions.drug_type = "BASE"
Where was the event Kage Kombat 16?
CREATE TABLE table_name_76 (location VARCHAR,event VARCHAR)
SELECT location FROM table_name_76 WHERE event = "kage kombat 16"
What was the earliest year that an event held in Berlin, Germany had a 100 m hurdles event?
CREATE TABLE table_60748 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text)
SELECT MIN("Year") FROM table_60748 WHERE "Venue" = 'berlin, germany' AND "Event" = '100 m hurdles'
on a BREAKFAST flight from PHILADELPHIA to DALLAS via ATLANTA
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE code_descript...
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, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'ATLANTA...
This Summer , which upper-level LING classes are being offered ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE co...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer...
intel tags: all posts from last n days.
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 SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Com...
WITH IntelTags AS (SELECT Id, TagName, Count FROM Tags WHERE Tags.TagName LIKE 'intel-%' OR Tags.TagName = 'intel'), IntelPostIds AS (SELECT DISTINCT PostTags.PostId FROM PostTags INNER JOIN IntelTags ON IntelTags.Id = PostTags.TagId) SELECT Id AS "post_link", Body, Tags, CreationDate, Score, ViewCount FROM Posts INNER...
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to list from high to low by the total number.
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
What is the lowest attendance for a game before 10 weeks on November 12, 1967
CREATE TABLE table_33017 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MIN("Attendance") FROM table_33017 WHERE "Week" < '10' AND "Date" = 'november 12, 1967'
What film festival was the participant/recipient Isao Tomita?
CREATE TABLE table_28561 ("Film Festival" text,"Date of ceremony" text,"Category" text,"Participants/Recipients" text,"Result" text)
SELECT "Film Festival" FROM table_28561 WHERE "Participants/Recipients" = 'Isao Tomita'
how many patients whose procedure long title is thoracentesis and lab test category is chemistry?
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 demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Chemistry"
count the number of patients whose year of death is less than or equal to 2133 and procedure long title is open and other replacement of mitral valve with tissue graft?
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 procedures (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.dod_year <= "2133.0" AND procedures.long_title = "Open and other replacement of mitral valve with tissue graft"
search comment by keyword and user id.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T...
SELECT Id AS "comment_link", Text, CreationDate FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%##Keyword##%' ORDER BY CreationDate DESC
Find Deleted Questions and Answers by User. shows all deleted answers for the specified user
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwner...
SELECT DISTINCT p.Id AS "post_link", p.LastActivityDate, p.DeletionDate FROM Posts AS p JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE p.OwnerUserId = '##USERID##' AND NOT p.DeletionDate IS NULL ORDER BY p.LastActivityDate DESC
Show me the correlation between the number of platforms and the number of total_passengers in a scatter chart.
CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE train_station (Train_ID int,Station_ID int)
SELECT SUM(Number_of_Platforms), SUM(Total_Passengers) FROM station GROUP BY Location
since 4 years ago, what are the top three most frequently performed laboratory tests given to patients within the same month after being diagnosed with atrial fibrillation - without hemodynamic compromise?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyst...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrillation - without hemodynamic compromise...
For the problem with id 10, return the ids and dates of its problem logs.
CREATE TABLE problem_log (problem_log_id number,assigned_to_staff_id number,problem_id number,problem_category_code text,problem_status_code text,log_entry_date time,log_entry_description text,log_entry_fix text,other_log_details text)CREATE TABLE problem_status_codes (problem_status_code text,problem_status_descriptio...
SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10
What is every value for if polish is ksi ka?
CREATE TABLE table_25008327_8 (словјански VARCHAR,polish VARCHAR)
SELECT словјански FROM table_25008327_8 WHERE polish = "książka"
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and department_id , and visualize them by a bar chart, and I want to list in descending by the X please.
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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
Which Round has a Method of ko, and a Date of 1958?
CREATE TABLE table_name_46 (round INTEGER,method VARCHAR,date VARCHAR)
SELECT MIN(round) FROM table_name_46 WHERE method = "ko" AND date = "1958"
What is the main use for the structure listed in walker city, iowa?
CREATE TABLE table_45506 ("Pinnacle height" text,"Year" real,"Structure type" text,"Main use" text,"Country" text,"Town" text)
SELECT "Main use" FROM table_45506 WHERE "Town" = 'walker city, iowa'
What is the lowest number of districts (kecamatan) in the north sulawesi province with more than 1,510 villages?
CREATE TABLE table_name_97 (number_of_districts__kecamatan_ INTEGER,province VARCHAR,villages VARCHAR)
SELECT MIN(number_of_districts__kecamatan_) FROM table_name_97 WHERE province = "north sulawesi" AND villages > 1 OFFSET 510
give me the number of patients whose discharge location is home health care and diagnoses long title is psoas muscle abscess?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.long_title = "Psoas muscle abscess"
What is the name of the school/s in North Manchester?
CREATE TABLE table_23353 ("School" text,"City / Town" text,"Website" text,"Size" real,"Principal" text,"Grades" text,"IDOE Profile" text)
SELECT "School" FROM table_23353 WHERE "City / Town" = 'North Manchester'
how many patients whose insurance is medicare and lab test name is albumin/creatinine, urine?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Albumin/Creatinine, Urine"
Which Competition has a Score of 2-0?
CREATE TABLE table_name_7 (competition VARCHAR,score VARCHAR)
SELECT competition FROM table_name_7 WHERE score = "2-0"
how many countries sampled with year of publication being 2007 and ranking l.a. (2) being 7th
CREATE TABLE table_17378 ("Index (Year)" text,"Author / Editor / Source" text,"Year of publication" text,"Countries sampled" real,"World Ranking (1)" text,"Ranking L.A. (2)" text)
SELECT COUNT("Countries sampled") FROM table_17378 WHERE "Year of publication" = '2007' AND "Ranking L.A. (2)" = '7th'
If the district ID is 74907, what is the name of the district?
CREATE TABLE table_25211 ("District name" text,"Dist. ID" real,"ISD" text,"County" text,"Authorizing agency" text,"Date opened" text,"Services" text)
SELECT "District name" FROM table_25211 WHERE "Dist. ID" = '74907'
What is the lowest lane in which an athlete got a time larger than 20.75 and a react smaller than 0.166?
CREATE TABLE table_63558 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real)
SELECT MIN("Lane") FROM table_63558 WHERE "Time" > '20.75' AND "React" < '0.166'
who is the runner-up where year is 2004 and champion is north carolina state
CREATE TABLE table_11214772_1 (runner_up VARCHAR,year VARCHAR,champion VARCHAR)
SELECT runner_up FROM table_11214772_1 WHERE year = "2004" AND champion = "North Carolina State"
Who were the the opponents of the Wildcats for game 8 of the season?
CREATE TABLE table_21062353_1 (opponent VARCHAR,game VARCHAR)
SELECT opponent FROM table_21062353_1 WHERE game = 8
Tell me the 13 january 2009 host
CREATE TABLE table_4343 ("Country/Region" text,"Name" text,"Host" text,"Network" text,"Premiere" text,"Prize" text)
SELECT "Host" FROM table_4343 WHERE "Premiere" = '13 january 2009'
what is date of birth of subject name jerry deberry?
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 demographic.dob FROM demographic WHERE demographic.name = "Jerry Deberry"
What are the id of each employee and the number of document destroyed by that employee. Visualize by scatter chart.
CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Det...
SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID
What is the score in the 6 atlas stones event of the player who got 2 (6 in 30.89s) in the 3 dead lift event?
CREATE TABLE table_26748 ("Position" text,"Name" text,"Nationality" text,"Event 1 Medley" text,"Event 2 Truck Pull" text,"Event 3 Dead Lift" text,"Event 4 Fingals Fingers" text,"Event 5 Keg Toss" text,"Event 6 Atlas Stones" text)
SELECT COUNT("Event 6 Atlas Stones") FROM table_26748 WHERE "Event 3 Dead Lift" = '2 (6 in 30.89s)'
What is the school/club team of the player with a pick larger than 83?
CREATE TABLE table_name_26 (school_club_team VARCHAR,pick INTEGER)
SELECT school_club_team FROM table_name_26 WHERE pick > 83
What site in the RCA Del Caribe was deleted?
CREATE TABLE table_51328 ("CERCLIS ID" text,"Name" text,"Municipality" text,"Proposed" text,"Listed" text,"Construction completed" text,"Partially deleted" text,"Deleted" text)
SELECT "Deleted" FROM table_51328 WHERE "Name" = 'rca del caribe'
Show the number of apartment bookings for each year and bin booking start date by year interval in a bar chart, and show by the Y in descending.
CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
count the number of patients whose admission type is elective and ethnicity is white - russian?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "WHITE - RUSSIAN"
Who directed the episode with a production code of 4WAB04?
CREATE TABLE table_2292 ("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 "Directedby" FROM table_2292 WHERE "Production code" = '4WAB04'
what was the number of goals he scored in 2005 ?
CREATE TABLE table_204_235 (id number,"season" text,"team" text,"country" text,"competition" text,"matches" number,"goals" number)
SELECT "goals" FROM table_204_235 WHERE "season" = 2005
What was their record when they played at Riverfront Stadium?
CREATE TABLE table_60263 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT "Record" FROM table_60263 WHERE "Game site" = 'riverfront stadium'
What is the week 10 result where the week 9 result was Dropped: Maryland South Carolina?
CREATE TABLE table_name_13 (week_10_nov_5 VARCHAR,week_9_oct_29 VARCHAR)
SELECT week_10_nov_5 FROM table_name_13 WHERE week_9_oct_29 = "dropped: maryland south carolina"
Tell me the record for kazuhiro nakamura
CREATE TABLE table_name_25 (record VARCHAR,opponent VARCHAR)
SELECT record FROM table_name_25 WHERE opponent = "kazuhiro nakamura"
What match number took place on August 3, 2007?
CREATE TABLE table_67904 ("Match" real,"Date" text,"Tournament" text,"Location" text,"Opponent team" text,"Score" text)
SELECT MAX("Match") FROM table_67904 WHERE "Date" = 'august 3, 2007'
What language is used when the service is sky primafila 10 and the package/option is qualsiasi?
CREATE TABLE table_42238 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "Language" FROM table_42238 WHERE "Package/Option" = 'qualsiasi' AND "Television service" = 'sky primafila 10'
Draw a bar chart of decor versus minimal baseprice, order by the total number in descending.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice) DESC
who was the first player chosen by the cincinnati bengals , in round seven ?
CREATE TABLE table_204_70 (id number,"pick #" number,"nfl team" text,"player" text,"position" text,"college" text)
SELECT "player" FROM table_204_70 WHERE "nfl team" = 'cincinnati bengals' ORDER BY "pick #" LIMIT 1