instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the date when France is the opposing team? | CREATE TABLE table_12574 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Date" FROM table_12574 WHERE "Opposing Teams" = 'france' |
WHAT IS THE RATING THAT HAD A SHARE SMALLER THAN 4, AND 2.47 MILLION VIEWERS? | CREATE TABLE table_name_70 (rating VARCHAR,share VARCHAR,viewers__millions_ VARCHAR) | SELECT COUNT(rating) FROM table_name_70 WHERE share < 4 AND viewers__millions_ > 2.47 |
which week has the same kickoff time as week 6 ? | CREATE TABLE table_204_123 (id number,"week" number,"date" text,"kickoff" text,"opponent" text,"results\nfinal score" text,"results\nteam record" text,"game site" text,"attendance" number) | SELECT "week" FROM table_204_123 WHERE "week" <> 6 AND "kickoff" = (SELECT "kickoff" FROM table_204_123 WHERE "week" = 6) |
When did the institution located in Lewiston, Maine join the conference? | CREATE TABLE table_28400 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Founding Religious Affiliation" text,"Enrollment" real,"Joined" real) | SELECT "Joined" FROM table_28400 WHERE "Location" = 'Lewiston, Maine' |
How many people live where there are 118% of people have phones? | CREATE TABLE table_7326 ("Country or region" text,"Number of mobile phones" text,"Population" text,"# of phones as % of population" real,"Last updated date" text) | SELECT "Population" FROM table_7326 WHERE "# of phones as % of population" = '118' |
get last flight from OAKLAND to SALT LAKE CITY on wednesday | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE dual_carrier (ma... | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 23 AND DATE_DAYalias1.month_number = 4 AND DATE_DAYalias1.year = 1991)) AND to... |
What is the class of the locomotive with an Eastleigh Works manufacturer, made in 1914, and withdrawn in 1959? | CREATE TABLE table_54949 ("Class" text,"Wheel arrangement" text,"Fleet number(s)" text,"Manufacturer" text,"Year made" text,"Quantity made" text,"Quantity preserved" text,"Year(s) withdrawn" text) | SELECT "Class" FROM table_54949 WHERE "Manufacturer" = 'eastleigh works' AND "Year made" = '1914' AND "Year(s) withdrawn" = '1959' |
What date was the circuit, snetterton, when riki christodoulou had the fastest lap? | CREATE TABLE table_65623 ("Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text) | SELECT "Date" FROM table_65623 WHERE "Circuit" = 'snetterton' AND "Fastest Lap" = 'riki christodoulou' |
what is the number of laps when the driver is ron flockhart? | CREATE TABLE table_name_5 (laps VARCHAR,driver VARCHAR) | SELECT COUNT(laps) FROM table_name_5 WHERE driver = "ron flockhart" |
What are the numbers of the players currently playing for Ironi Nahariya? | CREATE TABLE table_12962773_2 (no VARCHAR,current_club VARCHAR) | SELECT no FROM table_12962773_2 WHERE current_club = "Ironi Nahariya" |
what is the number of patients whose year of birth is less than 2117 and item id is 51176? | 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.dob_year < "2117" AND lab.itemid = "51176" |
What NHL team was the player from Calgary Centennials (WCHL) drafted for? | CREATE TABLE table_1965650_11 (nhl_team VARCHAR,college_junior_club_team VARCHAR) | SELECT nhl_team FROM table_1965650_11 WHERE college_junior_club_team = "Calgary Centennials (WCHL)" |
What shows for the League when the FA Cup is 6 (20)? | CREATE TABLE table_43300 ("Name" text,"Years" text,"League a" text,"FA Cup" text,"League Cup" text,"Other b" text,"Total" text) | SELECT "League a" FROM table_43300 WHERE "FA Cup" = '6 (20)' |
Name the most series number for giula sandler | CREATE TABLE table_20335 ("Season #" real,"Series #" real,"Title" text,"Director(s)" text,"Writer(s)" text,"Original airdate" text) | SELECT MAX("Series #") FROM table_20335 WHERE "Writer(s)" = 'Giula Sandler' |
Which episode had 2.75 million viewers in the U.S.? | CREATE TABLE table_73842 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Title" FROM table_73842 WHERE "U.S. viewers (million)" = '2.75' |
When did Orville H. Browning (r) succeed? | CREATE TABLE table_2417330_3 (date_of_successors_formal_installation VARCHAR,successor VARCHAR) | SELECT date_of_successors_formal_installation FROM table_2417330_3 WHERE successor = "Orville H. Browning (R)" |
Show me a bar chart that bin all date of transactions into the weekday interval and the y-axis is their total number, and order by the y-axis in desc. | CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY COUNT(date_of_transaction) DESC |
How many tries against did the club with 1 drawn and 41 points have? | CREATE TABLE table_80432 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Tries against" FROM table_80432 WHERE "Drawn" = '1' AND "Points" = '41' |
Who were the opponents during the 2006 fed cup europe/africa group ii against greece? | CREATE TABLE table_44336 ("Edition" text,"Round" text,"Date" text,"Partnering" text,"Against" text,"Surface" text,"Opponents" text,"Result" text) | SELECT "Opponents" FROM table_44336 WHERE "Edition" = '2006 fed cup europe/africa group ii' AND "Against" = 'greece' |
What are the notes for the athlete from Spain? | CREATE TABLE table_79567 ("Rank" real,"Athletes" text,"Country" text,"Time" text,"Notes" text) | SELECT "Notes" FROM table_79567 WHERE "Country" = 'spain' |
patient 15794 had any e24 with bp ng during this month? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)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,langua... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'e24 with... |
what was the last time that patient 027-153669 received a lab test in the last hospital encounter? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyst... | SELECT 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 = '027-153669' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital... |
What is the average Position, when Bike No is greater than 8, and when Points is less than 240? | CREATE TABLE table_name_16 (position INTEGER,bike_no VARCHAR,points VARCHAR) | SELECT AVG(position) FROM table_name_16 WHERE bike_no > 8 AND points < 240 |
Name the centennial for location | CREATE TABLE table_15977768_1 (centennial VARCHAR,information VARCHAR) | SELECT centennial FROM table_15977768_1 WHERE information = "Location" |
How long is track number 8? | CREATE TABLE table_17235 ("Disc" real,"Track" real,"English title" text,"Japanese title" text,"R\u014dmaji title" text,"Artist" text,"Track time" text) | SELECT "Track time" FROM table_17235 WHERE "Track" = '8' |
when this month patient 016-9636 received the sodium test for the last time? | 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 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 = '016-9636')) AND lab.labname = 'sodium' AND DATETIME(lab.labresulttime, 'start of mo... |
What's the rank for Daewoo Business Center when the notes are cancelled? | CREATE TABLE table_name_39 (rank VARCHAR,notes VARCHAR,name VARCHAR) | SELECT rank FROM table_name_39 WHERE notes = "cancelled" AND name = "daewoo business center" |
What year ranked larger than 5? | CREATE TABLE table_name_18 (year VARCHAR,rank INTEGER) | SELECT year FROM table_name_18 WHERE rank > 5 |
How many documents correspond with each project id? | CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE documents_with_expenses (document_id number,budget_type_code text,document_details text)CREATE TABLE statements (statement_id number,statem... | SELECT project_id, COUNT(*) FROM documents GROUP BY project_id |
What is the sum of 2007 when the 2009 is less than 7,006, and a 2008 larger than 2,226? | CREATE TABLE table_7096 ("million CZK" text,"2005" text,"2006" real,"2007" real,"2008" real,"2009" real) | SELECT SUM("2007") FROM table_7096 WHERE "2009" < '7,006' AND "2008" > '2,226' |
how many patients had the diagnosis icd9 code e8859 and drug type addictive? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT 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 = "E8859" AND prescriptions.drug_type = "ADDITIVE" |
Which Tags are most popular in Posts. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Review... | SELECT t.TagName, t.Count FROM Tags AS t ORDER BY t.Count DESC |
What was the record after the game in which Rosales (1-1) took the loss? | CREATE TABLE table_37731 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_37731 WHERE "Loss" = 'rosales (1-1)' |
How many Last wins have a Club of mansfield town, and Wins smaller than 1? | CREATE TABLE table_37595 ("Rank" real,"Club" text,"Wins" real,"Last win" real,"Runner-up" real,"Last losing final" text) | SELECT COUNT("Last win") FROM table_37595 WHERE "Club" = 'mansfield town' AND "Wins" < '1' |
for patients who were diagnosed until 2 years ago with hx-ven thrombosis/embols, what were the top five most common procedures that followed within 2 months? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... |
Is GREEK 441 section 825 provided in the Winter 2007 semester ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)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_... | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.section_number = 825 AND course.department = 'GREEK' AND course.number = 441 AND semester.semester = 'Winter' AND semest... |
Find the name of the person who has friends with age above 40 and under age 30? | CREATE TABLE PersonFriend (name VARCHAR,friend VARCHAR)CREATE TABLE Person (name VARCHAR,age INTEGER) | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) |
What are the most goals listed when Jack Trehey was the player, with the listed debut year of 1902, games less than 1? | CREATE TABLE table_name_29 (goals INTEGER,games VARCHAR,debut_year VARCHAR,player VARCHAR) | SELECT MAX(goals) FROM table_name_29 WHERE debut_year = 1902 AND player = "jack trehey" AND games < 1 |
Questions counted by time to first answer (w/o 24 hr restriction). | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId... | SELECT LOG(10, CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT)) AS "Log Time (m)", LOG(10, COUNT(*)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id LEFT OUTER JOIN Posts AS a2 ON a.ParentId = a2.ParentId AND a.CreationDate > a2.CreationDate WHERE a2.Id IS NULL AND a.CreationDate ... |
How many opponents were there with the record of 3-2-2? | CREATE TABLE table_25946 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT COUNT("Opponent") FROM table_25946 WHERE "Record" = '3-2-2' |
Which record has 64,053 as the attendance? | CREATE TABLE table_name_51 (record VARCHAR,attendance VARCHAR) | SELECT record FROM table_name_51 WHERE attendance = "64,053" |
What venue has 2 as the rank? | CREATE TABLE table_name_75 (venue VARCHAR,rank VARCHAR) | SELECT venue FROM table_name_75 WHERE rank = "2" |
How many people attended the Scottish Cup on 29.02.2000? | CREATE TABLE table_64326 ("Season" text,"Date" text,"Venue" text,"Competition" text,"Score" text,"Attendance" real,"Report" text) | SELECT "Attendance" FROM table_64326 WHERE "Competition" = 'scottish cup' AND "Date" = '29.02.2000' |
What was the maximum burglary statistics if the property crimes is 168630? | CREATE TABLE table_26060884_2 (burglary INTEGER,property_crimes VARCHAR) | SELECT MAX(burglary) FROM table_26060884_2 WHERE property_crimes = 168630 |
Give the proportion of what is the average price for each type of product? | CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(10),product_name VARCHAR(80),product_price DECIMAL(19,4))CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Suppliers (supplier_id INTEGER,supplier_name VARCHAR(80),supplier_phone VARCHAR(80))CREATE TABLE Department_St... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code |
current drug or alcohol abuse ( regular alcohol intake > 14 units / week ) | CREATE TABLE table_train_186 ("id" int,"language" string,"diabetic" string,"regular_alcohol_intake" int,"allergy_to_drug" bool,"alcohol_abuse" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_186 WHERE alcohol_abuse = 1 OR regular_alcohol_intake > 14 |
List the names of editors that are not on any journal committee. | CREATE TABLE journal_committee (editor_id number,journal_id number,work_type text)CREATE TABLE journal (journal_id number,date text,theme text,sales number)CREATE TABLE editor (editor_id number,name text,age number) | SELECT name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee) |
Show names of musicals which have at least three actors. | CREATE TABLE musical (Name VARCHAR,Musical_ID VARCHAR)CREATE TABLE actor (Musical_ID VARCHAR) | SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3 |
give me the number of patients whose drug type is main and lab test name is glucose, body fluid? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Glucose, Body Fluid" |
when was the first intake of patient 004-13127 in yesterday? | 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 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 = '004-13127')) AND intakeoutput.cellpath LIKE '%intake%... |
Tell me the tournament with a hard surface for 6 1, 6 2 | CREATE TABLE table_name_99 (tournament VARCHAR,surface VARCHAR,score VARCHAR) | SELECT tournament FROM table_name_99 WHERE surface = "hard" AND score = "6–1, 6–2" |
Do all upper-level classes contain exams ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' |
who is the auther when the transliteration is lasha-giorgis droindeli matiane? | CREATE TABLE table_22464685_1 (author VARCHAR,transliteration VARCHAR) | SELECT author FROM table_22464685_1 WHERE transliteration = "lasha-giorgis droindeli matiane" |
What is Grupo Capitol Valladolid's highest rank with more than 34 games? | CREATE TABLE table_name_99 (rank INTEGER,team VARCHAR,games VARCHAR) | SELECT MAX(rank) FROM table_name_99 WHERE team = "grupo capitol valladolid" AND games > 34 |
What is the event name with the number 8M? | CREATE TABLE table_22050544_4 (event VARCHAR,event__number VARCHAR) | SELECT event FROM table_22050544_4 WHERE event__number = "8M" |
What is the cons for lib dem of 8% and a lead of 27% | CREATE TABLE table_78204 ("Date(s) conducted" text,"Polling organisation/client" text,"Cons" text,"Plaid Cymru" text,"Lib Dem" text,"Others" text,"Lead" text) | SELECT "Cons" FROM table_78204 WHERE "Lib Dem" = '8%' AND "Lead" = '27%' |
What episode number has 2j5352 as a production code? | CREATE TABLE table_3101 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "No." FROM table_3101 WHERE "Production code" = '2J5352' |
provide the number of patients whose discharge location is rehab/distinct part hosp and lab test name is alkaline phosphatase? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Alkaline Phosphatase" |
What is the sum of the distances in 2nd for ranks higher than 4 and distance for 1st less than 111.5? | CREATE TABLE table_39437 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" real,"2nd (m)" real,"Points" real,"Overall NT points" text,"Overall WC points (Rank)" text) | SELECT SUM("2nd (m)") FROM table_39437 WHERE "Rank" > '4' AND "1st (m)" < '111.5' |
What school does Wayne Cooper play for? | CREATE TABLE table_name_76 (school_club_team VARCHAR,player VARCHAR) | SELECT school_club_team FROM table_name_76 WHERE player = "wayne cooper" |
What was the aggregate score for Montauban? | CREATE TABLE table_30160 ("Proceed to Quarter-final" text,"Match points" text,"Aggregate score" text,"Points margin" real,"Eliminated from competition" text) | SELECT "Aggregate score" FROM table_30160 WHERE "Proceed to Quarter-final" = 'Montauban' |
When did sony music direct a label? | CREATE TABLE table_name_60 (date VARCHAR,label VARCHAR) | SELECT date FROM table_name_60 WHERE label = "sony music direct" |
What are the ids and details of all statements? | CREATE TABLE documents_with_expenses (document_id number,budget_type_code text,document_details text)CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE ref_document_types (document_type_code... | SELECT statement_id, statement_details FROM statements |
Which season with 16 races had less than 321 points and a larger percent than 65.78 possible? | CREATE TABLE table_6454 ("Driver" text,"Points" real,"Season" text,"Races" real,"Percentage of possible points" real) | SELECT "Season" FROM table_6454 WHERE "Points" < '321' AND "Percentage of possible points" > '65.78' AND "Races" = '16' |
Metrics - Users - Accumulated PU Ratio by Quarter. | 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 r AS Registrated, COUNT(1) AS Users, SUM(s) AS Writers, ROUND(SUM(s) * 100.0 / COUNT(1), 2) AS "writers_%" FROM (SELECT u.Id, (CASE WHEN SUM(CASE WHEN p.PostTypeId = 2 AND (p.Score >= @minVote) THEN 1 ELSE 0 END) >= @minPost THEN 1 ELSE 0 END) AS s, (TIME_TO_STR(u.CreationDate, '%Y') * 100 + TIME_TO_STR(u.Creati... |
Find the distinct locations that has a cinema. | CREATE TABLE cinema (cinema_id number,name text,openning_year number,capacity number,location text)CREATE TABLE schedule (cinema_id number,film_id number,date text,show_times_per_day number,price number)CREATE TABLE film (film_id number,rank_in_series number,number_in_season number,title text,directed_by text,original_... | SELECT DISTINCT location FROM cinema |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID dec... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
What is Partner, when Outcome is Winner, and when Date is 12 October 2003? | CREATE TABLE table_46682 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Partner" FROM table_46682 WHERE "Outcome" = 'winner' AND "Date" = '12 october 2003' |
What is the average Total, when the value for Silver is less than 1, when the value for Gold is 0, when the Nation is Switzerland, and when the value for Bronze is 2? | CREATE TABLE table_70656 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Total") FROM table_70656 WHERE "Silver" < '1' AND "Gold" = '0' AND "Nation" = 'switzerland' AND "Bronze" < '2' |
Which Score has an Opponent of @ seattle? | CREATE TABLE table_46169 ("Date" text,"Opponent" text,"Score" text,"Result" text,"Record" text) | SELECT "Score" FROM table_46169 WHERE "Opponent" = '@ seattle' |
What is the score when Darlington is the home team? | CREATE TABLE table_name_9 (score VARCHAR,home_team VARCHAR) | SELECT score FROM table_name_9 WHERE home_team = "darlington" |
How many airports are there per country? Order the countries by decreasing number of airports. | CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,el... | SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC |
For those employees whose first name is ending with the letter m, visualize a bar chart to show each employee's salary by the last name, and could you show in desc by the y-axis please? | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varc... | SELECT LAST_NAME, SALARY FROM employees WHERE FIRST_NAME LIKE '%m' ORDER BY SALARY DESC |
What is the lowest overall amount of poles? | CREATE TABLE table_25352318_1 (poles INTEGER) | SELECT MIN(poles) FROM table_25352318_1 |
Which event had the time 45.74? | CREATE TABLE table_71187 ("Event" text,"Time" text,"Venue" text,"Date" text,"Notes" text) | SELECT "Event" FROM table_71187 WHERE "Time" = '45.74' |
Who was the away team that played Northampton Town at home with a tie number of replay? | CREATE TABLE table_name_53 (away_team VARCHAR,tie_no VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_53 WHERE tie_no = "replay" AND home_team = "northampton town" |
Return a bar chart about the distribution of date_address_from and the sum of monthly_rental bin date_address_from by weekday. | CREATE TABLE Detention (detention_id INTEGER,detention_type_code VARCHAR(10),teacher_id INTEGER,datetime_detention_start DATETIME,datetime_detention_end DATETIME,detention_summary VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(10),detention_type_description VARCHAR(... | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC |
Which Points is the highest one that has a Nationality of aut, and a Name of thomas morgenstern? | CREATE TABLE table_name_32 (points INTEGER,nationality VARCHAR,name VARCHAR) | SELECT MAX(points) FROM table_name_32 WHERE nationality = "aut" AND name = "thomas morgenstern" |
What district featured an election between james a. byrne (d) 59.3% joseph r. burns (r) 40.7%? | CREATE TABLE table_18429 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "District" FROM table_18429 WHERE "Candidates" = 'James A. Byrne (D) 59.3% Joseph R. Burns (R) 40.7%' |
Name the game site for october 4, 1992 | CREATE TABLE table_14956 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text) | SELECT "Game site" FROM table_14956 WHERE "Date" = 'october 4, 1992' |
how many more total goals does leandro de almeida has than zsombor kerekes ? | CREATE TABLE table_204_978 (id number,"position" number,"nation" number,"number" number,"name" text,"soproni liga" number,"uefa cup" number,"hungarian cup" number,"league cup" number,"total" number) | SELECT (SELECT "total" FROM table_204_978 WHERE "name" = 'leandro de almeida') - (SELECT "total" FROM table_204_978 WHERE "name" = 'zsombor kerekes') |
i need to go from BOSTON to DENVER and then to SAN FRANCISCO | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_numb... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... |
the first intake patient 366 had until 828 days ago what was the name of that? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,di... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 366)) AND DATETIME(inputevents_cv.ch... |
provide the number of patients whose primary disease is s/p fall and lab test fluid is ascites? | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Ascites" |
count the number of patients whose age is less than 74 and procedure short title is arterial catheterization? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Arterial catheterization" |
tell me the diagnoses icd9 code and short title of diagnoses for patient with patient id 28588. | 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 diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "28588" |
who is the candidate in district south carolina 2? | CREATE TABLE table_72435 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_72435 WHERE "District" = 'South Carolina 2' |
Which Average is the lowest one that has a Total smaller than 134, and a Number of dances smaller than 3, and a Rank by average smaller than 12? | CREATE TABLE table_name_38 (average INTEGER,rank_by_average VARCHAR,total VARCHAR,number_of_dances VARCHAR) | SELECT MIN(average) FROM table_name_38 WHERE total < 134 AND number_of_dances < 3 AND rank_by_average < 12 |
What is the average number of points for a team that played 17 games and had more than 15 losses? | CREATE TABLE table_name_37 (points INTEGER,games VARCHAR,losses VARCHAR) | SELECT AVG(points) FROM table_name_37 WHERE games = 17 AND losses > 15 |
Users' aggregated comments and posts in parent posts. User id's which are null or less than 0 have been removed | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Review... | SELECT DISTINCT a.UserId, a.QuestionId AS PostId, COUNT(a.QuestionId) AS Aggregate FROM (SELECT Posts.OwnerUserId AS UserId, COALESCE(Posts.ParentId, Posts.Id) AS QuestionId FROM Posts WHERE NOT Posts.OwnerUserId IS NULL AND Posts.OwnerUserId > 0 UNION ALL SELECT b.UserId AS UserId, COALESCE(b.ParentId, b.PostId) AS Qu... |
how many patients were diagnosed with hyperlipidemia since 2104 after having previously been diagnosed with diabetes mellitus - type ii within the same month? | 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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104') AS t1 JOIN (SELECT patient.uniquepid,... |
Who directed the episode with UK viewership of 6.09 million? | CREATE TABLE table_29063233_1 (directed_by VARCHAR,uk_viewers__million_ VARCHAR) | SELECT directed_by FROM table_29063233_1 WHERE uk_viewers__million_ = "6.09" |
Visualize a bar chart for what are the names and account balances of customers with the letter 'a' in their names? | CREATE TABLE customer (cust_ID varchar(3),cust_name varchar(20),acc_type char(1),acc_bal int,no_of_loans int,credit_score int,branch_ID int,state varchar(20))CREATE TABLE bank (branch_ID int,bname varchar(20),no_of_customers int,city varchar(10),state varchar(20))CREATE TABLE loan (loan_ID varchar(3),loan_type varchar(... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, list by the Y in asc. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE ... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) |
what is the team when the make is dodge and the year is after 2008? | CREATE TABLE table_name_18 (team VARCHAR,make VARCHAR,year VARCHAR) | SELECT team FROM table_name_18 WHERE make = "dodge" AND year > 2008 |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
WHAT TOWN IS WEST BROOK SENIOR HIGH SCHOOL FROM? | CREATE TABLE table_299 ("Player" text,"Position" text,"School" text,"Hometown" text,"MLB Draft" text) | SELECT "Hometown" FROM table_299 WHERE "School" = 'West Brook Senior High School' |
have there been any microbiological test history for patient 031-3355 in 12/2105? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2105-12' |
What is the release date with par116 as the cat. #? | CREATE TABLE table_48667 ("Cat. #" text,"Artist" text,"Title" text,"Release date" text,"Format" text,"Other information" text) | SELECT "Release date" FROM table_48667 WHERE "Cat. #" = 'par116' |
What is the total amount of allied-unrelated where the component is human capital? | CREATE TABLE table_11944282_1 (allied_unrelated VARCHAR,component VARCHAR) | SELECT COUNT(allied_unrelated) FROM table_11944282_1 WHERE component = "Human Capital" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.