instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which college have both players with position midfielder and players with position defender? | CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE match_season (season number,player text,position text,country number,team number,draft_pick_number number,draft_class text,college text)CREATE TABLE player (player_id number,player text,years_played text,to... | SELECT college FROM match_season WHERE position = "Midfielder" INTERSECT SELECT college FROM match_season WHERE position = "Defender" |
Titre des 10 derni res questions pos es et pseudo de l'auteur. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)... | SELECT MONTH(10) |
My comments by score with post link. | 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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos... | SELECT PostId AS "post_link", Text, Score FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC |
What are the enrollments of schools whose denomination is not 'Catholic'? | CREATE TABLE school (Enrollment VARCHAR,Denomination VARCHAR) | SELECT Enrollment FROM school WHERE Denomination <> "Catholic" |
What are the distinct districts for elections? | CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE election (election_id number,counties_represented text,district numb... | SELECT DISTINCT district FROM election |
Opponent of denver broncos happened on what date? | CREATE TABLE table_name_88 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_88 WHERE opponent = "denver broncos" |
Bar chart x axis publication date y axis how many publication date, and show y-axis in ascending order. | CREATE TABLE book (Book_ID int,Title text,Issues real,Writer text)CREATE TABLE publication (Publication_ID int,Book_ID int,Publisher text,Publication_Date text,Price real) | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) |
show me all the flights from DENVER to BALTIMORE arriving 5 10 | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREAT... | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 10 AND date_day.month_number ... |
While the Hornets were visiting, what date was Deron Williams (29) the leading scorer? | CREATE TABLE table_56468 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text) | SELECT "Date" FROM table_56468 WHERE "Leading scorer" = 'deron williams (29)' AND "Visitor" = 'hornets' |
Who did Footscray play against when they scored 14.12 (96)? | CREATE TABLE table_55547 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_55547 WHERE "Home team score" = '14.12 (96)' |
how many times is hypotonic fluid administration - half-normal saline solution taken since 4 years ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'hypotonic fluid administration - half-normal saline solution' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year') |
What is the Chinese name of the player in Index F10? | CREATE TABLE table_70966 ("Index" text,"Name" text,"Chinese Name" text,"Country" text,"Status" text) | SELECT "Chinese Name" FROM table_70966 WHERE "Index" = 'f10' |
How many mountains classifications when Rui Costa is the winner? | CREATE TABLE table_25999087_2 (mountains_classification VARCHAR,winner VARCHAR) | SELECT COUNT(mountains_classification) FROM table_25999087_2 WHERE winner = "Rui Costa" |
What county is the unemployment rate 4.8%? | CREATE TABLE table_22815568_6 (county VARCHAR,unemployment_rate VARCHAR) | SELECT county FROM table_22815568_6 WHERE unemployment_rate = "4.8%" |
Name the nickname that was founded 1798 | CREATE TABLE table_25581 ("Institution" text,"Nickname" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Left" real) | SELECT "Nickname" FROM table_25581 WHERE "Founded" = '1798' |
list the top three most frequent prescriptions that patients were prescribed with within the same month after being prescribed sertraline since 6 years ago. | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE admissions (row_id n... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sertraline' AND DATETIME(prescriptions.startdate) >= DATETIME(CUR... |
Which Result has a District of pennsylvania 13? | CREATE TABLE table_34970 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text) | SELECT "Result" FROM table_34970 WHERE "District" = 'pennsylvania 13' |
What is the rank of the Nation that has fewer than 24 total medals are more than 7 Gold medals? | CREATE TABLE table_32003 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Rank") FROM table_32003 WHERE "Total" < '24' AND "Gold" > '7' |
What was the highest game number when the opponent was the Miami Heat? | CREATE TABLE table_49046 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT MAX("Game") FROM table_49046 WHERE "Opponent" = 'miami heat' |
When will Sarah Mcdowell teach 763 next ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 763 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Sarah Mcdowell%' AND offering_instructor.inst... |
tell me the difference between the total amount of input and output for patient 2753. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code tex... | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2753))) - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icu... |
is the creatine kinase (ck) value of patient 26612 last measured on the first hospital visit greater than the value of the patient second to last measured on the first hospital visit? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... |
Which Rank has a Years of 1998 present? | CREATE TABLE table_41792 ("Rank" real,"Name" text,"Years" text,"Matches" real,"Goals" real) | SELECT AVG("Rank") FROM table_41792 WHERE "Years" = '1998–present' |
How many places did the rank change since 22006 for County Leitrim? | CREATE TABLE table_22978 ("Rank 2011" real,"Change since 2006" text,"Urban Area" text,"County" text,"Population 2011" real,"Increase since 2006" text) | SELECT COUNT("Change since 2006") FROM table_22978 WHERE "County" = 'County Leitrim' |
What home team plays at Windy Hill? | CREATE TABLE table_name_77 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_77 WHERE venue = "windy hill" |
Who was the incumbent in the Ohio 5 district? | CREATE TABLE table_2646656_3 (incumbent VARCHAR,district VARCHAR) | SELECT incumbent FROM table_2646656_3 WHERE district = "Ohio 5" |
What is the average total score of body builders with height bigger than 200? | CREATE TABLE body_builder (Total INTEGER,People_ID VARCHAR)CREATE TABLE people (People_ID VARCHAR,Height INTEGER) | SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200 |
What are the codes of all the courses that are located in room KLR209? | CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num number)CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE course (crs_code text,dept_code ... | SELECT class_code FROM class WHERE class_room = 'KLR209' |
What was the aggregate score for the match won by Viadana? | CREATE TABLE table_28068063_2 (aggregate_score VARCHAR,winners VARCHAR) | SELECT aggregate_score FROM table_28068063_2 WHERE winners = "Viadana" |
What is the Propulsion for the model offered in 2003-2004 by neoplan usa? | CREATE TABLE table_5272 ("Order Year" text,"Manufacturer" text,"Model" text,"Fleet (Qty.)" text,"Propulsion" text,"Length (ft.)" real) | SELECT "Propulsion" FROM table_5272 WHERE "Order Year" = '2003-2004' AND "Manufacturer" = 'neoplan usa' |
What was the venue for the matches played on the dates 3,4,5,6,7 June 1993? | CREATE TABLE table_67709 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Venue" FROM table_67709 WHERE "Date" = '3,4,5,6,7 june 1993' |
What is the total of Frequency MHz with a Class of b1? | CREATE TABLE table_name_99 (frequency_mhz INTEGER,class VARCHAR) | SELECT SUM(frequency_mhz) FROM table_name_99 WHERE class = "b1" |
Tell me the total number of Bronze for futsal | CREATE TABLE table_name_67 (bronze VARCHAR,sport VARCHAR) | SELECT COUNT(bronze) FROM table_name_67 WHERE sport = "futsal" |
How many no outs are there for an average of 43.70? | CREATE TABLE table_20367820_16 (not_out VARCHAR,average VARCHAR) | SELECT not_out FROM table_20367820_16 WHERE average = "43.70" |
How many times is st kilda the away team? | CREATE TABLE table_name_15 (crowd VARCHAR,away_team VARCHAR) | SELECT COUNT(crowd) FROM table_name_15 WHERE away_team = "st kilda" |
which religious background does the patient with patient id 3343 belong to? | 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 demographic.religion FROM demographic WHERE demographic.subject_id = "3343" |
What is the Class when Wessex Trains Pink is the Livery? | CREATE TABLE table_name_90 (class VARCHAR,livery VARCHAR) | SELECT class FROM table_name_90 WHERE livery = "wessex trains pink" |
What is the current income inequality for the country of Seychelles? | CREATE TABLE table_33325 ("Country" text,"Area (km\u00b2) 2010" text,"Population 2011" text,"GDP (PPP) (Intl. $) 2011" text,"GDP (PPP) per capita (Intl. $) 2011" text,"Income inequality 1994\u20132011 (latest available)" text,"HDI 2011" text,"FSI 2012" text,"CPI 2011" text,"IEF 2011" text,"GPI 2012" text,"WPFI 2011/201... | SELECT "Income inequality 1994\u20132011 (latest available)" FROM table_33325 WHERE "Country" = 'seychelles' |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and could you list in descending by the Y? | 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 JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC |
What was the tie resulting from Sheffield Wednesday's game? | CREATE TABLE table_name_56 (tie_no VARCHAR,home_team VARCHAR) | SELECT tie_no FROM table_name_56 WHERE home_team = "sheffield wednesday" |
What is the largest crowd for an Away team of st kilda? | CREATE TABLE table_56253 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_56253 WHERE "Away team" = 'st kilda' |
Was MUSED 371 ever offered in the Spring ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSED' AND course.number = 371 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester |
What is the Rank of the game with an Attendance of 93,039? | CREATE TABLE table_name_98 (rank VARCHAR,attendance VARCHAR) | SELECT COUNT(rank) FROM table_name_98 WHERE attendance = 93 OFFSET 039 |
Courses worth 11 credits ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varcha... | SELECT DISTINCT name, number FROM course WHERE credits = 11 AND department = 'EECS' |
Who has high points when verizon center 17,152 is location attendance? | CREATE TABLE table_23286112_7 (high_points VARCHAR,location_attendance VARCHAR) | SELECT high_points FROM table_23286112_7 WHERE location_attendance = "Verizon Center 17,152" |
where does CP fly to | CREATE TABLE code_description (code varchar,description text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,... | SELECT DISTINCT airport.airport_code FROM airport, flight WHERE flight.airline_code = 'CP' AND flight.to_airport = airport.airport_code |
give me the number of patients whose primary disease is morbid obesity/sda and lab test fluid is ascites? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Ascites" |
calculate the number of tracheostomy - performed during current admission for ventilatory support cases. | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'tracheostomy - performed during current admission for ventilatory support' |
What was the lowest week in the month of August against Andrew Combs? | CREATE TABLE table_name_60 (week INTEGER,month VARCHAR,offensive VARCHAR) | SELECT MIN(week) FROM table_name_60 WHERE month = "august" AND offensive = "andrew combs" |
What class has a MHZ frequency under 103.1 licensed in morro bay, california? | CREATE TABLE table_name_4 (class VARCHAR,frequency_mhz VARCHAR,city_of_license VARCHAR) | SELECT class FROM table_name_4 WHERE frequency_mhz < 103.1 AND city_of_license = "morro bay, california" |
What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25? | CREATE TABLE orders (order_id number,customer_id number,order_status text,date_order_placed time,order_details text)CREATE TABLE shipment_items (shipment_id number,order_item_id number)CREATE TABLE products (product_id number,product_name text,product_details text)CREATE TABLE invoices (invoice_number number,invoice_da... | SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25" |
DBA - Total Posts per Month. | 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 FlagTypes (Id number,Name text,Description text)CREATE TABLE Re... | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, COUNT(*) AS PostCount FROM Posts AS P GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P.CreationDate) DESC, MONTH(P.CreationDate) DESC |
Give the number of patients that survived and had a lab test name of phosphate, urine. | CREATE TABLE diagnoses (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 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.expire_flag = "0" AND lab.label = "Phosphate, Urine" |
What was the Friday June 3 practice time of the rider who did 20' 50.45 108.623mph on Thursday, June 2? | CREATE TABLE table_29218221_3 (fri_3_june VARCHAR,thurs_2_june VARCHAR) | SELECT fri_3_june FROM table_29218221_3 WHERE thurs_2_june = "20' 50.45 108.623mph" |
timeline for linear algebra. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,Ab... | SELECT YEAR(p.LastActivityDate) AS "recent", p.Title, YEAR(p.CreationDate) AS "initial" FROM Posts AS p WHERE p.Tags LIKE '<linear-algebra>' AND p.Score > 0 |
What is the highest number of League Cup goals that were scored by Hartlepool? | CREATE TABLE table_name_6 (league_cup_goals INTEGER,club VARCHAR) | SELECT MAX(league_cup_goals) FROM table_name_6 WHERE club = "hartlepool" |
Name the population 2011 for luxembourg | CREATE TABLE table_1789 ("Country" text,"Population (2011)" real,"GDP (nominal) (2010,US$ millions)" real,"Military expenditures (2011,US$ millions)" real,"Military expenditures (2011,% of GDP)" text,"Defence expenditures,(2011,per capita)" real,"Deployable military (2011,thousands)" text) | SELECT "Population (2011)" FROM table_1789 WHERE "Country" = 'Luxembourg' |
What position was the draft pick that came from Langston? | CREATE TABLE table_27377 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_27377 WHERE "College" = 'Langston' |
Who is the constructor of the 196 chassis? | CREATE TABLE table_57124 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine" text,"Tyre" text,"Driver" text,"Rounds" text) | SELECT "Constructor" FROM table_57124 WHERE "Chassis" = '196' |
What is the 1913 class of locomotive that has a 1st built value under 494 and WA of 4-4-0t? | CREATE TABLE table_7562 ("1st built" real,"1913 Class" text,"W.A." text,"No. Built" real,"Builder" text,"Date" text,"LNER Class" text) | SELECT "1913 Class" FROM table_7562 WHERE "1st built" < '494' AND "W.A." = '4-4-0t' |
the two teams who raced in 2011 are carlin motorsport and what other team ? | CREATE TABLE table_204_722 (id number,"season" text,"series" text,"team" text,"races" number,"wins" number,"poles" number,"f/lap" number,"podiums" number,"points" number,"position" text) | SELECT "team" FROM table_204_722 WHERE "team" <> 'carlin motorsport' AND "season" = 2011 |
What are McCain's Percent when Obama has 36.47%? | CREATE TABLE table_23818 ("County" text,"Obama%" text,"Obama#" real,"McCain%" text,"McCain#" real) | SELECT "McCain%" FROM table_23818 WHERE "Obama%" = '36.47%' |
What is the Frequency for Model Number c3 850? | CREATE TABLE table_name_99 (frequency VARCHAR,model_number VARCHAR) | SELECT frequency FROM table_name_99 WHERE model_number = "c3 850" |
Show the number of customer address history in each day and group by date to with a line chart, and I want to list in ascending by the x axis. | CREATE TABLE Contacts (contact_id INTEGER,customer_id INTEGER,gender VARCHAR(1),first_name VARCHAR(80),last_name VARCHAR(50),contact_phone VARCHAR(80))CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR... | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to |
How many juries are there for Brolle? | CREATE TABLE table_30215 ("Draw" real,"Artist" text,"Song (English translation)" text,"Lyrics (l) / Music (m)" text,"Juries" real,"Viewers" real,"Total" real,"Place" real) | SELECT MAX("Juries") FROM table_30215 WHERE "Artist" = 'Brolle' |
What tournament was being played on August 11, 1984? | CREATE TABLE table_33890 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Tournament" FROM table_33890 WHERE "Date" = 'august 11, 1984' |
Give me a scatter chart that groups by all home, the x-axis is team id and the y-axis is school id. | 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 Team_ID, School_ID FROM basketball_match GROUP BY All_Home |
What upper level classes next semester will not have to meet on Fridays ? | 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 comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE ta (campus_job_id int,student_id ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... |
Which Elevation (m) has a Prominence (m) of 2,876, and a Col (m) larger than 0? | CREATE TABLE table_65639 ("Peak" text,"Country" text,"Elevation (m)" real,"Prominence (m)" real,"Col (m)" real) | SELECT SUM("Elevation (m)") FROM table_65639 WHERE "Prominence (m)" = '2,876' AND "Col (m)" > '0' |
For numbers of 2600-2825 (223 buses), what is the length? | CREATE TABLE table_name_38 (length VARCHAR,numbers VARCHAR) | SELECT length FROM table_name_38 WHERE numbers = "2600-2825 (223 buses)" |
Who was the home team when the record was 36 21 8? | CREATE TABLE table_name_23 (home VARCHAR,record VARCHAR) | SELECT home FROM table_name_23 WHERE record = "36–21–8" |
Show all video game types and the number of video games in each type. | CREATE TABLE Video_games (gtype VARCHAR) | SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype |
calculate the minimum age of divorcee patients who had posterior communicating aneurysm/sda as primary disease. | 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" |
Cross-posts from Stack Overflow to Code Review. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)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... | SELECT * FROM sys.databases AS db |
How did the election end for Terry L. Bruce? | CREATE TABLE table_1341586_14 (result VARCHAR,incumbent VARCHAR) | SELECT result FROM table_1341586_14 WHERE incumbent = "Terry L. Bruce" |
what is the drug that patient 66015 was prescribed with within the same hospital visit after the closed bronchial biopsy a month before? | 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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABL... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... |
when was the last test of patient 031-9128's microbiology other until 11/2105? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid nu... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'other' AND STRFTIME('%y-%... |
How many classes has Prof. Alan Gosman taken for 421 ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE program_course (program_id int,course_id int,work... | SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 421 AND instructor.name LIKE '%Alan Gosman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offerin... |
uncontrolled hypertension ( systolic bp > 170 or diastolic bp > 100 ) . | CREATE TABLE table_train_82 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"hypertension" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_82 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp > 170 OR diastolic_blood_pressure_dbp > 100) |
Name the player that is 1.85 m | CREATE TABLE table_73573 ("No" real,"Player" text,"Height (m)" text,"Height (f)" text,"Position" text,"Year born" real,"Current Club" text) | SELECT "Player" FROM table_73573 WHERE "Height (m)" = '1.85' |
In next semester does Prof. Erkut Ozbay teach 445 ? | 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 COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 445 AND instructor.name LIKE '%Erkut Ozbay%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_ins... |
When dxcc-tv is the call sign how many station types are there? | CREATE TABLE table_26014 ("Branding" text,"Callsign" text,"Ch. #" text,"Power kW" text,"Station Type" text,"Location (Transmitter site)" text) | SELECT COUNT("Station Type") FROM table_26014 WHERE "Callsign" = 'DXCC-TV' |
Show me the number of patients suffering from hypertension but not coronary artery disease or cardiac catheterization as their primary disease who died on or before 2154. | 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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.dod_year <= "2154.0" |
What team did the Montreal Canadiens visit when the record was 0-3? | CREATE TABLE table_38418 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_38418 WHERE "Visitor" = 'montreal canadiens' AND "Record" = '0-3' |
What is the life expectancy of men with an IMR of 64? | CREATE TABLE table_29505 ("Period" text,"Live births per year" text,"Deaths per year" text,"Natural change per year" text,"CBR*" text,"CDR*" text,"NC*" text,"TFR*" text,"IMR*" real,"Life expectancy total" text,"Life expectancy males" text,"Life expectancy females" text) | SELECT "Life expectancy males" FROM table_29505 WHERE "IMR*" = '64' |
Can you tell me the Record that has the Game smaller than 76? | CREATE TABLE table_name_61 (record VARCHAR,game INTEGER) | SELECT record FROM table_name_61 WHERE game < 76 |
How much Year Left has a Location of howe? | CREATE TABLE table_name_13 (year_left INTEGER,location VARCHAR) | SELECT SUM(year_left) FROM table_name_13 WHERE location = "howe" |
On what date was the poll showing John Kennedy with 45% and Mary Landrieu with 38%? | CREATE TABLE table_43584 ("Poll Source" text,"Dates administered" text,"Democrat: Mary Landrieu" text,"Republican: John Kennedy" text,"Lead Margin" real) | SELECT "Dates administered" FROM table_43584 WHERE "Republican: John Kennedy" = '45%' AND "Democrat: Mary Landrieu" = '38%' |
What team appointed a manager on 12 June? | CREATE TABLE table_17327458_1 (team VARCHAR,date_of_appointment VARCHAR) | SELECT team FROM table_17327458_1 WHERE date_of_appointment = "12 June" |
What is the Date with a Time of 17:37, and the Set 4 is 25 15? | CREATE TABLE table_name_38 (date VARCHAR,time VARCHAR,set_4 VARCHAR) | SELECT date FROM table_name_38 WHERE time = "17:37" AND set_4 = "25–15" |
which scientific challenge came two years before spinning a tale ? | CREATE TABLE table_203_185 (id number,"season" text,"a\ntechnical" text,"b\nscientific" text,"c\nfine arts" text,"d\nimprovisational" text,"e\nstructural" text,"rising stars!\u00ae" text,"po\nprojectoutreach\u00ae" text,"university level" text) | SELECT "b\nscientific" FROM table_203_185 WHERE "season" = (SELECT "season" FROM table_203_185 WHERE "b\nscientific" = 'spinning a tale') - 2 |
What venue was the match against the guest team, FK ibar, played at? | CREATE TABLE table_37686 ("Venue" text,"Home" text,"Guest" text,"Score" text,"Attendance" real) | SELECT "Venue" FROM table_37686 WHERE "Guest" = 'fk ibar' |
Tinkering with votes and posts. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostNoticeTypes ... | SELECT v.Id, p.Id FROM Votes AS v, Posts AS p WHERE v.PostId = p.Id AND v.VoteTypeId = 1 |
On 27 July 2003 what was the outcome of the game that resulted in a score of 7 5, 6 3? | CREATE TABLE table_name_77 (outcome VARCHAR,score VARCHAR,date VARCHAR) | SELECT outcome FROM table_name_77 WHERE score = "7–5, 6–3" AND date = "27 july 2003" |
Which Mountains classification has Points classification of not awarded? | CREATE TABLE table_name_48 (mountains_classification VARCHAR,points_classification VARCHAR) | SELECT mountains_classification FROM table_name_48 WHERE points_classification = "not awarded" |
Were there Bulletins to all contacts of the license created by GG Network? | CREATE TABLE table_name_69 (bulletins_to_all_contacts VARCHAR,creator VARCHAR) | SELECT bulletins_to_all_contacts FROM table_name_69 WHERE creator = "gg network" |
who is the incumbent with candidates being bud shuster (r) unopposed | CREATE TABLE table_1341586_39 (incumbent VARCHAR,candidates VARCHAR) | SELECT incumbent FROM table_1341586_39 WHERE candidates = "Bud Shuster (R) Unopposed" |
calculate the number of patients who were tested for blood (toxo) microbiology in this year. | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id nu... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood (toxo)' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
Which opponent had a bye for the TV Time? | CREATE TABLE table_14136 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text) | SELECT "Opponent" FROM table_14136 WHERE "TV Time" = 'bye' |
When was the incumbent Sherrod Brown first elected? | CREATE TABLE table_681 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT MAX("First elected") FROM table_681 WHERE "Incumbent" = 'Sherrod Brown' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.