instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
how many patients whose age is less than 85 and lab test name is other cells?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "Other Cells"
Which district was the race between john i. nolan (r) 87% thomas f. feeley (s) 13%?
CREATE TABLE table_18737 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_18737 WHERE "Candidates" = 'John I. Nolan (R) 87% Thomas F. Feeley (S) 13%'
Name the least league apps for total apps of 5
CREATE TABLE table_27086613_5 (league_apps INTEGER,total_apps VARCHAR)
SELECT MIN(league_apps) FROM table_27086613_5 WHERE total_apps = 5
Show me about the distribution of meter_700 and meter_100 in a bar chart.
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 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text...
SELECT meter_700, meter_100 FROM swimmer
Who was the opponent in the Women's Cup 0 0 where Branc o Couto 0 is the scorer?
CREATE TABLE table_3825 ("Season" text,"Competition" text,"Stage" text,"Result" text,"Opponent" text,"Scorers" text)
SELECT "Opponent" FROM table_3825 WHERE "Competition" = 'Women''s Cup 0 0' AND "Scorers" = 'Brancão Couto 0'
How many instructors are in each department? Show me a bar chart, and show by the y axis from high to low.
CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))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 classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TA...
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID) DESC
what's the percent yes where voted yes is 2410119
CREATE TABLE table_413 ("Jurisdiction" text,"Voted Yes" real,"Percent Yes" text,"Voted No" real,"Percent No" text)
SELECT "Percent Yes" FROM table_413 WHERE "Voted Yes" = '2410119'
Top users by average non-deleted answer score. List of top users by average non-deleted and non-community wiki answer score.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > '#...
Top 5 StackOverflow members in Kolkata.
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 TABLE Comments (Id number,PostId number,Score number,Text text,Creati...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%kolkata%' OR UPPER(Location) LIKE '%KOLKATA%' OR Location LIKE '%kolkata%' ORDER BY Reputation DESC LIMIT 5
Who was the top goalscorer for season 2001-02?
CREATE TABLE table_26731 ("Season" text,"Champions" text,"Runner-up" text,"Third Place" text,"Top Goalscorer" text,"Club" text)
SELECT "Top Goalscorer" FROM table_26731 WHERE "Season" = '2001-02'
what is the number of floors of the oldest building ?
CREATE TABLE table_204_489 (id number,"rank" number,"name" text,"height" text,"floors" number,"year" number,"notes" text)
SELECT "floors" FROM table_204_489 ORDER BY "year" LIMIT 1
What are the fewest draws with less than 7 losses and Mitta United is the Tallagatta DFL?
CREATE TABLE table_78134 ("Tallangatta DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Draws") FROM table_78134 WHERE "Losses" < '7' AND "Tallangatta DFL" = 'mitta united'
What game was Minnesota the team?
CREATE TABLE table_46837 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("Game") FROM table_46837 WHERE "Team" = 'minnesota'
WHAT IS THE HOME TEAM WITH A TIE OF 14?
CREATE TABLE table_name_21 (home_team VARCHAR,tie_no VARCHAR)
SELECT home_team FROM table_name_21 WHERE tie_no = "14"
when was the last time in 10/2104 that patient 14990 was prescribed with lisinopril and potassium chloride at the same time?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum ...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lisinopril' AND admissions.subject_id = 14990 AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-10') AS t1 JOIN (SELECT admiss...
A bar chart about what is the average rating star for each reviewer?, could you show x axis from high to low order?
CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC
has patient 86792 been prescribed any medications since 2101.
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792) AND STRFTIME('%y', prescriptions.startdate) >= '2101'
What is the sum of the FAC/LC apps with less than 25 PC apps and a UEFA YC less than 0?
CREATE TABLE table_8286 ("Player" text,"PL Apps" real,"PL G" real,"CL Apps" real,"CL G" real,"FAC / LC Apps" real,"FAC / LC G" real,"Total Apps" real,"Total G" real,"FA YC" real,"UEFA YC" real)
SELECT SUM("FAC / LC Apps") FROM table_8286 WHERE "PL Apps" < '25' AND "UEFA YC" < '0'
What opposing teams playing on 11/04/1999?
CREATE TABLE table_name_63 (opposing_teams VARCHAR,date VARCHAR)
SELECT opposing_teams FROM table_name_63 WHERE date = "11/04/1999"
Total Number of Duplicated Questions.
CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Users (Id number,Re...
SELECT COUNT(*) AS count FROM Posts WHERE PostTypeId = 2
younger than the age of 50 or older than the age of 90 .
CREATE TABLE table_train_105 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"hypertension" bool,"age" float,"NOUSE" float)
SELECT * FROM table_train_105 WHERE age < 50 OR age > 90
what is the average losses when the wins is 3?
CREATE TABLE table_77518 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real)
SELECT AVG("Losses") FROM table_77518 WHERE "Wins" = '3'
When is the winner panathinaikos, the runner-up olympiacos and the venue nikos goumas stadium?
CREATE TABLE table_name_65 (year VARCHAR,venue VARCHAR,winner VARCHAR,runner_up VARCHAR)
SELECT year FROM table_name_65 WHERE winner = "panathinaikos" AND runner_up = "olympiacos" AND venue = "nikos goumas stadium"
how many patients whose discharge location is home and days of hospital stay is greater than 17?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "17"
sequence 1, 2, 3, 3, 2, 1 v2.
CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewTaskStates (Id number,Name te...
WITH numbers(v) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS n0(x)) SELECT ord = @n * (v + 2 * m) + n, n * (1 - v) + ABS(-@n - 1 + n) * v FROM (SELECT v FROM numbers ORDER BY v LIMIT @n) AS n(n) CROSS JOIN (VALUES (0), (1)) AS s(v) CROSS JOIN (SELECT...
Who is the writer when the director is bob berlinger?
CREATE TABLE table_29747178_2 (written_by VARCHAR,directed_by VARCHAR)
SELECT written_by FROM table_29747178_2 WHERE directed_by = "Bob Berlinger"
which typ has the most capacity ?
CREATE TABLE table_204_108 (id number,"typ" text,"construction time" text,"cylinders" text,"capacity" text,"power" text,"top speed" text)
SELECT "typ" FROM table_204_108 ORDER BY "capacity" DESC LIMIT 1
Which segment a's Netflix is S05E22?
CREATE TABLE table_36383 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Segment A" FROM table_36383 WHERE "Netflix" = 's05e22'
What is the average Qiangshu lower than rank 4 and less than 9.22 Jianshu?
CREATE TABLE table_name_45 (qiangshu INTEGER,rank VARCHAR,jianshu VARCHAR)
SELECT AVG(qiangshu) FROM table_name_45 WHERE rank > 4 AND jianshu < 9.22
What is the maximum lost with points 1 more than 58 and 66 goals against?
CREATE TABLE table_name_9 (lost INTEGER,points_1 VARCHAR,goals_against VARCHAR)
SELECT MAX(lost) FROM table_name_9 WHERE points_1 > 58 AND goals_against = 66
# Users able to flag.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate...
SELECT COUNT(*) FROM Users WHERE Reputation >= 15
which division had the larger area ?
CREATE TABLE table_204_891 (id number,"name" text,"hanzi" text,"population (2005)" number,"area (km2)" number)
SELECT "name" FROM table_204_891 ORDER BY "area (km2)" DESC LIMIT 1
What is Played, when Goal Difference is '+51'?
CREATE TABLE table_name_91 (played VARCHAR,goal_difference VARCHAR)
SELECT played FROM table_name_91 WHERE goal_difference = "+51"
When's the release date of the model with part number adh485biaa5do?
CREATE TABLE table_13869651_3 (release_date VARCHAR,part_number_s_ VARCHAR)
SELECT release_date FROM table_13869651_3 WHERE part_number_s_ = "ADH485BIAA5DO"
what is the minimum games played with goals for/against being 7-5
CREATE TABLE table_72509 ("Position" real,"Club (City/Town)" text,"Games Played" real,"W-L-D" text,"Goals For/Against" text,"Points" real)
SELECT MIN("Games Played") FROM table_72509 WHERE "Goals For/Against" = '7-5'
What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5?
CREATE TABLE table_name_45 (gold INTEGER,bronze VARCHAR,silver VARCHAR)
SELECT MIN(gold) FROM table_name_45 WHERE bronze = 4 AND silver > 5
indicate the yearly average amount of temperature c (calc) for patient 26995 since 895 days ago.
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CR...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp...
Which country had a t4 place and scored 66-73=139?
CREATE TABLE table_60492 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_60492 WHERE "Place" = 't4' AND "Score" = '66-73=139'
How many players were drafted from laval?
CREATE TABLE table_23584 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT COUNT("CFL Team") FROM table_23584 WHERE "College" = 'Laval'
Which Bronze has a Rank of 4, and a Gold smaller than 0?
CREATE TABLE table_65778 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_65778 WHERE "Rank" = '4' AND "Gold" < '0'
What engine was introduced in 1935?
CREATE TABLE table_10732 ("Number Range" text,"Introduced" text,"Builder" text,"Engine" text,"Seats" text,"Withdrawn" text)
SELECT "Engine" FROM table_10732 WHERE "Introduced" = '1935'
count how many patients have been discharged from hospital.
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 d_icd_diagnoses (row_id number,icd9_code tex...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL
What is the home team score for Footscray?
CREATE TABLE table_74762 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_74762 WHERE "Home team" = 'footscray'
Users with at least X reputation.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Review...
SELECT COUNT(*) FROM Users WHERE Reputation >= '##X?30000##'
Calculate the average age of patients who had an emergency type hospital admission and suffered from bladder cancer/sda as their primary disease.
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA"
Show the location codes with at least 3 documents.
CREATE TABLE ref_locations (location_code text,location_name text,location_description 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 documents_to_be_destroyed (document_id number,destruction_authorised_by_employee_id ...
SELECT location_code FROM document_locations GROUP BY location_code HAVING COUNT(*) >= 3
What is the capital of the country with a population density per km of 15.6/km (/sqmi)?
CREATE TABLE table_26769_1 (capital VARCHAR,population_density_per_km² VARCHAR)
SELECT capital FROM table_26769_1 WHERE population_density_per_km² = "15.6/km² (/sqmi)"
What date had a 4ad label and a CD (reissue) format?
CREATE TABLE table_name_99 (date VARCHAR,label VARCHAR,format VARCHAR)
SELECT date FROM table_name_99 WHERE label = "4ad" AND format = "cd (reissue)"
Name the result for 9-1 record
CREATE TABLE table_2416 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Midshipmen points" real,"Opponents" real,"Record" text)
SELECT "Result" FROM table_2416 WHERE "Record" = '9-1'
When did the part 1 of the episode 'Anxiety' air?
CREATE TABLE table_640 ("Episode #" real,"Title" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Part 5" text,"Part 6" text)
SELECT "Part 1" FROM table_640 WHERE "Title" = 'Anxiety'
Chicago fire has a total of a total of how many #s?
CREATE TABLE table_31917 ("Pick #" real,"MLS team" text,"Player" text,"Position" text,"Affiliation" text)
SELECT COUNT("Pick #") FROM table_31917 WHERE "MLS team" = 'chicago fire'
all fares and flights from PHILADELPHIA
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE flight_stop (flight_id int,...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND flight.from_airport = airport_service.airport_code
what is the average age for each dorm and what are the names of each dorm?, list by the total number in asc.
CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Student (StuI...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age)
Show sum team id from each all home, sort bars from low to high order please.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
Name the Nationality of s dert lje sk?
CREATE TABLE table_62152 ("Pick #" real,"Player" text,"Nationality" text,"Position" text,"NHL team" text,"Team from" text,"League from" text)
SELECT "Nationality" FROM table_62152 WHERE "Team from" = 'södertälje sk'
What's the mean attendance number when the record is 12-4 and the average is less than 10,027?
CREATE TABLE table_name_24 (attendance INTEGER,record VARCHAR,average VARCHAR)
SELECT AVG(attendance) FROM table_name_24 WHERE record = "12-4" AND average < 10 OFFSET 027
Which Season 1 has a Season 7 of david chilton?
CREATE TABLE table_name_5 (season_1 VARCHAR,season_7 VARCHAR)
SELECT season_1 FROM table_name_5 WHERE season_7 = "david chilton"
count the number of patients whose year of birth is less than 2065 and procedure short title is skin closure nec?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.short_title = "Skin closure NEC"
in how many games did this team have more than 80 points ?
CREATE TABLE table_204_627 (id number,"date" text,"opponent" text,"score" text,"top scorer (total points)" text,"venue (location)" text)
SELECT COUNT(*) FROM table_204_627 WHERE "score" > 80
are the riders of the camel yamaha team the same as tech 3 yamaha ?
CREATE TABLE table_204_162 (id number,"team" text,"constructor" text,"motorcycle" text,"tyres" text,"no" number,"rider" text,"rounds" text)
SELECT (SELECT "rider" FROM table_204_162 WHERE "team" = 'camel yamaha team') = (SELECT "rider" FROM table_204_162 WHERE "team" = 'tech 3 yamaha')
give me the number of emergency hospital admission patients who had initial insertion of tranvenous lead [electrode] into ventricle.
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Int insert lead in vent"
WHAT IS THE 2012 PERFORMANCE FOR THE MADRID MASTERS?
CREATE TABLE table_47275 ("Tournament" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2012" FROM table_47275 WHERE "Tournament" = 'madrid masters'
Give me the number of patients less than 62 years who are suffering from morbid obesity/sda as their primary disease.
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 WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.age < "62"
Which rank has final with 5:18.85?
CREATE TABLE table_name_96 (rank VARCHAR,final VARCHAR)
SELECT rank FROM table_name_96 WHERE final = "5:18.85"
What are the races that johnny rutherford has won?
CREATE TABLE table_10706879_3 (name VARCHAR,winning_driver VARCHAR)
SELECT name FROM table_10706879_3 WHERE winning_driver = "Johnny Rutherford"
provide the number of patients whose admission location is trsf within this facility and lab test name is cholesterol, ldl, calculated?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.label = "Cholesterol, LDL, Calculated"
what is primary disease and diagnoses icd9 code of subject id 84129?
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 demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "84129"
What is the category for the year when Brioude started and the stage is less than 7?
CREATE TABLE table_58953 ("Year" real,"Stage" real,"Category" real,"Start" text,"Finish" text,"Leader at the summit" text)
SELECT COUNT("Category") FROM table_58953 WHERE "Start" = 'brioude' AND "Stage" < '7'
What is the label for the UK in 1996?
CREATE TABLE table_name_34 (label VARCHAR,region VARCHAR,date VARCHAR)
SELECT label FROM table_name_34 WHERE region = "uk" AND date = "1996"
which month is listed the least on this chart ?
CREATE TABLE table_204_250 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number)
SELECT "date" FROM table_204_250 GROUP BY "date" ORDER BY COUNT(*) LIMIT 1
What is the value in 1987 when it is A in 1999, 1989, and 1997?
CREATE TABLE table_9745 ("Tournament" text,"1985" text,"1986" text,"1987" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2010" text,"2011" text)
SELECT "1987" FROM table_9745 WHERE "1999" = 'a' AND "1989" = 'a' AND "1997" = 'a'
what is the number of times that they placed 1st ?
CREATE TABLE table_204_35 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT COUNT(*) FROM table_204_35 WHERE "place" = 1
Compare the average salary by each hire date (bin it into the day of week interval) of employees using a bar chart.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY ...
SELECT HIRE_DATE, AVG(SALARY) FROM employees
what is the number of patients diagnosed with lack of coordination until 2102?
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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE p...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'lack of coordination') AND STRFTIME('%y', diagnoses_icd.ch...
Posts containing a given text (case insensitive, including title).
CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number...
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, LastActivityDate, Score, ViewCount, Body FROM Posts WHERE (CONCAT(LOWER(Title), ' ', LOWER(Body)) LIKE '%##text?analisi##%') ORDER BY CreationDate DESC LIMIT 500
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and show by the Y-axis from high to low.
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 regions (REGION_ID decimal(5,0),REGIO...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
What is the sum of Goals scored when there was less than 20 Games played?
CREATE TABLE table_62391 ("Position" real,"Club" text,"Games played" real,"Wins" real,"Draws" real,"Loses" real,"Goals scored" real,"Goals conceded" real,"Points" real)
SELECT SUM("Goals scored") FROM table_62391 WHERE "Games played" < '20'
What nationality is Rob Nicholson?
CREATE TABLE table_36595 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "Nationality" FROM table_36595 WHERE "Player" = 'rob nicholson'
Search my answer posts by tag....
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe...
SELECT Answer.Id AS "post_link", Answer.Score AS "score", Answer.CreationDate AS "creation_date" FROM Posts AS Question LEFT JOIN Posts AS Answer ON Question.Id = Answer.ParentId WHERE Answer.OwnerUserId = @MyUserID AND Answer.PostTypeId IN (2, 3) AND NOT Question.Tags LIKE '%' + @Tag + '%' AND UPPER(Question.Body) LIK...
what is the total amount of members in the socialist group not including caucusing members ?
CREATE TABLE table_203_266 (id number,"group" text,"members" number,"caucusing" number,"total" number)
SELECT "members" FROM table_203_266 WHERE "group" = 'socialist group'
Which artist had a result of 4?
CREATE TABLE table_26485957_1 (artist VARCHAR,result VARCHAR)
SELECT artist FROM table_26485957_1 WHERE result = "4"
What is the total number of purchases for members with level 6?
CREATE TABLE member (member_id number,card_number text,name text,hometown text,level number)CREATE TABLE purchase (member_id number,branch_id text,year text,total_pounds number)CREATE TABLE branch (branch_id number,name text,open_year text,address_road text,city text,membership_amount text)CREATE TABLE membership_regis...
SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
What is the average number of games played associated with a first game in 1997 and over 0 games drawn?
CREATE TABLE table_name_48 (played INTEGER,first_game VARCHAR,drawn VARCHAR)
SELECT AVG(played) FROM table_name_48 WHERE first_game = 1997 AND drawn > 0
Where a specific tag was added by the given user.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,B...
WITH firstrev_cte AS (SELECT MIN(ph.Id) AS MinId, p.Id FROM Posts AS p JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.Text LIKE '%<##tagName?divergence-operator##>%' AND ph.PostHistoryTypeId IN (3, 6, 9) GROUP BY p.Id) SELECT ph.PostId AS "post_link", 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' AS "re...
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the headquarter , and group by attribute headquarter by a bar chart, and show in desc by the x-axis.
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
What was the sum of the crowds at Western Oval?
CREATE TABLE table_name_65 (crowd INTEGER,venue VARCHAR)
SELECT SUM(crowd) FROM table_name_65 WHERE venue = "western oval"
When did the episode with production code 410 air?
CREATE TABLE table_11630008_6 (original_air_date VARCHAR,production_code VARCHAR)
SELECT original_air_date FROM table_11630008_6 WHERE production_code = 410
How many times was the award inte awards?
CREATE TABLE table_name_90 (year VARCHAR,award VARCHAR)
SELECT COUNT(year) FROM table_name_90 WHERE award = "inte awards"
what is admission type and lab test name of subject id 2560?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT demographic.admission_type, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
Which Third has Runners-up of 0, and Winners of 0, and a Club of far rabat?
CREATE TABLE table_76488 ("Rank" real,"Club" text,"Winners" real,"Runners-up" real,"Third" real)
SELECT AVG("Third") FROM table_76488 WHERE "Runners-up" = '0' AND "Winners" = '0' AND "Club" = 'far rabat'
What is the total amount of points when the played number was less than 12?
CREATE TABLE table_7214 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT SUM("Points") FROM table_7214 WHERE "Played" < '12'
What's the home ground of the Lions?
CREATE TABLE table_61178 ("Club" text,"Nickname" text,"Location" text,"Home Ground" text,"GFL Premierships" text,"Years in GFL" text)
SELECT "Home Ground" FROM table_61178 WHERE "Nickname" = 'lions'
Which category had a year of 1991?
CREATE TABLE table_40337 ("Year" real,"Category" text,"Champion" text,"Runner-up" text,"Score" text)
SELECT "Category" FROM table_40337 WHERE "Year" = '1991'
Which cell type has a conduction speed of 35?
CREATE TABLE table_name_15 (cell_type VARCHAR,conduction_speed__m_s_ VARCHAR)
SELECT cell_type FROM table_name_15 WHERE conduction_speed__m_s_ = "35"
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday.
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 job_history (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
What was the attendance of the Oakland Raiders game?
CREATE TABLE table_77447 ("Game" text,"Date" text,"Opponent" text,"Result" text,"Dolphins' points" text,"Opponents' Points" text,"Record" text,"Streak" text,"Attendance" text)
SELECT "Attendance" FROM table_77447 WHERE "Opponent" = 'oakland raiders'
What was the date of week 3?
CREATE TABLE table_8743 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Date" FROM table_8743 WHERE "Week" = '3'
when has patient 97330 for the last time come to the hospital?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,su...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 97330 ORDER BY admissions.admittime DESC LIMIT 1
What was the home town of Bob Geren, picked by the San Diego Padres?
CREATE TABLE table_name_18 (hometown_school VARCHAR,team VARCHAR,player VARCHAR)
SELECT hometown_school FROM table_name_18 WHERE team = "san diego padres" AND player = "bob geren"
What is the average score with lee westwood as the player?
CREATE TABLE table_name_5 (score INTEGER,player VARCHAR)
SELECT AVG(score) FROM table_name_5 WHERE player = "lee westwood"