instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which Zero Fighter has a count of 10? | CREATE TABLE table_name_1 (id_code_of_his_zero_fighter VARCHAR,count VARCHAR) | SELECT id_code_of_his_zero_fighter FROM table_name_1 WHERE count = "10" |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and manager_id , and sort y axis from low to high order 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 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,J... | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID |
What is the venue for the team Terek? | CREATE TABLE table_20140132_1 (venue VARCHAR,team VARCHAR) | SELECT venue FROM table_20140132_1 WHERE team = "Terek" |
Which type had an unknown manufacturer? | CREATE TABLE table_49271 ("Name" text,"Type" text,"Themed area" text,"Manufacturer" text,"Opened" text) | SELECT "Type" FROM table_49271 WHERE "Manufacturer" = 'unknown' |
Show the first names and last names of customers without any account. | CREATE TABLE Accounts (customer_id VARCHAR)CREATE TABLE Customers (customer_first_name VARCHAR,customer_last_name VARCHAR,customer_id VARCHAR) | SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id |
provide the number of patients whose age is less than 49 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "49" AND lab.flag = "abnormal" |
Which part has the least chargeable amount? List the part id and amount. | CREATE TABLE Parts (part_id VARCHAR,chargeable_amount VARCHAR) | SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount LIMIT 1 |
Is DANCE 103 section 496 going to be offered in the Fall 2017 semester ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree... | 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 = 496 AND course.department = 'DANCE' AND course.number = 103 AND semester.semester = 'Fall' AND semester... |
when did patient 031-23605 receive blood, venipuncture microbiology testing for the last time? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' ORD... |
how many hours has it passed since patient 94229 was admitted to hospital? | 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 TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount numbe... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL |
What was the score of the game that had a loss of Williams (1-1)? | CREATE TABLE table_68234 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Score" FROM table_68234 WHERE "Loss" = 'williams (1-1)' |
Name the country for johannesburg | CREATE TABLE table_38639 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "Country" FROM table_38639 WHERE "City" = 'johannesburg' |
Who is the trophy presentation in the year 1987? | CREATE TABLE table_25075 ("Year" real,"Network" text,"Race caller" text,"s Host" text,"s Analyst" text,"Reporters" text,"Trophy presentation" text) | SELECT "Trophy presentation" FROM table_25075 WHERE "Year" = '1987' |
count the number of patients who had been prescribed an biotene dry mouth mt liqd. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'biotene dry mouth mt liqd') |
since 2104, what was the four most frequent procedure for patients 20s? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE icustays (r... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
Who had the high assists while Erick Dampier (8) had the high rebounds? | CREATE TABLE table_21472 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High assists" FROM table_21472 WHERE "High rebounds" = 'Erick Dampier (8)' |
Which NTFS has a no for ReFS and a yes for HPFS? | CREATE TABLE table_32636 ("FAT16" text,"FAT32" text,"HPFS" text,"ISO 9660" text,"NTFS" text,"ReFS" text) | SELECT "NTFS" FROM table_32636 WHERE "ReFS" = 'no' AND "HPFS" = 'yes' |
What is the form ('to sing') when brazilian portuguese is [k t mus]? | CREATE TABLE table_25401_2 (form__to_sing_ VARCHAR,brazilian_portuguese VARCHAR) | SELECT form__to_sing_ FROM table_25401_2 WHERE brazilian_portuguese = "[kɐ̃ˈtẽmus]" |
Name the party or first elected is 1920 | CREATE TABLE table_1342393_16 (party VARCHAR,first_elected VARCHAR) | SELECT party FROM table_1342393_16 WHERE first_elected = 1920 |
What is the largest draw with 37 games from England? | CREATE TABLE table_name_65 (drawn INTEGER,nationality VARCHAR,games VARCHAR) | SELECT MAX(drawn) FROM table_name_65 WHERE nationality = "england" AND games = 37 |
Site's questions per hour of the day. Questions grouped per hour of the day, posted less than X Days ago; also graphed | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount nu... | SELECT CAST(STR(DATEPART(hour, p.CreationDate)) AS INT) AS Hour, COUNT(DATEPART(hour, p.CreationDate)) AS "# of questions" FROM Posts AS p WHERE p.PostTypeId = 1 AND DATEDIFF(DAY, p.CreationDate, GETDATE()) < '##Days:int?7##' GROUP BY DATEPART(hour, p.CreationDate) |
what is the average number of daily diagnosed cases of sepsis in 2104? | 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 AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time. | 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(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE jobs (JOB_I... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of price , and group by attribute founder, order by the x axis in ascending. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder |
What is the average amount of money of players in t8 place with a 68-71-69-72=280 score? | CREATE TABLE table_62412 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT AVG("Money ( $ )") FROM table_62412 WHERE "Place" = 't8' AND "Score" = '68-71-69-72=280' |
At the longitude of 355.0e, what is the name origin? | CREATE TABLE table_21101 ("Name" text,"Latitude" text,"Longitude" text,"Diameter (km)" text,"Year named" real,"Name origin" text) | SELECT "Name origin" FROM table_21101 WHERE "Longitude" = '355.0E' |
What is the country when last/current driver(s) 3 november 2013 is daniel abt ( 2012 )? | CREATE TABLE table_3733 ("Country" text,"Total Drivers" real,"Champions" text,"Championships" text,"Current 3 November 2013" real,"First driver(s)" text,"Last/Current driver(s) 3 November 2013" text) | SELECT "Country" FROM table_3733 WHERE "Last/Current driver(s) 3 November 2013" = 'Daniel Abt ( 2012 )' |
Find the physicians who are trained in a procedure that costs more than 5000, and count them by a bar chart, display by the how many name from low to high. | CREATE TABLE Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone VARCHAR(30),InsuranceID INTEGER,PCP INTEGER)CREATE TABLE Department (DepartmentID INTEGER,Name VARCHAR(30),Head INTEGER)CREATE TABLE Stay (StayID INTEGER,Patient INTEGER,Room INTEGER,StayStart DATETIME,StayEnd DATETIME)CREATE TABLE Physician (... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) |
how many players were from ann arbor ? | CREATE TABLE table_204_170 (id number,"player" text,"position" text,"games\nstarted" text,"hometown" text,"height" text,"weight" number,"age" number) | SELECT COUNT("player") FROM table_204_170 WHERE "hometown" = 'ann arbor' |
CLEANUP: find posts that could probably use some copy-editing. | 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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos... | SELECT p.Id AS "post_link", p.CreationDate, p.OwnerUserId AS "user_link" FROM Posts AS p WHERE p.Body LIKE '% i %' COLLATE Latin1_General_BIN OR p.Title LIKE 'a-z%' COLLATE Latin1_General_BIN OR p.Body LIKE '%`%' ORDER BY p.CreationDate DESC |
What's the highest Pl GP with a Reg GP over 18? | CREATE TABLE table_78102 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real) | SELECT MAX("Pl GP") FROM table_78102 WHERE "Reg GP" > '18' |
Youngest Users With More than 5000 Reputation. | CREATE TABLE PostTags (PostId number,TagId number)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 Comments (Id number,PostId number,Score number,T... | SELECT Id AS "user_link", * FROM (SELECT * FROM Users WHERE Age != '' AND Age >= 13 AND Reputation > 5000 ORDER BY Age LIMIT 100) AS users |
count the number of patients whose diagnoses short title is hemorrhage complic proc and drug type is main? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hemorrhage complic proc" AND prescriptions.drug_type = "MAIN" |
count the number of inpatient hospital admission patients who were admitted before the year 2174. | 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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2174" |
What was his record when he went over 1 round? | CREATE TABLE table_name_81 (record VARCHAR,round INTEGER) | SELECT record FROM table_name_81 WHERE round > 1 |
hba1c 12 % | CREATE TABLE table_train_183 ("id" int,"anemia" bool,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"creatinine_clearance_cl" float,"panel_reactive_antibodies" int,"NOUSE" float) | SELECT * FROM table_train_183 WHERE hemoglobin_a1c_hba1c < 12 |
How many number of WJC Jews in the Los Angeles Metro Area has a ARDA rank of more than 2? | CREATE TABLE table_51949 ("Rank (WJC)" real,"Rank (ARDA)" real,"Metro area" text,"Number of Jews (WJC)" real,"Number of Jews (ASARB)" real) | SELECT SUM("Number of Jews (WJC)") FROM table_51949 WHERE "Metro area" = 'los angeles' AND "Rank (ARDA)" > '2' |
What was the original air date for season number 2? | CREATE TABLE table_21781578_2 (original_air_date VARCHAR,season_no VARCHAR) | SELECT original_air_date FROM table_21781578_2 WHERE season_no = 2 |
Name the publisher for resident evil 4 | CREATE TABLE table_14325653_2 (publisher_s_ VARCHAR,video_game VARCHAR) | SELECT publisher_s_ FROM table_14325653_2 WHERE video_game = "Resident Evil 4" |
Which province has a gdp of 38355 million euros? | CREATE TABLE table_16240 ("Province" text,"Population (2004 estimate)" real,"Area (km\u00b2)" real,"Density" text,"GDP (2003,PPS in mil. \u20ac)" real,"GDP per cap. (2003,in \u20ac)" real) | SELECT "Province" FROM table_16240 WHERE "GDP (2003, PPS in mil. \u20ac )" = '38355' |
What Nation has more than 4 silver, more than 3 gold and 18 total medals? | CREATE TABLE table_13460 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Nation" FROM table_13460 WHERE "Silver" > '4' AND "Gold" > '3' AND "Total" = '18' |
A bar chart about how many students are older than average for each gender?, and sort by the X-axis from high to low please. | CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCH... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex DESC |
Which Adelaide's Melbourne and Perth were yes when Auckland was no? | CREATE TABLE table_68330 ("Sydney" text,"Melbourne" text,"Perth" text,"Adelaide" text,"Gold Coast" text,"Auckland" text) | SELECT "Adelaide" FROM table_68330 WHERE "Melbourne" = 'yes' AND "Auckland" = 'no' AND "Perth" = 'yes' |
What are the different names of all the races in reverse alphabetical order? | CREATE TABLE circuits (circuitid number,circuitref text,name text,location text,country text,lat number,lng number,alt number,url text)CREATE TABLE pitstops (raceid number,driverid number,stop number,lap number,time text,duration text,milliseconds number)CREATE TABLE status (statusid number,status text)CREATE TABLE lap... | SELECT DISTINCT name FROM races ORDER BY name DESC |
what is the Chinese name for Forensic heroes ii? | CREATE TABLE table_374 ("Rank" real,"English title" text,"Chinese title" text,"Average" real,"Peak" real,"Premiere" real,"Finale" real,"HK viewers" text) | SELECT "Chinese title" FROM table_374 WHERE "English title" = 'Forensic Heroes II' |
Club aik had over 9 small silver medals and more than 8 bronze medals, how many total points did they have? | CREATE TABLE table_54781 ("Rank" real,"Club" text,"Gold" real,"Big Silver" real,"Small Silver" real,"Bronze" real,"Points" real) | SELECT AVG("Points") FROM table_54781 WHERE "Small Silver" > '9' AND "Club" = 'aik' AND "Bronze" > '8' |
Top 20 users called DavidG. Top 20 SO users from China | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(DisplayName) = 'jon skeet' ORDER BY Reputation DESC LIMIT 20 |
What is the days held the champion with a reign larger than 3 and less than 1 defense has? | CREATE TABLE table_72025 ("Name" text,"Reign" real,"Days held" text,"Location" text,"Defenses" real) | SELECT "Days held" FROM table_72025 WHERE "Reign" > '3' AND "Defenses" < '1' |
count the number of patients whose diagnoses long title is malignant carcinoid tumor of the rectum and lab test category is hematology? | 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 procedures (subject_id text,hadm_id te... | 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 = "Malignant carcinoid tumor of the rectum" AND lab."CATEGORY" = "Hematology" |
which songwriter is credited with the largest number of songs ? | CREATE TABLE table_203_228 (id number,"#" number,"title" text,"songwriters" text,"producer(s)" text,"performer (s)" text) | SELECT "songwriters" FROM table_203_228 GROUP BY "songwriters" ORDER BY COUNT("title") DESC LIMIT 1 |
how many drivers got less than 80 points ? | CREATE TABLE table_204_853 (id number,"pos" number,"grid" number,"no." number,"driver" text,"team" text,"manufacturer" text,"laps" number,"points" number) | SELECT COUNT("driver") FROM table_204_853 WHERE "points" < 80 |
Tell me the declination with NGC number larger than 5750 | CREATE TABLE table_55067 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text,"Apparent magnitude" real) | SELECT "Declination ( J2000 )" FROM table_55067 WHERE "NGC number" > '5750' |
What was the score when Calgary was visiting team and Niittymaki had the decision? | CREATE TABLE table_45979 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_45979 WHERE "Decision" = 'niittymaki' AND "Visitor" = 'calgary' |
Show votes on my questions. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment te... | SELECT Posts.Id, Posts.Title, Posts.Score, CASE Votes.VoteTypeId WHEN 2 THEN 'up' WHEN 3 THEN 'down' WHEN 15 THEN 'mod review' WHEN 16 THEN 'approve edit' ELSE CONCAT('<', Votes.VoteTypeId, '>') END AS VoteType FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Posts.OwnerUserId = '##UserId##' AND Posts.PostTypeId ... |
Name the Goals Conceded which has a Draw of 0 and a Played larger than 0? | CREATE TABLE table_61256 ("Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" text) | SELECT AVG("Goals Conceded") FROM table_61256 WHERE "Draw" = '0' AND "Played" > '0' |
How many frequencies have a line of East London and destination of Crystal Palace? | CREATE TABLE table_40407 ("Platform" real,"Frequency (per hour)" real,"Destination" text,"Service Pattern" text,"Operator" text,"Line" text) | SELECT COUNT("Frequency (per hour)") FROM table_40407 WHERE "Line" = 'east london' AND "Destination" = 'crystal palace' |
What is Method, when Location is 'Tokyo , Japan', and when Event is 'Rings: Millennium Combine 2'? | CREATE TABLE table_45870 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Method" FROM table_45870 WHERE "Location" = 'tokyo , japan' AND "Event" = 'rings: millennium combine 2' |
What was the result of the game that was attended by 72,703 people? | CREATE TABLE table_58804 ("Date" text,"Opponent#" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_58804 WHERE "Attendance" = '72,703' |
show me all overnight flights from WASHINGTON to SAN FRANCISCO and list their fares | 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 airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE compartment... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT... |
What is the lowest number of people attending the game where Colorado was the home team? | CREATE TABLE table_name_67 (attendance INTEGER,home VARCHAR) | SELECT MIN(attendance) FROM table_name_67 WHERE home = "colorado" |
Which country has a delegate who was first elected in 2006? | CREATE TABLE table_19071 ("District" text,"Counties Represented" text,"Delegate" text,"Party" text,"First Elected" real,"Committee" text) | SELECT "Counties Represented" FROM table_19071 WHERE "First Elected" = '2006' |
Who directed the episode titled 'Two Towns'? | CREATE TABLE table_25516 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Directed by" FROM table_25516 WHERE "Title" = 'Two Towns' |
when patient 3403 first received the open reduc-int fix femur this year? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 inputevents_cv (row_... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduc-int fix femur') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND ... |
Who directed the episode whose production code is 2m5901? | CREATE TABLE table_30149 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production" text,"U.S. viewers (in millions)" text) | SELECT "Directed by" FROM table_30149 WHERE "Production" = '2M5901' |
how many games had at least a score of two or more points ? | CREATE TABLE table_203_442 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT(*) FROM table_203_442 WHERE "score" + "score" >= 2 |
marked hyperlipidemia ( serum ldl > 158 mg / dl, or serum tg > 691 mg / dl ) | CREATE TABLE table_dev_34 ("id" int,"gender" string,"heart_disease" bool,"body_weight" float,"hematocrit_hct" float,"fasting_blood_glucose_fbg" float,"hyperlipidemia" bool,"systemic_illness" bool,"angina" bool,"serum_ldl" int,"clinically_significant_atherosclerotic_vascular_disease" bool,"impaired_glucose_tolerance" bo... | SELECT * FROM table_dev_34 WHERE hyperlipidemia = 1 OR (serum_ldl > 158 OR serum_tg > 691) |
What is the Class where City of license is lake oconee, ga? | CREATE TABLE table_35880 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" text,"Class" text,"FCC info" text) | SELECT "Class" FROM table_35880 WHERE "City of license" = 'lake oconee, ga' |
show me the top four most common diagnoses for patients 50s of age a year before? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icusta... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... |
What game 1 has bob lindner as game 2? | CREATE TABLE table_75299 ("Position" text,"Game 1" text,"Game 2" text,"Game 3" text,"Exhibition*" text) | SELECT "Game 1" FROM table_75299 WHERE "Game 2" = 'bob lindner' |
Tell me the trend using a line chart to show the total number of the station over the installation date, could you sort by the x-axis in asc? | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f... | SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date |
what is the name when the west or south terminus is ne 112 west of blue springs? | CREATE TABLE table_56780 ("County" text,"Name" text,"Length (miles)" real,"West or south terminus" text,"East or north terminus" text) | SELECT "Name" FROM table_56780 WHERE "West or south terminus" = 'ne 112 west of blue springs' |
Which Frequency has a Facility ID of 13598? | CREATE TABLE table_name_71 (frequency VARCHAR,facility_id VARCHAR) | SELECT frequency FROM table_name_71 WHERE facility_id = 13598 |
WHAT WAS THE PICK NUMBER FOR BRANDON RUSH? | CREATE TABLE table_7876 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"College" text) | SELECT COUNT("Pick") FROM table_7876 WHERE "Player" = 'brandon rush' |
COMP 239 is a have-to for what classes ? | CREATE TABLE ta (campus_job_id int,student_id int,location 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 varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project ... | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'COMP' AND COURSE_0.number = 239 AND COURSE_1.course_id = course_prerequisite.course_id |
How many instances is the unlocked n/a? | CREATE TABLE table_24463470_1 (setting VARCHAR,unlocked_by VARCHAR) | SELECT COUNT(setting) FROM table_24463470_1 WHERE unlocked_by = "N/A" |
What was the time for the match with away team Convoy Sun Hei Team A? | CREATE TABLE table_name_47 (time VARCHAR,away_team VARCHAR) | SELECT time FROM table_name_47 WHERE away_team = "convoy sun hei team a" |
i would like to book a flight from BALTIMORE to NEWARK early in the morning on 4 9 | CREATE TABLE code_description (code varchar,description text)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... | 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 = 'NEWARK' AND date_day.day_number = 9 AND date_day.month_number = 4 AND da... |
When was outgoing manager Zolt n Varga appointed? | CREATE TABLE table_58671 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Position in table" text,"Replaced by" text,"Date of appointment" text) | SELECT "Date of appointment" FROM table_58671 WHERE "Outgoing manager" = 'zoltán varga' |
count the number of patients whose marital status is married and gender is f? | 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 WHERE demographic.marital_status = "MARRIED" AND demographic.gender = "F" |
What is the Netflix where Segment D is pressure gauges ? | CREATE TABLE table_19884 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Netflix" FROM table_19884 WHERE "Segment D" = 'Pressure Gauges' |
Name the result for week less than 7 and game sites of los angeles memorial coliseum | CREATE TABLE table_name_25 (result VARCHAR,week VARCHAR,game_site VARCHAR) | SELECT result FROM table_name_25 WHERE week < 7 AND game_site = "los angeles memorial coliseum" |
How many courses each teacher taught? Show me a bar chart, I want to rank bars in ascending order please. | CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))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)C... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME ORDER BY EMP_FNAME |
what are the flights from BALTIMORE to DALLAS on sunday afternoon | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)C... | 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 = 27 AND date_day.month_number = 8 AND d... |
provide the number of self pay insurance patients who had regional lymph node excision. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Regional lymph node excision" |
What is the highest rank of rider colin martin? | CREATE TABLE table_63877 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text) | SELECT MAX("Rank") FROM table_63877 WHERE "Rider" = 'colin martin' |
What is the 17th c. pronunciation when the british is ? | CREATE TABLE table_name_68 (british VARCHAR) | SELECT 17 AS th_c FROM table_name_68 WHERE british = "əʊ" |
Which First season of current spell is the lowest one that has a First season larger than 2005, and a Number of seasons in Superettan smaller than 8, and a Club of syrianska fc? | CREATE TABLE table_41412 ("Club" text,"Position in 2013" text,"First season" real,"First season of current spell" real,"Number of seasons in Superettan" real,"Number of seasons in second tier" real) | SELECT MIN("First season of current spell") FROM table_41412 WHERE "First season" > '2005' AND "Number of seasons in Superettan" < '8' AND "Club" = 'syrianska fc' |
when was antonio horvath kiss last elected ? | CREATE TABLE table_203_447 (id number,"constituency" number,"region" text,"name" text,"party" text,"last elected" number) | SELECT "last elected" FROM table_203_447 WHERE "name" = 'antonio horvath kiss' |
What is the final record for the Philadelphia 76ers? | CREATE TABLE table_name_58 (record VARCHAR,opponent VARCHAR) | SELECT record FROM table_name_58 WHERE opponent = "philadelphia 76ers" |
What is the highest number of Seats 2006 held by the Christian Democratic Union of Germany Party/Voter Community, with a %2006 higher than 24.6? | CREATE TABLE table_56801 ("Parties and voter communities" text,"% 2006" real,"Seats 2006" real,"% 2001" real,"Seats 2001" real) | SELECT MAX("Seats 2006") FROM table_56801 WHERE "Parties and voter communities" = 'christian democratic union of germany' AND "% 2006" > '24.6' |
show me all flights from PHOENIX to MILWAUKEE on AA on wednesday | 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 time_interval (period text,... | 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 = 'MILWAUKEE' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... |
Which Date has a Week smaller than 11, and a Attendance of 54,094? | CREATE TABLE table_name_17 (date VARCHAR,week VARCHAR,attendance VARCHAR) | SELECT date FROM table_name_17 WHERE week < 11 AND attendance = "54,094" |
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix? | CREATE TABLE races (raceid VARCHAR,name VARCHAR)CREATE TABLE results (driverid VARCHAR,raceid VARCHAR)CREATE TABLE drivers (forename VARCHAR,driverid VARCHAR) | SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = ... |
get the number of married patients who have procedure icd9 code 3972. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3972" |
What is the sum of the values for N, Laakso-Taagepera, when Largest Component, Fractional Share is 0.35000000000000003, and when Constellation is E? | CREATE TABLE table_43953 ("Constellation" text,"Largest component,fractional share" real,"Other components,fractional shares" text,"N,Laakso-Taagepera" real,"N,Golosov" real) | SELECT SUM("N, Laakso-Taagepera") FROM table_43953 WHERE "Largest component, fractional share" = '0.35000000000000003' AND "Constellation" = 'e' |
List the names of products that are not in any event, and count them by a bar chart, I want to show total number from low to high order please. | CREATE TABLE Finances (Finance_ID INTEGER,Other_Details VARCHAR(255))CREATE TABLE Parties_in_Events (Party_ID INTEGER,Event_ID INTEGER,Role_Code CHAR(15))CREATE TABLE Agreements (Document_ID INTEGER,Event_ID INTEGER)CREATE TABLE Parties (Party_ID INTEGER,Party_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,... | SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY COUNT(Product_Name) |
What is the location of the match against Martinis Knyzelis? | CREATE TABLE table_name_75 (location VARCHAR,opponent VARCHAR) | SELECT location FROM table_name_75 WHERE opponent = "martinis knyzelis" |
What number is shown for january 15-16 when november 3 is 133? | CREATE TABLE table_25252080_3 (january_15_16 VARCHAR,november_3 VARCHAR) | SELECT january_15_16 FROM table_25252080_3 WHERE november_3 = "133" |
List the number of completion students in each day and bin date of completion by weekday with a bar chart. | 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 Student_Tests_Taken (registration_id INTEGER,date_test_... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment |
What rank has jo angel (wa) as the player? | CREATE TABLE table_name_47 (rank VARCHAR,player VARCHAR) | SELECT rank FROM table_name_47 WHERE player = "jo angel (wa)" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.