instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the Country of the Player with a Score of 66-72-70-69=277? | CREATE TABLE table_12935 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" real) | SELECT "Country" FROM table_12935 WHERE "Score" = '66-72-70-69=277' |
what amount of topiramate has been prescribed to patient 62413 in total in 02/this year? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chart... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62413) AND prescriptions.drug = 'topiramate' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND ... |
Sum of m. night shyamalan ranks? | CREATE TABLE table_name_41 (rank INTEGER,director_s_ VARCHAR) | SELECT SUM(rank) FROM table_name_41 WHERE director_s_ = "m. night shyamalan" |
what kind of ground transportation can you offer me in SEATTLE | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SEATTLE' AND ground_service.city_code = city.city_code |
Who was the home team when Sheffield United was the away team and the date was also Sheffield United? | CREATE TABLE table_48291 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_48291 WHERE "Away team" = 'sheffield united' AND "Date" = 'sheffield united' |
What week of the season was December 13? | CREATE TABLE table_41932 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Week" FROM table_41932 WHERE "Date" = 'december 13' |
What date is st kilda the Away team? | CREATE TABLE table_name_90 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_90 WHERE away_team = "st kilda" |
In what Venue was the Score 1-1? | CREATE TABLE table_name_76 (venue VARCHAR,score VARCHAR) | SELECT venue FROM table_name_76 WHERE score = "1-1" |
Which deputy prime minister left office in 1981? | CREATE TABLE table_69919 ("Deputy Prime Minister" text,"Took office" real,"Left office" text,"Prime Minister" text,"Term" text,"Party" text) | SELECT "Deputy Prime Minister" FROM table_69919 WHERE "Left office" = '1981' |
What's the smallest March when the record is 22-12-6? | CREATE TABLE table_39913 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text) | SELECT MIN("March") FROM table_39913 WHERE "Record" = '22-12-6' |
How many rebounds does Fedor likholitov have with a rank greater than 8? | CREATE TABLE table_name_21 (rebounds INTEGER,name VARCHAR,rank VARCHAR) | SELECT SUM(rebounds) FROM table_name_21 WHERE name = "fedor likholitov" AND rank > 8 |
The course for MDE that is the easiest has who as a teacher ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cr... | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour... |
What is the number of the name for number 4? | CREATE TABLE table_17811 ("#" real,"Name" text,"Tenure" text,"Courtesy title" text,"Court Rank" text,"Revenues" text,"Lineage" text) | SELECT COUNT("Name") FROM table_17811 WHERE "#" = '4' |
Upvotes by tag in 2015. how long before I get tag badges? | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseA... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.CreationDate > '01/01/2015' GROUP BY TagName ORDER BY UpVotes DESC |
Which Thai restaurant has the most number of reviews | CREATE TABLE business (bid int,business_id varchar,name varchar,full_address varchar,city varchar,latitude varchar,longitude varchar,review_count bigint,is_open tinyint,rating float,state varchar)CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TA... | SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Thai' ORDER BY business.review_count DESC LIMIT 1 |
Which Scorers have a Venue of A, and an Opponent of arsenal? | CREATE TABLE table_67659 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Scorers" text) | SELECT "Scorers" FROM table_67659 WHERE "Venue" = 'a' AND "Opponent" = 'arsenal' |
How many are enrolled at 49 Marion with the Warriors as their mascot? | CREATE TABLE table_39619 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"# / County" text) | SELECT COUNT("Enrollment") FROM table_39619 WHERE "# / County" = '49 marion' AND "Mascot" = 'warriors' |
Name the max for prohibition. | CREATE TABLE table_17410 ("Jurisdiction" text,"For Prohibition" real,"Percent For" text,"Against Prohibition" real,"Percent Against" text) | SELECT MAX("For Prohibition") FROM table_17410 |
what is the chassis when the tyre is b, the engine is ferrari 050 ferrari 051 and the driver is rubens barrichello? | CREATE TABLE table_77583 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine \u2020" text,"Tyre" text,"Driver" text,"Rounds" text) | SELECT "Chassis" FROM table_77583 WHERE "Tyre" = 'b' AND "Engine \u2020" = 'ferrari 050 ferrari 051' AND "Driver" = 'rubens barrichello' |
What was Mark O'Meara's total? | CREATE TABLE table_name_40 (total VARCHAR,player VARCHAR) | SELECT total FROM table_name_40 WHERE player = "mark o'meara" |
What was the home teams score at Arden Street Oval? | CREATE TABLE table_33399 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_33399 WHERE "Venue" = 'arden street oval' |
give me the number of patients whose admission year is less than 2197 and item id is 50925? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.itemid = "50925" |
what is diagnoses long title and procedure long title of subject id 83678? | 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 diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678" |
when was patient 10266 prescribed a medication via pr route the first time during their first hospital visit? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,chart... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'pr' ORDER BY prescriptions.startdate LIMIT 1 |
What are the names of perpetrators in country 'China' or 'Japan'? | CREATE TABLE people (people_id number,name text,height number,weight number,home town text)CREATE TABLE perpetrator (perpetrator_id number,people_id number,date text,year number,location text,country text,killed number,injured number) | SELECT T1.name FROM people AS T1 JOIN perpetrator AS T2 ON T1.people_id = T2.people_id WHERE T2.country = "China" OR T2.country = "Japan" |
Which class has fewer than 10 and number(s) names? | CREATE TABLE table_58897 ("Class" text,"Number(s)" text,"Quantity" real,"Year(s) of Manufacture" text,"Type" text) | SELECT "Class" FROM table_58897 WHERE "Quantity" < '10' AND "Number(s)" = 'names' |
What was the date of the game in which Holt (4-4) took the loss? | CREATE TABLE table_name_36 (date VARCHAR,loss VARCHAR) | SELECT date FROM table_name_36 WHERE loss = "holt (4-4)" |
What was the active period for the pop genre? | CREATE TABLE table_name_87 (period_active VARCHAR,genre VARCHAR) | SELECT period_active FROM table_name_87 WHERE genre = "pop" |
What's the year that has a Baden Freiburger FC? | CREATE TABLE table_name_78 (year VARCHAR,baden VARCHAR) | SELECT COUNT(year) FROM table_name_78 WHERE baden = "freiburger fc" |
What was the date of the game against Hayes & Yeading United? | CREATE TABLE table_6288 ("Round" text,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text) | SELECT "Date" FROM table_6288 WHERE "Opponent" = 'hayes & yeading united' |
What is the number of generators where the power capicity is 78.7? | CREATE TABLE table_11456251_5 (number_of_generators VARCHAR,power_capacity__gw_ VARCHAR) | SELECT COUNT(number_of_generators) FROM table_11456251_5 WHERE power_capacity__gw_ = "78.7" |
How many wins in the season he finished 33rd | CREATE TABLE table_1875157_1 (winnings VARCHAR,position VARCHAR) | SELECT winnings FROM table_1875157_1 WHERE position = "33rd" |
What is the total with lower than rank 8, and higher than 27.6 score and 13.8 difficulty? | CREATE TABLE table_name_63 (total INTEGER,difficulty_score VARCHAR,rank VARCHAR,routine_score VARCHAR) | SELECT MIN(total) FROM table_name_63 WHERE rank > 8 AND routine_score > 27.6 AND difficulty_score = "13.8" |
what is procedure icd9 code and procedure short title of subject name alice nixon? | 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 procedures.icd9_code, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Alice Nixon" |
What Opponent has a Results of 1:3? | CREATE TABLE table_36438 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text) | SELECT "Opponent" FROM table_36438 WHERE "Results\u00b9" = '1:3' |
What is the Score on 27 Jan 1990 with an Away Team of Queens Park Rangers? | CREATE TABLE table_name_71 (score VARCHAR,date VARCHAR,away_team VARCHAR) | SELECT score FROM table_name_71 WHERE date = "27 jan 1990" AND away_team = "queens park rangers" |
what was the number of passengers in phoenix arizona ? | CREATE TABLE table_203_515 (id number,"rank" number,"city" text,"passengers" number,"ranking" number,"airline" text) | SELECT "passengers" FROM table_203_515 WHERE "city" = 'phoenix' |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
what were the four most frequent drugs prescribed to stroke male patients with age 60 or above during the same month after being diagnosed with stroke the last year? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT 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 = 'stroke' AND DATETIME(diagnosis.diagnosistime, 'sta... |
Who sunk the ship with the flag of Norway? | CREATE TABLE table_name_67 (sunk_by VARCHAR,flag VARCHAR) | SELECT sunk_by FROM table_name_67 WHERE flag = "norway" |
What is the top round for the baltimore bullets with a Pick larger than 6? | CREATE TABLE table_52696 ("Round" real,"Pick" real,"Player" text,"Position" text,"Team" text,"College" text) | SELECT MAX("Round") FROM table_52696 WHERE "Team" = 'baltimore bullets' AND "Pick" > '6' |
what was the name of the player who accomplished this in 1999 but played for the boston red sox ? | CREATE TABLE table_203_549 (id number,"player" text,"team" text,"date" text,"opponent" text,"venue" text) | SELECT "player" FROM table_203_549 WHERE "date" = 1999 AND "team" = 'boston red sox' |
Which Category was from before 2009 with a Role/Episode of Libby Goldstein and Junie Lowry-Johnson? | CREATE TABLE table_63973 ("Year" real,"Category" text,"Recipients and nominees" text,"Role/Episode" text,"Result" text) | SELECT "Category" FROM table_63973 WHERE "Year" < '2009' AND "Role/Episode" = 'libby goldstein and junie lowry-johnson' |
What is the average number of conversions for the Cardiff Blues with less than 14 tries? | CREATE TABLE table_name_91 (conversions INTEGER,team VARCHAR,tries VARCHAR) | SELECT AVG(conversions) FROM table_name_91 WHERE team = "cardiff blues" AND tries < 14 |
How many matches has Mohammad Al-Shamlan played when there is 1 win? | CREATE TABLE table_71372 ("Name" text,"Period" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text) | SELECT "Matches" FROM table_71372 WHERE "Wins" = '1' AND "Name" = 'mohammad al-shamlan' |
what is the to par for geoff ogilvy? | CREATE TABLE table_63554 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "To par" FROM table_63554 WHERE "Player" = 'geoff ogilvy' |
what were the total number of titles aired in november ? | CREATE TABLE table_203_685 (id number,"no. in\nseries" number,"no. in\nseason" number,"title" text,"directed by" text,"written by" text,"original air date" text) | SELECT COUNT("title") FROM table_203_685 WHERE "original air date" = 11 |
When did Kim Thompson win with 278 score? | CREATE TABLE table_35771 ("Year" real,"Champion" text,"Venue" text,"Location" text,"Score" text) | SELECT SUM("Year") FROM table_35771 WHERE "Score" = '278' AND "Champion" = 'kim thompson' |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of last_name and salary in a bar chart, and list bar in ascending 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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STAT... | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME |
What are all the profits elegance (2007) in which mayor is ma. Ester a. Hamor | CREATE TABLE table_255812_1 (income_class__2007_ VARCHAR,mayor VARCHAR) | SELECT income_class__2007_ FROM table_255812_1 WHERE mayor = "Ma. Ester A. Hamor" |
Where is the coimbatore affilation that was established in 1982? | CREATE TABLE table_57112 ("College Name" text,"Location" text,"District" text,"Affiliation" text,"Estd" text) | SELECT "Affiliation" FROM table_57112 WHERE "Estd" = '1982' AND "Location" = 'coimbatore' |
Which Representative has a Termination of Mission as May 24, 1905? | CREATE TABLE table_name_10 (representative VARCHAR,termination_of_mission VARCHAR) | SELECT representative FROM table_name_10 WHERE termination_of_mission = "may 24, 1905" |
What was david ferrer seeded? | CREATE TABLE table_24431264_16 (seed INTEGER,player VARCHAR) | SELECT MAX(seed) FROM table_24431264_16 WHERE player = "David Ferrer" |
Who was the name of the opposing team on 11/02/1961? | CREATE TABLE table_59602 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Opposing Teams" FROM table_59602 WHERE "Date" = '11/02/1961' |
What was the percentage in 2011 of the province that had 2.4% population in 2001? | CREATE TABLE table_21405 ("Province" text,"South Asians 2001" real,"% 2001" text,"South Asians 2011" real,"% 2011" text) | SELECT "% 2011" FROM table_21405 WHERE "% 2001" = '2.4%' |
In what city is the United Spirit Arena located? | CREATE TABLE table_32897 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text) | SELECT "City" FROM table_32897 WHERE "Venue" = 'united spirit arena' |
Which courses are least difficult ? | 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 ta (campus_job_id int,student_id int,location var... | SELECT DISTINCT course.name, course.number, program_course.workload FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EECS' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1) |
Which Architecture and modelling has a Unit test of no, and a Projects templates of limited? | CREATE TABLE table_name_5 (architecture_and_modelling VARCHAR,unit_test VARCHAR,projects_templates VARCHAR) | SELECT architecture_and_modelling FROM table_name_5 WHERE unit_test = "no" AND projects_templates = "limited" |
The competition that took place on 4 Apr 1997 ended with what as the score? | CREATE TABLE table_name_42 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_42 WHERE date = "4 apr 1997" |
Zero-score uncommented, not accepted answers by a specific user. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT SUM(CASE WHEN a.Score = 0 AND COALESCE(q.AcceptedAnswerId, 0) != a.Id AND a.CommentCount = 0 THEN 1 ELSE 0 END) AS "unappreciated_answers", COUNT(a.Id) AS "total_answers", 100 * CAST(SUM(CASE WHEN a.Score = 0 AND a.CommentCount = 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(a.Id) AS "percentage_unappreciated" FROM Pos... |
which was released earlier , artamene or merope ? | CREATE TABLE table_204_104 (id number,"title" text,"genre" text,"sub\u00addivisions" text,"libretto" text,"premiere date" text,"place,theatre" text,"notes" text) | SELECT "title" FROM table_204_104 WHERE "title" IN ('artamene', 'merope') ORDER BY "premiere date" LIMIT 1 |
what is primary disease and procedure short title of subject id 2560? | 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 demographic (subject_id text,hadm_id t... | SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
qtc < 450 msec at screening | CREATE TABLE table_train_202 ("id" int,"systolic_blood_pressure_sbp" int,"body_weight" float,"diabetic" string,"qtc" int,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"clinical_diagnosis" bool,"NOUSE" float) | SELECT * FROM table_train_202 WHERE qtc < 450 |
Which Artist has a Week of Top 12? | CREATE TABLE table_60180 ("Week" text,"Theme" text,"Song Sung" text,"Artist" text,"Status" text) | SELECT "Artist" FROM table_60180 WHERE "Week" = 'top 12' |
how many medicaid patients had (aorto)coronary bypass of three coronary arteries procedure? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" |
For those employees whose first name does not containing the letter M, display their average salary by binning the hire date into Month interval for visualizing a bar chart, and order in asc by the y axis. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) |
What was the score when the opposition was sussex after 1890? | CREATE TABLE table_name_49 (score VARCHAR,opposition VARCHAR,year VARCHAR) | SELECT score FROM table_name_49 WHERE opposition = "sussex" AND year > 1890 |
Which province is grey and bell electorate in | CREATE TABLE table_1024710_2 (province VARCHAR,electorate VARCHAR) | SELECT province FROM table_1024710_2 WHERE electorate = "Grey and Bell" |
Tell me the highest year for result of 9th | CREATE TABLE table_name_98 (year INTEGER,result VARCHAR) | SELECT MAX(year) FROM table_name_98 WHERE result = "9th" |
Bin the claim date into Year interval and count them for visualizing a bar chart, and could you order by the the number of date claim settled from high to low? | CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment INTEGER)CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID IN... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC |
How many rounds have a Pick smaller than 10, and a Name of larry hendershot? | CREATE TABLE table_48526 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Round") FROM table_48526 WHERE "Pick" < '10' AND "Name" = 'larry hendershot' |
Which team plays at the Arden Street Oval? | CREATE TABLE table_name_97 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_97 WHERE venue = "arden street oval" |
what's the bleeding time with condition being factor v deficiency | CREATE TABLE table_14006_1 (bleeding_time VARCHAR,condition VARCHAR) | SELECT bleeding_time FROM table_14006_1 WHERE condition = "Factor V deficiency" |
what is the number of patients whose year of death is less than or equal to 2179 and procedure short title is aicd check? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2179.0" AND procedures.short_title = "AICD check" |
WHAT IS THE NUMBER OF Attendance WITH A RECORD 94 36 | CREATE TABLE table_name_70 (attendance INTEGER,save VARCHAR,record VARCHAR) | SELECT AVG(attendance) FROM table_name_70 WHERE save = "–" AND record = "94–36" |
What is Thad Jemison's position? | CREATE TABLE table_78298 ("Pick" real,"Round" text,"Player" text,"Position" text,"School" text) | SELECT "Position" FROM table_78298 WHERE "Player" = 'thad jemison' |
what are the three lab tests that are given most frequently this year? | 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,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE outputevents (row_id number,sub... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1... |
I want the lowest points diff for against being less than 578 and lost being 15 and points more than 26 | CREATE TABLE table_name_37 (points_diff INTEGER,points VARCHAR,against VARCHAR,lost VARCHAR) | SELECT MIN(points_diff) FROM table_name_37 WHERE against < 578 AND lost = 15 AND points > 26 |
What is the total number of bronze when gold is less than 1 and silver is more than 1? | CREATE TABLE table_40681 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Bronze") FROM table_40681 WHERE "Gold" < '1' AND "Silver" > '1' |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the phone_number by a bar chart, show in ascending by the EMPLOYEE_ID. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,... | SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID |
how many years has it been since the cow has diverged from human ? | CREATE TABLE table_204_358 (id number,"species" text,"common name" text,"ncbi accession #" text,"ncbi name" text,"length" text,"sequence identity" text,"sequence similarity" text,"years since divergence from human (mya)" number) | SELECT "years since divergence from human (mya)" FROM table_204_358 WHERE "common name" = 'cow' |
What is Second, when Position is greater than 33, when Points is greater than 12, and when Equipment is Zabel-VMC? | CREATE TABLE table_50490 ("Position" real,"Equipment" text,"Points" real,"Wins" text,"Second" text,"Third" text) | SELECT "Second" FROM table_50490 WHERE "Position" > '33' AND "Points" > '12' AND "Equipment" = 'zabel-vmc' |
Users sorted by profile views. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT Id AS "user_link", Views FROM Users ORDER BY Views DESC |
What is the number of matches for the player in rank 8? | CREATE TABLE table_name_44 (matches INTEGER,rank VARCHAR) | SELECT MAX(matches) FROM table_name_44 WHERE rank = 8 |
just how many magnesium sulfate 4 gram/100 ml iv piggy back : 100 ml flex cont prescriptions were there during a year before? | 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 cost (costid number,uniquepid text,pati... | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'magnesium sulfate 4 gram/100 ml iv piggy back : 100 ml flex cont' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
What is the margin of victory of the tournament with a winning score of 70-67-64-71=272? | CREATE TABLE table_11480 ("Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text) | SELECT "Margin of victory" FROM table_11480 WHERE "Winning score" = '70-67-64-71=272' |
Which year has a railway class of 250? | CREATE TABLE table_5679 ("Gauge" text,"Railway" text,"Class" text,"Works no." text,"Year" text,"Builder" text) | SELECT "Year" FROM table_5679 WHERE "Class" = '250' |
Name the drawn with lost of 3 and points of 88 | CREATE TABLE table_name_86 (drawn VARCHAR,lost VARCHAR,points VARCHAR) | SELECT drawn FROM table_name_86 WHERE lost = "3" AND points = "88" |
Bar graph to show how many asset make from different asset make | CREATE TABLE Engineer_Skills (engineer_id INTEGER,skill_id INTEGER)CREATE TABLE Assets (asset_id INTEGER,maintenance_contract_id INTEGER,supplier_company_id INTEGER,asset_details VARCHAR(255),asset_make VARCHAR(20),asset_model VARCHAR(20),asset_acquired_date DATETIME,asset_disposed_date DATETIME,other_asset_details VAR... | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make |
did bekele have a better world ranking in 2012 or 2007 ? | CREATE TABLE table_204_576 (id number,"year" number,"best" text,"location" text,"date" text,"world rank" text) | SELECT "year" FROM table_204_576 WHERE "year" IN (2012, 2007) ORDER BY "world rank" LIMIT 1 |
What was the result when there were 27,321 in attendance? | CREATE TABLE table_44834 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_44834 WHERE "Attendance" = '27,321' |
What is the ERP W with a call sign at w261cq? | CREATE TABLE table_name_19 (erp_w VARCHAR,call_sign VARCHAR) | SELECT erp_w FROM table_name_19 WHERE call_sign = "w261cq" |
what is the highest goals against when the wins is less than 1? | CREATE TABLE table_name_54 (goals_against INTEGER,wins INTEGER) | SELECT MAX(goals_against) FROM table_name_54 WHERE wins < 1 |
Find the names of swimmers who has a result of 'win', and count them by a bar chart, rank X in asc order. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year... | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY name |
Name the most touchdowns for becker | CREATE TABLE table_14342592_8 (touchdowns INTEGER,player VARCHAR) | SELECT MAX(touchdowns) FROM table_14342592_8 WHERE player = "Becker" |
Which name is the learning/social difficulties type? | CREATE TABLE table_10300 ("Name" text,"Type" text,"Local board" text,"Suburb" text,"Authority" text,"Decile" real) | SELECT "Name" FROM table_10300 WHERE "Type" = 'learning/social difficulties' |
The player who had 5 touchdowns had how many extra points? | CREATE TABLE table_25642873_2 (extra_points VARCHAR,touchdowns VARCHAR) | SELECT extra_points FROM table_25642873_2 WHERE touchdowns = 5 |
Create a bar chart showing how many allergytype across allergytype, and could you rank by the bars from high to low? | 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 AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC |
What batting partners batted for pakistan? | CREATE TABLE table_1670921_2 (batting_partners VARCHAR,batting_team VARCHAR) | SELECT batting_partners FROM table_1670921_2 WHERE batting_team = "Pakistan" |
in what year did the colors red and gold join? | CREATE TABLE table_2368 ("Institution" text,"Location" text,"Year Joined" real,"Affiliation" text,"Enrollment" real,"Mascot" text,"Colors" text) | SELECT COUNT("Year Joined") FROM table_2368 WHERE "Colors" = 'Red and Gold' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.