instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what are the top five most often ordered procedures?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmen...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
Who was the runner-up in 2004?
CREATE TABLE table_70189 ("Year" text,"Venue" text,"Winners" text,"Runner-up" text,"3rd place" text)
SELECT "Runner-up" FROM table_70189 WHERE "Year" = '2004'
how many trains are going to trivandrum ?
CREATE TABLE table_204_78 (id number,"no." number,"train no." text,"origin" text,"destination" text,"train name" text)
SELECT COUNT("train name") FROM table_204_78 WHERE "destination" = 'trivandrum'
How many parties of the time they left office, binning the left office time into Year interval, and then split by the minister's name, I want to display in ascending by the Y.
CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE party_events (E...
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office)
What is the total that had an event of +105 kg and clean & jerk less than 227.5?
CREATE TABLE table_78261 ("Athlete" text,"Event" text,"Snatch" real,"Clean & Jerk" real,"Total" real)
SELECT COUNT("Total") FROM table_78261 WHERE "Event" = '+105 kg' AND "Clean & Jerk" < '227.5'
Who is moving from Treviso with a loan return?
CREATE TABLE table_name_42 (name VARCHAR,moving_from VARCHAR,type VARCHAR)
SELECT name FROM table_name_42 WHERE moving_from = "treviso" AND type = "loan return"
What's the airing date for the show with 62 episodes?
CREATE TABLE table_65811 ("Airing date" text,"English title (Chinese title)" text,"Number of episodes" real,"Genre" text,"Official website" text)
SELECT "Airing date" FROM table_65811 WHERE "Number of episodes" = '62'
What is the cospar ID of the Kosmos 2397 satellite, which has an operational life of 2 months?
CREATE TABLE table_18161217_2 (cospar_id VARCHAR,estimated_operational_life VARCHAR,satellite VARCHAR)
SELECT cospar_id FROM table_18161217_2 WHERE estimated_operational_life = "2 months" AND satellite = "Kosmos 2397"
Which Type has a Name of edson ratinho?
CREATE TABLE table_47406 ("Nat." text,"Name" text,"Moving to" text,"Type" text,"Transfer window" text,"Transfer fee" text)
SELECT "Type" FROM table_47406 WHERE "Name" = 'edson ratinho'
Which parts have more than 2 faults? Show the part name and id in a bar chart, show by the y axis from low to high.
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 VARCHAR(255))CREATE TABLE Staff (staff_id INTEGER,staff_name VARCHAR(2...
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id
Find the name of scientists who are not assigned to any project.
CREATE TABLE scientists (ssn number,name text)CREATE TABLE projects (code text,name text,hours number)CREATE TABLE assignedto (scientist number,project text)
SELECT name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM assignedto)
What is the composition with an artist of Henry Purdy, a year smaller than 2002, and a mint more than 1,998?
CREATE TABLE table_54149 ("Year" real,"Artist" text,"Composition" text,"Mintage" real,"Issue Price" text)
SELECT "Composition" FROM table_54149 WHERE "Year" < '2002' AND "Mintage" > '1,998' AND "Artist" = 'henry purdy'
What is the Took Office Date of the Presidency that Left Office Incumbent?
CREATE TABLE table_name_42 (took_office INTEGER,left_office VARCHAR)
SELECT SUM(took_office) FROM table_name_42 WHERE left_office = "incumbent"
list flights from MINNEAPOLIS to PITTSBURGH on friday
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE equipment_sequence (aircraft_cod...
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 = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AN...
Which home team played in front of 18,345 people in Adelaide Oval?
CREATE TABLE table_53611 ("Round" real,"Date" text,"Home Team" text,"Score" text,"Away Team" text,"Crowd" real,"Stadium" text,"Match Details" text)
SELECT "Home Team" FROM table_53611 WHERE "Crowd" > '18,345' AND "Stadium" = 'adelaide oval'
Which act's album has a name of All That You Can't Leave Behind?
CREATE TABLE table_name_58 (pop_act VARCHAR,album VARCHAR)
SELECT pop_act FROM table_name_58 WHERE album = "all that you can't leave behind"
Show the trend about the total average number of attendance at home games change over the years, bin year into year interval, and I want to list by the X in desc please.
CREATE TABLE manager_award_vote (award_id TEXT,year INTEGER,league_id TEXT,player_id TEXT,points_won INTEGER,points_max INTEGER,votes_first INTEGER)CREATE TABLE batting (player_id TEXT,year INTEGER,stint INTEGER,team_id TEXT,league_id TEXT,g INTEGER,ab NUMERIC,r NUMERIC,h NUMERIC,double NUMERIC,triple NUMERIC,hr NUMERI...
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
What is the rd number where the reg GP is 0 and the pick is 150?
CREATE TABLE table_name_24 (rd__number VARCHAR,reg_gp VARCHAR,pick__number VARCHAR)
SELECT COUNT(rd__number) FROM table_name_24 WHERE reg_gp = 0 AND pick__number = 150
Which Score has a Set 1 of 25 16?
CREATE TABLE table_44506 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Score" FROM table_44506 WHERE "Set 1" = '25–16'
get me the number of white ethnic background patients who were born before the year 2058.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2058"
difficulty of various JS frameworks.
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Pos...
SELECT Tags.TagName FROM Tags AS tags JOIN PostTags AS postTags ON PostTags.TagId = Tags.Id JOIN Posts AS posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName IN ('angularjs', 'angular2', 'vue.js', 'ember.js', 'backbone.js', 'reactjs', 'knockout.js', 'typescript') AND Posts.AcceptedAnswerId IS NULL
Does the city of moline have stereo?
CREATE TABLE table_27296 ("Freq" real,"Call" text,"City" text,"Owner" text,"Start" real,"Day Power (W)" real,"Night Power" real,"Nickname" text,"Format" text,"Stereo" text)
SELECT "Stereo" FROM table_27296 WHERE "City" = 'Moline'
If I take PHARMACY 426 , what classes will I be able to take ?
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_assignments int,respected int,participation int,heavy_reading int,tough_grade...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'PHARMACY' AND COURSE_1.num...
What music is in the film before 1962?
CREATE TABLE table_55094 ("Title" text,"Year" real,"Country" text,"Music" text,"Uncut run time" text)
SELECT "Music" FROM table_55094 WHERE "Year" = '1962'
what is days of hospital stay and diagnoses icd9 code of subject name troy friedman?
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.days_stay, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Troy Friedman"
What's the target for the brand mylotarg?
CREATE TABLE table_45022 ("Antibody" text,"Brand name" text,"Approval date" real,"Type" text,"Target" text)
SELECT "Target" FROM table_45022 WHERE "Brand name" = 'mylotarg'
how much does it cost for nacl 0.9% bolus?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,orga...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'nacl 0.9% bolus')
What is the drug type and drug name of METD5?
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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "METD5"
Return the codes of the document types that do not have a total access count of over 10000.
CREATE TABLE users (user_id number,role_code text,user_name text,user_login text,password text)CREATE TABLE images (image_id number,image_alt_text text,image_name text,image_url text)CREATE TABLE document_sections_images (section_id number,image_id number)CREATE TABLE roles (role_code text,role_description text)CREATE ...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000
For those employees who do not work in departments with managers that have ids between 100 and 200, find job_id and employee_id , and visualize them by a bar chart, and display Y-axis in asc order.
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 jobs (JOB_ID varchar(10),JOB_TITLE va...
SELECT JOB_ID, 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 patients are diagnosed with hx surgery to organs nec and base drug type?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx surgery to organs NEC" AND prescriptions.drug_type = "BASE"
List the enrollment for each school that does not have 'Catholic' as denomination.
CREATE TABLE school (school_id number,school text,location text,enrollment number,founded number,denomination text,boys_or_girls text,day_or_boarding text,year_entered_competition number,school_colors text)CREATE TABLE school_details (school_id number,nickname text,colors text,league text,class text,division text)CREAT...
SELECT enrollment FROM school WHERE denomination <> "Catholic"
What is the location of the game with a 6-11-8 record?
CREATE TABLE table_76866 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Location" FROM table_76866 WHERE "Record" = '6-11-8'
was there any organism found during the last month in patient 031-15666's first urine, catheter specimen test?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientun...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM...
Name the term ends for bethlehem
CREATE TABLE table_1979619_3 (term_ends VARCHAR,residence VARCHAR)
SELECT COUNT(term_ends) FROM table_1979619_3 WHERE residence = "Bethlehem"
What is the lowest number of episodes for anabel barnston?
CREATE TABLE table_name_35 (episodes INTEGER,actor VARCHAR)
SELECT MIN(episodes) FROM table_name_35 WHERE actor = "anabel barnston"
Where is the track that opened in 1995?
CREATE TABLE table_17685 ("Track Name" text,"Location" text,"Length" text,"Seating" real,"Year Opened" real,"Year Acquired [A ]" real)
SELECT "Location" FROM table_17685 WHERE "Year Opened" = '1995'
What country has a loan as the type?
CREATE TABLE table_6629 ("Name" text,"Country" text,"Type" text,"Moving from" text,"Transfer window" text,"Ends" text,"Transfer fee" text,"Source" text)
SELECT "Country" FROM table_6629 WHERE "Type" = 'loan'
Which act's album has a name of All That You Can't Leave Behind?
CREATE TABLE table_6723 ("Year" real,"Male" text,"Female" text,"Band" text,"Album" text,"Pop Act" text,"Lifetime Achievement Award" text)
SELECT "Pop Act" FROM table_6723 WHERE "Album" = 'all that you can''t leave behind'
What was the result of week 13?
CREATE TABLE table_name_38 (result VARCHAR,week VARCHAR)
SELECT result FROM table_name_38 WHERE week = 13
what's the naturalisation by marriage with regbeingtration of a minor child being 114
CREATE TABLE table_11214212_1 (naturalisation_by_marriage VARCHAR,registration_of_a_minor_child VARCHAR)
SELECT naturalisation_by_marriage FROM table_11214212_1 WHERE registration_of_a_minor_child = 114
what are all the Canadian air dates where the u.s. air date is may 1, 2009
CREATE TABLE table_482 ("Season #" real,"Series #" real,"Title" text,"Canadian airdate" text,"U.S. airdate" text,"Production code" real)
SELECT "Canadian airdate" FROM table_482 WHERE "U.S. airdate" = 'May 1, 2009'
Name the dominant religion for
CREATE TABLE table_2562572_22 (dominant_religion__2002_ VARCHAR,cyrillic_name_other_names VARCHAR)
SELECT dominant_religion__2002_ FROM table_2562572_22 WHERE cyrillic_name_other_names = "Станишић"
Which county has 438 (4%) listed under R. Bacon?
CREATE TABLE table_name_92 (county VARCHAR,r_bacon VARCHAR)
SELECT county FROM table_name_92 WHERE r_bacon = "438 (4%)"
What is John Edwards, when John Kerry is '70%'?
CREATE TABLE table_name_41 (john_edwards VARCHAR,john_kerry VARCHAR)
SELECT john_edwards FROM table_name_41 WHERE john_kerry = "70%"
What was the score in the match against Sanaz Marand?
CREATE TABLE table_name_54 (score VARCHAR,opponent VARCHAR)
SELECT score FROM table_name_54 WHERE opponent = "sanaz marand"
Suggested edits voting compared to final result.
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 p.Id AS Id, p.Id AS "post_link", se.Id AS "suggested_edit_link" FROM SuggestedEdits AS se INNER JOIN SuggestedEditVotes AS sev ON sev.SuggestedEditId = se.Id INNER JOIN Posts AS p ON p.Id = se.PostId WHERE sev.UserId = '##UserId##' AND NOT se.RejectionDate IS NULL AND sev.VoteTypeId = 2
How many picks did the College of USC wind up getting?
CREATE TABLE table_34338 ("Pick #" real,"Round" text,"Player" text,"Position" text,"College" text)
SELECT COUNT("Pick #") FROM table_34338 WHERE "College" = 'usc'
What is Money ( $ ), when Score is '75-71-72-70=288'?
CREATE TABLE table_name_35 (money___$__ VARCHAR,score VARCHAR)
SELECT money___$__ FROM table_name_35 WHERE score = 75 - 71 - 72 - 70 = 288
Who had a points average with 0 extra points and 0 field goals?
CREATE TABLE table_35972 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT AVG("Points") FROM table_35972 WHERE "Extra points" = '0' AND "Field goals" > '0'
what is minimum age of patients whose admission location is phys referral/normal deli and primary disease is bladder cancer/sda?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "BLADDER CANCER/SDA"
Which team had the attendance of 16,468 and lost?
CREATE TABLE table_69378 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text)
SELECT "Loss" FROM table_69378 WHERE "Attendance" = '16,468'
Find posts in last 60 days with 'coreclr' in title, body or tags.
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 Posts.Id AS "post_link", Title, Posts.CreationDate, PostTypeId, AnswerCount, Tags, ViewCount, Score, OwnerUserId AS "user_link", DisplayName, LastActivityDate, LastEditDate, ClosedDate, Body FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.CreationDate >= CURRENT_TIMESTAMP() - 60 AND (Title LIKE '%...
how long was it between losing streak almbum and gnv fla in years .
CREATE TABLE table_203_661 (id number,"year" number,"single" text,"peak chart positions\nus mod" number,"peak chart positions\nuk" number,"album" text)
SELECT ABS((SELECT "year" FROM table_203_661 WHERE "album" = 'losing streak') - (SELECT "year" FROM table_203_661 WHERE "album" = 'gnv fla'))
Which Skip has a Third of sara carlsson?
CREATE TABLE table_34916 ("Country" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Skip" FROM table_34916 WHERE "Third" = 'sara carlsson'
Which player on the Bulls has a 6 May 1978 birthday?
CREATE TABLE table_name_58 (player VARCHAR,club_province VARCHAR,date_of_birth__age_ VARCHAR)
SELECT player FROM table_name_58 WHERE club_province = "bulls" AND date_of_birth__age_ = "6 may 1978"
List the competitor ranking with 900 defense points.
CREATE TABLE table_3049 ("Seed" real,"Rank" real,"Player" text,"Points" real,"Points defending" text,"Points won" real,"New points" real,"Status" text)
SELECT COUNT("Seed") FROM table_3049 WHERE "Points defending" = '900'
how many gold medals did this country win during these olympics ?
CREATE TABLE table_204_884 (id number,"medal" text,"name" text,"sport" text,"event" text,"date" text)
SELECT COUNT(*) FROM table_204_884 WHERE "medal" = 'gold'
What is the branding for callsign dypv?
CREATE TABLE table_3796 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text)
SELECT "Branding" FROM table_3796 WHERE "Callsign" = 'DYPV'
Which Centre has a Rank of 42?
CREATE TABLE table_name_34 (centre VARCHAR,rank VARCHAR)
SELECT centre FROM table_name_34 WHERE rank = 42
Which Position has a Player of bernard thompson?
CREATE TABLE table_name_64 (position VARCHAR,player VARCHAR)
SELECT position FROM table_name_64 WHERE player = "bernard thompson"
What is the date that 4,286 attended?
CREATE TABLE table_67409 ("Date" text,"Opponent" text,"Result" text,"Game Site" text,"Attendance" text)
SELECT "Date" FROM table_67409 WHERE "Attendance" = '4,286'
What is the fewest points for positions with under 12 losses, goals against under 50, goal difference over 11, and under 30 played?
CREATE TABLE table_name_22 (points INTEGER,played VARCHAR,goal_difference VARCHAR,losses VARCHAR,goals_against VARCHAR)
SELECT MIN(points) FROM table_name_22 WHERE losses < 12 AND goals_against < 50 AND goal_difference > 11 AND played < 30
Name the incumbent for lost renomination republican hold
CREATE TABLE table_73140 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Incumbent" FROM table_73140 WHERE "Result" = 'Lost renomination Republican hold'
when was the last time on this month/26 that patient 10855's heart rate was measured greater than 94.0?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,char...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, sort bar from high to low order please.
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_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
How many communes associated with over 10 cantons and an area (Square km) of 1,589?
CREATE TABLE table_57132 ("Dep." text,"Chief town" text,"Arrondissement" text,"Population (1999)" text,"Area (Square km)" real,"Pop density" real,"Cantons" real,"Communes" real)
SELECT AVG("Communes") FROM table_57132 WHERE "Cantons" > '10' AND "Area (Square km)" = '1,589'
When population is greater than 832,901 and murder and non-negligent manslaughter is 11.6, what is the smallest burglary?
CREATE TABLE table_61066 ("State" text,"City" text,"Population" real,"Violent Crime" text,"Murder and Non-Negligent Manslaughter" real,"Forcible Rape" text,"Robbery" real,"Aggravated Assault" real,"Property Crime" text,"Burglary" real,"Larceny-Theft" text,"Motor Vehicle Theft" real)
SELECT MIN("Burglary") FROM table_61066 WHERE "Population" > '832,901' AND "Murder and Non-Negligent Manslaughter" = '11.6'
What is the attendance when the opponent was the Houston Oilers?
CREATE TABLE table_name_47 (attendance VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_name_47 WHERE opponent = "houston oilers"
provide the number of patients whose diagnoses short title is subtrochanteric fx-close and drug route is left eye?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subtrochanteric fx-close" AND prescriptions.route = "LEFT EYE"
provide the number of patients whose death status is 0 and primary disease is aortic insufficiency/re-do sternotomy; aortic valve replacement.
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.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
When the Score was 4-10, what was the Attendance?
CREATE TABLE table_name_13 (attendance VARCHAR,score VARCHAR)
SELECT attendance FROM table_name_13 WHERE score = "4-10"
What is the score for game 5?
CREATE TABLE table_33885 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Series" text)
SELECT "Score" FROM table_33885 WHERE "Game" = '5'
Name the opponent for 1996 at the mt smart stadium venue
CREATE TABLE table_71159 ("Margin" real,"Score" text,"Opponent" text,"Venue" text,"Year" real)
SELECT "Opponent" FROM table_71159 WHERE "Venue" = 'mt smart stadium' AND "Year" = '1996'
Which series with a total of 27 albums did Dargaud edit?
CREATE TABLE table_52044 ("Series" text,"Years" text,"Magazine" text,"Albums" text,"Editor" text)
SELECT "Series" FROM table_52044 WHERE "Editor" = 'dargaud' AND "Albums" = '27'
Which year had a publication of Pazz & Jop?
CREATE TABLE table_name_99 (year VARCHAR,publication VARCHAR)
SELECT year FROM table_name_99 WHERE publication = "pazz & jop"
What are the positions with both players having more than 20 points and less than 10 points.
CREATE TABLE player (POSITION VARCHAR,Points INTEGER)
SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10
Are there any 400 -level courses in the Fall or Winter term that I can take ?
CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE area (course_id int,area var...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
Give me a bar chart for sum price of each name, and order y-axis in desc order.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC
Give me a bar chart for mean tonnage of each type, show by the Y in asc.
CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)
SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage)
how old is the patient josette orr?
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 demographic.age FROM demographic WHERE demographic.name = "Josette Orr"
what is discharge location of subject name kelly gallardo?
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 demographic.discharge_location FROM demographic WHERE demographic.name = "Kelly Gallardo"
how patient 8991 was admitted to hospital in the previous year for the last time?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8991 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
How many degrees were conferred in 'San Jose State University' in 2000?
CREATE TABLE degrees (Id VARCHAR)CREATE TABLE campuses (Id VARCHAR)
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
Draw a bar chart of investor versus the total number, and could you list bars from high to low order?
CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
What was the Match Report for the Euro2008q at the Athens Olympic Stadium on November 17, 2007?
CREATE TABLE table_67793 ("Date" text,"Venue" text,"Score" text,"Competition" text,"Match report" text)
SELECT "Match report" FROM table_67793 WHERE "Competition" = 'euro2008q' AND "Venue" = 'athens olympic stadium' AND "Date" = 'november 17, 2007'
What is the first prize amount of the person who has a score of 207 (-9) and a purse amount of more than 800,000?
CREATE TABLE table_58122 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real)
SELECT COUNT("1st Prize( $ )") FROM table_58122 WHERE "Score" = '207 (-9)' AND "Purse( $ )" > '800,000'
Which 2nd (m) has a 1st (m) of 120.5 and Points smaller than 249.9?
CREATE TABLE table_34894 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" real,"2nd (m)" real,"Points" real,"Overall WC points (Rank)" text)
SELECT AVG("2nd (m)") FROM table_34894 WHERE "1st (m)" = '120.5' AND "Points" < '249.9'
Who was the host that garnered ratings of 9.6/26?
CREATE TABLE table_52444 ("Year" real,"Network" text,"Lap-by-lap" text,"Color commentator(s)" text,"Pit reporters" text,"Host" text,"Ratings" text,"Viewers" text)
SELECT "Host" FROM table_52444 WHERE "Ratings" = '9.6/26'
What was the score for the Perth Wildcats as away team?
CREATE TABLE table_9338 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Box Score" text,"Report" text)
SELECT "Score" FROM table_9338 WHERE "Away team" = 'perth wildcats'
which language does patient jonathan wiggins speak?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT demographic.language FROM demographic WHERE demographic.name = "Jonathan Wiggins"
What is the earliest week with an opponent of cincinnati bengals?
CREATE TABLE table_name_15 (week INTEGER,opponent VARCHAR)
SELECT MIN(week) FROM table_name_15 WHERE opponent = "cincinnati bengals"
What is the score of the game against the baltimore bullets on March 14?
CREATE TABLE table_49542 ("Date" text,"H/A/N" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_49542 WHERE "Opponent" = 'baltimore bullets' AND "Date" = 'march 14'
what is the daily maximum value of patient 59473's base excess since 6 years ago?
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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numb...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59473) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(),...
Which episode aired on august19,2012?
CREATE TABLE table_2284 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text)
SELECT "Title" FROM table_2284 WHERE "Original air date" = 'August19,2012'
What set 2 has a total of 97 74?
CREATE TABLE table_name_85 (set_2 VARCHAR,total VARCHAR)
SELECT set_2 FROM table_name_85 WHERE total = "97–74"
What is the length of the film with Burleigh Sullivan as the character?
CREATE TABLE table_name_30 (length VARCHAR,character_name VARCHAR)
SELECT length FROM table_name_30 WHERE character_name = "burleigh sullivan"
how many hours have elapsed since the first time that patient 030-52327 had a continuous infusion meds intake on the current intensive care unit visit?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,lab...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
What is Place, when Weapon is '35mm fire', and when Date is '27 May 1982'?
CREATE TABLE table_name_15 (place VARCHAR,weapon VARCHAR,date VARCHAR)
SELECT place FROM table_name_15 WHERE weapon = "35mm fire" AND date = "27 may 1982"
had patient 006-35134 in this year been admitted to an er?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-35134' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')