instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
In what year did the teams leave the conference? | CREATE TABLE table_2419754_1 (left INTEGER) | SELECT MAX(left) FROM table_2419754_1 |
What is the verb meaning when the part 2 is bl ot? | CREATE TABLE table_46609 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text) | SELECT "Verb meaning" FROM table_46609 WHERE "Part 2" = 'blēot' |
there must not be any history of uncontrolled depression. | CREATE TABLE table_train_104 ("id" int,"migraines" bool,"depression" bool,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"renal_disease" bool,"alzheimer" bool,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"clinical_dementia_rating_cdr" float,"NOUSE" float... | SELECT * FROM table_train_104 WHERE depression = 0 |
what does NW stand for | CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,t... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'NW' |
give me the number of patients whose drug code is isos10? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ISOS10" |
Name the most wickets for best is 4/22 | CREATE TABLE table_72943 ("Player" text,"Team" text,"Matches" real,"Overs" text,"Runs" real,"Wickets" real,"Best" text,"Econ" text,"S/Rate" text,"4/inns" real,"5+/inns" real,"Average" text) | SELECT MAX("Wickets") FROM table_72943 WHERE "Best" = '4/22' |
when had patient 46484 in 2103 get the last procedure? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_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 transfers (row_id num... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46484) AND STRFTIME('%y', procedures_icd.charttime) = '2103' ORDER BY procedures_icd.charttime DESC LIMIT 1 |
Users by approximate meta reputation. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,U... | SELECT u.Id AS "user_link", SUM(CASE WHEN v.VoteTypeId = 1 THEN 15 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 5 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 2 THEN 10 WHEN v.VoteTypeId = 3 THEN -2 END) AS Reputation FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId INNER JOIN Users AS u ON p.OwnerUserId = u.Id ... |
Which Position has 24 Goals against, and a Played smaller than 30? | CREATE TABLE table_59036 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real) | SELECT MAX("Position") FROM table_59036 WHERE "Goals against" = '24' AND "Played" < '30' |
count the number of patients for whom csf lab test was ordered. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Cerebrospinal Fluid (CSF)" |
tell me the drug that patient 021-25705 had an allergic reaction to in 11/2105? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,cul... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND STRFTIME('%y-%m', allergy.allergytime) = '2105-11' |
What is the area of the parish with a population larger than 1,172 and a census ranking of 1,871 of 5,008? | CREATE TABLE table_name_16 (area_km_2 VARCHAR,census_ranking VARCHAR,population VARCHAR) | SELECT COUNT(area_km_2) FROM table_name_16 WHERE census_ranking = "1,871 of 5,008" AND population > 1 OFFSET 172 |
What is the A-side for it Never Entered My Mind, Part 2? | CREATE TABLE table_name_75 (a_side VARCHAR,b_side VARCHAR) | SELECT a_side FROM table_name_75 WHERE b_side = "it never entered my mind, part 2" |
List the number of people injured by perpetrators in ascending order. | CREATE TABLE perpetrator (Injured VARCHAR) | SELECT Injured FROM perpetrator ORDER BY Injured |
Name the result for ji nov k radek t p nek | CREATE TABLE table_22825058_23 (result VARCHAR,opponents VARCHAR) | SELECT result FROM table_22825058_23 WHERE opponents = "Jiří Novák Radek Štěpánek" |
Name the least wins | CREATE TABLE table_2187333_1 (wins INTEGER) | SELECT MIN(wins) FROM table_2187333_1 |
Which Runner-up played in the Season of 2000 01? | CREATE TABLE table_name_72 (runner_up VARCHAR,season VARCHAR) | SELECT runner_up FROM table_name_72 WHERE season = "2000–01" |
What is the magnitude of the earthquake with an epicenter in biskra province? | CREATE TABLE table_name_6 (magnitude VARCHAR,epicenter VARCHAR) | SELECT magnitude FROM table_name_6 WHERE epicenter = "biskra province" |
Calculate the minimum age of patients with bladder cancer/sda as the primary disease who were admitted to hospital in or after the year 2164. | 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 MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND demographic.admityear >= "2164" |
What is the position elected in 2011 from the Country of Algeria? | CREATE TABLE table_8396 ("Name" text,"Country of Origin" text,"Position" text,"Elected" real,"Term" real) | SELECT "Position" FROM table_8396 WHERE "Elected" = '2011' AND "Country of Origin" = 'algeria' |
I want to see trend count(*) over year by semester, and binning by year, | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))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))... | SELECT year, COUNT(*) FROM section GROUP BY semester |
Sample Posts and Comments query. | 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 Posts.Id, COUNT(Comments.Id) FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id GROUP BY Posts.Id ORDER BY COUNT(Comments.Id) |
What 1957 engine has a Chassis of connaught type b? | CREATE TABLE table_name_71 (engine VARCHAR,chassis VARCHAR,year VARCHAR) | SELECT engine FROM table_name_71 WHERE chassis = "connaught type b" AND year > 1957 |
What is the average attendance of the Mariners' attendance when their record was 62-64? | CREATE TABLE table_name_86 (attendance INTEGER,opponent VARCHAR,record VARCHAR) | SELECT AVG(attendance) FROM table_name_86 WHERE opponent = "mariners" AND record = "62-64" |
Who won the race at the Jersey circuit? | CREATE TABLE table_233 ("Race Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Constructor" text,"Report" text) | SELECT "Winning driver" FROM table_233 WHERE "Circuit" = 'Jersey' |
How many high assists were on November 27? | CREATE TABLE table_name_10 (high_assists VARCHAR,date VARCHAR) | SELECT high_assists FROM table_name_10 WHERE date = "november 27" |
Give me a bar chart for sum price of each name, and could you order in ascending 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 Name, SUM(Price) FROM Products GROUP BY Name ORDER BY Name |
What was the rank for Great Britain? | CREATE TABLE table_66127 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT COUNT("Rank") FROM table_66127 WHERE "Country" = 'great britain' |
INSERT INTO Posts (Score) VALUES(1). | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostLinks (Id number,Creatio... | SELECT Score, COUNT(Score) FROM Posts WHERE Score > 10 AND Score < 100 GROUP BY Score ORDER BY Score |
provide me the number of patients admitted before the year 2144 who had diagnosis icd9 code 28802. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "28802" |
Which railroad is 112.6 kilometers from kingston? | CREATE TABLE table_20629 ("No." real,"Name" text,"Mi from Kingston" text,"Km from Kingston" text,"Parish" text,"Length feet" real,"Length meters" text) | SELECT "Name" FROM table_20629 WHERE "Km from Kingston" = '112.6' |
what is the average age of patients whose admission type is urgent and who died before the year 2133? | 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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dod_year < "2133.0" |
Name the santee sisseton for wi h a | CREATE TABLE table_1499774_5 (santee_sisseton VARCHAR,yankton_yanktonai VARCHAR) | SELECT santee_sisseton FROM table_1499774_5 WHERE yankton_yanktonai = "wičháša" |
Name the population 1891 for area being 175836 | CREATE TABLE table_1128 ("Administrative county" text,"Area 1891 (Statute acres)" real,"Population 1891" real,"Area 1961 (Statute acres)" real,"Population 1961" real) | SELECT COUNT("Population 1891") FROM table_1128 WHERE "Area 1891 (Statute acres)" = '175836' |
What city is Tiffin University located in? | CREATE TABLE table_29483673_1 (location___city VARCHAR,institution VARCHAR) | SELECT location___city FROM table_29483673_1 WHERE institution = "Tiffin University" |
Visualize a bar chart about the distribution of middle_name and author_tutor_ATB . | CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,date_of_enrolment ... | SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name |
What is the highest Game, when High Assists is 'Hedo T rko lu (7)'? | CREATE TABLE table_76860 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT MAX("Game") FROM table_76860 WHERE "High assists" = 'hedo türkoğlu (7)' |
Which year did the Short Pump Town Center Mall open? | CREATE TABLE table_name_4 (year_opened VARCHAR,mall_name VARCHAR) | SELECT year_opened FROM table_name_4 WHERE mall_name = "short pump town center" |
What vfl club(s) did players who played 23 cfl games play for? | CREATE TABLE table_16527640_2 (vfl_club_s_ VARCHAR,vfl_games VARCHAR) | SELECT vfl_club_s_ FROM table_16527640_2 WHERE vfl_games = 23 |
Name the vertical for ys | CREATE TABLE table_27731 ("Number" real,"Name" text,"Vertices" text,"Hypotenuse 0 c" text,"Vertical 0 b" text,"Horizontal 0 a" text) | SELECT "Vertical 0 b" FROM table_27731 WHERE "Horizontal 0 a" = '明勾(YS月南)' |
Name the total number of date for 10 | CREATE TABLE table_2446333_2 (date VARCHAR,round VARCHAR) | SELECT COUNT(date) FROM table_2446333_2 WHERE round = 10 |
Who was the champion when the attendance was 70,000? | CREATE TABLE table_45392 ("Year" real,"Champion" text,"Runner-Up" text,"Result" text,"Date" text,"Venue" text,"Attendance" text) | SELECT "Champion" FROM table_45392 WHERE "Attendance" = '70,000' |
How many silver medals did the nation who received 32 bronze medals receive? | CREATE TABLE table_name_61 (silver VARCHAR,bronze VARCHAR) | SELECT silver FROM table_name_61 WHERE bronze = 32 |
how much is patient 28447's changing heart rate last measured on the current icu visit compared to the value first measured on the current icu visit? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_... | SELECT (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 = 28447) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... |
How long does the one that stars with son bou of middle difficulty, and on a stage number larger than 13 last? | CREATE TABLE table_name_34 (duration VARCHAR,start VARCHAR,stage VARCHAR,difficulty VARCHAR) | SELECT duration FROM table_name_34 WHERE stage > 13 AND difficulty = "middle" AND start = "son bou" |
What is the score of player jay haas? | CREATE TABLE table_name_48 (score VARCHAR,player VARCHAR) | SELECT score FROM table_name_48 WHERE player = "jay haas" |
What was the fewest entrants in an event won by Grant Hinkle? | CREATE TABLE table_name_90 (entrants INTEGER,winner VARCHAR) | SELECT MIN(entrants) FROM table_name_90 WHERE winner = "grant hinkle" |
How many accounts are opened in each day? Bin the account open day by weekday and group by other account details in a stacked bar chart, and could you sort by the Y-axis in desc? | CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,invoice_number INTEGER,product_id INTEGER,product_title VARCHAR(80),product_quantity VARCHAR(50),product_price DECIMAL(19,4),derived_product_cost DECIMAL(19,4),derived_vat_payable DECIMAL(19,4),derived_total_cost DECIMAL(19,4))CREATE TABLE Order_Items (order_item_i... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY COUNT(date_account_opened) DESC |
Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance. | CREATE TABLE checking (balance INTEGER,custid VARCHAR)CREATE TABLE savings (balance INTEGER,custid VARCHAR)CREATE TABLE accounts (name VARCHAR,custid VARCHAR) | SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings) |
A pie chart shows the proportion of All_Games and School_ID. | 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 All_Games, School_ID FROM basketball_match |
Give me a bar chart for the total number of each payment method code, show by the X in ascending. | CREATE TABLE Performers (Performer_ID INTEGER,Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Customers (Customer_ID VARCHAR(100),Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code |
Name the award won in the hall of fame | CREATE TABLE table_name_30 (award VARCHAR,result VARCHAR,category VARCHAR) | SELECT award FROM table_name_30 WHERE result = "won" AND category = "hall of fame" |
What is the Irish name listed with 62% Irish speakers? | CREATE TABLE table_15928 ("County" text,"English name" text,"Irish name" text,"Population" real,"Irish speakers" text) | SELECT "Irish name" FROM table_15928 WHERE "Irish speakers" = '62%' |
what location saw the most matches ? | CREATE TABLE table_204_245 (id number,"#" number,"wrestlers" text,"reign" number,"date" text,"days\nheld" number,"location" text,"event" text,"notes" text) | SELECT "location" FROM table_204_245 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1 |
What is the catalog with an LP Format and under the Simply Vinyl label? | CREATE TABLE table_name_62 (catalog VARCHAR,format VARCHAR,label VARCHAR) | SELECT catalog FROM table_name_62 WHERE format = "lp" AND label = "simply vinyl" |
Which Final has a Team of liechtenstein (lie) liechtenstein i? | CREATE TABLE table_77468 ("Team" text,"Athletes" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text) | SELECT "Final" FROM table_77468 WHERE "Team" = 'liechtenstein (lie) liechtenstein i' |
what are the nonstop flights between HOUSTON and MEMPHIS | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPH... |
Inactive beginners who asked questions. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostFeedback (Id number,PostId num... | SELECT COUNT(Posts.Id) FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE Reputation < '##reputation1##' AND Reputation >= '##reputation2##' AND Users.CreationDate < DATEADD(month, -6, GETDATE())) AND PostTypeId = 1 |
What are the colors of the team hosted by Christopher? | CREATE TABLE table_name_77 (colors VARCHAR,host VARCHAR) | SELECT colors FROM table_name_77 WHERE host = "christopher" |
What date was the record 21-11? | CREATE TABLE table_64757 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_64757 WHERE "Record" = '21-11' |
What is the sum of points for teams with more than 10 matches, more than 0 draws, and 7 losses? | CREATE TABLE table_name_86 (points INTEGER,match VARCHAR,draw VARCHAR,lost VARCHAR) | SELECT SUM(points) FROM table_name_86 WHERE draw > 0 AND lost = 7 AND match > 10 |
What 2001 has a ATP World Tour Masters 1000 2007? | CREATE TABLE table_name_12 (Id VARCHAR) | SELECT 2011 FROM table_name_12 WHERE 2007 = "atp world tour masters 1000" |
What is the to par of the player with a 73-70-70-65=278 score? | CREATE TABLE table_60948 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" text) | SELECT "To par" FROM table_60948 WHERE "Score" = '73-70-70-65=278' |
What courses offered in the Spring or Summer semester allow me to satisfy my PreMajor requirement ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester 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, program_course AS PROGRAM_COURSEalias0... |
What is the ISSN number of a publication range of 1984-? | CREATE TABLE table_name_36 (issn VARCHAR,publication_range VARCHAR) | SELECT issn FROM table_name_36 WHERE publication_range = "1984-" |
Who was the host team when the Miami Dolphins were the visiting team? | CREATE TABLE table_14567 ("Week" real,"Date" text,"Visiting team" text,"Final score" text,"Host team" text,"Stadium" text) | SELECT "Host team" FROM table_14567 WHERE "Visiting team" = 'miami dolphins' |
The year 1974 has what listed as the Height? | CREATE TABLE table_44127 ("Continent" text,"Structure" text,"Height" text,"Year" real,"Country" text) | SELECT "Height" FROM table_44127 WHERE "Year" = '1974' |
How many episodes were written by Warren Leight? | CREATE TABLE table_29154676_1 (season_no VARCHAR,written_by VARCHAR) | SELECT COUNT(season_no) FROM table_29154676_1 WHERE written_by = "Warren Leight" |
What is listed as the Date made with a Quantity made of 13? | CREATE TABLE table_name_5 (date_made VARCHAR,quantity_made VARCHAR) | SELECT date_made FROM table_name_5 WHERE quantity_made = 13 |
how many hours has time elapsed since patient 022-199074 was prescribed with valium for the first time in this hospital encounter? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-19... |
what is the number of patients whose days of hospital stay is greater than 27 and procedure icd9 code is 3607? | 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.days_stay > "27" AND procedures.icd9_code = "3607" |
what was the top four most frequent lab tests in this year? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patie... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 |
Can I take NERS 673 any semester ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in... | SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'NERS' AND COURSEalias0.number =... |
What is the number of clubs when Dalian Shide won and Sichuan Quanxing won 4th? | CREATE TABLE table_62704 ("Season" real,"Winners" text,"Runners-up" text,"Third-place" text,"fourth-placed" text,"Number of clubs" real) | SELECT AVG("Number of clubs") FROM table_62704 WHERE "Winners" = 'dalian shide' AND "fourth-placed" = 'sichuan quanxing' |
If the velocity angle is ln[(1 + 5)/2] 0.481, what is the condition/parameter? | CREATE TABLE table_15314901_1 (condition_parameter VARCHAR,velocity_angle_η_in_i_radians VARCHAR) | SELECT condition_parameter FROM table_15314901_1 WHERE velocity_angle_η_in_i_radians = "ln[(1 + √5)/2] ≅ 0.481" |
What score to par won in 1998? | CREATE TABLE table_18862490_2 (to_par VARCHAR,year VARCHAR) | SELECT to_par FROM table_18862490_2 WHERE year = 1998 |
Who had the mountains classification when borut bo i was the winner? | CREATE TABLE table_25655781_17 (mountains_classification VARCHAR,winner VARCHAR) | SELECT mountains_classification FROM table_25655781_17 WHERE winner = "Borut Božič" |
What is the relationship between People_ID and Height , and group by attribute Sex? | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT People_ID, Height FROM people GROUP BY Sex |
What is the total number pick for seattle mariners team? | CREATE TABLE table_13937 ("Pick" real,"Player" text,"Team" text,"Position" text,"School" text) | SELECT COUNT("Pick") FROM table_13937 WHERE "Team" = 'seattle mariners' |
what is the gender of patient name paul edwards? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT demographic.gender FROM demographic WHERE demographic.name = "Paul Edwards" |
in what year was galen r. clagett first elected into the western maryland delegation ? | CREATE TABLE table_203_247 (id number,"district" text,"counties represented" text,"delegate" text,"party" text,"first elected" number,"committee" text) | SELECT "first elected" FROM table_203_247 WHERE "delegate" = 'galen r. clagett' |
what's the name of the procedure that patient 5866 was given two or more times until 16 months ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 586... |
Who drove the fastest lap for round 8? | CREATE TABLE table_1139087_2 (fastest_lap VARCHAR,rd VARCHAR) | SELECT fastest_lap FROM table_1139087_2 WHERE rd = 8 |
What is under segment C when s cuckoo clock is under segment B? | CREATE TABLE table_38029 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Segment C" FROM table_38029 WHERE "Segment B" = 's cuckoo clock' |
count the number of people that died after being diagnosed with hypovolemic shock - hemorrhagic within the same month since 2105. | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypovolemic shock - hemorrhagic') AS t1 GROUP BY t1.uniquepid HA... |
what is the name of the organism found in patient 031-16123's first microbiological nasopharynx test since 09/2104? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND STRFTIME('%y-%m... |
what are the five most commonly ordered procedures for patients who have been diagnosed with stroke - hemorrhagic stroke previously within 2 months a year before? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'stroke - hemorrhagic stroke' AND DATETIM... |
Which Player plays Guard-Forward Position for School/Club Team Pepperdine? | CREATE TABLE table_40969 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "Player" FROM table_40969 WHERE "Position" = 'guard-forward' AND "School/Club Team" = 'pepperdine' |
Please show the trend of the number of the church by open date (bin into the year) using a line chart, and I want to rank x axis from low to high order. | CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text)CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int) | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date |
Name the february | CREATE TABLE table_20050 ("2000 :" text,"January" text,"February" text,"March" text,"April" text,"May" text,"June" text,"July" text,"August" text,"September" text,"October" text,"November" text,"December" text) | SELECT "February" FROM table_20050 |
how many patient are with widowed marital status and lab test fluid ascites? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Ascites" |
WHERE filtering with dates and not times. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ... | SELECT * FROM dbo.Users WHERE CreationDate = '2016/04/01' |
What was the rainfall by volume in Huetar Atlantico where the rainfall depth (mm/year) was 3527? | CREATE TABLE table_25983027_1 (rainfall_by_volume__km_3__year_ VARCHAR,rainfall_by_depth__mm_year_ VARCHAR) | SELECT rainfall_by_volume__km_3__year_ FROM table_25983027_1 WHERE rainfall_by_depth__mm_year_ = 3527 |
How the question ratio of the lower and higher-rep users changed with the years. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,Re... | WITH Raw AS (SELECT FLOOR(LN(Users.Reputation) / LN('##LogBase:float?5##')) AS LogRep, TIME_TO_STR(Posts.CreationDate, '%Y') AS "year", Posts.PostTypeId FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.PostTypeId IN (1, 2) AND Users.Id >= 1) SELECT DATEFROMPARTS('year', 1, 1) AS "year", 'Rep between ' + C... |
Find the least value of attendance? | CREATE TABLE table_14656147_2 (attendance INTEGER) | SELECT MIN(attendance) FROM table_14656147_2 |
What the title of the song when the result is to the live shows? | CREATE TABLE table_31211 ("Episode" text,"Theme / Date" text,"Song title" text,"Original performer" text,"Result (Placement)" text) | SELECT "Song title" FROM table_31211 WHERE "Result (Placement)" = 'to the Live Shows' |
what is the maximum daily number of patients who suffer from obs chr bronc w(ac) exac until 3 years ago? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obs chr bronc w(ac) exac') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year'... |
Who is riding the Ducati 999 RS in Round 7? | CREATE TABLE table_4680 ("Team" text,"Constructor" text,"Motorcycle" text,"Rider" text,"Rounds" text) | SELECT "Rider" FROM table_4680 WHERE "Rounds" = '7' AND "Motorcycle" = 'ducati 999 rs' |
What is the Date for Catalog of lp 5060? | CREATE TABLE table_name_65 (date VARCHAR,catalog VARCHAR) | SELECT date FROM table_name_65 WHERE catalog = "lp 5060" |
What is the transaction type that has processed the greatest total amount in transactions? | CREATE TABLE Financial_transactions (transaction_type VARCHAR,transaction_amount INTEGER) | SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.