instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Name the away captain with result of wi by 9 wkts | CREATE TABLE table_name_69 (away_captain VARCHAR,result VARCHAR) | SELECT away_captain FROM table_name_69 WHERE result = "wi by 9 wkts" |
Draw a bar chart of owner versus total number of rating in percent, and display in ascending by the X. | CREATE TABLE program (Program_ID int,Name text,Origin text,Launch real,Owner text)CREATE TABLE channel (Channel_ID int,Name text,Owner text,Share_in_percent real,Rating_in_percent real)CREATE TABLE broadcast (Channel_ID int,Program_ID int,Time_of_day text)CREATE TABLE broadcast_share (Channel_ID int,Program_ID int,Date... | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner |
How many patients admitted to the hospital before 2139 had a lab test base excess? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (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.admityear < "2139" AND lab.label = "Base Excess" |
Which date has a score of 2-1? | CREATE TABLE table_name_6 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_6 WHERE score = "2-1" |
What was the result in the election where the incumbent was Finis J. Garrett? | CREATE TABLE table_1342370_41 (result VARCHAR,incumbent VARCHAR) | SELECT result FROM table_1342370_41 WHERE incumbent = "Finis J. Garrett" |
show me all flights from SAN DIEGO to LOS ANGELES | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ... |
What is the swimsuit score for the item that has 7.61 as evening gown | CREATE TABLE table_15081939_4 (swimsuit VARCHAR,evening_gown VARCHAR) | SELECT swimsuit FROM table_15081939_4 WHERE evening_gown = "7.61" |
What is the friendly game for Germany of France? | CREATE TABLE table_name_58 (friendly VARCHAR,germany VARCHAR) | SELECT friendly FROM table_name_58 WHERE germany = "france" |
What is the NBA draft result of the player from Washington, DC? | CREATE TABLE table_54586 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "NBA Draft" FROM table_54586 WHERE "Hometown" = 'washington, dc' |
How many points have a difference of 23, with a drawn less than 5? | CREATE TABLE table_name_62 (points VARCHAR,difference VARCHAR,drawn VARCHAR) | SELECT COUNT(points) FROM table_name_62 WHERE difference = "23" AND drawn < 5 |
What was the score of the team that danced a jive and was safe? | CREATE TABLE table_name_65 (score VARCHAR,dance VARCHAR,result VARCHAR) | SELECT score FROM table_name_65 WHERE dance = "jive" AND result = "safe" |
Who produced 'Fast Life'? | CREATE TABLE table_79857 ("Title" text,"Producer(s)" text,"Artist(s)" text,"Time" text,"Team(s)" text) | SELECT "Producer(s)" FROM table_79857 WHERE "Title" = 'fast life' |
List the players for team bryn s if (sweden). | CREATE TABLE table_2850912_12 (player VARCHAR,college_junior_club_team VARCHAR) | SELECT player FROM table_2850912_12 WHERE college_junior_club_team = "Brynäs IF (Sweden)" |
What is the frequency of the model whose part number is ado520biaa5do? | CREATE TABLE table_13869651_3 (frequency VARCHAR,part_number_s_ VARCHAR) | SELECT frequency FROM table_13869651_3 WHERE part_number_s_ = "ADO520BIAA5DO" |
What was the attendance in week 8? | CREATE TABLE table_14875671_1 (attendance INTEGER,week VARCHAR) | SELECT MAX(attendance) FROM table_14875671_1 WHERE week = 8 |
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, could you show X-axis in desc order? | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC |
Name the insurgents for civilians being 49 | CREATE TABLE table_name_75 (insurgents VARCHAR,civilians VARCHAR) | SELECT insurgents FROM table_name_75 WHERE civilians = "49" |
What is the highest position Talk on Corners, which had an issue date greater than 1, had? | CREATE TABLE table_38374 ("Issue Date" real,"Album Title" text,"Artist" text,"Sales" real,"Highest Position" real) | SELECT COUNT("Highest Position") FROM table_38374 WHERE "Album Title" = 'talk on corners' AND "Issue Date" > '1' |
What is the average number of points for a team in the 250cc class with fewer than 0 wins? | CREATE TABLE table_35810 ("Year" real,"Class" text,"Team" text,"Points" real,"Rank" text,"Wins" real) | SELECT AVG("Points") FROM table_35810 WHERE "Class" = '250cc' AND "Wins" < '0' |
Which Club/province has a Player of david penalva? | CREATE TABLE table_name_41 (club_province VARCHAR,player VARCHAR) | SELECT club_province FROM table_name_41 WHERE player = "david penalva" |
how many prescriptions of bengay until 3 years ago are there? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx t... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'bengay' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') |
what is the number of patients whose drug code is quin20 and lab test fluid is other body fluid? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "QUIN20" AND lab.fluid = "Other Body Fluid" |
What are the dates with a maximum temperature higher than 85, and count them by a bar chart, list in asc by the y axis. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) |
Show the race class and number of races in each class with a bar chart. | CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real) | SELECT Class, COUNT(*) FROM race GROUP BY Class |
What is the nation when the for is 326? | CREATE TABLE table_28838 ("Place" real,"Nation" text,"played" real,"won" real,"drawn" real,"lost" real,"for" real,"against" real,"difference" real,"Table points" real) | SELECT "Nation" FROM table_28838 WHERE "for" = '326' |
Who are the rowers with the time of 5:54.57? | CREATE TABLE table_65543 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT "Rowers" FROM table_65543 WHERE "Time" = '5:54.57' |
What is the top goal for the result of 2 3? | CREATE TABLE table_name_39 (goal INTEGER,result VARCHAR) | SELECT MAX(goal) FROM table_name_39 WHERE result = "2–3" |
what kind of airplane goes from BOSTON to SAN FRANCISCO before 1200 | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code ... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1200 AND f... |
Who was the director of the film that Sister Films received an award for on 2/3/05? | CREATE TABLE table_67768 ("Film" text,"Director(s)" text,"Producer(s)" text,"Recipient" text,"Date" text,"Award" text) | SELECT "Director(s)" FROM table_67768 WHERE "Date" = '2/3/05' AND "Recipient" = 'sister films' |
what is the cheapest flight from LONG BEACH to MEMPHIS | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE days (days... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT... |
Which 7:00 has an 8:00 of la soir e du hockey? | CREATE TABLE table_37294 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"10:00" text,"10:30" text) | SELECT "7:00" FROM table_37294 WHERE "8:00" = 'la soirée du hockey' |
return me the total citations of papers in the VLDB conference in 2005 . | CREATE TABLE domain (did int,name varchar)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varchar,year int)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE conference (cid int,homepage varchar,name varchar)CREATE TABLE publication_keyword (kid int,pi... | SELECT SUM(publication.citation_num) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year = 2005 |
Bar chart x axis nationality y axis how many nationality, and list in descending by the Y-axis. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)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 record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC |
What was the date of the game when St. Louis was the home team? | CREATE TABLE table_6085 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_6085 WHERE "Home" = 'st. louis' |
What is the fixed charge for the user with a unit/time range of i-2: peak (18:30-22:30)? | CREATE TABLE table_25479607_3 (fixed_charge___rs__kwh_ VARCHAR,unit__kwh__time_range VARCHAR) | SELECT fixed_charge___rs__kwh_ FROM table_25479607_3 WHERE unit__kwh__time_range = "I-2: Peak (18:30-22:30)" |
What is the average total in 1969? | CREATE TABLE table_78906 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT AVG("Total") FROM table_78906 WHERE "Year(s) won" = '1969' |
How many players' hometown was Akron, Ohio? | CREATE TABLE table_11677691_4 (school VARCHAR,hometown VARCHAR) | SELECT COUNT(school) FROM table_11677691_4 WHERE hometown = "Akron, Ohio" |
when did patient 005-12192 first receive a prescription for calcium gluconate 100 mg/ml (10 %) iv : 10 ml? | 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 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 = '005-12192')) AND medication.drugname = 'calcium gluconate 100 ... |
what does a pros repair atria def-cl cost? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)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 cost (row_id number,subject_id number,hadm_id number,event_type t... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'pros repair atria def-cl')) |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of last_name and salary . | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0)... | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Who won the Modena circuit? | CREATE TABLE table_16771 ("Race Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Constructor" text,"Report" text) | SELECT "Winning driver" FROM table_16771 WHERE "Circuit" = 'Modena' |
global lvef between 30 and 45 % . | CREATE TABLE table_test_5 ("id" int,"systemic_lupus_erythematosus" bool,"anemia" bool,"gender" string,"pregnancy_or_lactation" bool,"serum_potassium" float,"hemoglobin_a1c_hba1c" float,"heart_disease" bool,"renal_disease" bool,"creatinine_clearance_cl" float,"estimated_glomerular_filtration_rate_egfr" int,"chronic_infl... | SELECT * FROM table_test_5 WHERE global_lvef >= 30 AND global_lvef <= 45 |
Users by badges by badge category?. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score nu... | WITH linqbadges AS (SELECT RANK() OVER (PARTITION BY b.UserId ORDER BY b.Date) AS rn, b.UserId, b.Date, b.Name FROM Badges AS b WHERE b.Name = 'Necromancer') SELECT u.DisplayName, linqbadges.Date AS date_earned, CASE rn WHEN 1 THEN 'bronze linq' WHEN 2 THEN 'silver linq' WHEN 3 THEN 'gold linq' END AS badge, linqbadges... |
Show me about the distribution of meter_300 and ID in a bar chart, could you show by the Y-axis in asc? | 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 record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Openin... | SELECT meter_300, ID FROM swimmer ORDER BY ID |
Show me the comparison of the total number of all ships' nationalities with a bar graph, and I want to sort in desc by the x axis. | 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 Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality DESC |
when was the last time on this hospital visit that patient 007-849 was prescribed medication? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | 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-849' AND patient.hospitaldischargetime IS NULL)) ORDER BY ... |
What college did hunter henry go to? | CREATE TABLE table_10728 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT "College" FROM table_10728 WHERE "Player" = 'hunter henry' |
What is the team's record in games against the Hartford Whalers? | CREATE TABLE table_name_52 (record VARCHAR,opponent VARCHAR) | SELECT record FROM table_name_52 WHERE opponent = "hartford whalers" |
name each contestant whose age is 21 ? | CREATE TABLE table_204_144 (id number,"represent" number,"contestant" text,"age" number,"height" text,"hometown" text) | SELECT "contestant" FROM table_204_144 WHERE "age" = 21 |
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? | CREATE TABLE operate_company (id number,name text,type text,principal_activities text,incorporated_in text,group_equity_shareholding number)CREATE TABLE airport (id number,city text,country text,iata text,icao text,name text)CREATE TABLE flight (id number,vehicle_flight_number text,date text,pilot text,velocity number,... | SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' |
provide the number of patients whose drug code is warf1 and lab test fluid is pleural. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "WARF1" AND lab.fluid = "Pleural" |
what is the difference in height between key tower and 55 public square | CREATE TABLE table_204_649 (id number,"rank" number,"name" text,"image" number,"height\nft (m)" text,"floors" number,"year" number,"notes" text) | SELECT ABS((SELECT "height\nft (m)" FROM table_204_649 WHERE "name" = 'key tower') - (SELECT "height\nft (m)" FROM table_204_649 WHERE "name" = '55 public square')) |
what times does the late afternoon flight leave from WASHINGTON for DENVER | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE date_day (month_number int,day_number int,year int,... | SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name ... |
What tournament was after 2009? | CREATE TABLE table_71139 ("Year" real,"Tournament" text,"Venue" text,"Result" text,"Event" text) | SELECT "Tournament" FROM table_71139 WHERE "Year" > '2009' |
Will the NURS 556 course be offered in Spring-Summer 2002 ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instr... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NURS' AND course.number = 556 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2002 |
When mount gauttier is the peak what is the highest prominence in meters? | CREATE TABLE table_18946749_1 (prominence__m_ INTEGER,peak VARCHAR) | SELECT MAX(prominence__m_) FROM table_18946749_1 WHERE peak = "Mount Gauttier" |
how many patients staying in the hospital for more than 20 days had the procedure under icd9 code 9907? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "20" AND procedures.icd9_code = "9907" |
same question favoritred multiple times by same user. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CRE... | SELECT PostId AS "post_link", UserId AS "user_link", COUNT(*) AS "duplication_level" FROM Votes WHERE VoteTypeId = 5 GROUP BY PostId, UserId HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC |
what is the maximum hospital cost that involves a procedure known as a esophagogastroduodenoscopy in 2105? | 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 MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'esophagogastroduodenoscopy')) AND STRFTIME('... |
Name of calvin o'neal, and a Round smaller than 6 had what number total overall? | CREATE TABLE table_name_3 (overall VARCHAR,name VARCHAR,round VARCHAR) | SELECT COUNT(overall) FROM table_name_3 WHERE name = "calvin o'neal" AND round < 6 |
What is the common name for the creature with darker colors? | CREATE TABLE table_name_18 (common_name VARCHAR,color VARCHAR) | SELECT common_name FROM table_name_18 WHERE color = "darker colors" |
What was the team that scored 122 points? | CREATE TABLE table_22048 ("Team" text,"Average" text,"Points" real,"Played" real,"1988-89" text,"1989-90" text,"1990-1991" real) | SELECT "Team" FROM table_22048 WHERE "Points" = '122' |
What dance had a score total of 31? | CREATE TABLE table_2803106_1 (dance_song VARCHAR,total VARCHAR) | SELECT dance_song FROM table_2803106_1 WHERE total = "31" |
Which Extra points is the lowest one that has a Player of ross kidston, and Points smaller than 5? | CREATE TABLE table_38958 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT MIN("Extra points") FROM table_38958 WHERE "Player" = 'ross kidston' AND "Points" < '5' |
How many laps have a Time/Retired of +1:35.553? | CREATE TABLE table_10476 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Laps") FROM table_10476 WHERE "Time/Retired" = '+1:35.553' |
How many yards did kevin swayne average, with a long carry over 7? | CREATE TABLE table_57991 ("Player" text,"Car." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT MIN("Avg.") FROM table_57991 WHERE "Player" = 'kevin swayne' AND "Long" > '7' |
What was the date of the game with a score of 15 6? | CREATE TABLE table_name_15 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_15 WHERE score = "15–6" |
Who was the host team at Louisiana Superdome when the final score was 10-20? | CREATE TABLE table_11239 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Host Team" FROM table_11239 WHERE "Stadium" = 'louisiana superdome' AND "Final Score" = '10-20' |
Users with the Highest Score in a Tag with at Least X Answers. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,Vo... | SELECT ROW_NUMBER() OVER (ORDER BY Score DESC) AS Rank, Id AS "user_link", Score, 'count' AS TotalAnswers, Average FROM (SELECT u.Id, SUM(a.Score) AS Score, COUNT(a.Score) AS "Count", AVG(a.Score) AS Average FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER J... |
What is the number of blank ends when the stolen ends were 17 and Jennifer Jones was skipped with a more than 83 shot pct? | CREATE TABLE table_name_57 (blank_ends VARCHAR,shot_pct VARCHAR,stolen_ends VARCHAR,skip VARCHAR) | SELECT COUNT(blank_ends) FROM table_name_57 WHERE stolen_ends = 17 AND skip = "jennifer jones" AND shot_pct > 83 |
Round larger than 6, and a Pick # smaller than 25, and a College of southern Illinois has what position? | CREATE TABLE table_79865 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "Position" FROM table_79865 WHERE "Round" > '6' AND "Pick #" < '25' AND "College" = 'southern illinois' |
Which classes are prerequisites for most other classes and available this semester ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE... | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... |
What is the 2006 value with a 1r in 2011? | CREATE TABLE table_name_56 (Id VARCHAR) | SELECT 2006 FROM table_name_56 WHERE 2011 = "1r" |
WHAT IS THE RESULT WHEN THE OPPONENT WAS CHICAGO BEARS? | CREATE TABLE table_name_18 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_18 WHERE opponent = "chicago bears" |
how many patients whose age is less than 77 and diagnoses long title is abscess of intestine? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "77" AND diagnoses.long_title = "Abscess of intestine" |
Closed non-duplicate questions answered by a user. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId numb... | SELECT q.Id AS "post_link", q.Score AS "question_score", a.Score AS "answer_score", q.AcceptedAnswerId AS "accepted_answer" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE NOT q.ClosedDate IS NULL AND a.OwnerUserId = '##UserId##' AND q.Id NOT IN (SELECT PostId FROM PostLinks) ORDER BY q.ClosedDate DESC |
My Profiles Across Stack Exchange. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate ... | SELECT * FROM sys.databases |
How many different riders are there that won riding Omr Tsunami? | CREATE TABLE table_30027 ("Year" real,"Location" text,"Distance (miles)" real,"Rider Names" text,"Horse Name" text,"Best-Conditioned Horse" text) | SELECT COUNT("Rider Names") FROM table_30027 WHERE "Horse Name" = 'OMR Tsunami' |
hyperlipidemia ( fasting total cholesterol > 240 mg / dl and / or fasting triglycerides > 200 mg / dl and / or fasting ldl cholesterol > 140 mg / dl ) ; | CREATE TABLE table_train_248 ("id" int,"anemia" bool,"prostate_specific_antigen_psa" float,"hemoglobin_a1c_hba1c" float,"body_weight" float,"fasting_triglycerides" int,"hyperlipidemia" bool,"hgb" int,"fasting_total_cholesterol" int,"fasting_ldl_cholesterol" int,"body_mass_index_bmi" float,"NOUSE" float) | SELECT * FROM table_train_248 WHERE hyperlipidemia = 1 OR (fasting_total_cholesterol > 240 OR fasting_triglycerides > 200 OR fasting_ldl_cholesterol > 140) |
What is the highest round with a pick# of 11, a position of offensive tackle, and overall less than 414? | CREATE TABLE table_name_24 (round INTEGER,position VARCHAR,pick__number VARCHAR,overall VARCHAR) | SELECT MAX(round) FROM table_name_24 WHERE pick__number = 11 AND overall < 414 AND position = "offensive tackle" |
what is the total number of patients who had brain mass, intracranial hemorrhage as primary disease and had a lab test for ascites? | 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 demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Ascites" |
What Player had a Score of 70-71=141? | CREATE TABLE table_name_80 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_80 WHERE score = 70 - 71 = 141 |
What ends lost came out to 37? | CREATE TABLE table_3072 ("Country" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot %" text) | SELECT "Stolen Ends" FROM table_3072 WHERE "Ends Lost" = '37' |
How many people attended the game at Jahn-sportpark? | CREATE TABLE table_3141 ("Week" real,"Date" text,"Kickoff" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_3141 WHERE "Game site" = 'Jahn-Sportpark' |
Show me about the correlation between ACC_Percent and All_Games_Percent in a scatter chart. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match |
Which FAT32 has yes v1.0/v1.1 for NTFS? | CREATE TABLE table_name_31 (fat32 VARCHAR,ntfs VARCHAR) | SELECT fat32 FROM table_name_31 WHERE ntfs = "yes v1.0/v1.1" |
how many more seats were available in 1975 than 1963 ? | CREATE TABLE table_203_330 (id number,"year of election" number,"candidates elected" number,"# of seats available" number,"# of votes" number,"% of popular vote" text) | SELECT (SELECT "# of seats available" FROM table_203_330 WHERE "year of election" = 1975) - (SELECT "# of seats available" FROM table_203_330 WHERE "year of election" = 1963) |
what is the sum of points when lost is less than 10, name is vfl denklingen and position is higher than 2? | CREATE TABLE table_8631 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real) | SELECT SUM("Points") FROM table_8631 WHERE "Lost" < '10' AND "Name" = 'vfl denklingen' AND "Position" > '2' |
Which venue held the Euro 2012 Qualifier? | CREATE TABLE table_7239 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_7239 WHERE "Competition" = 'euro 2012 qualifier' |
What is Adam's score when Peter's score is less than 3 and the plat'num is greater than 6? | CREATE TABLE table_38655 ("Discipline" text,"Peter" real,"Adam" real,"Jade" real,"Plat'num" real) | SELECT MIN("Adam") FROM table_38655 WHERE "Peter" < '3' AND "Plat'num" > '6' |
Name the number of color for furcifer pardalis | CREATE TABLE table_21800 ("Scientific name" text,"Common name" text,"Length (male)" text,"Length (female)" text,"Color" text,"Lifespan (years)" text) | SELECT COUNT("Color") FROM table_21800 WHERE "Scientific name" = 'Furcifer pardalis' |
How many people led in assists on game 71? | CREATE TABLE table_23248940_10 (high_assists VARCHAR,game VARCHAR) | SELECT COUNT(high_assists) FROM table_23248940_10 WHERE game = 71 |
When 3t7461 is the production code who is the director? | CREATE TABLE table_22785 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"U.S. air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Directed by" FROM table_22785 WHERE "Production code" = '3T7461' |
what is the number of fans who attended the december 7 , 1969 game against the broncos ? | CREATE TABLE table_204_670 (id number,"week" number,"date" text,"opponent" text,"result" text,"record" text,"attendance" number) | SELECT "attendance" FROM table_204_670 WHERE "date" = 'december 7, 1969' |
on which date was the patient with patient id 74463 born? | 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 demographic.dob FROM demographic WHERE demographic.subject_id = "74463" |
which tributary has at least 3 variant names ? | CREATE TABLE table_203_41 (id number,"name" text,"variant name(s)" text,"source" text,"source coordinates" text,"length" text,"mouth" text,"mouth coordinates" text) | SELECT "name" FROM table_203_41 WHERE "variant name(s)" >= 3 |
Record of 92 70 had what date? | CREATE TABLE table_name_70 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_70 WHERE record = "92–70" |
Which game number was played against Georgia? | CREATE TABLE table_20928682_1 (game INTEGER,opponent VARCHAR) | SELECT MIN(game) FROM table_20928682_1 WHERE opponent = "Georgia" |
Number of bounties with accepted answer depending on the day (time) when bounty started. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,Targe... | WITH tmp AS (SELECT p.Id, p.AcceptedAnswerId AS Acc, Period = CASE @Frequency WHEN 1 THEN TIME_TO_STR(bs.CreationDate, '%h') WHEN 2 THEN TIME_TO_STR(bs.CreationDate, '%W') WHEN 3 THEN ROUND((CAST(TIME_TO_STR(bs.CreationDate, '%W') AS FLOAT) + CAST(TIME_TO_STR(bs.CreationDate, '%h') AS FLOAT) / 24), 2) END FROM Posts AS... |
On what Date was the Opponent the Tennessee Titans? | CREATE TABLE table_name_47 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_47 WHERE opponent = "tennessee titans" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.