instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
count the number of patients whose item id is 50803 and lab test abnormal status is abnormal? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50803" AND lab.flag = "abnormal" |
List the event venues and names that have the top 2 most number of people attended. | CREATE TABLE news_report (journalist_id number,event_id number,work_type text)CREATE TABLE event (event_id number,date text,venue text,name text,event_attendance number)CREATE TABLE journalist (journalist_id number,name text,nationality text,age text,years_working number) | SELECT venue, name FROM event ORDER BY event_attendance DESC LIMIT 2 |
What is the result of the game at kyiv, ukraine? | CREATE TABLE table_61380 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_61380 WHERE "Venue" = 'kyiv, ukraine' |
When did woking compete? | CREATE TABLE table_39190 ("Round" text,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_39190 WHERE "Opponent" = 'woking' |
What is the round of 16 result for Jiske Griffioen Esther Vergeer? | CREATE TABLE table_22498 ("Athlete" text,"Class" text,"Event" text,"Round of 32" text,"Round of 16" text,"Quarterfinals" text,"Semifinals" text,"Final/ Bronze medal match" text) | SELECT "Round of 16" FROM table_22498 WHERE "Athlete" = 'Jiske Griffioen Esther Vergeer' |
When did an away team score 12.14 (86) at Windy Hill? | CREATE TABLE table_56441 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_56441 WHERE "Away team score" = '12.14 (86)' AND "Venue" = 'windy hill' |
What classes will count as Other next semester ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,r... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program... |
calculate the number of people who had a total protein lab test the last year. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'total protein' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) |
what is maximum age of patients whose admission type is emergency and year of death is less than 2183? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2183.0" |
Which tier is for football at Tianhe Stadium? | CREATE TABLE table_80019 ("Sport" text,"League" text,"Tier" text,"Club" text,"Stadium" text) | SELECT "Tier" FROM table_80019 WHERE "Sport" = 'football' AND "Stadium" = 'tianhe stadium' |
Who was Class AAAAA during the school year of 1995-96? | CREATE TABLE table_10399701_2 (class_aAAAA VARCHAR,school_year VARCHAR) | SELECT class_aAAAA FROM table_10399701_2 WHERE school_year = "1995-96" |
What are the programs that require EARTH 423 ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructo... | SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'EARTH' AND course.number = 423 |
Where was the race with Luke Ellery as fastest lap and Wayne Boyd as winning driver? | CREATE TABLE table_31045 ("Rnd" real,"Circuit" text,"Location" text,"Date" text,"Pole position" text,"Fastest lap" text,"Most laps led" text,"Winning driver" text,"Winning team" text,"Supporting" text) | SELECT "Location" FROM table_31045 WHERE "Fastest lap" = 'Luke Ellery' AND "Winning driver" = 'Wayne Boyd' |
What is the lowest age of an astronaut named Stu Roosa? | CREATE TABLE table_name_81 (age_on_mission INTEGER,name VARCHAR) | SELECT MIN(age_on_mission) FROM table_name_81 WHERE name = "stu roosa" |
Show the average of price supplied by supplier id 3 for different product type code in a bar chart, and order by the y axis in ascending. | CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE Suppliers (supplier_id INTEGER,supplier_name VARCHAR(80),supplier_phone VARCHAR(80))CREATE TABLE Products (product_id INTEGER,p... | SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY AVG(product_price) |
For those products with a price between 60 and 120, give me the comparison about price over the name by a bar chart, order by the x axis in ascending. | 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, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name |
Return a bar chart on how many customers use each payment method?, could you display by the total number in descending please? | CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_purchased VARCHAR(80),total_value_purchased DECIMAL(19,4))CREATE TABLE Customers (customer_id INTEGER,payment_... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) DESC |
ejection fraction <= 35 % and at least one of the following criteria: intervention on the last patent coronary conduit, or intervention on an unprotected left main coronary artery | CREATE TABLE table_test_31 ("id" int,"ejection_fraction_ef" int,"macular_disease" bool,"systemic" bool,"alt" float,"iud" bool,"condom_with_spermicide" bool,"gender" string,"meropenem" bool,"non_q_wave_myocardial_infarction" bool,"hbcab" bool,"unstable_angina" bool,"birth_control_pills" bool,"cystic_fibrosis" bool,"hbv_... | SELECT * FROM table_test_31 WHERE ejection_fraction_ef <= 35 AND (coronary_conduit = 1 OR unprotected_left_main_coronary_artery = 1) |
What is the largest number of rounds for the team that hired Donnie Wingo as crew chief? | CREATE TABLE table_1266602_2 (rounds INTEGER,crew_chief VARCHAR) | SELECT MAX(rounds) FROM table_1266602_2 WHERE crew_chief = "Donnie Wingo" |
Who took third place in 2012? | CREATE TABLE table_48323 ("Year" real,"Venue" text,"Winner" text,"Runner Up" text,"Third Place" text) | SELECT "Third Place" FROM table_48323 WHERE "Year" = '2012' |
during the last year, what were the top four most frequent specimen tests given to a patient in the same month after the diagnosis of mal neo pyloric antrum? | 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,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)C... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
What is the stadium in Kuopio? | CREATE TABLE table_25129482_1 (stadium VARCHAR,location VARCHAR) | SELECT stadium FROM table_25129482_1 WHERE location = "Kuopio" |
What was Brian Moran's share of the votes when Creigh Deeds had 30%? | CREATE TABLE table_2475 ("Source" text,"Dates Administered" text,"Terry McAuliffe" text,"Brian Moran" text,"Creigh Deeds" text) | SELECT "Brian Moran" FROM table_2475 WHERE "Creigh Deeds" = '30%' |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name , order bar from low to high order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar... | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME |
Top 100 SO Users from Pakistan. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,Creati... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK' ORDER BY Reputation DESC LIMIT 1000 |
Tags with no wiki excerpt. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostNoticeTypes ... | SELECT Tags.*, Posts.Body, Posts.PostTypeId, Posts.CreationDate, Posts.DeletionDate, Posts.LastEditDate, Posts.LastActivityDate FROM Tags JOIN Posts ON Tags.ExcerptPostId = Posts.Id WHERE LENGTH(Posts.Body) = 0 |
What are the number of start date of the apartment bookings made by female guests (gender code 'Female') for each year? Plot a bar chart. | CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),buildi... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" |
Plot the id and the number of journal committees they are on in a scatter chart. | 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 T1.Editor_ID, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID |
What is the method against Paula Mataele? | CREATE TABLE table_54176 ("Date" text,"Result" text,"Opponent" text,"Location" text,"Method" text) | SELECT "Method" FROM table_54176 WHERE "Opponent" = 'paula mataele' |
Which team had a game of 82? | CREATE TABLE table_55772 ("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_55772 WHERE "Game" = '82' |
What is the maximum number of points scored against? | CREATE TABLE table_24687 ("Position" real,"Club" text,"Played" real,"H-Win" real,"H-Draw" real,"A-Win" real,"A-Draw" real,"Lost" real,"Def." real,"Pts For" real,"Pts Agst" real,"Pair" real,"Long" real,"Points" real,"Average" text) | SELECT MAX("Pts Agst") FROM table_24687 |
what is the competition when the result is 1-1 and venue is gwangju? | CREATE TABLE table_name_35 (competition VARCHAR,result VARCHAR,venue VARCHAR) | SELECT competition FROM table_name_35 WHERE result = "1-1" AND venue = "gwangju" |
What label is in CD format in Australia? | CREATE TABLE table_name_14 (label VARCHAR,format VARCHAR,region VARCHAR) | SELECT label FROM table_name_14 WHERE format = "cd" AND region = "australia" |
What is the highest Top 25 with a Money list rank of 232 and Cuts smaller than 2? | CREATE TABLE table_56529 ("Year" text,"Starts" real,"Cuts made" real,"Wins" real,"Top 10" real,"Top 25" real,"Earnings ($)" real,"Money list rank" text) | SELECT MAX("Top 25") FROM table_56529 WHERE "Money list rank" = '232' AND "Cuts made" < '2' |
Which film was released in 1983? | CREATE TABLE table_15007 ("Film" text,"Year" real,"Score composer" text,"U.K. peak position" text,"U.S. peak position" text) | SELECT "Film" FROM table_15007 WHERE "Year" = '1983' |
calculate the length of stay of patient 4269's last stay in the intensive care unit for. | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numb... | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4269) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1 |
For those employees who do not work in departments with managers that have ids between 100 and 200, what is the relationship between employee_id and department_id ? | 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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLO... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Which series number has the production code 7.07? | CREATE TABLE table_2226817_8 (no_in_series VARCHAR,production_code VARCHAR) | SELECT COUNT(no_in_series) FROM table_2226817_8 WHERE production_code = "7.07" |
Search posts by UserId, comment text. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comment... | SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY Score DESC |
Which name has notes b and the game of tennis? | CREATE TABLE table_name_13 (name VARCHAR,sport VARCHAR,notes VARCHAR) | SELECT name FROM table_name_13 WHERE sport = "tennis" AND notes = "b" |
What is the highest Number of Bearers 2008, when Surname is Hansen, and when Rank is less than 1? | CREATE TABLE table_77259 ("Rank" real,"Surname" text,"Number of bearers 2008" real,"Type" text,"Etymology" text) | SELECT MAX("Number of bearers 2008") FROM table_77259 WHERE "Surname" = 'hansen' AND "Rank" < '1' |
What is the Score of the Pingguo Tournament? | CREATE TABLE table_name_94 (score VARCHAR,tournament VARCHAR) | SELECT score FROM table_name_94 WHERE tournament = "pingguo" |
A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and I want to rank in ascending by the Y-axis. | 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 All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) |
What was the departure time of the train going to Boston? | CREATE TABLE table_18365784_3 (departure VARCHAR,going_to VARCHAR) | SELECT departure FROM table_18365784_3 WHERE going_to = "Boston" |
What's the location of the National event? | CREATE TABLE table_name_97 (location VARCHAR,event VARCHAR) | SELECT location FROM table_name_97 WHERE event = "the national" |
Who is the opponent in week 15? | CREATE TABLE table_50684 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" real) | SELECT "Opponent" FROM table_50684 WHERE "Week" = '15' |
How many documents are there of each type. Show bar chart. | CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Projec... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code |
how many films were done before the 1950s ? | CREATE TABLE table_204_852 (id number,"year" number,"film" text,"language" text,"character" text,"co-star" text,"music" text,"banner" text) | SELECT COUNT("film") FROM table_204_852 WHERE "year" < 1950 |
What was the attendance when the VFL played Lake Oval? | CREATE TABLE table_name_44 (crowd VARCHAR,venue VARCHAR) | SELECT COUNT(crowd) FROM table_name_44 WHERE venue = "lake oval" |
how many patients whose diagnoses long title is other pulmonary embolism and infarction and drug route is po? | 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.long_title = "Other pulmonary embolism and infarction" AND prescriptions.route = "PO" |
when was the first procedure patient 006-157753 had on this hospital encounter? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime 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,cultu... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) ORDER BY ... |
Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. | CREATE TABLE phone (Carrier VARCHAR,Memory_in_G INTEGER) | SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64 |
What is the name of the bo-bodh train with a number less than 5? | CREATE TABLE table_name_31 (name VARCHAR,number VARCHAR,type VARCHAR) | SELECT name FROM table_name_31 WHERE number < 5 AND type = "bo-bodh" |
What year has 54 (73) points? | CREATE TABLE table_58736 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Pts." text) | SELECT SUM("Year") FROM table_58736 WHERE "Pts." = '54 (73)' |
What's the previous conference of Fountain City with a size more than 287? | CREATE TABLE table_name_88 (previous_conference VARCHAR,size VARCHAR,location VARCHAR) | SELECT previous_conference FROM table_name_88 WHERE size > 287 AND location = "fountain city" |
What is the team 1 with cementarnica as team 2? | CREATE TABLE table_name_20 (team_1 VARCHAR,team_2 VARCHAR) | SELECT team_1 FROM table_name_20 WHERE team_2 = "cementarnica" |
What are the names of customers who never made an order. | CREATE TABLE customers (customer_id number,payment_method text,customer_name text,date_became_customer time,other_customer_details text)CREATE TABLE customer_orders (order_id number,customer_id number,order_status text,order_date time,order_details text)CREATE TABLE addresses (address_id number,address_content text,cit... | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id |
Which player has the fewest assists and played 2 games or fewer? | CREATE TABLE table_name_72 (assists INTEGER,games INTEGER) | SELECT MIN(assists) FROM table_name_72 WHERE games < 2 |
What is the highest number of poles? | CREATE TABLE table_26794530_1 (poles INTEGER) | SELECT MAX(poles) FROM table_26794530_1 |
When was the opposition sydney fc on round 19? | CREATE TABLE table_11997 ("Date" text,"Round" text,"Attendance" text,"Opposition" text,"Stadium" text) | SELECT "Date" FROM table_11997 WHERE "Opposition" = 'sydney fc' AND "Round" = 'round 19' |
what are the four most frequently given laboratory tests for patients who have previously received destruct chest wall les within the same month until 2104? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime t... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... |
What is the Round when the value for Fixtures is 2? | CREATE TABLE table_66853 ("Round" text,"Fixtures" real,"Clubs" text,"New entries" text,"Leagues entering" text) | SELECT "Round" FROM table_66853 WHERE "Fixtures" = '2' |
In which city is the network with the callsign kgns-dt3 licensed? | CREATE TABLE table_name_71 (city_of_license VARCHAR,callsign VARCHAR) | SELECT city_of_license FROM table_name_71 WHERE callsign = "kgns-dt3" |
what is insurance and primary disease of subject id 2560? | 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 demographic.insurance, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" |
which album has the record label i.r.s records , eye of the hurricane or compact hits ? | CREATE TABLE table_203_686 (id number,"release date" text,"album" text,"record label" text,"uk albums chart" number,"u.s. billboard 200 chart" number) | SELECT "album" FROM table_203_686 WHERE "album" IN ('eye of the hurricane', 'compact hits') AND "record label" = 'i.r.s. records' |
Name the 1991-1992 for river plate | CREATE TABLE table_14390413_1 (team VARCHAR) | SELECT 1991 AS _1992 FROM table_14390413_1 WHERE team = "River Plate" |
Nationality of england, and a Lost larger than 39, and a Win % of 28.7, and a Drawn smaller than 37 had what sum of matches? | CREATE TABLE table_name_1 (matches INTEGER,drawn VARCHAR,win__percentage VARCHAR,nationality VARCHAR,lost VARCHAR) | SELECT SUM(matches) FROM table_name_1 WHERE nationality = "england" AND lost > 39 AND win__percentage = 28.7 AND drawn < 37 |
How many times was the rank (csa) was (msa 348)? | CREATE TABLE table_12720275_1 (rank__csa_ VARCHAR) | SELECT COUNT(2000 AS _population) FROM table_12720275_1 WHERE rank__csa_ = "(MSA 348)" |
how much weight change does patient 19428 have last measured on the current hospital visit compared to the value first measured on the current hospital visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num... | 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 = 19428 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM... |
what is the price for the lidocaine 2%? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id ... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'lidocaine 2%') |
How many games ended in a record of 30-28-4, with a March more than 1? | CREATE TABLE table_75050 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text) | SELECT COUNT("Game") FROM table_75050 WHERE "Record" = '30-28-4' AND "March" > '1' |
How much Lost has an Against larger than 19, and a Drawn smaller than 1? | CREATE TABLE table_name_67 (lost INTEGER,against VARCHAR,drawn VARCHAR) | SELECT SUM(lost) FROM table_name_67 WHERE against > 19 AND drawn < 1 |
What was the second qualification time for Dale Coyne Racing with a best of 1:03.757? | CREATE TABLE table_43613 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text) | SELECT "Qual 2" FROM table_43613 WHERE "Team" = 'dale coyne racing' AND "Best" = '1:03.757' |
give me the number of patients whose admission type is emergency and procedure icd9 code is 5188? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose 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.admission_type = "EMERGENCY" AND procedures.icd9_code = "5188" |
What's the value for oklahoma when texas is kennedy? | CREATE TABLE table_62538 ("Year" text,"Arizona" text,"California" text,"Colorado" text,"Nevada" text,"New Mexico" text,"Oklahoma" text,"Texas" text,"Utah" text) | SELECT "Oklahoma" FROM table_62538 WHERE "Texas" = 'kennedy' |
What year was the team with the nickname pride established? | CREATE TABLE table_name_14 (established VARCHAR,nickname VARCHAR) | SELECT COUNT(established) FROM table_name_14 WHERE nickname = "pride" |
Draw a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?, and show from low to high by the bar. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temp... | SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY name |
How many patients admitted to the emergency room had renal and ureteral dis nos? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Renal & ureteral dis NOS" |
What manufacturer makes locomotive number CTN 46? | CREATE TABLE table_name_73 (manufacturer VARCHAR,locomotive_number VARCHAR) | SELECT manufacturer FROM table_name_73 WHERE locomotive_number = "ctn 46" |
Find the number of students who took some course and got A or C and group by first name in a bar chart, and I want to show by the how many stu fname in ascending. | CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(1... | SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME) |
what is the distance between PITTSBURGH airport and downtown PITTSBURGH | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service... | SELECT DISTINCT AIRPORT_SERVICE_0.miles_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_SE... |
What is the id and name of the enzyme that can interact with the most medicines as an activator? | CREATE TABLE medicine_enzyme_interaction (enzyme_id number,medicine_id number,interaction_type text)CREATE TABLE enzyme (id number,name text,location text,product text,chromosome text,omim number,porphyria text)CREATE TABLE medicine (id number,name text,trade_name text,fda_approved text) | SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 |
Which team had a 2008-3 2008 draft? | CREATE TABLE table_53486 ("Draft" text,"Round" real,"Pick" real,"Nationality" text,"Position" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_53486 WHERE "Draft" = '2008-3 2008' |
how many hours has it been since the first time patient 027-142451 stayed in ward 966 during this hospital visit? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-142451' AND patient.wardid = 966 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
list flights from SAN JOSE to DALLAS on friday | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE T... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da... |
What's the 2006 if there's less than 6.7 in 2007 and less than 3.4 in 2009? | CREATE TABLE table_name_46 (Id VARCHAR) | SELECT SUM(2006) FROM table_name_46 WHERE 2007 < 6.7 AND 2009 < 3.4 |
in this month, when was the last time patient 027-85328 had the maximum sodium? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labi... | 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-85328')) AND lab.labname = 'sodium' AND DATETIME(lab.labresulttime, 'start of m... |
Which Date has a record of 3-5? | CREATE TABLE table_name_76 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_76 WHERE record = "3-5" |
Which date has a format's album? | CREATE TABLE table_name_31 (date VARCHAR,format_s_ VARCHAR) | SELECT date FROM table_name_31 WHERE format_s_ = "album" |
How many rounds were played in the matching resulting in a Points For score of 343? | CREATE TABLE table_9408 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Bonus Points" text,"Points" text) | SELECT "Played" FROM table_9408 WHERE "Points for" = '343' |
What was the winning score in 2000? | CREATE TABLE table_39399 ("Year" real,"Champion" text,"Country" text,"Venue" text,"Location" text,"Score" text,"Winner's share ($)" real) | SELECT "Score" FROM table_39399 WHERE "Year" = '2000' |
What was the profit before tax when the turnover was 431.06? | CREATE TABLE table_2856898_1 (profit_before_tax__£m_ VARCHAR,turnover__£m_ VARCHAR) | SELECT profit_before_tax__£m_ FROM table_2856898_1 WHERE turnover__£m_ = "431.06" |
Which Rank has a Heat larger than 7? | CREATE TABLE table_13663 ("Rank" real,"Heat" real,"Cyclist" text,"Nation" text,"Result" text) | SELECT MAX("Rank") FROM table_13663 WHERE "Heat" > '7' |
Who were the candidates in the district whose incumbent is Joe Waggonner? | CREATE TABLE table_1341843_19 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1341843_19 WHERE incumbent = "Joe Waggonner" |
Give the number of patients that survived had a and procedure icd9 code of 3772. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3772" |
Visualize a bar chart about the distribution of All_Neutral and Team_ID , rank in ascending by the y-axis. | 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 All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID |
What stadium(sO does san juan jabloteh play in? | CREATE TABLE table_25794138_1 (stadium VARCHAR,team VARCHAR) | SELECT stadium FROM table_25794138_1 WHERE team = "San Juan Jabloteh" |
What is the lowest average score where the evening gown score was 8.811? | CREATE TABLE table_46665 ("Country" text,"Preliminary" real,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT MIN("Average") FROM table_46665 WHERE "Evening Gown" = '8.811' |
List the distinct payment method codes with the number of orders mad in a bar chart. | CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID INTEGER,Address_ID INTEGER,Currency_Code CHAR(15),Marketing_Region_Code CHAR(15),Store_Name VARCHAR(255),Store_Phone VARCHAR(255),Store_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Clients (Client_ID INTEGER,Address_ID INTEGER,Customer_Email_Ad... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code |
Name the mountains classification for bradley white | CREATE TABLE table_23944514_15 (mountains_classification VARCHAR,aggressive_rider VARCHAR) | SELECT mountains_classification FROM table_23944514_15 WHERE aggressive_rider = "Bradley White" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.