instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What seasons does Nick Lucas appear in?
CREATE TABLE table_17680 ("Character" text,"Portrayed by" text,"Main cast seasons" text,"Recurring cast seasons" text,"# of episodes" real)
SELECT "Recurring cast seasons" FROM table_17680 WHERE "Character" = 'Nick Lucas'
How many patients are discharged due to short term hospital and tested with potassium whole blood?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND lab.label = "Potassium, Whole Blood"
gastrointestinal hemorrhage, seizure, drug overdose, burn or trauma
CREATE TABLE table_train_61 ("id" int,"white_blood_cell_count_wbc" int,"in_another_study" bool,"systolic_blood_pressure_sbp" int,"trauma" bool,"temperature" float,"anc" int,"hypotension" bool,"heart_rate" int,"paco2" float,"gastrointestinal_disease" bool,"burn_injury" int,"seizure_disorder" bool,"hypoperfusion" bool,"i...
SELECT * FROM table_train_61 WHERE gastrointestinal_disease = 1 OR seizure_disorder = 1 OR drug_abuse = 1 OR burn_injury > 0 OR trauma = 1
subjects with diagnosis of current alcohol related problems
CREATE TABLE table_train_138 ("id" int,"mini_mental_state_examination_mmse" int,"stroke" bool,"body_weight" float,"cranial_neurosurgery" bool,"first_degree_relative" bool,"seizure_disorder" bool,"alcohol_abuse" bool,"body_mass_index_bmi" float,"aneurysm" bool,"NOUSE" float)
SELECT * FROM table_train_138 WHERE alcohol_abuse = 1
What would be the lowest Attendance that also showed a loss of Obermueller (1-2)?
CREATE TABLE table_67700 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT MIN("Attendance") FROM table_67700 WHERE "Loss" = 'obermueller (1-2)'
Name the order number for 1960s
CREATE TABLE table_19508635_1 (order__number VARCHAR,theme VARCHAR)
SELECT order__number FROM table_19508635_1 WHERE theme = "1960s"
What are the first and last names of all the female students who have president votes?
CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote number,class_senator_vote number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number...
SELECT DISTINCT T1.fname, T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.president_vote WHERE T1.sex = "F"
what is the capital where it is ramtha
CREATE TABLE table_28352 ("\u00d7" text,"Wehdat" text,"Faisaly" text,"Ramtha" text,"Ahli" text,"Hussein" text,"Jazeera" text,"Amman" text,"Qadisiya" text,"Jeel" text,"Baqaa" text)
SELECT "Qadisiya" FROM table_28352 WHERE "\u00d7" = 'Ramtha'
What is the Attendance of the game in Week 12?
CREATE TABLE table_66397 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MAX("Attendance") FROM table_66397 WHERE "Week" = '12'
What are the papers published under the institution 'Indiana University'?
CREATE TABLE authors (authid number,lname text,fname text)CREATE TABLE inst (instid number,name text,country text)CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE papers (paperid number,title text)
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Which attendance number was taken in a week less than 16 when the Washington Redskins were the opponents?
CREATE TABLE table_name_39 (attendance VARCHAR,week VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_name_39 WHERE week < 16 AND opponent = "washington redskins"
For what nation is the gold medals 0, and the bronze medals less than 1?
CREATE TABLE table_name_28 (nation VARCHAR,gold VARCHAR,bronze VARCHAR)
SELECT nation FROM table_name_28 WHERE gold = 0 AND bronze < 1
What was the score for the game on February 29?
CREATE TABLE table_35448 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Score" FROM table_35448 WHERE "Date" = 'february 29'
Top 5k Users by Reputation per Post.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Votes (Id number,PostId number,Vot...
SELECT (u.Reputation / COUNT(p.OwnerUserId)) AS "Rep Per Post", u.DisplayName, COUNT(p.OwnerUserId) AS "Posts", u.Reputation FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE u.Reputation >= 5000 GROUP BY u.Reputation, u.DisplayName ORDER BY (u.Reputation / COUNT(p.OwnerUserId)) DESC
calculate the total number of patients with item id 51244
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51244"
What is the total of the 3-0 score with a set 2 of 25-12 and a set 3 of 25-18?
CREATE TABLE table_41983 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Set 5" text,"Total" text)
SELECT "Total" FROM table_41983 WHERE "Score" = '3-0' AND "Set 3" = '25-18' AND "Set 2" = '25-12'
what is the names of the medications which patient 004-7984 was allergic to until 36 months ago?
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 microlab (microlabid number,patientunitstayid number...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-7984')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-...
Ratio of downvoted questions over time.. Look at the Graph, to see the evolution of the upvote/downvote ratio.
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 PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate ...
SELECT DATEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), 1) AS YearMonth, 1 / (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT), 0)) AS Ratio FROM Votes WHERE CreationDate > '01-01-2010' GROUP BY DATEFROMPARTS(YEAR(CreationDate),...
Find the average rating star for each movie that are not reviewed by Brittany Harris. Plot them as scatter chart.
CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
Draw a bar chart of gender versus the number of gender
CREATE TABLE club (Club_ID int,Club_name text,Region text,Start_year int)CREATE TABLE match_result (Rank int,Club_ID int,Gold int,Big_Silver int,Small_Silver int,Bronze int,Points int)CREATE TABLE player_coach (Player_ID int,Coach_ID int,Starting_year int)CREATE TABLE coach (Coach_ID int,Coach_name text,Gender text,Clu...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender
Which years did the USA have a rank lower than 6 and an assist number less than 26?
CREATE TABLE table_name_47 (years VARCHAR,nation VARCHAR,assist VARCHAR,rank VARCHAR)
SELECT years FROM table_name_47 WHERE assist < 26 AND rank < 6 AND nation = "usa"
Visualize a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes?, could you sort x-axis in desc order?
CREATE TABLE enzyme (id int,name text,Location text,Product text,Chromosome text,OMIM int,Porphyria text)CREATE TABLE medicine (id int,name text,Trade_Name text,FDA_approved text)CREATE TABLE medicine_enzyme_interaction (enzyme_id int,medicine_id int,interaction_type text)
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name DESC
Which Avg/G has a Long of 93, and a Loss smaller than 249?
CREATE TABLE table_name_71 (avg_g INTEGER,long VARCHAR,loss VARCHAR)
SELECT SUM(avg_g) FROM table_name_71 WHERE long = 93 AND loss < 249
How many season 4 appearances are there by Mrs. Jennifer Knight?
CREATE TABLE table_28472 ("Character" text,"Played by" text,"Season 1" real,"Season 2" real,"Season 3" real,"Season 4" real,"First Appearance" text)
SELECT MIN("Season 4") FROM table_28472 WHERE "Character" = 'Mrs. Jennifer Knight'
Visualize a pie chart to show the credit scores of customers who have taken a loan by different names.
CREATE TABLE loan (loan_ID varchar(3),loan_type varchar(15),cust_ID varchar(3),branch_ID varchar(3),amount int)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),...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID
when is the last time patient 4758 visited the hospital since 2105?
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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE prescriptions (row_id numbe...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 4758 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1
Find the number of records of each policy type and its type code. Visualize by bar chart.
CREATE TABLE Claims_Processing (Claim_Processing_ID INTEGER,Claim_ID INTEGER,Claim_Outcome_Code CHAR(15),Claim_Stage_ID INTEGER,Staff_ID INTEGER)CREATE TABLE Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATETIME,End_Date DATETIME)CREATE TABLE Staff (Staff_ID INTEGER,Staff_Details...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code
count the number of patients whose discharge location is short term hospital and year of birth is less than 2078?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2078"
what is the percentile 109.0 in the laboratory test of chloride with regard to the same age of patient 15986 in their current hospital encounter?
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 DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age ...
Tags with a high proportion of unanswered questions. with score <= 0, low views, no answers
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 Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteU...
SELECT t.TagName, 100 * CAST(COUNT(p.Id) AS FLOAT) / COUNT(*) AS "% Unanswered", COUNT(p.Id) AS Unanswered, COUNT(*) AS Posts FROM Tags AS t LEFT JOIN PostTags AS pt ON t.Id = pt.TagId LEFT OUTER JOIN Posts AS p ON pt.PostId = p.Id AND p.PostTypeId = 1 AND p.ViewCount < 500 AND (p.AnswerCount < 1 OR p.AnswerCount IS NU...
what were the three most frequent drugs that were prescribed within 2 months to patients of age 30s after they had been diagnosed with hyperglycemia - stress related since 2104.
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosi...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia - stress related' AND STRFTIME('%y',...
when was first time that patient 20000 had the minimum calculated total co2 value since 102 months ago?
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)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,ic...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TI...
During which Game 4, did Brett Kenny play Game 2?
CREATE TABLE table_58358 ("Position" text,"Game 1" text,"Game 2" text,"Game 3" text,"Game 4" text)
SELECT "Game 4" FROM table_58358 WHERE "Game 2" = 'brett kenny'
Draw a bar chart for what is the average account balance of customers with credit score below 50 for the different account types?, could you list by the X-axis in ascending?
CREATE TABLE bank (branch_ID int,bname varchar(20),no_of_customers int,city varchar(10),state varchar(20))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 loan (loan_ID varchar(3),loan_type varchar(...
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type
count the number of patients admitted before 2194 who were diagnosed with hypopotassemia.
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.admityear < "2194" AND diagnoses.long_title = "Hypopotassemia"
What was Katie's order number when the theme was The Rolling Stones?
CREATE TABLE table_28491 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Order #" FROM table_28491 WHERE "Theme" = 'The Rolling Stones'
How many years have 78 for points?
CREATE TABLE table_39458 ("Year" real,"Class" text,"Team" text,"Machine" text,"Points" real,"Rank" text,"Wins" real)
SELECT COUNT("Year") FROM table_39458 WHERE "Points" = '78'
What was the event for vinny magalh es?
CREATE TABLE table_56891 ("Result" text,"Opponent" text,"Method" text,"Event" text,"Date" real)
SELECT "Event" FROM table_56891 WHERE "Opponent" = 'vinny magalhães'
A bar chart about the number of faults for different fault status of all the faults recoreded in the logs, sort by the Y-axis in desc.
CREATE TABLE Fault_Log (fault_log_entry_id INTEGER,asset_id INTEGER,recorded_by_staff_id INTEGER,fault_log_entry_datetime DATETIME,fault_description VARCHAR(255),other_fault_details VARCHAR(255))CREATE TABLE Engineer_Visits (engineer_visit_id INTEGER,contact_staff_id INTEGER,engineer_id INTEGER,fault_log_entry_id INTEG...
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY COUNT(fault_status) DESC
What's the built date when the CR number is more than 940 and the LMS number is 14760?
CREATE TABLE table_name_57 (built VARCHAR,cr_no VARCHAR,lms_no VARCHAR)
SELECT built FROM table_name_57 WHERE cr_no > 940 AND lms_no = 14760
When was la vista built?
CREATE TABLE table_name_9 (built VARCHAR,location VARCHAR)
SELECT built FROM table_name_9 WHERE location = "la vista"
Total points with 114 played and average of 0.982?
CREATE TABLE table_44527 ("Team" text,"Average" real,"Points" real,"Played" real,"1991-92" text,"1992-93" text,"1993-94" real)
SELECT SUM("Points") FROM table_44527 WHERE "Played" = '114' AND "Average" = '0.982'
What round was jerry corcoran drafted in as pick number 114?
CREATE TABLE table_7901 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College" text)
SELECT MAX("Round") FROM table_7901 WHERE "Pick" > '114' AND "Player" = 'jerry corcoran'
Which Tournament has Pat Cash as a runner-up?
CREATE TABLE table_57045 ("Tournament" text,"Winner" text,"Runner-up" text,"Score" text,"Third Place" text)
SELECT "Tournament" FROM table_57045 WHERE "Runner-up" = 'pat cash'
what is drug type of drug name enalaprilat?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Enalaprilat"
provide the number of patients whose death status is 0 and admission location is emergency room admit?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
In what Round with an Overall greater than 306 was the pick from the College of Virginia Tech?
CREATE TABLE table_name_66 (round VARCHAR,college VARCHAR,overall VARCHAR)
SELECT COUNT(round) FROM table_name_66 WHERE college = "virginia tech" AND overall > 306
What Sweet Sixteen team is in the Colonial conference?
CREATE TABLE table_74753 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" text,"Sweet Sixteen" text,"Elite Eight" text,"Final Four" text,"Championship Game" text)
SELECT "Sweet Sixteen" FROM table_74753 WHERE "Conference" = 'colonial'
Return a pie chart on what are the memories and carriers of phones?
CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
Who was the Home team in Tie #23?
CREATE TABLE table_name_80 (home_team VARCHAR,tie_no VARCHAR)
SELECT home_team FROM table_name_80 WHERE tie_no = 23
provide the number of patients whose admission year is less than 2158 and diagnoses long title is benign neoplasm of spinal meninges?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Benign neoplasm of spinal meninges"
What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?
CREATE TABLE membership_register_branch (member_id number,branch_id text,register_year text)CREATE TABLE purchase (member_id number,branch_id text,year text,total_pounds number)CREATE TABLE branch (branch_id number,name text,open_year text,address_road text,city text,membership_amount text)CREATE TABLE member (member_i...
SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
Compare the total number of different ranks using a bar graph, could you order X in desc order?
CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text)
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank DESC
how many total number of moto2/250cc when country is united states
CREATE TABLE table_2889810_2 (moto2_250cc VARCHAR,country VARCHAR)
SELECT COUNT(moto2_250cc) FROM table_2889810_2 WHERE country = "United States"
English title of mal na had what original title?
CREATE TABLE table_name_9 (original_title VARCHAR,english_title VARCHAR)
SELECT original_title FROM table_name_9 WHERE english_title = "malèna"
Visualize a scatter chart on what are total salaries and department id for each department that has more than 2 employees?
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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANA...
SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID
How many engines were built with a cylinder size of 20 x 26 , firebox is belpaire and valve gear is from Stephenson?
CREATE TABLE table_25695027_1 (number_built VARCHAR,valve_gear VARCHAR,cylinder_size VARCHAR,firebox VARCHAR)
SELECT number_built FROM table_25695027_1 WHERE cylinder_size = "20 ½” x 26”" AND firebox = "Belpaire" AND valve_gear = "Stephenson"
What is the name of the player from NGA?
CREATE TABLE table_name_17 (name VARCHAR,country VARCHAR)
SELECT name FROM table_name_17 WHERE country = "nga"
Does Prof. Gabriel Horowitz teach INSTHUM 611 with a lab ?
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 varchar,minor varchar,internship varchar)CREATE TABLE semester (semester_id int,semester varchar,year i...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'INST...
Which bike did Jiri Drazdak ride when he had a grid number larger than 14 and less than 22 laps?
CREATE TABLE table_name_34 (bike VARCHAR,rider VARCHAR,grid VARCHAR,laps VARCHAR)
SELECT bike FROM table_name_34 WHERE grid > 14 AND laps < 22 AND rider = "jiri drazdak"
How many percent of the votes in Debaca did McCain get?
CREATE TABLE table_20539826_1 (mccain_percentage VARCHAR,county VARCHAR)
SELECT mccain_percentage FROM table_20539826_1 WHERE county = "DeBaca"
i would like to travel from BOSTON to DENVER early in the morning
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE code_description (code varchar,descr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
What week number saw a w 31-16 result?
CREATE TABLE table_57842 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT MIN("Week") FROM table_57842 WHERE "Result" = 'w 31-16'
Which box score has an Attendance of 54,773?
CREATE TABLE table_10463 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text,"Boxscore" text)
SELECT "Boxscore" FROM table_10463 WHERE "Attendance" = '54,773'
What year did the movie Rango come out?
CREATE TABLE table_14716 ("Year" real,"Category" text,"Film" text,"Winner/Nominee(s)" text,"Result" text)
SELECT AVG("Year") FROM table_14716 WHERE "Film" = 'rango'
Who was in 1963?
CREATE TABLE table_80085 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Entrant" FROM table_80085 WHERE "Year" = '1963'
WHAT TEAM HAS A PICK LARGER THAN 29?
CREATE TABLE table_61865 ("Pick" real,"Player" text,"Team" text,"Position" text,"Hometown/School" text)
SELECT "Team" FROM table_61865 WHERE "Pick" > '29'
List the names of editors in ascending order of age.
CREATE TABLE journal (journal_id number,date text,theme text,sales number)CREATE TABLE journal_committee (editor_id number,journal_id number,work_type text)CREATE TABLE editor (editor_id number,name text,age number)
SELECT name FROM editor ORDER BY age
How many different titles does the representative whose mission was terminated on August 5, 1984 have?
CREATE TABLE table_20065425_1 (title VARCHAR,termination_of_mission VARCHAR)
SELECT COUNT(title) FROM table_20065425_1 WHERE termination_of_mission = "August 5, 1984"
What is the venue where the home team is Footscray?
CREATE TABLE table_name_57 (venue VARCHAR,home_team VARCHAR)
SELECT venue FROM table_name_57 WHERE home_team = "footscray"
What is the lowest Loss, when Long is less than 0?
CREATE TABLE table_name_41 (loss INTEGER,long INTEGER)
SELECT MIN(loss) FROM table_name_41 WHERE long < 0
What is the nationality of the player from the Detroit Red Wings?
CREATE TABLE table_1213511_6 (nationality VARCHAR,nhl_team VARCHAR)
SELECT nationality FROM table_1213511_6 WHERE nhl_team = "Detroit Red Wings"
What is the lowest year in since that had a transfer fee of 14m and ended after 2011?
CREATE TABLE table_name_76 (since INTEGER,transfer_fee VARCHAR,ends VARCHAR)
SELECT MIN(since) FROM table_name_76 WHERE transfer_fee = "€ 14m" AND ends > 2011
What was the record on march 26?
CREATE TABLE table_name_79 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_79 WHERE date = "march 26"
What is the Year of Kodansha Novels' Tokyo Nightmare?
CREATE TABLE table_name_80 (year VARCHAR,first_publisher VARCHAR,english_title VARCHAR)
SELECT year FROM table_name_80 WHERE first_publisher = "kodansha novels" AND english_title = "tokyo nightmare"
What is the FIPS code for the municipality that has an area of 114.76 sq mi (297.23 sq km) and had a 2010 population of less than 166,327?
CREATE TABLE table_65004 ("Municipality" text,"FIPS code" real,"Founded" real,"Population (2010)" real,"Area" text)
SELECT AVG("FIPS code") FROM table_65004 WHERE "Area" = '114.76 sq mi (297.23 sq km)' AND "Population (2010)" < '166,327'
what is the class when the power is 22500 watts?
CREATE TABLE table_name_17 (class VARCHAR,power VARCHAR)
SELECT class FROM table_name_17 WHERE power = "22500 watts"
Name the Place which has a Score of 67-71=138, united states?
CREATE TABLE table_60259 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_60259 WHERE "Country" = 'united states' AND "Score" = '67-71=138'
What is the lowest number of goals of the player with 9 (0) games and less than 0 assists?
CREATE TABLE table_63271 ("Name" text,"Games" text,"A-League" text,"Finals" text,"Goals" real,"Assists" real,"Years" text)
SELECT MIN("Goals") FROM table_63271 WHERE "Games" = '9 (0)' AND "Assists" < '0'
Who played as the home team when the attendance was more than 30,080?
CREATE TABLE table_name_21 (home_team VARCHAR,crowd INTEGER)
SELECT home_team FROM table_name_21 WHERE crowd > 30 OFFSET 080
What is Set 2, when Total is '52:44'?
CREATE TABLE table_name_81 (set_2 VARCHAR,total VARCHAR)
SELECT set_2 FROM table_name_81 WHERE total = "52:44"
What is the college club that plays before round 3?
CREATE TABLE table_name_85 (college_junior_club_team VARCHAR,round INTEGER)
SELECT college_junior_club_team FROM table_name_85 WHERE round < 3
What is the report for Challenge Stadium?
CREATE TABLE table_8048 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Crowd" real,"Box Score" text,"Report" text)
SELECT "Report" FROM table_8048 WHERE "Venue" = 'challenge stadium'
What height was the player that played for the Rockets between 1992-93?
CREATE TABLE table_330 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"Years for Rockets" text,"School/Club Team/Country" text)
SELECT "Height in Ft." FROM table_330 WHERE "Years for Rockets" = '1992-93'
What is the Total medals the Year Yugoslavia had 1 Sport and won 0 Gold, Bronze or Silver?
CREATE TABLE table_name_94 (total VARCHAR,sports VARCHAR,silver VARCHAR,gold VARCHAR,bronze VARCHAR)
SELECT total FROM table_name_94 WHERE gold = "0" AND bronze = "0" AND silver = "0" AND sports = "1"
What is the score when the opposition is mid canterbury?
CREATE TABLE table_26847237_3 (score VARCHAR,opposition VARCHAR)
SELECT score FROM table_26847237_3 WHERE opposition = "Mid Canterbury"
Which round did Dundee United end in?
CREATE TABLE table_name_11 (round VARCHAR,club VARCHAR)
SELECT round FROM table_name_11 WHERE club = "dundee united"
How many different kinds of information sources are there for injury accidents?
CREATE TABLE stadium (id number,name text,home_games number,average_attendance number,total_attendance number,capacity_percentage number)CREATE TABLE injury_accident (game_id number,id number,player text,injury text,number_of_matches text,source text)CREATE TABLE game (stadium_id number,id number,season number,date tex...
SELECT COUNT(DISTINCT source) FROM injury_accident
provide the number of patients whose discharge location is home health care and age is less than 31?
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 text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "31"
hematocrit of less than 36 % for male , less than 32 % for female .
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 (hematocrit_hct < 36 AND gender = 'male') OR (hematocrit_hct < 32 AND gender = 'female')
can you give me the latest flight from ATLANTA to DENVER on 7 7
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 equipment_sequen...
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 = 'DENVER' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da...
who came in first place in 1966 ?
CREATE TABLE table_204_110 (id number,"year" number,"champion" text,"city" text,"llws" text,"record" text)
SELECT "champion" FROM table_204_110 WHERE "year" = 1966
what is minimum age of patients whose admission type is emergency and year of death is less than 2158?
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 text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2158.0"
What club had 0 goals?
CREATE TABLE table_name_4 (club VARCHAR,goals VARCHAR)
SELECT club FROM table_name_4 WHERE goals = 0
What is the smallest rank when there are more than 2 games?
CREATE TABLE table_name_52 (rank INTEGER,games INTEGER)
SELECT MIN(rank) FROM table_name_52 WHERE games > 2
what is the difference in medals between cuba and mexico ?
CREATE TABLE table_203_466 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT (SELECT "total" FROM table_203_466 WHERE "nation" = 'cuba') - (SELECT "total" FROM table_203_466 WHERE "nation" = 'mexico')
Where did North Melbourne play as the home team?
CREATE TABLE table_77693 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_77693 WHERE "Home team" = 'north melbourne'
List the name for storms and the number of affected regions for each storm.
CREATE TABLE region (region_id number,region_code text,region_name text)CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number)
SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id
count the number of patients for whom prednisone 50 mg po tabs was prescribed in the same hospital visit after having been diagnosed with pneumonia.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vita...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttim...
What is the Away team when Arsenal is the Home team?
CREATE TABLE table_12306 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Away team" FROM table_12306 WHERE "Home team" = 'arsenal'