instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the nation when gold is 0, bronze is more than 0 and rank is 16? | CREATE TABLE table_name_98 (nation VARCHAR,rank VARCHAR,gold VARCHAR,bronze VARCHAR) | SELECT nation FROM table_name_98 WHERE gold = 0 AND bronze > 0 AND rank = "16" |
What was the location of the fight when Sara McMann's record was 1-0? | CREATE TABLE table_name_42 (location VARCHAR,record VARCHAR) | SELECT location FROM table_name_42 WHERE record = "1-0" |
how many patient have died after they were diagnosed with hematological effect of infection - leukocytosis during the same hospital encounter until 2 years ago? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dos... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... |
What is the 9:00 show that will be aired on the station that airs Dawson's Creek at 8:00? | CREATE TABLE table_35272 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text,"10:30" text) | SELECT "9:00" FROM table_35272 WHERE "8:00" = 'dawson''s creek' |
Who wrote 'Monica's bad day'? | CREATE TABLE table_29106 ("Series #" real,"Season #" real,"Title" text,"Director" text,"Writer" text,"Original air date" text) | SELECT "Writer" FROM table_29106 WHERE "Title" = 'Monica''s Bad Day' |
what number of irregular types are there ? | CREATE TABLE table_203_250 (id number,"name" text,"type" text,"r.a. (j2000)" text,"dec. (j2000)" text,"redshift (km/s)" text,"apparent magnitude" number) | SELECT COUNT(*) FROM table_203_250 WHERE "type" = 'irregular' |
Suggested edits by a specific user. | 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 Id AS "suggested_edit_link" FROM SuggestedEdits WHERE OwnerUserId = '##UserId##' |
how many times did patient 021-196241 during this year go to the icu? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-196241') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
Give me a pie to show how many country from different country. | CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text)CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int) | SELECT Country, COUNT(Country) FROM member GROUP BY Country |
hypotension requiring vasopressor therapy, despite fluid resuscitation of at least 30 cc / kg and lactate > 2 mmol / l | CREATE TABLE table_train_57 ("id" int,"bleeding" int,"in_another_study" bool,"hiv_infection" bool,"hepatitis_c_infection" bool,"receiving_vasopressor" bool,"hypotension" bool,"NOUSE" float) | SELECT * FROM table_train_57 WHERE hypotension = 1 AND receiving_vasopressor = 1 |
What is the title of the episode with production code 305? | CREATE TABLE table_26448179_4 (title VARCHAR,production_code VARCHAR) | SELECT title FROM table_26448179_4 WHERE production_code = 305 |
Find the payment method and phone of the party with email 'enrico09@example.com'. | CREATE TABLE organizations (organization_id number,date_formed time,organization_name text,uk_vat_number text)CREATE TABLE organization_contact_individuals (individual_id number,organization_id number,date_contact_from time,date_contact_to time)CREATE TABLE addresses (address_id number,line_1_number_building text,town_... | SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com" |
What is the NBA draft result of the player from Dunbar High School? | CREATE TABLE table_58211 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "NBA Draft" FROM table_58211 WHERE "School" = 'dunbar high school' |
What player belongs to Northwestern College? | CREATE TABLE table_name_34 (player VARCHAR,college VARCHAR) | SELECT player FROM table_name_34 WHERE college = "northwestern" |
who was the opponent after hawthorn ? | CREATE TABLE table_204_881 (id number,"round" number,"date" text,"score" text,"opponent" text,"opponent's score" text,"result" text,"venue" text,"attendance" number,"best on ground" text,"team" text) | SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1 |
There were 68 worcs f-c matches played on Chester Road North Ground. | CREATE TABLE table_16891 ("Name of ground" text,"Location" text,"First-class span" text,"Worcs f-c matches" real,"List A span" text,"Worcs LA matches" real) | SELECT "Worcs f-c matches" FROM table_16891 WHERE "Name of ground" = 'Chester Road North Ground' |
what is the total number of locations in the city of algonac ? | CREATE TABLE table_204_558 (id number,"name" text,"location" text,"city" text,"listing date" text) | SELECT COUNT("location") FROM table_204_558 WHERE "city" = 'algonac' |
In Summer 2003 , can I take GREEKMOD 505 ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday... | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... |
i would like to find a flight from PITTSBURGH to BOSTON on wednesday and i have to be in BOSTON by one so i'd like a flight out of here no later than 1100 | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_... | 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, date_day, days, flight WHERE (((flight.arrival_time <= 1300 AND flight.departure_time <= 1100) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = ... |
What are the course numbers Dr. William Gehring is teaching next semester ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%William Gehring%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... |
How many o-19% are where the quartier is in saint-loup? | CREATE TABLE table_4223 ("Quartier" text,"% 0-19 years" text,"% 20-39 years" text,"% 40-59 years" text,"% 60-74 years" text,"% 75 years and +" text) | SELECT "% 0-19 years" FROM table_4223 WHERE "Quartier" = 'Saint-Loup' |
how many singles did kitty wells release before 1952 ? | CREATE TABLE table_204_500 (id number,"year" number,"title" text,"peak chart positions\nus country" number,"peak chart positions\nus" number,"album" text) | SELECT COUNT("title") FROM table_204_500 WHERE "year" < 1952 |
What position is Jeff Brown? | CREATE TABLE table_name_74 (position VARCHAR,player VARCHAR) | SELECT position FROM table_name_74 WHERE player = "jeff brown" |
Tell me the goals for score of 38-28 | CREATE TABLE table_name_54 (goals VARCHAR,score VARCHAR) | SELECT goals FROM table_name_54 WHERE score = "38-28" |
who won more races , the usa or canada ? | CREATE TABLE table_204_48 (id number,"date" text,"race name" text,"location" text,"uci rating" text,"winner" text,"team" text) | SELECT "winner" FROM table_204_48 WHERE "winner" IN ('usa', 'canada') GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1 |
What is the highest amount of group legs won when the prize money was 21,850? | CREATE TABLE table_26758 ("Player" text,"Group Legs won" real,"Play-Off Legs won" real,"Winners Group Legs won" real,"Winners Play-Off Legs won" real,"Final position money won*" text,"Total money won" text) | SELECT MAX("Winners Group Legs won") FROM table_26758 WHERE "Total money won" = '£21,850' |
Average Reputation of SO Users n Manchester, United Kingdom. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body te... | SELECT AVG(Reputation) AS "average_reputation", COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation > 1 |
Tell me the number of gold for albania with a silver of 1 and total less than 1 | CREATE TABLE table_name_12 (gold VARCHAR,total VARCHAR,silver VARCHAR,nation VARCHAR) | SELECT COUNT(gold) FROM table_name_12 WHERE silver = 1 AND nation = "albania" AND total < 1 |
How many patients born before the year 2094 have diagnosis short title anemia in chronic kidney disease? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2094" AND diagnoses.short_title = "Anemia in chr kidney dis" |
What is the club that has the turkish basketball cup and fiba eurochallenge (3rd tier)? | CREATE TABLE table_55082 ("Season" text,"Club" text,"National League" text,"National Cup" text,"European Cup" text) | SELECT "Club" FROM table_55082 WHERE "National Cup" = 'turkish basketball cup' AND "European Cup" = 'fiba eurochallenge (3rd tier)' |
What is the population of Chimbote? | CREATE TABLE table_name_38 (population INTEGER,name_of_city VARCHAR) | SELECT SUM(population) FROM table_name_38 WHERE name_of_city = "chimbote" |
What was the winning score in 1980? | CREATE TABLE table_name_51 (winning_score VARCHAR,year VARCHAR) | SELECT winning_score FROM table_name_51 WHERE year = 1980 |
Show each premise type and the number of premises in that type. | CREATE TABLE premises (premises_type VARCHAR) | SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type |
How many questions & answers last edited by Mat(635608) in a time range. | 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 PostHistoryTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,... | SELECT COUNT(*) FROM Posts WHERE LastEditorUserId = 635608 AND OwnerUserId != 635608 AND LastEditDate > '2013-05-03 12:00:00 AM' |
What is the total number of positions having 1 loss and more than 9 conceded? | CREATE TABLE table_14062 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT COUNT("Position") FROM table_14062 WHERE "Losses" = '1' AND "Conceded" > '9' |
Who is the chairman of Mark Robins team? | CREATE TABLE table_3594 ("Team" text,"Manager" text,"Chairman" text,"Team captain" text,"Kit maker" text,"Sponsor" text) | SELECT "Chairman" FROM table_3594 WHERE "Manager" = 'Mark Robins' |
Which Land area (km ) has a Population density (per km ) larger than 112.6, and a Population (2006) larger than 785, and a Name of pinehouse? | CREATE TABLE table_62794 ("Name" text,"Population (2011)" real,"Population (2006)" real,"Change (%)" real,"Land area (km\u00b2)" real,"Population density (per km\u00b2)" real) | SELECT MAX("Land area (km\u00b2)") FROM table_62794 WHERE "Population density (per km\u00b2)" > '112.6' AND "Population (2006)" > '785' AND "Name" = 'pinehouse' |
what percentile is red blood cells 3.61 among patients of the same age as patient 15209 during their current hospital visit? | 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 DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio... |
how many times did patient 005-46456 receive surgery consultation in 2104? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,d... | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND treatment.treatmentname = 'surgery consultation' AND STRFTIME('... |
What record has montreal, qc as the location, with boston bruins as the visitor? | CREATE TABLE table_name_14 (record VARCHAR,location VARCHAR,visitor VARCHAR) | SELECT record FROM table_name_14 WHERE location = "montreal, qc" AND visitor = "boston bruins" |
Find coincident activity between two users. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)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,LastEditorDisplayN... | WITH Interesting(UserId) AS (SELECT 342852 UNION ALL SELECT 57611) SELECT PostId = p.Id, QuestionId = COALESCE(a.Id, p.Id), AnswerId = CASE WHEN p.PostTypeId = 2 THEN p.Id ELSE NULL END FROM Posts AS p LEFT JOIN Posts AS a ON p.PostTypeId = 2 AND p.ParentId = a.Id WHERE EXISTS(SELECT * FROM Interesting AS i WHERE p.Own... |
how many patients with primary disease bowel obstruction died in or before 2174? | 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 WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2174.0" |
Name the memory for meodel number for atom e640t | CREATE TABLE table_21020 ("Model number" text,"sSpec number" text,"Frequency" text,"GPU frequency" text,"L2 cache" text,"I/O bus" text,"Memory" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text) | SELECT "Memory" FROM table_21020 WHERE "Model number" = 'Atom E640T' |
Visualize a bar chart for how many students play each sport?, and show total number from low to high order. | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Spor... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) |
how many patients have anemia in chronic kidney disease as their diagnosis long title? | 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 diagnoses.long_title = "Anemia in chronic kidney disease" |
What is the Game site week 1? | CREATE TABLE table_77441 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game site" text) | SELECT "Game site" FROM table_77441 WHERE "Week" = '1' |
What is the rank where the gold is 0? | CREATE TABLE table_name_70 (rank INTEGER,gold INTEGER) | SELECT AVG(rank) FROM table_name_70 WHERE gold < 0 |
What was the sample size for the poll from Nov 9-11, 2007 with a margin of error less than 4.3? | CREATE TABLE table_name_72 (sample_size INTEGER,date VARCHAR,margin_of_error VARCHAR) | SELECT MAX(sample_size) FROM table_name_72 WHERE date = "nov 9-11, 2007" AND margin_of_error < 4.3 |
what is patient 22295's yearly maximum level of glucose? | 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 patients (row_id number,subject_id number,ge... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') GROUP BY STRFTIME('%y', labevents.charttime) |
What is the score for Billy Andrade? | CREATE TABLE table_name_73 (score VARCHAR,player VARCHAR) | SELECT score FROM table_name_73 WHERE player = "billy andrade" |
Which IHSAA class has a mascot of the Raiders? | CREATE TABLE table_64419 ("School" text,"Location" text,"Mascot" text,"Size" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text) | SELECT "IHSAA Class" FROM table_64419 WHERE "Mascot" = 'raiders' |
How many under the category of Against have a Difference of 11 | CREATE TABLE table_20032 ("Position" real,"Team" text,"Points" real,"Played" real,"Won" real,"Drawn" real,"Lost" real,"For" real,"Against" real,"Difference" real) | SELECT COUNT("Against") FROM table_20032 WHERE "Difference" = '11' |
Users by Downvotes (top 100). | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Tags (Id number,Tag... | SELECT * FROM Users ORDER BY DownVotes DESC LIMIT 100 |
what's the game with date being march 7 | CREATE TABLE table_18820 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Game" FROM table_18820 WHERE "Date" = 'March 7' |
what are the four most frequently ordered laboratory tests for patients of age 20s? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id numb... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) GROUP BY labevents.itemid) AS ... |
What's the 1949/50 expenditure (in $ millions) in the country where the 1948/49 expenditure was 232$ millions? | CREATE TABLE table_2155 ("Country" text,"1948/49 ($ millions)" real,"1949/50 ($ millions)" real,"1950/51 ($ millions)" real,"Cumulative ($ millions)" real) | SELECT MAX("1949/50 ($ millions)") FROM table_2155 WHERE "1948/49 ($ millions)" = '232' |
What is the number of patients who died on or before 2148 that had complete heart block as their primary disease? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2148.0" |
what were the five most frequent drugs that were prescribed within 2 months to the hypotension / pressor dependent female patients with age 30s after they have been diagnosed with hypotension / pressor dependent, this year? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmen... | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'hypotension / pressor dependent' AND DATETIME(diag... |
Who is the second member more recently than 1790 when John Williams is the first member? | CREATE TABLE table_name_10 (second_member VARCHAR,year VARCHAR,first_member VARCHAR) | SELECT second_member FROM table_name_10 WHERE year > 1790 AND first_member = "john williams" |
Name the miles for june 7 | CREATE TABLE table_16493961_1 (miles__km_ VARCHAR,date VARCHAR) | SELECT miles__km_ FROM table_16493961_1 WHERE date = "June 7" |
Anthony West ride which Motorcyle? | CREATE TABLE table_67166 ("Team" text,"Constructor" text,"Motorcycle" text,"Tyre" text,"Rider" text,"Rounds" text) | SELECT "Motorcycle" FROM table_67166 WHERE "Rider" = 'anthony west' |
How many entries arr there for the top 10 for the 78th position? | CREATE TABLE table_1507423_5 (top_10 VARCHAR,position VARCHAR) | SELECT COUNT(top_10) FROM table_1507423_5 WHERE position = "78th" |
What is the mean year number where there are more than 0 wins, the class is 250cc, and the points are 95? | CREATE TABLE table_74984 ("Year" real,"Class" text,"Team" text,"Points" real,"Wins" real) | SELECT AVG("Year") FROM table_74984 WHERE "Wins" > '0' AND "Class" = '250cc' AND "Points" = '95' |
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, could you sort X from high to low order please? | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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),COUNTRY_NAME varchar(40),REGION_ID deci... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
what is id of students who registered some courses but the least number of courses in these students? | CREATE TABLE candidates (candidate_id number,candidate_details text)CREATE TABLE people_addresses (person_address_id number,person_id number,address_id number,date_from time,date_to time)CREATE TABLE candidate_assessments (candidate_id number,qualification text,assessment_date time,asessment_outcome_code text)CREATE TA... | SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1 |
what is the name of the drug prescribed to patient 66015 in the same hospital encounter after having been diagnosed with hypertension nos during the last month? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... |
How many players were 6'1' and from Columbia, South Carolina? | CREATE TABLE table_72574 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" text,"Class" text,"Hometown" text,"Games\u2191" real) | SELECT COUNT("Position") FROM table_72574 WHERE "Height" = '6''1' AND "Hometown" = 'Columbia, South Carolina' |
what is the only model of these aircraft to originate in canada ? | CREATE TABLE table_204_710 (id number,"model" text,"origin" text,"type" text,"versions" text,"in service" text,"notes" text) | SELECT "model" FROM table_204_710 WHERE "origin" = 'canada' |
What are the census ranking(s) for a population of 284? | CREATE TABLE table_21370 ("Official Name" text,"Status" text,"Area km 2" text,"Population" real,"Census Ranking" text) | SELECT "Census Ranking" FROM table_21370 WHERE "Population" = '284' |
What is the original title of the film from Japan/Taiwan before 2003? | CREATE TABLE table_71643 ("Year" real,"English title" text,"Original title" text,"Country" text,"Director(s)" text) | SELECT "Original title" FROM table_71643 WHERE "Year" < '2003' AND "Country" = 'japan/taiwan' |
Find the minimum gpa of all students in each department with a pie chart. | CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeri... | SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE |
Give me a bar chart for the total number of each budget type code, and rank from high to low by the X please. | CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC |
what is the declination (j2000) when the ngc number is higher than 3593? | CREATE TABLE table_58453 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text) | SELECT "Declination ( J2000 )" FROM table_58453 WHERE "NGC number" > '3593' |
What was the payout in US dollars at the Insight Bowl? | CREATE TABLE table_41012 ("Bowl Game" text,"Date" text,"Stadium" text,"City" text,"Television" text,"Conference Matchups" text,"Payout (US$)" text) | SELECT "Payout ( US$ )" FROM table_41012 WHERE "Bowl Game" = 'insight bowl' |
Plot the average of budget in billions over creation in a line chart, and order by the Creation in descending. | CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text) | SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC |
How many program data on Asia was written if the organization launched 14 programs iin the Americas? | CREATE TABLE table_29354 ("Programs" text,"World" real,"Africa" real,"Americas" real,"Asia" real,"Australasia" real,"Europe" real) | SELECT COUNT("Asia") FROM table_29354 WHERE "Americas" = '14' |
What was the score of the game on October 20 when the home team is the NY Islanders? | CREATE TABLE table_name_57 (score VARCHAR,home VARCHAR,date VARCHAR) | SELECT score FROM table_name_57 WHERE home = "ny islanders" AND date = "october 20" |
What was the table position for the team whose outgoing manager was Brian Laws? | CREATE TABLE table_28800 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Position in table" text,"Incoming manager" text,"Date of appointment" text) | SELECT "Position in table" FROM table_28800 WHERE "Outgoing manager" = 'Brian Laws' |
Which Tournament has a Surface of carpet, and a Date smaller than 1995, and an Opponent in the final of ken flach robert seguso? | CREATE TABLE table_50089 ("Date" real,"Tournament" text,"Surface" text,"Partnering" text,"Opponent in the final" text,"Score" text) | SELECT "Tournament" FROM table_50089 WHERE "Surface" = 'carpet' AND "Date" < '1995' AND "Opponent in the final" = 'ken flach robert seguso' |
What's 's romanised name? | CREATE TABLE table_25184 ("Romanised name" text,"Chinese name" text,"age at appointment" real,"Portfolio" text,"Prior occupation" text) | SELECT "Romanised name" FROM table_25184 WHERE "Chinese name" = '梁愛詩' |
What are all the instruments used? | CREATE TABLE Instruments (instrument VARCHAR) | SELECT DISTINCT instrument FROM Instruments |
What type of game had a 0:0 result? | CREATE TABLE table_name_17 (type_of_game VARCHAR,results¹ VARCHAR) | SELECT type_of_game FROM table_name_17 WHERE results¹ = "0:0" |
what was the venue when he placed first ? | CREATE TABLE table_204_706 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT "venue" FROM table_204_706 WHERE "position" = 1 |
Rust questions per day averaged over weeks (2018). | 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... | SELECT MIN(Posts.CreationDate), COUNT(*) / 7.0 AS "posts per day" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = 'rust' AND Posts.CreationDate > '2018-01-01' GROUP BY TIME_TO_STR(Posts.CreationDate, '%W'), TIME_TO_STR(Posts.CreationDate, '%Y... |
how much weight was patient 013-29301's last weight on their first hospital visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29301' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY p... |
What is the 2003 statistic for general cargo? | CREATE TABLE table_name_94 (product VARCHAR) | SELECT 2003 FROM table_name_94 WHERE product = "general cargo" |
What home team played Collingwood as the away team? | CREATE TABLE table_55738 ("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_55738 WHERE "Away team" = 'collingwood' |
Where was the Fury FC 4: High Voltage event held? | CREATE TABLE table_44653 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Location" FROM table_44653 WHERE "Event" = 'fury fc 4: high voltage' |
what is the number of patients whose marital status is divorced and admission year is less than 2151? | 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.marital_status = "DIVORCED" AND demographic.admityear < "2151" |
On what date did Jesse Levine play on a hard surface? | CREATE TABLE table_name_78 (date VARCHAR,surface VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_78 WHERE surface = "hard" AND opponent = "jesse levine" |
What is the model that was made in the years 2011 2012-? | CREATE TABLE table_63380 ("Model" text,"Years" text,"Engine code" text,"Power" text,"Torque" text) | SELECT "Model" FROM table_63380 WHERE "Years" = '2011 2012-' |
What is the highest rank of the player with less than 32 points? | CREATE TABLE table_41871 ("Rank" real,"Name" text,"Team" text,"Games" real,"Points" real) | SELECT MAX("Rank") FROM table_41871 WHERE "Points" < '32' |
Return the characters and durations for each actor. | CREATE TABLE musical (musical_id number,name text,year number,award text,category text,nominee text,result text)CREATE TABLE actor (actor_id number,name text,musical_id number,character text,duration text,age number) | SELECT character, duration FROM actor |
What was the result of the game on December 22, 1991? | CREATE TABLE table_74787 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_74787 WHERE "Date" = 'december 22, 1991' |
What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent? | CREATE TABLE table_5675 ("Game" real,"December" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT "Record" FROM table_5675 WHERE "December" < '6' AND "Points" < '38' AND "Opponent" = 'pittsburgh penguins' |
What is the largest 6-car-sets for fiscal year 1968? | CREATE TABLE table_19255192_1 (fiscal_year VARCHAR) | SELECT MAX(6 AS _car_sets) FROM table_19255192_1 WHERE fiscal_year = 1968 |
Who is team c when dhez javier is team e? | CREATE TABLE table_name_44 (team_c VARCHAR,team_e VARCHAR) | SELECT team_c FROM table_name_44 WHERE team_e = "dhez javier" |
How many courses are offered? | CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num number)CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE professor (emp_num number,dept_c... | SELECT COUNT(DISTINCT crs_code) FROM class |
Draw a bar chart for how many different locations does each school have?, order from low to high by the y-axis. | CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(1... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS) |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time, I want to order by the Y-axis in ascending 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 departments (DEPARTMENT_ID decima... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.