instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
WHAT IS THE TEAM WITH ATTENDANCE AT TARGET CENTER 11,921? | CREATE TABLE table_48581 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_48581 WHERE "Location Attendance" = 'target center 11,921' |
Please use a bar chart to compare the number of customers of each customer's move in date. | CREATE TABLE Customer_Event_Notes (Customer_Event_Note_ID INTEGER,Customer_Event_ID INTEGER,service_type_code CHAR(15),resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME)CREATE TABLE Properties (property_id INTEGER,property_type_code CHAR(15),property_address VARCHAR(255),other_details VARCHAR(255))CREATE T... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in |
Which bronze has a Nation of poland? | CREATE TABLE table_70666 ("Rank" text,"Nation" text,"Gold" text,"Silver" text,"Bronze" text,"Total" text) | SELECT "Bronze" FROM table_70666 WHERE "Nation" = 'poland' |
Which Sub-Parish (Sogn) is in the Parish (Prestegjeld) of hafslo parish and has a church called Hafslo Kyrkje? | CREATE TABLE table_59787 ("Parish (Prestegjeld)" text,"Sub-Parish (Sogn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text) | SELECT "Sub-Parish (Sogn)" FROM table_59787 WHERE "Parish (Prestegjeld)" = 'hafslo parish' AND "Church Name" = 'hafslo kyrkje' |
i need the cheapest direct flight from ATLANTA to DENVER leaving on 5 7 | CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE code_description (code varc... | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, ... |
Plot the total number by grouped by directed by as a bar graph, and I want to rank by the bars in ascending please. | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod... | SELECT Directed_by, COUNT(*) FROM film GROUP BY Directed_by ORDER BY Directed_by |
What is the number of the player who went to Southern University? | CREATE TABLE table_72222 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"Years for Rockets" text,"School/Club Team/Country" text) | SELECT "No.(s)" FROM table_72222 WHERE "School/Club Team/Country" = 'Southern University' |
Show me a bar chart for what are the ids and details of events that have more than one participants? | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details |
Which Gold is the lowest one that has a Bronze of 14, and a Total larger than 42? | CREATE TABLE table_name_47 (gold INTEGER,bronze VARCHAR,total VARCHAR) | SELECT MIN(gold) FROM table_name_47 WHERE bronze = 14 AND total > 42 |
What is the Set 1 when the date is 08 jul, and a Set 2 of 25 21? | CREATE TABLE table_6786 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Total" text,"Report" text) | SELECT "Set 1" FROM table_6786 WHERE "Date" = '08 jul' AND "Set 2" = '25–21' |
What was the date of the game that had a loss of Burns (0-1)? | CREATE TABLE table_name_85 (date VARCHAR,loss VARCHAR) | SELECT date FROM table_name_85 WHERE loss = "burns (0-1)" |
What is the 2012 Employees (Total) when the rank (2012) is 7? | CREATE TABLE table_name_63 (rank__2012_ VARCHAR) | SELECT 2012 AS _employees__total_ FROM table_name_63 WHERE rank__2012_ = 7 |
please list the AA flights from HOUSTON to MILWAUKEE | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE code_description (code varchar,descr... | 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOU... |
What is the PEPE Michinoku value for a Ryuji Hijikata value of sabin (12:33)? | CREATE TABLE table_55063 ("Block A" text,"Ryuji Hijikata" text,"Shuji Kondo" text,"El NOSAWA Mendoza" text,"PEPE Michinoku" text,"Katsuhiko Nakajima" text) | SELECT "PEPE Michinoku" FROM table_55063 WHERE "Ryuji Hijikata" = 'sabin (12:33)' |
WHAT IS THE LOWEST MONEY WITH TO PAR LARGER THAN 26? | CREATE TABLE table_name_1 (money___ INTEGER,to_par INTEGER) | SELECT MIN(money___) AS $__ FROM table_name_1 WHERE to_par > 26 |
Show all majors and corresponding number of students. | CREATE TABLE Student (major VARCHAR) | SELECT major, COUNT(*) FROM Student GROUP BY major |
All Posts and answers with less then 300 characters after 5/10/2015. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT Id, CreationDate, ParentId, PostTypeId, Body FROM Posts AS p WHERE LENGTH(Body) <= 300 AND p.CreationDate > '2015-05-10' |
how many patients with quantitative g6pd lab test were admitted in the hospital for more than 16 days? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.label = "Quantitative G6PD" |
on the first intensive care unit visit, when was the last time that patient 021-198501 had a output y (ml)-chest tube y - a #1 right lateral b #4 left lateral output? | 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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-198501') AND NOT patient.unitdischargetime IS NUL... |
What Nationality is the Pick that is 116? | CREATE TABLE table_6617 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"School/Club Team" text) | SELECT "Nationality" FROM table_6617 WHERE "Pick" = '116' |
HOW MANY PLAYERS PLAY FOR OREGON? | CREATE TABLE table_11677691_2 (player VARCHAR,college VARCHAR) | SELECT COUNT(player) FROM table_11677691_2 WHERE college = "Oregon" |
How many enrolment students in each day? Return a bar chart binning date of enrolment by weekday, and list y axis from low to high order. | CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) |
what is the last red blood cells in patient 14467 this month? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locatio... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND DATETIME(labevents.charttime, 'start of month') = DATETIME... |
What is the highest Money ( $ ), when To Par is less than 2? | CREATE TABLE table_49093 ("Place" text,"Player" text,"Country" text,"Score" text,"To Par" real,"Money ($)" real) | SELECT MAX("Money ( $ )") FROM table_49093 WHERE "To Par" < '2' |
give me the number of patients on main type of drug prescription who have diagnoses icd9 code v4962. | 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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V4962" AND prescriptions.drug_type = "MAIN" |
I want the score for 23 july 1992 | CREATE TABLE table_51849 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Score" FROM table_51849 WHERE "Date" = '23 july 1992' |
How many females speak Ukrainian? | CREATE TABLE table_67373 ("Language" text,"Number" text,"percentage (%)" text,"males" text,"females" text) | SELECT "females" FROM table_67373 WHERE "Language" = 'ukrainian' |
Find the name of the courses that do not have any prerequisite? | CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABL... | SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq) |
Who won Bronze with Notes of 2.5km, 16controls? | CREATE TABLE table_name_31 (bronze VARCHAR,notes VARCHAR) | SELECT bronze FROM table_name_31 WHERE notes = "2.5km, 16controls" |
How many players named victor h nescu played? | CREATE TABLE table_26846 ("Seed" real,"Rank" real,"Player" text,"Points" real,"Points defending" text,"Points won" real,"New points" real,"Status" text) | SELECT COUNT("Points won") FROM table_26846 WHERE "Player" = 'Victor Hănescu' |
What Country's ICAO is VOTR? | CREATE TABLE table_45563 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "Country" FROM table_45563 WHERE "ICAO" = 'votr' |
What was the score in the episode that had Louie Spence and Joe Wilkinson on Sean's team? | CREATE TABLE table_23292220_13 (scores VARCHAR,seans_team VARCHAR) | SELECT scores FROM table_23292220_13 WHERE seans_team = "Louie Spence and Joe Wilkinson" |
What is the value of vinculum for parentheses of 0.(6)? | CREATE TABLE table_36625 ("Fraction" text,"Ellipsis" text,"Vinculum" text,"Dots" text,"Parentheses" text) | SELECT "Vinculum" FROM table_36625 WHERE "Parentheses" = '0.(6)' |
Who was responsible for the land of the biggest fire in Oregon in 2015? | CREATE TABLE fires (fire_year number,discovery_date number,discovery_doy number,discovery_time text,stat_cause_code number,stat_cause_descr text,cont_date text,cont_doy text,cont_time text,fire_size number,fire_size_class text,latitude number,longitude number,owner_code number,owner_descr text,state text,county text,fi... | SELECT owner_descr FROM fires WHERE state = "OR" AND fire_year = 2015 ORDER BY fire_size DESC LIMIT 1 |
What is the title of the track after 11? | CREATE TABLE table_name_93 (title VARCHAR,track INTEGER) | SELECT title FROM table_name_93 WHERE track > 11 |
Show the city and the number of branches opened before 2010 for each city. | CREATE TABLE branch (city VARCHAR,open_year INTEGER) | SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city |
Show the price of each product supplied by supplier id 3 in a bar chart, and list from low to high by the y axis. | CREATE TABLE Department_Store_Chain (dept_store_chain_id INTEGER,dept_store_chain_name VARCHAR(80))CREATE TABLE Staff (staff_id INTEGER,staff_gender VARCHAR(1),staff_name VARCHAR(80))CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount... | SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 ORDER BY product_price |
Which tournament's 2001 and 2006s were a? | CREATE TABLE table_name_25 (tournament VARCHAR) | SELECT tournament FROM table_name_25 WHERE 2001 = "a" AND 2006 = "a" |
provide the number of patients whose diagnoses long title is hypovolemia and lab test category is chemistry? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypovolemia" AND lab."CATEGORY" = "Chemistry" |
What is the race class with most number of races. | CREATE TABLE race (race_id number,name text,class text,date text,track_id text)CREATE TABLE track (track_id number,name text,location text,seating number,year_opened number) | SELECT class FROM race GROUP BY class ORDER BY COUNT(*) DESC LIMIT 1 |
How many Copy Editor/Strunk & White-qualifying edits have I made?. Counts the number of title and/or body revisions you've made
on other people's non-deleted posts. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,Is... | SELECT * FROM PostHistoryTypes |
when is the first time patient 006-254182 was prescribed a medication via inpl route until 15 months ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numb... | SELECT 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 = '006-254182')) AND medication.routeadmin = 'inpl' AND DATETIME(... |
how many times was the candidates phil crane (r) 58.0% edward a. warman (d) 42.0%? | CREATE TABLE table_1341718_14 (incumbent VARCHAR,candidates VARCHAR) | SELECT COUNT(incumbent) FROM table_1341718_14 WHERE candidates = "Phil Crane (R) 58.0% Edward A. Warman (D) 42.0%" |
when did patient 65759 first get prescribed a drug since 01/2103? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,ite... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65759) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-01' ORDER BY prescriptions.startdate LIMIT 1 |
Find the number of distinct courses that have enrolled students. | CREATE TABLE courses (course_id number,author_id number,subject_id number,course_name text,course_description text)CREATE TABLE subjects (subject_id number,subject_name text)CREATE TABLE student_course_enrolment (registration_id number,student_id number,course_id number,date_of_enrolment time,date_of_completion time)CR... | SELECT COUNT(course_id) FROM student_course_enrolment |
who came to power after the rule of james iii ? | CREATE TABLE table_203_876 (id number,"name" text,"birth" text,"marriages" text,"death" text) | SELECT "name" FROM table_203_876 WHERE id > (SELECT id FROM table_203_876 WHERE "name" = 'james iii') LIMIT 1 |
When james seaton is the incumbent what is the reason? | CREATE TABLE table_28898974_3 (reason VARCHAR,incumbent VARCHAR) | SELECT reason FROM table_28898974_3 WHERE incumbent = "James Seaton" |
when was the last time patient 031-4423 had had an intake on 07/07/last year? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultur... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) AND intakeoutput.cellpath LIKE '%intake%'... |
What were the highest points before the year 1974? | CREATE TABLE table_name_61 (points INTEGER,year INTEGER) | SELECT MAX(points) FROM table_name_61 WHERE year < 1974 |
What is the 2010 with a qf in 2011? | CREATE TABLE table_61843 ("Tournament" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text) | SELECT "2010" FROM table_61843 WHERE "2011" = 'qf' |
How many times is the series italian and the circuit is valencia? | CREATE TABLE table_3676 ("Round" real,"Circuit" text,"Series" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT COUNT("Round") FROM table_3676 WHERE "Series" = 'Italian' AND "Circuit" = 'Valencia' |
How many posts did users with <50 rep post per day. Returns the number of posts per day for the last ##NumberOfDays## | 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 Users (Id number,Reputation number,CreationDate... | SELECT DAY(Posts.CreationDate), COUNT(Posts.Id) FROM Posts INNER JOIN Users AS u ON u.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 2 AND u.Reputation < 50 AND DATEDIFF(day, Posts.CreationDate, CURRENT_TIMESTAMP()) <= '##NumberOfDays##' GROUP BY DAY(Posts.CreationDate) |
What national cup has fc barcelona? | CREATE TABLE table_55083 ("Season" text,"Club" text,"National League" text,"National Cup" text,"European Cup" text) | SELECT "National Cup" FROM table_55083 WHERE "Club" = 'fc barcelona' |
Draw a scatterplot of school id vs all_games_percent where school id is on the x-axis and points are colored by All_Home | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Home |
Which rating larger than 5 have the lowest amount of views in #3 rank with a share of 9? | CREATE TABLE table_name_11 (viewers__millions_ INTEGER,rating VARCHAR,weekly_rank VARCHAR,share VARCHAR) | SELECT MIN(viewers__millions_) FROM table_name_11 WHERE weekly_rank = "#3" AND share = 9 AND rating > 5 |
until 4 years ago has patient 13473 received any medication? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TA... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') |
Are there PEDDENT courses that are 8 credit ? | 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 DISTINCT name, number FROM course WHERE department = 'PEDDENT' AND credits = 8 |
What were the bleeding times when both the platelet count was unaffected and the partial thromboplastin time was unaffected | CREATE TABLE table_16421 ("Condition" text,"Prothrombin time" text,"Partial thromboplastin time" text,"Bleeding time" text,"Platelet count" text) | SELECT "Bleeding time" FROM table_16421 WHERE "Partial thromboplastin time" = 'Unaffected' AND "Platelet count" = 'Unaffected' |
Number of posts in Stack Overflow that are over the 30k soft character limit. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT p.Id AS "post_link", (CASE WHEN p.PostTypeId = 1 THEN 'Q' ELSE 'A' END) AS Type, p.Id, LENGTH(p.Body) AS HtmlSize, LENGTH(ph.Text) AS MarkdownSize, p.CreationDate, ph.CreationDate AS LatestRevisionDate FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id LEFT OUTER JOIN PostHistory AS phb ON phb.Post... |
How many teams had gary megson as an incoming manager | CREATE TABLE table_26914759_3 (position_in_table VARCHAR,incoming_manager VARCHAR) | SELECT COUNT(position_in_table) FROM table_26914759_3 WHERE incoming_manager = "Gary Megson" |
Low quality, low hanging fruit questions. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu... | SELECT * FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.Score = 0 AND Posts.AnswerCount > 5 AND Posts.ParentId IS NULL AND Posts.AcceptedAnswerId IS NULL AND Users.LastAccessDate < DATEADD(year, -2, GETDATE()) |
What's the team's status in the Open Cup in 2006? | CREATE TABLE table_2187 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text) | SELECT "Open Cup" FROM table_2187 WHERE "Year" = '2006' |
known neutropenia, defined as < 1000 neutrophils / ml; | CREATE TABLE table_test_22 ("id" int,"ejection_fraction_ef" int,"pregnancy_or_lactation" bool,"child_pugh_class" string,"hbv" bool,"systolic_blood_pressure_sbp" int,"active_infection" bool,"leukocyte_count" int,"hiv_infection" bool,"left_ventricular_dysfunction" bool,"active_inflammatory_diseases" bool,"hcv" bool,"neut... | SELECT * FROM table_test_22 WHERE neutropenia = 1 OR neutrophil_count < 1000 |
What is the call sign when the frequency is less than 95.5 MHz, and a ERP W is higher than 10? | CREATE TABLE table_name_16 (call_sign VARCHAR,frequency_mhz VARCHAR,erp_w VARCHAR) | SELECT call_sign FROM table_name_16 WHERE frequency_mhz < 95.5 AND erp_w > 10 |
What is the name of the player with less than 2 wins? | CREATE TABLE table_name_24 (player VARCHAR,wins INTEGER) | SELECT player FROM table_name_24 WHERE wins < 2 |
What is the name of Rhode Island College's softball stadium? | CREATE TABLE table_1974545_3 (softball_stadium VARCHAR,school VARCHAR) | SELECT softball_stadium FROM table_1974545_3 WHERE school = "Rhode Island College" |
Number of answers per user. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDi... | SELECT TOP(5000) AS owneruserid, COUNT(*) AS answer_count FROM Posts WHERE PostTypeId = 2 GROUP BY OwnerUserId ORDER BY answer_count DESC |
What are good classes to take before enrolling in BIOMEDE 580 ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'BIOMEDE' AND number = 580 |
how many drugs were prescribed until 4 years ago for patient 025-50079? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosi... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50079')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME()... |
what is the only cruise ship listed ? | CREATE TABLE table_203_547 (id number,"ship" text,"built" number,"in service for cunard" text,"type" text,"tonnage" text,"notes" text) | SELECT "ship" FROM table_203_547 WHERE "type" = 'cruise' |
count the number of patients that have been diagnosed with k. pneumoniae pneumonia but did not return to the hospital within 2 months in 2100. | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'k. pneumon... |
Tell me the sum of rank for when gold is more than 0 and silver less than 23 with total more than 32 | CREATE TABLE table_55257 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Rank") FROM table_55257 WHERE "Gold" > '0' AND "Total" > '32' AND "Silver" < '23' |
did patient 022-3713 get the vasodilating agent - iv - nitroprusside since 2105? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid num... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-3713')) AND treatment.treatmentname = 'vasodilating agent - iv - nitropr... |
What is the total number of Matches, when Clubs is 588 406? | CREATE TABLE table_40198 ("Round" text,"Date" text,"Matches" real,"Clubs" text,"Prize money" text) | SELECT COUNT("Matches") FROM table_40198 WHERE "Clubs" = '588 → 406' |
How many Episode Counts have an Actor of liz carr? | CREATE TABLE table_name_13 (episode_count VARCHAR,actor VARCHAR) | SELECT COUNT(episode_count) FROM table_name_13 WHERE actor = "liz carr" |
Which Competition has a Year larger than 1990 in seville , spain? | CREATE TABLE table_name_5 (competition VARCHAR,year VARCHAR,venue VARCHAR) | SELECT competition FROM table_name_5 WHERE year > 1990 AND venue = "seville , spain" |
Which film was released in the year 2002? | CREATE TABLE table_11732 ("Year" real,"Film name" text,"Co-singer" text,"Music director" text,"Lyricist" text) | SELECT "Film name" FROM table_11732 WHERE "Year" = '2002' |
What rank does Tricia Flores have? | CREATE TABLE table_name_22 (rank VARCHAR,name VARCHAR) | SELECT rank FROM table_name_22 WHERE name = "tricia flores" |
Name the outcome for opponent of micha lla krajicek eleni daniilidou | CREATE TABLE table_name_98 (outcome VARCHAR,opponent VARCHAR) | SELECT outcome FROM table_name_98 WHERE opponent = "michaëlla krajicek eleni daniilidou" |
how many times was the rosemont convention center used ? | CREATE TABLE table_204_823 (id number,"dates" text,"location" text,"attendance" text,"official guests" text,"notes" text) | SELECT COUNT(*) FROM table_204_823 WHERE "location" = 'rosemont convention center' |
how many male patients had the diagnoses titled pseudomonas infect nos? | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Pseudomonas infect NOS" |
A bar chart for showing the number of the names of editors that are on the committee of journals with sales bigger than 3000. | CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text) | SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name |
What was the Christ made king date with a great tribulation in 1925? | CREATE TABLE table_7477 ("LastDays begin" text,"Startof Christ's Presence" text,"Christ madeKing" text,"Resurrection of144,000" text,"Judgmentof Religion" text,"Separating Sheep &Goats" text,"Great Tribulation" text) | SELECT "Christ madeKing" FROM table_7477 WHERE "Great Tribulation" = '1925' |
What was the record on January 4? | CREATE TABLE table_45764 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text) | SELECT "Record" FROM table_45764 WHERE "Date" = 'january 4' |
how many times was jan steytler the party leader ? | CREATE TABLE table_204_690 (id number,"election" number,"party name" text,"total votes" number,"share of votes" text,"seats" number,"share of seats" text,"party leader(s)" text,"notes" text) | SELECT COUNT(*) FROM table_204_690 WHERE "party leader(s)" = 'jan steytler' |
When the Away team score equaled 15.20 (110) what was the Date of the game? | CREATE TABLE table_57747 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_57747 WHERE "Away team score" = '15.20 (110)' |
What's the type of muzzle devices on the models with round hand guards? | CREATE TABLE table_72337 ("Colt model no." text,"Name" text,"Stock" text,"Fire control" text,"Rear sight" text,"Forward assist" text,"Case deflector" text,"Barrel length" text,"Barrel profile" text,"Barrel twist" text,"Hand guards" text,"Bayonet Lug" text,"Muzzle device" text) | SELECT "Muzzle device" FROM table_72337 WHERE "Hand guards" = 'Round' |
What is the Date with an Away that is central blues? | CREATE TABLE table_name_15 (date VARCHAR,away VARCHAR) | SELECT date FROM table_name_15 WHERE away = "central blues" |
Which higher harmonics have a speed of 0.0821373? | CREATE TABLE table_name_36 (higher_harmonics VARCHAR,speed VARCHAR) | SELECT higher_harmonics FROM table_name_36 WHERE speed = "0.0821373" |
The lowest rank with 2011 less than 80.7 and 2012 less than 73.1 is what? | CREATE TABLE table_5614 ("Rank" real,"Airline" text,"2012" real,"2011" real,"2010" real,"2009" real) | SELECT MIN("Rank") FROM table_5614 WHERE "2011" < '80.7' AND "2012" < '73.1' |
When was the rate for 16-17 year olds 3.40? | CREATE TABLE table_54908 ("From" text,"Adult Rate" text,"Development Rate" text,"16-17 Year Olds Rate" text,"Apprentice Rate" text) | SELECT "From" FROM table_54908 WHERE "16-17 Year Olds Rate" = '£3.40' |
How many rooms are there? | CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text)CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number) | SELECT COUNT(*) FROM rooms |
Name the date with score of 9-2 | CREATE TABLE table_name_49 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_49 WHERE score = "9-2" |
What is the biggended for 1947? | CREATE TABLE table_17704 ("Year" real,"Total Region" real,"Biggenden" real,"Eidsvold" real,"Gayndah" real,"Monto" real,"Mundubbera" real,"Perry" real) | SELECT MAX("Biggenden") FROM table_17704 WHERE "Year" = '1947' |
Which locations contains both shops that opened after the year 2012 and shops that opened before 2008? | CREATE TABLE shop (shop_id number,shop_name text,location text,open_date text,open_year number)CREATE TABLE device (device_id number,device text,carrier text,package_version text,applications text,software_platform text)CREATE TABLE stock (shop_id number,device_id number,quantity number) | SELECT location FROM shop WHERE open_year > 2012 INTERSECT SELECT location FROM shop WHERE open_year < 2008 |
What is the year average when not free was the status, and less than 7 was the civil liberties, and less than 6 political rights? | CREATE TABLE table_64292 ("Year" real,"Political Rights" real,"Civil Liberties" real,"Status" text,"President" text) | SELECT AVG("Year") FROM table_64292 WHERE "Status" = 'not free' AND "Civil Liberties" < '7' AND "Political Rights" < '6' |
what was the total time by france ? | CREATE TABLE table_203_160 (id number,"rank" number,"heat" number,"nation" text,"competitors" text,"time" text,"notes" text) | SELECT "time" FROM table_203_160 WHERE "nation" = 'france' |
How many tries for does the team with 263 points against have? | CREATE TABLE table_name_13 (tries_for VARCHAR,points_against VARCHAR) | SELECT tries_for FROM table_name_13 WHERE points_against = "263" |
Get list of prospective answerers for a set of 3 Tags : Before a certain Post's CreationDate. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,... | SELECT ParentId, Id, OwnerUserId FROM Posts WHERE ParentId IN (SELECT PostId FROM PostTags WHERE TagId = '5990' INTERSECT SELECT PostId FROM PostTags WHERE TagId = '16' INTERSECT SELECT PostId FROM PostTags WHERE TagId = '12408') AND CreationDate < (SELECT CreationDate FROM Posts WHERE Id = '9299346') ORDER BY ParentId |
How many touchdowns did the player with 10 points have? | CREATE TABLE table_28071 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT MIN("Touchdowns") FROM table_28071 WHERE "Points" = '10' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.