instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
screening geriatric depression ( gds ) _ 15 score less than ( < ) 6 | CREATE TABLE table_train_116 ("id" int,"mini_mental_state_examination_mmse" int,"hemoglobin_a1c_hba1c" float,"body_weight" float,"hepatic_disease" bool,"geriatric_depression_scale_gds" int,"NOUSE" float) | SELECT * FROM table_train_116 WHERE geriatric_depression_scale_gds <= 6 |
what is the number of patients whose admission location is trsf within this facility and year of birth is less than 1887? | 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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1887" |
What is the relationship between account id and the number of transactions for each account? Return a scatter chart. | CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Product_Categories (production_type_code VARCHAR(15),product_type_description VARCHAR(80),vat_rating DECIMAL(19,4))CREATE TABLE Financial_Transactions (transaction_id INTEGER,account_id INTEGER,invoice_number INTEGER,trans... | SELECT T1.account_id, COUNT(*) FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id |
what number of patients admitted in emergency had drug code enox80i? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "ENOX80I" |
get the number of patients with procedure icd9 code 4439. | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4439" |
please give me flights from ATLANTA to BOSTON on wednesday morning and thursday afternoon | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE T... | 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.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_na... |
What is the lowest pick for the Buffalo Bills? | CREATE TABLE table_name_60 (pick INTEGER,team VARCHAR) | SELECT MIN(pick) FROM table_name_60 WHERE team = "buffalo bills" |
For Winter Other classes who is the professor ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TAB... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... |
In what Game did Rams Points equal 0? | CREATE TABLE table_name_82 (game VARCHAR,rams_points VARCHAR) | SELECT game FROM table_name_82 WHERE rams_points = 0 |
What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents? Show a bar graph, and rank in desc by the X. | CREATE TABLE store_district (Store_ID int,District_ID int)CREATE TABLE product (product_id int,product text,dimensions text,dpi real,pages_per_minute_color real,max_page_size text,interface text)CREATE TABLE store (Store_ID int,Store_Name text,Type text,Area_size real,Number_of_product_category real,Ranking int)CREATE ... | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY District_name DESC |
When are the vacancy dates for outgoing manager Damien Fox? | CREATE TABLE table_11190568_7 (date_of_vacancy VARCHAR,outgoing_manager VARCHAR) | SELECT date_of_vacancy FROM table_11190568_7 WHERE outgoing_manager = "Damien Fox" |
What is the type of Guangjia? | CREATE TABLE table_name_50 (type VARCHAR,name__pinyin_ VARCHAR) | SELECT type FROM table_name_50 WHERE name__pinyin_ = "guangjia" |
what is minimum age for different job title?, and list by the job in desc. | CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER) | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC |
What is Bruce Cerone overall? | CREATE TABLE table_16077 ("Round" real,"Choice" real,"Overall" real,"Player name" text,"Position" text,"College" text) | SELECT MIN("Overall") FROM table_16077 WHERE "Player name" = 'Bruce Cerone' |
What's the Class for the city the license plate was issued in great barrington, massachusetts? | CREATE TABLE table_42144 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT "Class" FROM table_42144 WHERE "City of license" = 'great barrington, massachusetts' |
What is Candlelight Records format? | CREATE TABLE table_name_98 (format VARCHAR,label VARCHAR) | SELECT format FROM table_name_98 WHERE label = "candlelight records" |
Name the District that has a Reserved for ( SC / ST /None) of none and a Constituency number of 242? | CREATE TABLE table_name_19 (district VARCHAR,reserved_for___sc___st__none_ VARCHAR,constituency_number VARCHAR) | SELECT district FROM table_name_19 WHERE reserved_for___sc___st__none_ = "none" AND constituency_number = "242" |
What's the amount of winnings (in $) in the year with 2 wins? | CREATE TABLE table_22810 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text) | SELECT "Winnings" FROM table_22810 WHERE "Wins" = '2' |
What platform is nds4droid on for the nintendo ds with a license of gpl v2? | CREATE TABLE table_54562 ("Name" text,"Current version" text,"System" text,"Platform" text,"License" text) | SELECT "Platform" FROM table_54562 WHERE "System" = 'nintendo ds' AND "License" = 'gpl v2' AND "Name" = 'nds4droid' |
What was the score of the game with a record of 18-22-13? | CREATE TABLE table_name_18 (score VARCHAR,record VARCHAR) | SELECT score FROM table_name_18 WHERE record = "18-22-13" |
Which apartments have type code 'Flat'? Give me their apartment numbers. | CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count number,room_count text)CREATE TABLE apartment_facilities (apt_id number,facility_code text)CREATE TABLE apartment_buildings (building_id number,building_short_name text,building_full_name tex... | SELECT apt_number FROM apartments WHERE apt_type_code = "Flat" |
Top 50 SO Users from Madhya Pradesh. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGU... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Madhya pradesh%' OR UPPER(Location) LIKE '%Madhya pradesh%' OR Location LIKE '%Madhya pradesh%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 2500 |
What are the results of the incumbent who was first elected in 1996? | CREATE TABLE table_79086 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text) | SELECT "Results" FROM table_79086 WHERE "First elected" = '1996' |
how much weight was patient 739's last weight in this month? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE ... | SELECT 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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' A... |
Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute All_Home, and rank by the x axis in desc please. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC |
What is the total number of points combined from the teams that played over 14 games? | CREATE TABLE table_64522 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real) | SELECT COUNT("Points") FROM table_64522 WHERE "Played" > '14' |
Does Prof. Bradley Smith teach 475 next Winter ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,r... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 475 AND instructor.name LIKE '%Bradley Smith%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i... |
hemoglobin a1c < 8.5 % | CREATE TABLE table_train_215 ("id" int,"hemoglobin_a1c_hba1c" float,"hgba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"kidney_disease" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_215 WHERE hemoglobin_a1c_hba1c < 8.5 |
What was the average rank of Wolfgang Schwarz with greater than 13 places? | CREATE TABLE table_34384 ("Rank" real,"Name" text,"Nation" text,"Points" real,"Places" real) | SELECT AVG("Rank") FROM table_34384 WHERE "Name" = 'wolfgang schwarz' AND "Places" > '13' |
what is the place for ireland? | CREATE TABLE table_71074 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Place" FROM table_71074 WHERE "Country" = 'ireland' |
What is the country of origin for the player who plays on Tondena 65 Rhum? | CREATE TABLE table_14292 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text) | SELECT "Country of origin*" FROM table_14292 WHERE "PBA team" = 'tondena 65 rhum' |
What was the series# with the original airdate of october 23, 1967? | CREATE TABLE table_21146729_6 (series__number INTEGER,original_airdate VARCHAR) | SELECT MAX(series__number) FROM table_21146729_6 WHERE original_airdate = "October 23, 1967" |
What Competition has a Year smaller than 1983? | CREATE TABLE table_60132 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Time" text) | SELECT "Competition" FROM table_60132 WHERE "Year" < '1983' |
provide the number of patients whose admission type is newborn and drug route is neb? | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "NEB" |
where was the first court house built ? | CREATE TABLE table_204_749 (id number,"courthouse" text,"city" text,"street address" text,"jurisdiction" text,"dates of use" text,"named for" number) | SELECT "city" FROM table_204_749 ORDER BY "dates of use" LIMIT 1 |
How many times did argentina win? | CREATE TABLE table_1074 ("Nation" text,"Winners" real,"Runners-up" real,"Third Place" real,"Fourth Place" real) | SELECT MAX("Winners") FROM table_1074 WHERE "Nation" = 'Argentina' |
Who was the runner(s)-Up to winner Sarah Brice? | CREATE TABLE table_name_23 (runner_s__up VARCHAR,winner VARCHAR) | SELECT runner_s__up FROM table_name_23 WHERE winner = "sarah brice" |
how long did cap anson play ? | CREATE TABLE table_203_697 (id number,"player" text,"career" text,"nickname" text,"team inducted as" text) | SELECT "career" - "career" FROM table_203_697 WHERE "player" = 'cap anson' |
what is the number of patients who were admitted via emergency room and had open liver biopsy procedure? | 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.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Open liver biopsy" |
until 2104, when did patient 86206 come to the hospital via the phys referral/normal deli for the first time? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 86206 AND admissions.admission_location = 'phys referral/normal deli' AND STRFTIME('%y', admissions.admittime) <= '2104' ORDER BY admissions.admittime LIMIT 1 |
Year(s) won of 1994 , 1997 has what average total? | CREATE TABLE table_37033 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text) | SELECT AVG("Total") FROM table_37033 WHERE "Year(s) won" = '1994 , 1997' |
When was Southend United the home team? | CREATE TABLE table_name_44 (date VARCHAR,home_team VARCHAR) | SELECT date FROM table_name_44 WHERE home_team = "southend united" |
what 1989 has 2002 of 4r and 2005 of 4r? | CREATE TABLE table_56435 ("Tournament" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text) | SELECT "1989" FROM table_56435 WHERE "2002" = '4r' AND "2005" = '4r' |
Which classes make up an EECS major 's Core ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE p... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id |
What year was Caroline Medina Miss Fire (3rd Runner-up)? | CREATE TABLE table_name_21 (year INTEGER,miss_fire__3rd_runner_up_ VARCHAR) | SELECT AVG(year) FROM table_name_21 WHERE miss_fire__3rd_runner_up_ = "caroline medina" |
What is the first name and age of every student who lives in a dorm with a TV Lounge? | CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE lives_in (stuid number,dormid number,room_number number)CREATE TABLE student (stuid number,lname text,fname te... | SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') |
How many people were in the crowd with the away team being collingwood? | CREATE TABLE table_name_5 (crowd VARCHAR,away_team VARCHAR) | SELECT COUNT(crowd) FROM table_name_5 WHERE away_team = "collingwood" |
Questions with outstanding close votes by tag. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPo... | SELECT * FROM (SELECT Posts.Id AS "post_link", AVG(Posts.Score) AS "score", COUNT(*) AS "close_votes", MAX(Votes.CreationDate) AS "last_vote", MIN(Votes.CreationDate) AS "first_vote" FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND Posts.ClosedDate IS NULL AND Posts.Tags LIKE '%<##Tag##>%... |
When 1.12 is the production code what is the original title? | CREATE TABLE table_20124413_1 (original_title VARCHAR,prod_code VARCHAR) | SELECT original_title FROM table_20124413_1 WHERE prod_code = "1.12" |
what is the number of provincial captial where the province is northern cape? | CREATE TABLE table_1692 ("Province" text,"Provincial capital" text,"Largest city" text,"Area (km 2)" real,"Population (2013)" real) | SELECT COUNT("Provincial capital") FROM table_1692 WHERE "Province" = 'Northern Cape' |
How many Points have a Date of march 19, 2009? | CREATE TABLE table_8650 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT COUNT("Points") FROM table_8650 WHERE "Date" = 'march 19, 2009' |
What is the lowest series episode with a production code of 406? | CREATE TABLE table_26137 ("Series episode" real,"Season episode" real,"Title" text,"U.S. viewers (millions)" text,"Original U.S. airdate" text,"Prod. code" real) | SELECT MIN("Series episode") FROM table_26137 WHERE "Prod. code" = '406' |
What is the home team score for the game with the away team Carlton? | CREATE TABLE table_4910 ("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_4910 WHERE "Away team" = 'carlton' |
Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points before 1955? | CREATE TABLE table_name_15 (entrant VARCHAR,points VARCHAR,chassis VARCHAR,engine VARCHAR,year VARCHAR) | SELECT entrant FROM table_name_15 WHERE engine = "offenhauser l4" AND year < 1955 AND chassis = "kurtis kraft kk500a" AND points = 9 |
What is the territory that was acquired past 1899 and has a capital of saipan? | CREATE TABLE table_name_37 (territory VARCHAR,acquired VARCHAR,capital VARCHAR) | SELECT territory FROM table_name_37 WHERE acquired > 1899 AND capital = "saipan" |
A bar chart shows the distribution of meter_600 and ID . | 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,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev... | SELECT meter_600, ID FROM swimmer |
Who is the winner of the tournament in Georgia on Oct 3? | CREATE TABLE table_name_90 (winner VARCHAR,location VARCHAR,date VARCHAR) | SELECT winner FROM table_name_90 WHERE location = "georgia" AND date = "oct 3" |
What is the most Bronze medals won among the participants that won less than 22 medals overall and less than 5 silver medals? | CREATE TABLE table_name_5 (bronze INTEGER,total VARCHAR,silver VARCHAR) | SELECT MAX(bronze) FROM table_name_5 WHERE total < 22 AND silver < 5 |
What is the prisoner's name that is currently 29 years old? | CREATE TABLE table_15194 ("Name" text,"Race" text,"Current age" real,"Age at offense" real,"Years on death row" real,"Location of offense" text) | SELECT "Name" FROM table_15194 WHERE "Current age" = '29' |
What was the time of sportfight 10? | CREATE TABLE table_name_45 (time VARCHAR,event VARCHAR) | SELECT time FROM table_name_45 WHERE event = "sportfight 10" |
What is the Record for April 13? | CREATE TABLE table_45714 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Record" FROM table_45714 WHERE "Date" = 'april 13' |
how many patients born before 2076 have been discharged to short term hospital? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076" |
what are the four most frequently occurring specimen tests? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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 number,valueuom text)... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 |
List the full name (first and last name), and salary for those employees who earn below 6000. | CREATE TABLE countries (country_id text,country_name text,region_id number)CREATE TABLE jobs (job_id text,job_title text,min_salary number,max_salary number)CREATE TABLE regions (region_id number,region_name text)CREATE TABLE locations (location_id number,street_address text,postal_code text,city text,state_province te... | SELECT first_name, last_name, salary FROM employees WHERE salary < 6000 |
what is the number of films in this category that came from france during this year ? | CREATE TABLE table_204_652 (id number,"title" text,"year" number,"director" text,"country" text,"genre" text,"notes" text) | SELECT COUNT("title") FROM table_204_652 WHERE "country" = 'france' |
What is the roll number of Poroti school, which has a 6 decile? | CREATE TABLE table_58494 ("Name" text,"Years" text,"Area" text,"Authority" text,"Decile" text,"Roll" text) | SELECT "Roll" FROM table_58494 WHERE "Decile" = '6' AND "Name" = 'poroti school' |
Who was the incumbent in the Kentucky 8 district? | CREATE TABLE table_2668367_7 (incumbent VARCHAR,district VARCHAR) | SELECT incumbent FROM table_2668367_7 WHERE district = "Kentucky 8" |
i would like information on ground transportation in ATLANTA from the airport to the city in the morning around 9am | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_requi... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp... |
when was the last time patient 1902 was having greater than 64.0 heart rate today? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id ... | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... |
provide the number of patients whose admission type is elective and drug name is heparin (iabp)? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Heparin (IABP)" |
Who was the Home Captain at Sabina Park? | CREATE TABLE table_15479 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Home captain" FROM table_15479 WHERE "Venue" = 'sabina park' |
what changes have been made to the wbc x 1000 values in patient 027-141930 second measured on the first hospital visit compared to the first value measured on the first hospital visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-141930' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... |
how many teams had an appointment date of 11 april 2011 | CREATE TABLE table_74113 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT COUNT("Team") FROM table_74113 WHERE "Date of appointment" = '11 April 2011' |
How many silver medals when the total was 2 and less than 1 bronze? | CREATE TABLE table_14293 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Silver") FROM table_14293 WHERE "Bronze" < '1' AND "Total" = '2' |
count the number of patients who are diagnosed with coronary artery disease and do not come back to the hospital in the same month until 2104. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresul... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COU... |
What is the sum of laps that has a car number of larger than 1, is a ford, and has 155 points? | CREATE TABLE table_name_54 (laps INTEGER,points VARCHAR,car__number VARCHAR,make VARCHAR) | SELECT SUM(laps) FROM table_name_54 WHERE car__number > 1 AND make = "ford" AND points = 155 |
What is the Surface of the match played on October 5, 1987? | CREATE TABLE table_name_77 (surface VARCHAR,date VARCHAR) | SELECT surface FROM table_name_77 WHERE date = "october 5, 1987" |
how many losses did the team have in 1981 ? | CREATE TABLE table_204_319 (id number,"mlb\nseason" number,"team\nseason" number,"league" text,"division" text,"finish" text,"wins" number,"losses" number,"win %" number,"gb" text,"postseason" text,"awards" text) | SELECT SUM("losses") FROM table_204_319 WHERE "mlb\nseason" = 1981 |
List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc. | CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status text)CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion t... | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name |
How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, order 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 Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARC... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) |
what is the number of patients whose diagnoses short title is cor ath unsp vsl ntv/gft and drug route is sl? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "SL" |
What is the largest gold with a Total larger than 16? | CREATE TABLE table_name_90 (gold INTEGER,total INTEGER) | SELECT MAX(gold) FROM table_name_90 WHERE total > 16 |
all tags related to Microsoft Office & related Questions. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCo... | SELECT t.TagName, t.Count, Body FROM Tags AS t LEFT OUTER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE LOWER(Body) LIKE '%ms-word%' OR LOWER(Body) LIKE '%excel%' OR LOWER(Body) LIKE '%powerpoint%' OR LOWER(Body) LIKE '%outlook%' OR LOWER(Body) LIKE '%ms access%' OR LOWER(Body) LIKE '%microsoft access%' OR LOWER(Body... |
Name the first elected for lost renomination democratic loss | CREATE TABLE table_1342249_32 (first_elected VARCHAR,result VARCHAR) | SELECT first_elected FROM table_1342249_32 WHERE result = "Lost renomination Democratic loss" |
What was the attendance of april 17? | CREATE TABLE table_name_83 (attendance INTEGER,date VARCHAR) | SELECT SUM(attendance) FROM table_name_83 WHERE date = "april 17" |
Where is the moving from location with a transfer window of summer and the source kerkida.net? | CREATE TABLE table_name_88 (moving_from VARCHAR,transfer_window VARCHAR,source VARCHAR) | SELECT moving_from FROM table_name_88 WHERE transfer_window = "summer" AND source = "kerkida.net" |
For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings and had an atttendance smaller than 68,431? | CREATE TABLE table_33016 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT COUNT("Week") FROM table_33016 WHERE "Opponent" = 'minnesota vikings' AND "Attendance" < '68,431' |
Who did the play-by-play before 1992 with the Ice level reporter Mike Emrick? | CREATE TABLE table_55597 ("Year" real,"Network" text,"Play-by-play" text,"Color commentator(s)" text,"Ice level reporters" text) | SELECT "Play-by-play" FROM table_55597 WHERE "Year" < '1992' AND "Ice level reporters" = 'mike emrick' |
What is the Score with an Outcome of runner-up, and a Partner that is elizabeth little? | CREATE TABLE table_35747 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Score" FROM table_35747 WHERE "Outcome" = 'runner-up' AND "Partner" = 'elizabeth little' |
What is the lest amount of bronzes that ranked 2 and has less silvers than 0? | CREATE TABLE table_45287 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Bronze") FROM table_45287 WHERE "Rank" = '2' AND "Silver" < '0' |
In the Central region, what was the infiltration (km 3 /year)? | CREATE TABLE table_28224 ("Region" text,"Land area (km 2)" text,"Rainfall by depth (mm/year)" real,"Rainfall by volume (km 3 /year)" text,"Surface run off (km 3 /year)" text,"Infiltration (km 3 /year)" text,"Evapotranspiration (km 3 /year)" text) | SELECT "Infiltration (km 3 /year)" FROM table_28224 WHERE "Region" = 'Central' |
How many losses altogether were had by teams that won 12 times, had 40-4 points, and more than 57 goals? | CREATE TABLE table_name_11 (losses INTEGER,goals_for VARCHAR,wins VARCHAR,points VARCHAR) | SELECT SUM(losses) FROM table_name_11 WHERE wins = 12 AND points = "40-4" AND goals_for > 57 |
Give the names and locations of all wrestlers. | CREATE TABLE wrestler (wrestler_id number,name text,reign text,days_held text,location text,event text)CREATE TABLE elimination (elimination_id text,wrestler_id text,team text,eliminated_by text,elimination_move text,time text) | SELECT name, location FROM wrestler |
What's the total long for an avg/g over 0.2, fewer than 2 loss, and a gain less than 8? | CREATE TABLE table_name_30 (long VARCHAR,gain VARCHAR,avg_g VARCHAR,loss VARCHAR) | SELECT COUNT(long) FROM table_name_30 WHERE avg_g > 0.2 AND loss < 2 AND gain < 8 |
what were the number of contestants that were male ? | CREATE TABLE table_203_446 (id number,"name" text,"gender" text,"age" number,"from" text,"occupation" text,"prize money (usd)" text,"status" text) | SELECT COUNT("name") FROM table_203_446 WHERE "gender" = 'male' |
how many days have elapsed since patient 004-13127 last received a -monos lab test on their current 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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127' AND patient.hospi... |
Which courses available in Molecular Anthropology satisfy the MDE requirement ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varcha... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Molecular Anthropology%' OR course.description LIKE '%Molecular Anthropology%' OR course.name LI... |
What was the score of the game from July 18? | CREATE TABLE table_name_30 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_30 WHERE date = "july 18" |
What is the date before week 13 and Miami Dolphins as an opponent? | CREATE TABLE table_33755 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Attendance" real) | SELECT "Date" FROM table_33755 WHERE "Week" < '13' AND "Opponent" = 'miami dolphins' |
Which Season 7 has a Season 6 of jim treliving? | CREATE TABLE table_name_98 (season_7 VARCHAR,season_6 VARCHAR) | SELECT season_7 FROM table_name_98 WHERE season_6 = "jim treliving" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.