instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Show all the ranks and the number of male and female faculty for each rank. | CREATE TABLE Faculty (rank VARCHAR,sex VARCHAR) | SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex |
wbc count < 3 | CREATE TABLE table_train_161 ("id" int,"white_blood_cell_count_wbc" int,"systolic_blood_pressure_sbp" int,"c_peptide_level" float,"diastolic_blood_pressure_dbp" int,"heart_rate" int,"glycosylated_hemoglobin" float,"NOUSE" float) | SELECT * FROM table_train_161 WHERE white_blood_cell_count_wbc < 3 |
find out how many patients were discharged from the hospital during the previous year. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
Can you draw a bar chart to show the number of items in each customer details category?, I want to order in asc by the total number. | CREATE TABLE Customer_Events (Customer_Event_ID INTEGER,customer_id INTEGER,date_moved_in DATETIME,property_id INTEGER,resident_id INTEGER,thing_id INTEGER)CREATE TABLE Properties (property_id INTEGER,property_type_code CHAR(15),property_address VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Residents (resident_i... | SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details ORDER BY COUNT(customer_details) |
Which song was sung by Artist Luther Vandross in the Week Top 20? | CREATE TABLE table_60179 ("Week" text,"Theme" text,"Song Sung" text,"Artist" text,"Status" text) | SELECT "Song Sung" FROM table_60179 WHERE "Artist" = 'luther vandross' AND "Week" = 'top 20' |
what is the difference between the number of onthophagus obliquus species released and the number of sisyphus rubrus paschalidis released ? | CREATE TABLE table_204_869 (id number,"species" text,"country of origin" text,"total released" number,"first release" text,"last release" text,"areas of release" text,"areas established" text,"pasture type" text) | SELECT ABS((SELECT "total released" FROM table_204_869 WHERE "species" = 'onthophagus obliquus') - (SELECT "total released" FROM table_204_869 WHERE "species" = 'sisyphus rubrus paschalidis')) |
give me the number of patients whose lab test name is prolactin? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Prolactin" |
what is the intake method of the ecotrin ec? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid ... | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'ecotrin ec' |
Which have more than $80k and a total percent of 2.2%? | CREATE TABLE table_name_60 (more_than_$80 VARCHAR,percent_of_total VARCHAR) | SELECT more_than_$80, 000 FROM table_name_60 WHERE percent_of_total = "2.2%" |
What is the date of game 5? | CREATE TABLE table_20745706_1 (date VARCHAR,_number VARCHAR) | SELECT date FROM table_20745706_1 WHERE _number = "5" |
what distance hurdles was run the most ? | CREATE TABLE table_203_539 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" number) | SELECT "event" FROM table_203_539 GROUP BY "event" ORDER BY COUNT(*) DESC LIMIT 1 |
What's the average attendance on january 6, 2008? | CREATE TABLE table_name_34 (attendance INTEGER,date VARCHAR) | SELECT AVG(attendance) FROM table_name_34 WHERE date = "january 6, 2008" |
What is the lowest number for the University of Dublin, having and administrative panel of 3, and a Cultural and Educational panel less than 2? | CREATE TABLE table_34677 ("Administrative Panel" real,"Agricultural Panel" real,"Cultural and Educational Panel" real,"Industrial and Commercial Panel" real,"Labour Panel" real,"National University of Ireland" real,"University of Dublin" real,"Nominated by the Taoiseach" real,"Total" real) | SELECT MIN("University of Dublin") FROM table_34677 WHERE "Administrative Panel" = '3' AND "Cultural and Educational Panel" < '2' |
What will the special topics classes be next Winter ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text 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 varcha... | SELECT DISTINCT course.department, course.name, course.number 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.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... |
What did Denmark time at? | CREATE TABLE table_65405 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT "Time" FROM table_65405 WHERE "Country" = 'denmark' |
How many 300 -level classes are being offered in Spring and Summer term ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assi... | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester ... |
how many places for chinese are there in the bay area ? | CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE geographic (city_name varchar,county varchar,region varchar) | SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'chinese' |
What is the total pick number of the player from a round greater than 1, a draft before 2002, and with the college/high school/club of western kentucky? | CREATE TABLE table_44004 ("Draft" real,"Round" real,"Pick" real,"Player" text,"College/High School/Club" text) | SELECT COUNT("Pick") FROM table_44004 WHERE "Round" > '1' AND "Draft" < '2002' AND "College/High School/Club" = 'western kentucky' |
Find the number of patients with coronary artery as their primary disease who were born before 2110. | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2110" |
Return a bar chart about the distribution of Sex and the amount of Sex , and group by attribute Sex, and rank in desc by the names. | CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real) | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex DESC |
what is the time/retired when the grid is 9? | CREATE TABLE table_name_77 (time_retired VARCHAR,grid VARCHAR) | SELECT time_retired FROM table_name_77 WHERE grid = 9 |
What is Name, when Length Meters is greater than 66.4, and when Km From Kingston is 138.8? | CREATE TABLE table_9560 ("Name" text,"Mi from Kingston" real,"Km from Kingston" real,"Parish" text,"Length feet" real,"Length meters" real) | SELECT "Name" FROM table_9560 WHERE "Length meters" > '66.4' AND "Km from Kingston" = '138.8' |
What is the largest payment amount? | CREATE TABLE payment (amount VARCHAR) | SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 |
On what date did Detroit play at home? | CREATE TABLE table_name_25 (date VARCHAR,home VARCHAR) | SELECT date FROM table_name_25 WHERE home = "detroit" |
What are the L2 cache specifications of part number amql64dam22gg? | CREATE TABLE table_3721 ("Model Number" text,"Frequency" text,"L2 Cache" text,"HT" text,"Mult. 1" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Order Part Number" text) | SELECT "L2 Cache" FROM table_3721 WHERE "Order Part Number" = 'AMQL64DAM22GG' |
give me the number of patients whose ethnicity is white - russian and drug route is id? | 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 text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "ID" |
What's listed for the lowest Year that a Silver of Kim Kyung-Ho? | CREATE TABLE table_name_51 (year INTEGER,silver VARCHAR) | SELECT MIN(year) FROM table_name_51 WHERE silver = "kim kyung-ho" |
Which clubs have players with height 2.14m? | CREATE TABLE table_26244 ("No" real,"Player" text,"Height (m)" text,"Height (f)" text,"Position" text,"Year born" real,"Current Club" text) | SELECT "Current Club" FROM table_26244 WHERE "Height (m)" = '2.14' |
Which wheel arrangement made in year 1900? | CREATE TABLE table_49530 ("Class" text,"Wheel arrangement" text,"Fleet number(s)" text,"Manufacturer" text,"Year made" text,"Quantity made" text,"Quantity preserved" text) | SELECT "Wheel arrangement" FROM table_49530 WHERE "Year made" = '1900' |
Percent of users who added this [tag]?. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT FIRST_USER AS "user_link", COUNT(PostId) AS "COUNT", COUNT(PostId) * 100 / SUM(COUNT(PostId)) OVER () AS "%" FROM (SELECT MAX(CreationDate) AS CDATE, PostId, FIRST_USER FROM (SELECT FIRST_VALUE(PH.UserId) OVER (PARTITION BY PH.PostId ORDER BY PH.CreationDate) AS FIRST_USER, * FROM PostHistory AS PH WHERE PH.Text... |
What are the number of the names of the technicians that are assigned to repair machines with more point values than 70?, and order from high to low by the total number. | CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair (... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) DESC |
Can you tell me the total number of Rank that has the Area (km 2) smaller than 2,040, and the Population smaller than 1,234,596? | CREATE TABLE table_71141 ("Rank" real,"Country/Region" text,"Population" real,"Area (km 2)" real,"Density (Pop. per km 2)" real) | SELECT COUNT("Rank") FROM table_71141 WHERE "Area (km 2 )" < '2,040' AND "Population" < '1,234,596' |
count the number of patients that are diagnosed with int inf clstrdium dfcile until 3 years ago. | 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 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 ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'int inf clstrdium dfcile') AND DATETIME(diagnoses_icd.char... |
cardiogenic shock ( sbp < 80 mmhg for > 30 minutes, or requiring iv pressors or intra _ aortic balloon bump ( iabp ) or other hemodynamic support device for hypotension ) | CREATE TABLE table_test_14 ("id" int,"bleeding" int,"intra_aortic_balloon_pump_iabp" bool,"systolic_blood_pressure_sbp" int,"haemoglobin" float,"severe_hypertension" bool,"platelets" int,"neutrophil_count" int,"renal_disease" bool,"severe_thrombocytopenia" bool,"fasting_blood_glucose_fbg" float,"creatinine_clearance_cl... | SELECT * FROM table_test_14 WHERE cardiogenic_shock = 1 OR (systolic_blood_pressure_sbp < 80 OR iv_pressors = 1 OR intra_aortic_balloon_pump_iabp = 1 OR hemodynamic_instability = 1) |
What is the sum of attendance for the games played at Los Angeles Rams? | CREATE TABLE table_name_39 (attendance INTEGER,opponent VARCHAR) | SELECT SUM(attendance) FROM table_name_39 WHERE opponent = "at los angeles rams" |
What is the lowest Floors, when Built is greater than 1970, and when Name is NV Building 3? | CREATE TABLE table_name_90 (floors INTEGER,built VARCHAR,name VARCHAR) | SELECT MIN(floors) FROM table_name_90 WHERE built > 1970 AND name = "nv building 3" |
Count the number of elective hospital admission patients who had a creatine kinase lab test. | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Creatine Kinase (CK)" |
What is the title of the episode with series number 14? | CREATE TABLE table_30862 ("Episode #" real,"Series #" real,"Episode Title" text,"Original air date" text,"Production Code" real) | SELECT "Episode Title" FROM table_30862 WHERE "Series #" = '14' |
during the previous year, what is the top four most frequent microbiology tests given to patients within the same hospital visit within the same patient after receiving ventilator weaning? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitst... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilato... |
what is the number of patients whose admission type is elective and admission year is less than 2184? | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2184" |
What ethnic group had the largest population in in 2002? | CREATE TABLE table_2562572_53 (largest_ethnic_group__2002_ VARCHAR,cyrillic_name VARCHAR) | SELECT largest_ethnic_group__2002_ FROM table_2562572_53 WHERE cyrillic_name = "Сурдук" |
What is the highest Assets (USD) Millions from Equity Bank and less than 44 branches? | CREATE TABLE table_name_37 (assets__usd__millions INTEGER,bank VARCHAR,number_of_branches VARCHAR) | SELECT MAX(assets__usd__millions) FROM table_name_37 WHERE bank = "equity bank" AND number_of_branches < 44 |
other than switzerland , which other nation won a total of three bronze awards ? | CREATE TABLE table_204_761 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_761 WHERE "nation" <> 'switzerland' AND "bronze" = 3 |
If the team is Rubio , what is the 08 points? | CREATE TABLE table_24709 ("Pos" real,"Team" text,"07 Pts" real,"08 Pts" real,"09 Pts" real,"Total Pts" real,"Total Pld" real,"Avg" text) | SELECT "08 Pts" FROM table_24709 WHERE "Team" = 'Rubio Ñú' |
What is the title when the writer is Emily Halpern? | CREATE TABLE table_24910733_1 (title VARCHAR,written_by VARCHAR) | SELECT title FROM table_24910733_1 WHERE written_by = "Emily Halpern" |
How many dar are in germany? | CREATE TABLE table_72734 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"Package/Option" text) | SELECT "DAR" FROM table_72734 WHERE "Country" = 'Germany' |
On April 15 who is the Home team? | CREATE TABLE table_45715 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_45715 WHERE "Date" = 'april 15' |
Name the averag scored for 2011 long teng cup and 2 october 2011 | CREATE TABLE table_name_64 (scored INTEGER,competition VARCHAR,date VARCHAR) | SELECT AVG(scored) FROM table_name_64 WHERE competition = "2011 long teng cup" AND date = "2 october 2011" |
what is admission location and icu stay id of subject id 74032? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.admission_location, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032" |
what is the number of patients categorized under chemistry lab test who have a diagnoses of acute myocardial infarction of inferolataeral wall, inital episode of care? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "AMI inferolateral, init" AND lab."CATEGORY" = "Chemistry" |
for patients who have received endotracheal tube removal since 2 years ago, what are the top four most common medications that have followed during the same 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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'endotracheal tu... |
Who is the prisoner that is older than 45 and has served less than 22 years on death row? | CREATE TABLE table_name_39 (name VARCHAR,current_age VARCHAR,years_on_death_row VARCHAR) | SELECT name FROM table_name_39 WHERE current_age > 45 AND years_on_death_row < 22 |
Show the average age for all female students and group them by last name with a bar chart, could you list by the total number in asc please? | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20)) | SELECT LName, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY AVG(Age) |
female of non _ childbearing potential. | CREATE TABLE table_dev_25 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"diastolic_blood_pressure_dbp" int,"alcohol_abuse" bool,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_25 WHERE gender = 'female' AND pregnancy_or_lactation = 0 |
Name the peletier for systematics being million 1 | CREATE TABLE table_28297 ("Shortscale comparison" text,"Chuquet" text,"Peletier" text,"Systematics" text,"Base 10" text,"SI Prefix" text) | SELECT "Peletier" FROM table_28297 WHERE "Systematics" = 'Million 1' |
Tell me the location for altitude being less thaan 6102 | CREATE TABLE table_31722 ("Name" text,"Location" text,"District" text,"Altitude (metres)" real,"Region" text) | SELECT "Location" FROM table_31722 WHERE "Altitude (metres)" < '6102' |
What are the exact Cubic inches of the Metric value of 104.955 L? | CREATE TABLE table_name_9 (cubic_inches__exact_ VARCHAR,metric_value VARCHAR) | SELECT cubic_inches__exact_ FROM table_name_9 WHERE metric_value = "104.955 l" |
what is the time/retired for driver richard attwood? | CREATE TABLE table_55694 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_55694 WHERE "Driver" = 'richard attwood' |
What is the average grid number that had Team China with less than 10 laps? | CREATE TABLE table_38275 ("Team" text,"Driver" text,"Laps" real,"Time" text,"Grid" real) | SELECT AVG("Grid") FROM table_38275 WHERE "Laps" < '10' AND "Team" = 'china' |
What is the total number of Silver medals for the Nation with less than 1 Bronze? | CREATE TABLE table_name_84 (silver VARCHAR,bronze INTEGER) | SELECT COUNT(silver) FROM table_name_84 WHERE bronze < 1 |
I want the condition that has a partial thromboplastin time of prolonged and unaffected bleeding time | CREATE TABLE table_51590 ("Condition" text,"Prothrombin time" text,"Partial thromboplastin time" text,"Bleeding time" text,"Platelet count" text) | SELECT "Condition" FROM table_51590 WHERE "Partial thromboplastin time" = 'prolonged' AND "Bleeding time" = 'unaffected' |
What is the position of the player from Tampa? | CREATE TABLE table_name_14 (position VARCHAR,school_club_team VARCHAR) | SELECT position FROM table_name_14 WHERE school_club_team = "tampa" |
List the number of invoices from the US, grouped by state Visualize by bar chart, I want to rank in ascending by the X please. | CREATE TABLE tracks (id INTEGER,name VARCHAR(200),album_id INTEGER,media_type_id INTEGER,genre_id INTEGER,composer VARCHAR(220),milliseconds INTEGER,bytes INTEGER,unit_price NUMERIC(10,2))CREATE TABLE genres (id INTEGER,name VARCHAR(120))CREATE TABLE invoice_lines (id INTEGER,invoice_id INTEGER,track_id INTEGER,unit_pr... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY billing_state |
What is the average prize for the Buttercross Limited Stakes? | CREATE TABLE table_69269 ("Race" text,"Dist (f)" real,"Course" text,"Prize (\u00a3K)" real,"Runners" real,"Placing" real,"Margin" text,"Jockey" text,"Trainer" text) | SELECT AVG("Prize (\u00a3K)") FROM table_69269 WHERE "Race" = 'buttercross limited stakes' |
How many club teams had more than 14 people? | CREATE TABLE table_66814 ("Position" text,"Player" text,"County team" text,"Club team(s)" text,"Team Number" real) | SELECT "Club team(s)" FROM table_66814 WHERE "Team Number" > '14' |
Find the count and code of the job has most employees. | CREATE TABLE employee (emp_jobcode VARCHAR) | SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1 |
what was the score on the game that happened on May 15? | CREATE TABLE table_name_49 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_49 WHERE date = "may 15" |
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, list in descending by the y-axis. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME var... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC |
If the equation is 6 9 + 6 9 + 6, what is the 3rd throw? | CREATE TABLE table_17265535_7 (equation VARCHAR) | SELECT MAX(3 AS rd_throw) FROM table_17265535_7 WHERE equation = "6 × 9² + 6 × 9 + 6" |
What are the open source movies with planned releases in 2013? | CREATE TABLE table_name_67 (open_source_movie VARCHAR,planned_release VARCHAR) | SELECT open_source_movie FROM table_name_67 WHERE planned_release = "2013" |
Which teacher gives the class EPID 709 ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EPID' AND course.number = 709 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... |
count the number of people who were prescribed heparin sod (porcine) within 2 months following a diagnosis of hypothyroidism. | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid n... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypothyroidism') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient... |
Which hanzi's name is nmtv mongolian satellite television? | CREATE TABLE table_37740 ("Name" text,"Hanzi" text,"Language" text,"Launch" real,"Owner" text) | SELECT "Hanzi" FROM table_37740 WHERE "Name" = 'nmtv mongolian satellite television' |
What was the terrain for stage 10 of the tour? | CREATE TABLE table_name_69 (terrain VARCHAR,stage VARCHAR) | SELECT terrain FROM table_name_69 WHERE stage = "10" |
What are the dates of publications in descending order of price? | CREATE TABLE book (book_id number,title text,issues number,writer text)CREATE TABLE publication (publication_id number,book_id number,publisher text,publication_date text,price number) | SELECT publication_date FROM publication ORDER BY price DESC |
What Game has a Location of Philadelphia Spectrum and a Date of April 1? | CREATE TABLE table_name_80 (game VARCHAR,location VARCHAR,date VARCHAR) | SELECT game FROM table_name_80 WHERE location = "philadelphia spectrum" AND date = "april 1" |
What is the launch date of ? | CREATE TABLE table_69905 ("Kanji" text,"Name" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text) | SELECT "Launched" FROM table_69905 WHERE "Kanji" = '栗' |
Name the total number of 2010 for when 2009 is less than 14, 2008 is less than 15 and 2005 is 3 | CREATE TABLE table_name_85 (Id VARCHAR) | SELECT COUNT(2010) FROM table_name_85 WHERE 2009 < 14 AND 2008 < 15 AND 2005 = 3 |
What was the major version when the webkit version was 528.17? | CREATE TABLE table_26703 ("Major version" text,"Minor version" text,"WebKit version" text,"Operating System" text,"Release date" text,"Features" text) | SELECT "Major version" FROM table_26703 WHERE "WebKit version" = '528.17' |
provide the number of patients taking base type drug medication who were hospitalized for more than 2 days. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "BASE" |
What was the report of Mike Hawthorn's winning race? | CREATE TABLE table_1140113_5 (report VARCHAR,winning_driver VARCHAR) | SELECT report FROM table_1140113_5 WHERE winning_driver = "Mike Hawthorn" |
Among deaths 106 000 how many is crude rate. | CREATE TABLE table_21258_1 (crude_death_rate VARCHAR,deaths VARCHAR) | SELECT crude_death_rate FROM table_21258_1 WHERE deaths = "106 000" |
Which venue had a note of 3:34.88 after 2003? | CREATE TABLE table_51833 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Notes" text) | SELECT "Venue" FROM table_51833 WHERE "Year" > '2003' AND "Notes" = '3:34.88' |
Where was the game seen by 10056 people played? | CREATE TABLE table_27537518_6 (location VARCHAR,attendance VARCHAR) | SELECT location FROM table_27537518_6 WHERE attendance = 10056 |
since 65 months ago, when patient 007-9626 was prescribed for the last time a drug? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname te... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9626')) AND DATETIME(medication.drugstarttime) >= DATETIME... |
Which rooms cost between 120 and 150? Give me the room names. | CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number)CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text) | SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 |
What is the earliest year that a candidate was first elected? | CREATE TABLE table_18443 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MIN("First elected") FROM table_18443 |
What are the weights of entrepreneurs in descending order of money requested? | CREATE TABLE people (Weight VARCHAR,People_ID VARCHAR)CREATE TABLE entrepreneur (People_ID VARCHAR,Money_Requested VARCHAR) | SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC |
how many days has it been since the last time patient 004-79017 stayed in ward 185 during the current hospital encounter. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayi... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '004-79017' AND patient.wardid = 185 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 |
in what year was twilight heroes released ? | CREATE TABLE table_204_700 (id number,"name" text,"developer" text,"release" text,"type" text,"game flow" text,"setting" text) | SELECT "release" FROM table_204_700 WHERE "name" = 'twilight heroes' |
what about the EA flights arriving in PITTSBURGH between 1200 and 1600 in the afternoon | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE state (state_code text,state_name text,country_name text... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE ((flight.arrival_time <= 1600 AND flight.arrival_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'EA' |
What was the score on September 8? | CREATE TABLE table_name_52 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_52 WHERE date = "september 8" |
WHAT WAS THE SCORE FOR GAME 31? | CREATE TABLE table_15869204_6 (score VARCHAR,game VARCHAR) | SELECT score FROM table_15869204_6 WHERE game = 31 |
how much should patient 16904 have to pay for their stay at the hospital when they came to the hospital last time? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (r... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16904 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) |
What is the mark for Kim Collins? | CREATE TABLE table_41763 ("Lane" real,"Name" text,"Country" text,"Mark" text,"React" real) | SELECT "Mark" FROM table_41763 WHERE "Name" = 'kim collins' |
Where was the game when Collingwood was the home team? | CREATE TABLE table_32464 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_32464 WHERE "Away team" = 'collingwood' |
what papers are typically cited by tom mitchell and oren etzioni | CREATE TABLE field (fieldid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABL... | SELECT DISTINCT author.authorname, cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname IN ('tom mitchell', 'oren etzioni') AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid, author.au... |
What are the titles of all movies that have between 3 and 5 stars, and count them by a bar chart, and display X-axis in ascending order. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text) | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title |
what is the five most frequent drugs that were prescribed in the same month to the patients in the same age 30s after they had been diagnosed with myopathy, until 2103? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,... | 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 = 'myopathy' AND STRFTIME('%y', diagnosis.diagnosisti... |
What is the rounds of rider Mika Kallio 1 of the Ducati Marlboro team? | CREATE TABLE table_name_67 (rounds VARCHAR,team VARCHAR,rider VARCHAR) | SELECT rounds FROM table_name_67 WHERE team = "ducati marlboro team" AND rider = "mika kallio 1" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.