instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what drug was prescribed to patient 005-77687 within the same day after having undergone the oral diuretic - metolazone (zaroxolyn) in a month before? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayi... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687') AND treatment.treatme... |
Show weight from each date of birth, and display in descending by the total number. | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT Date_of_Birth, Weight FROM people ORDER BY Weight DESC |
Queries for systemc over time. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time... | SELECT TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') AS yyyymm, COUNT(*) AS cnt FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'systemc' GROUP BY TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') ORD... |
What is the model for Thor's Hammer which is listed as operating? | CREATE TABLE table_55048 ("Name" text,"Model" text,"Park" text,"Opened" text,"Status" text) | SELECT "Model" FROM table_55048 WHERE "Status" = 'operating' AND "Name" = 'thor''s hammer' |
What trips are operated by Atlantic coast charters? | CREATE TABLE table_name_47 (total_trips__am_pm_ VARCHAR,operated_by VARCHAR) | SELECT total_trips__am_pm_ FROM table_name_47 WHERE operated_by = "atlantic coast charters" |
How many incumbents were for district georgia 6? | CREATE TABLE table_72391 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("Incumbent") FROM table_72391 WHERE "District" = 'Georgia 6' |
What is the grid with a yamaha manufacturer and a +19.435 time/retired? | CREATE TABLE table_name_65 (grid VARCHAR,manufacturer VARCHAR,time_retired VARCHAR) | SELECT grid FROM table_name_65 WHERE manufacturer = "yamaha" AND time_retired = "+19.435" |
Show me the trend about what are all the calendar dates and day Numbers?, rank in descending by the x-axis please. | CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TA... | SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC |
Which Centennial has a del Pueblo of 1986? | CREATE TABLE table_75759 ("Information" text,"Altade\u00f1a" text,"Aprende" text,"Centennial" text,"Kyrene MS" text,"del Pueblo" text) | SELECT "Centennial" FROM table_75759 WHERE "del Pueblo" = '1986' |
Which visiting team wound up with a final score of 18-40? | CREATE TABLE table_71822 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Visiting Team" FROM table_71822 WHERE "Final Score" = '18-40' |
since 2105 what are the top four most common drugs prescribed to patients in the same hospital encounter after stress ulcer prophylaxis - famotidine? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer pr... |
Name the normal with que of 24 | CREATE TABLE table_70945 ("Date enacted" text,"Normal total" text,"\u00a726 total" text,"Ont." text,"Que." text,"N.S." text,"N.B." text) | SELECT "Normal total" FROM table_70945 WHERE "Que." = '24' |
Who won the bronze medal in Hiroshima? | CREATE TABLE table_name_90 (bronze VARCHAR,location VARCHAR) | SELECT bronze FROM table_name_90 WHERE location = "hiroshima" |
what is the name of the medication that patient 016-30273 was first prescribed in 09/2103? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-30273')) AND STRFTIME('%y-%m', medication.drugstarttime) = '210... |
What is the 1st run that is down hill less than 46, and 84.45 points? | CREATE TABLE table_name_95 (downhill VARCHAR,points VARCHAR) | SELECT 1 AS st_run FROM table_name_95 WHERE downhill < 46 AND points = "84.45" |
What was the time of the person in lane 7? | CREATE TABLE table_66760 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Time" FROM table_66760 WHERE "Lane" = '7' |
what is the maximum total cost for the hospital involving a procedure called valve replacement or repair - routine during the last year? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | 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 = 'valve replacement or repair - routine')) AND... |
give me the number of patients whose discharge location is home and days of hospital stay is greater than 23? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "23" |
Which date had a sport of Academics? | CREATE TABLE table_name_70 (date VARCHAR,sport VARCHAR) | SELECT date FROM table_name_70 WHERE sport = "academics" |
What tournament had a black of Kramnik and an opening of B66 Sicilian Defence? | CREATE TABLE table_8507 ("White" text,"Black" text,"Year" real,"Result" text,"Moves" real,"Tournament" text,"Opening" text) | SELECT "Tournament" FROM table_8507 WHERE "Black" = 'kramnik' AND "Opening" = 'b66 sicilian defence' |
What are the profits (in billions) of the company with a market value of 172.9 billion? | CREATE TABLE table_1682026_3 (profits__billion_$_ VARCHAR,market_value__billion_$_ VARCHAR) | SELECT profits__billion_$_ FROM table_1682026_3 WHERE market_value__billion_$_ = "172.9" |
which team had the top transfer come in ? | CREATE TABLE table_203_440 (id number,"rank" number,"player" text,"from" text,"to" text,"transfer fee\n(\u20ac million)" number,"year" number) | SELECT "to" FROM table_203_440 ORDER BY "rank" LIMIT 1 |
What is the to par score from Brad Faxon of the United States with a score of 73-68=141? | CREATE TABLE table_44993 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "To par" FROM table_44993 WHERE "Country" = 'united states' AND "Score" = '73-68=141' AND "Player" = 'brad faxon' |
What is the maximum number of points against when the team has more than 0 losses and plays fewer than 6 games? | CREATE TABLE table_name_18 (against INTEGER,lost VARCHAR,played VARCHAR) | SELECT MAX(against) FROM table_name_18 WHERE lost > 0 AND played < 6 |
To get 18 credits , which courses should I take ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit i... | SELECT DISTINCT name, number FROM course WHERE credits = 18 AND department = 'EECS' |
How many numbers were recorded for Qatari female when Qatari male was 97? | CREATE TABLE table_19309079_2 (qatari_female VARCHAR,qatari_male VARCHAR) | SELECT COUNT(qatari_female) FROM table_19309079_2 WHERE qatari_male = 97 |
Tell me the D 50 + for D 48 + of d 53 + | CREATE TABLE table_57564 ("D 41 \u221a" text,"D 42 \u221a" text,"D 43 \u221a" text,"D 44 \u221a" text,"D 45 O" text,"D 46 O" text,"D 47 +" text,"D 48 +" text,"D 49 +" text,"D 50 +" text) | SELECT "D 50 +" FROM table_57564 WHERE "D 48 +" = 'd 53 +' |
How many episodes had a season premiere on December 11, 2010? | CREATE TABLE table_25405 ("Season" real,"Episodes" real,"Timeslot (ET)" text,"Season Premiere" text,"Season Finale" text,"TV Season" text,"Rank" text,"Viewers (in millions)" text) | SELECT COUNT("Episodes") FROM table_25405 WHERE "Season Premiere" = 'December 11, 2010' |
How many people attended the green bay packers game? | CREATE TABLE table_name_14 (attendance INTEGER,opponent VARCHAR) | SELECT SUM(attendance) FROM table_name_14 WHERE opponent = "green bay packers" |
Which home team plays at VFL Park? | CREATE TABLE table_54458 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_54458 WHERE "Venue" = 'vfl park' |
what team played against zimbabwe in 1999? | CREATE TABLE table_37059 ("Player" text,"Team" text,"Score" text,"Versus" text,"Year" real) | SELECT "Team" FROM table_37059 WHERE "Year" = '1999' AND "Versus" = 'zimbabwe' |
Can you tell me the average Total votes that has the # of seats won smaller than 0? | CREATE TABLE table_name_75 (total_votes INTEGER,_number_of_seats_won INTEGER) | SELECT AVG(total_votes) FROM table_name_75 WHERE _number_of_seats_won < 0 |
What is the name of the primary with a DCSF number larger than 2337 and an Ofsted number smaller than 135339? | CREATE TABLE table_name_74 (name VARCHAR,ofsted_number VARCHAR,type VARCHAR,dcsf_number VARCHAR) | SELECT name FROM table_name_74 WHERE type = "primary" AND dcsf_number > 2337 AND ofsted_number < 135339 |
What game in February 10, 2009 has the most points and a game number larger than 54? | CREATE TABLE table_48148 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT MAX("Points") FROM table_48148 WHERE "Date" = 'february 10, 2009' AND "Game" > '54' |
What shows for Chen Yanqing (CHN) when Doha, Qatar is ? | CREATE TABLE table_65306 ("World record" text,"Snatch" text,"Chen Yanqing (CHN)" text,"111kg" text,"Doha,Qatar" text) | SELECT "Chen Yanqing ( CHN )" FROM table_65306 WHERE "Doha , Qatar" = '—' |
What is the average capacity for rooms in each building? Draw a bar chart, and display bars in asc order. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE teaches (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varch... | SELECT building, AVG(capacity) FROM classroom GROUP BY building ORDER BY building |
Who wrote the episode with the production code 2j5153? | CREATE TABLE table_25830834_2 (written_by VARCHAR,production_code VARCHAR) | SELECT written_by FROM table_25830834_2 WHERE production_code = "2J5153" |
What was the course on 13 may? | CREATE TABLE table_57017 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Course" FROM table_57017 WHERE "Date" = '13 may' |
how many patients with private insurance had procedure under icd9 code 8852? | 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.insurance = "Private" AND procedures.icd9_code = "8852" |
Who is the opponent of the 3:00 time? | CREATE TABLE table_6974 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" real,"Time" text,"Location" text) | SELECT "Opponent" FROM table_6974 WHERE "Time" = '3:00' |
what amount played tried for 60? | CREATE TABLE table_17813 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT COUNT("Played") FROM table_17813 WHERE "Tries for" = '60' |
who was king right before kang ? | CREATE TABLE table_204_125 (id number,"state" text,"type" text,"name" text,"title" text,"royal house" text,"from" text,"to" text) | SELECT "name" FROM table_204_125 WHERE id = (SELECT id FROM table_204_125 WHERE "name" = 'kang') - 1 |
retrieve the top five most frequent lab tests that patients took within 2 months after receiving hemodialysis - for chronic renal failure until 2101. | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hemodialysis - for chronic renal failure' AND STRFTI... |
Who was the opponent that anke huber played against in the leipzig tournament? | CREATE TABLE table_34784 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Opponent" FROM table_34784 WHERE "Tournament" = 'leipzig' |
What year is the founding year, for the school that had an enrollment in 2005 of 963? | CREATE TABLE table_2076490_1 (founded VARCHAR,enrollment__2005_ VARCHAR) | SELECT founded FROM table_2076490_1 WHERE enrollment__2005_ = "963" |
What is the average age of patients whose primary disease is angioedema and age is equal to or more than 51 years? | 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 text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA" AND demographic.age >= "51" |
what is the five most frequent drugs that were prescribed in the same hospital visit during this year to the patients of age 40s after having been diagnosed with atrial fibrillation. | 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, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla... |
show me the admission and discharge location of subject id 22377. | 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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "22377" |
What is the latest year when Call of Duty 4: Modern Warfare was the game? | CREATE TABLE table_name_63 (year INTEGER,game VARCHAR) | SELECT MAX(year) FROM table_name_63 WHERE game = "call of duty 4: modern warfare" |
i need flight information for flights departing from CLEVELAND to MILWAUKEE on wednesday after 1700 | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE food_se... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1700 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... |
What lane is David Carry in heat 1? | CREATE TABLE table_33013 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"100m" real,"150m" text,"Time" text) | SELECT COUNT("Lane") FROM table_33013 WHERE "Heat" = '1' AND "Name" = 'david carry' |
Find the average rating star for each movie that received at least 2 ratings. | CREATE TABLE Rating (mID VARCHAR,stars INTEGER) | SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2 |
What was the aggregate score for Montauban? | CREATE TABLE table_27986200_3 (aggregate_score VARCHAR,proceed_to_quarter_final VARCHAR) | SELECT aggregate_score FROM table_27986200_3 WHERE proceed_to_quarter_final = "Montauban" |
the previous year, how many patients were prescribed with lopressor in the same hospital visit after having been diagnosed with cellulitis - extremity? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmen... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - extremity' AND DATETIME(diagnosis.diagnosistime, 'start of y... |
Which Genre has a Developer(s) of naughty dog? | CREATE TABLE table_14156 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text) | SELECT "Genre" FROM table_14156 WHERE "Developer(s)" = 'naughty dog' |
What was the result of week 11? | CREATE TABLE table_46493 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text) | SELECT "Result" FROM table_46493 WHERE "Week" = '11' |
Name the gt2 winning team where lmp2 winning team and butch leitzinger marino franchitti ben devlin | CREATE TABLE table_19598014_2 (gt2_winning_team VARCHAR,lmp2_winning_team VARCHAR) | SELECT gt2_winning_team FROM table_19598014_2 WHERE lmp2_winning_team = "Butch Leitzinger Marino Franchitti Ben Devlin" |
how many patients discharged to psychiatric facility-partial hospitalization were admitted to hospital before 2187? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2187" |
Which Opponent has an Event of king of the cage: shock and awe? | CREATE TABLE table_name_8 (opponent VARCHAR,event VARCHAR) | SELECT opponent FROM table_name_8 WHERE event = "king of the cage: shock and awe" |
who directed s01e13 | CREATE TABLE table_73199 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"Television order" text) | SELECT "Directed by" FROM table_73199 WHERE "Television order" = 'S01E13' |
Show the name of the product that is cheapest in each product category with their minimum price with a bar graph, and sort by the y-axis in asc. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) |
Find the number of characteristics that the product 'flax' has. | CREATE TABLE product_characteristics (product_id number,characteristic_id number,product_characteristic_value text)CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteristic_data_type text,characteristic_name text,other_characteristic_details text)CREATE TABLE ref_product_catego... | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax" |
what was the earliest date of a flight ? | CREATE TABLE table_203_538 (id number,"flight" text,"date" text,"payload nickname" text,"payload" text,"orbit" text,"result" text) | SELECT "date" FROM table_203_538 ORDER BY "date" LIMIT 1 |
Name the most number for new england blazers | CREATE TABLE table_20630 ("#" real,"Date" text,"at/vs." text,"Opponent" text,"Score" text,"Attendance" real,"Record" text) | SELECT MAX("#") FROM table_20630 WHERE "Opponent" = 'New England Blazers' |
8 credit upper-level classes number how many ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,he... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 8 AND program_course.category LIKE 'ULCS' |
flights from NEWARK to BOSTON | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE date_day (month_number int,day_number... | 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 = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'... |
What is the number of electorates (2009) for Hingna? | CREATE TABLE table_12609 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT AVG("Number of electorates (2009)") FROM table_12609 WHERE "Name" = 'hingna' |
What is the week 12 opponent for the year that had a week 3 opponent of South Florida (3-0)? | CREATE TABLE table_name_6 (week_12_nov_16 VARCHAR,week_3_sept_14 VARCHAR) | SELECT week_12_nov_16 FROM table_name_6 WHERE week_3_sept_14 = "south florida (3-0)" |
Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)? | CREATE TABLE table_22834834_3 (surface VARCHAR,score_in_the_final VARCHAR) | SELECT surface FROM table_22834834_3 WHERE score_in_the_final = "6–1, 6–7 (2–7) , 7–6 (7–5) , 7–6 (10–8)" |
Which box score has an Attendance of 54,773? | CREATE TABLE table_name_32 (boxscore VARCHAR,attendance VARCHAR) | SELECT boxscore FROM table_name_32 WHERE attendance = "54,773" |
What is the numberof running wiht pamela zapata? | CREATE TABLE table_12407546_2 (running VARCHAR,athlete VARCHAR) | SELECT COUNT(running) FROM table_12407546_2 WHERE athlete = "Pamela Zapata" |
Which Holmenkollen has a Country of norway, and a Winner of tom sandberg? | CREATE TABLE table_name_22 (holmenkollen VARCHAR,country VARCHAR,winner VARCHAR) | SELECT holmenkollen FROM table_name_22 WHERE country = "norway" AND winner = "tom sandberg" |
How many are on the administrative panel with an agricultural panel of fewer than 11 and an industrial and commercial panel of 3, with fewer than 4 on the labor panel? | CREATE TABLE table_7115 ("Administrative Panel" real,"Agricultural Panel" real,"Cultural and Educational Panel" real,"Industrial and Commercial Panel" real,"Labour Panel" real,"National University of Ireland" real,"University of Dublin" real,"Nominated by the Taoiseach" real,"Total" real) | SELECT AVG("Administrative Panel") FROM table_7115 WHERE "Agricultural Panel" < '11' AND "Industrial and Commercial Panel" = '3' AND "Labour Panel" < '4' |
What was the result of the singer with the top 8? | CREATE TABLE table_68960 ("Episode" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT "Result" FROM table_68960 WHERE "Episode" = 'top 8' |
For each record in schedule, show sum of price for each day in a bar chart, and could you list y-axis in desc order? | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod... | SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY SUM(Price) DESC |
display flights from DALLAS to ATLANTA which depart between 1400 and 1800 | CREATE TABLE airline (airline_code varchar,airline_name text,note 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 varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service... | 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 ((flight.departure_time <= 1800 AND flight.departure_time >= 1400) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight... |
Which player had a total of 116 (22)? | CREATE TABLE table_name_3 (name VARCHAR,total VARCHAR) | SELECT name FROM table_name_3 WHERE total = "116 (22)" |
what is the total number of points when the constructor is citro n total world rally team and the wins is less than 7? | CREATE TABLE table_79265 ("Constructor" text,"Chassis" text,"Starts" real,"Finishes" real,"Wins" real,"Podiums" real,"Stage wins" real,"Points" real) | SELECT COUNT("Points") FROM table_79265 WHERE "Constructor" = 'citroën total world rally team' AND "Wins" < '7' |
What is the lowest wins with less than 2 Byes? | CREATE TABLE table_name_15 (wins INTEGER,byes INTEGER) | SELECT MIN(wins) FROM table_name_15 WHERE byes < 2 |
Draw a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?, and I want to rank by the Y in desc please. | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i... | SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY id DESC |
Rep Earned after Change in the weight of Question Upvote. This is just an estimation and doesn't take rep cap into account. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time... | SELECT QuestionUpVotes = COUNT(*) * 5 FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND v.VoteTypeId = 2 AND p.OwnerUserId = '##UserId##' |
provide the number of patients whose insurance is private and procedure icd9 code is 8847? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8847" |
DHTML Questions not tagged HTML, Javascript or CSS:. | 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 "post_link", Title, Tags AS NotTags FROM Posts WHERE (Tags LIKE '%<dhtml>%') AND NOT (Tags LIKE '%<html>%') AND NOT (Tags LIKE '%<javascript>%') AND NOT (Tags LIKE '%<css>%') |
Which pens has 1 tries and matt alexander as a player with conv of 4? | CREATE TABLE table_52574 ("Player" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text,"Venue" text,"Date" text) | SELECT "Pens" FROM table_52574 WHERE "Tries" = '1' AND "Player" = 'matt alexander' AND "Conv" = '4' |
SQL Server related thread volume by month. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,C... | SELECT COUNT(*) AS Volume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<surface%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_STR(P.CreationDate, '%-mONT%-H... |
What's the season number of the episode originally aired on October 14, 2008? | CREATE TABLE table_22970 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text) | SELECT "No. in season" FROM table_22970 WHERE "Original air date" = 'October 14, 2008' |
Who was number 9 that had a number 7 of Joana and a Final of Pedro? | CREATE TABLE table_name_96 (no9 VARCHAR,no7 VARCHAR,final VARCHAR) | SELECT no9 FROM table_name_96 WHERE no7 = "joana" AND final = "pedro" |
What is the Score of the Burnley Home game? | CREATE TABLE table_name_57 (score VARCHAR,home_team VARCHAR) | SELECT score FROM table_name_57 WHERE home_team = "burnley" |
How many events did nigel mansell drive the fastest and a mclaren - honda win? | CREATE TABLE table_1139087_2 (grand_prix VARCHAR,constructor VARCHAR,fastest_lap VARCHAR) | SELECT COUNT(grand_prix) FROM table_1139087_2 WHERE constructor = "McLaren - Honda" AND fastest_lap = "Nigel Mansell" |
What director has 2004-03-31 as the release date, with daffy (as duck dodgers) as the character? | CREATE TABLE table_name_93 (director VARCHAR,release_date VARCHAR,characters VARCHAR) | SELECT director FROM table_name_93 WHERE release_date = "2004-03-31" AND characters = "daffy (as duck dodgers)" |
What was the maximum crowd size against St Kilda? | CREATE TABLE table_16387653_1 (crowd INTEGER,away_team VARCHAR) | SELECT MAX(crowd) FROM table_16387653_1 WHERE away_team = "St Kilda" |
Can you tell me the professor who is teaching LATIN 802 ? | CREATE TABLE gsi (course_offering_id int,student_id int)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,respe... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 802 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.... |
what is the average league cup goals when the position is df and total goals is more than 4? | CREATE TABLE table_name_78 (league_cup_goals INTEGER,position VARCHAR,total_goals VARCHAR) | SELECT AVG(league_cup_goals) FROM table_name_78 WHERE position = "df" AND total_goals > 4 |
What are the number of the descriptions of the service types with product price above 100?, order by the X-axis in ascending. | CREATE TABLE Performers (Performer_ID INTEGER,Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Customer_Orders (Order_ID INTEGER,Customer_ID INTEGER,Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Ac... | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description |
Which player wears the number 2 on his jersey? | CREATE TABLE table_name_18 (player VARCHAR,jersey_number_s_ VARCHAR) | SELECT player FROM table_name_18 WHERE jersey_number_s_ = "2" |
What is the dpi for the scanner with a max page size of 216mm x 355mm? | CREATE TABLE table_20792 ("product" text,"dimensions (mm)" text,"dpi" real,"pages per minute (color)" real,"max page size" text,"interface" text) | SELECT "dpi" FROM table_20792 WHERE "max page size" = '216mm x 355mm' |
On what date were Perth Wildcats the away team? | CREATE TABLE table_49863 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Box Score" text,"Report" text) | SELECT "Date" FROM table_49863 WHERE "Away team" = 'perth wildcats' |
Show the country names and the corresponding number of players Show bar chart, could you order in desc by the x axis? | CREATE TABLE country (Country_id int,Country_name text,Capital text,Official_native_language text)CREATE TABLE team (Team_id int,Name text)CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE match_season (Season real,Player text,Position t... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name DESC |
How many weeks was K.Maro at #1? | CREATE TABLE table_27441210_12 (weeks_at__number1 INTEGER,artist VARCHAR) | SELECT MAX(weeks_at__number1) FROM table_27441210_12 WHERE artist = "K.Maro" |
Who was the Producer/Director of Fear Beneath? | CREATE TABLE table_35328 ("Year" real,"Film" text,"Role" text,"Producer/Director" text,"Notes" text) | SELECT "Producer/Director" FROM table_35328 WHERE "Film" = 'fear beneath' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.