instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the trend of department_id over hire_date , sort HIRE_DATE in ascending order. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE va... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE |
when was the first time that patient 80645 got a urine out void output on 12/05/last year? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 diagnoses_icd (row_id n... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80645)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... |
What is the nationality of the athlete with a time of 2:12.56? | CREATE TABLE table_name_80 (nationality VARCHAR,time VARCHAR) | SELECT nationality FROM table_name_80 WHERE time = "2:12.56" |
What is the frequency of the talk station? | CREATE TABLE table_53998 ("Frequency" text,"Call sign" text,"Name" text,"Format" text,"Owner" text) | SELECT "Frequency" FROM table_53998 WHERE "Format" = 'talk' |
Who is the founder of Sony? | CREATE TABLE products (code number,name text,price number,manufacturer number)CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number) | SELECT founder FROM manufacturers WHERE name = 'Sony' |
What date was proposed when the listed date was 12/16/1994 in the County of beaufort? | CREATE TABLE table_name_65 (proposed VARCHAR,listed VARCHAR,county VARCHAR) | SELECT proposed FROM table_name_65 WHERE listed = "12/16/1994" AND county = "beaufort" |
What is the language of the film directed by Hans Kristensen? | CREATE TABLE table_name_14 (language VARCHAR,director VARCHAR) | SELECT language FROM table_name_14 WHERE director = "hans kristensen" |
what is the number of patients whose admission location is emergency room admit and admission year is less than 2151? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2151" |
Which player is from scotland? | CREATE TABLE table_name_24 (player VARCHAR,country VARCHAR) | SELECT player FROM table_name_24 WHERE country = "scotland" |
Return the average price of products that have each category code, and order by the mean product price in asc. | CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,product_category_code VARCHAR(20),date_product_first_available DATETIME,date_product_discontinued DATETIME,product_name VARCHAR(80),product_description VARCHAR(255),product_price DECIMAL(19,4))CREATE TABLE Complaints (complaint_id INTEGER,product_id IN... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) |
On what date did Fitzroy have a home team score of 8.13 (61)? | CREATE TABLE table_54974 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_54974 WHERE "Home team score" = '8.13 (61)' |
what is the least year for 4 points? | CREATE TABLE table_name_75 (year INTEGER,points VARCHAR) | SELECT MIN(year) FROM table_name_75 WHERE points = 4 |
In what edition was the opponent team Zimbabwe? | CREATE TABLE table_27877656_8 (edition VARCHAR,opponent_team VARCHAR) | SELECT edition FROM table_27877656_8 WHERE opponent_team = "Zimbabwe" |
Which players were selected after 2011? | CREATE TABLE table_37139 ("Year [A ]" real,"Pick" text,"Player name" text,"Position" text,"College" text) | SELECT "Player name" FROM table_37139 WHERE "Year [A ]" > '2011' |
count the number of patients whose year of birth is less than 2104 and drug type is main? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.drug_type = "MAIN" |
what was the first intake of patient 29741 for the patient until 04/26/2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_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 d_icd_diagnoses (row_id number,icd9_code... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 29741)) AND STRFTIME('%y-%m-%d', inp... |
what is patient 015-91239's average heartrate, on the current intensive care unit visit? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,d... | SELECT AVG(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239') AND patient.unitdischargetime IS NULL) A... |
What is the series episode number with a segment of D, and having fluorescent tubes? | CREATE TABLE table_name_22 (series_ep VARCHAR,segment_d VARCHAR) | SELECT series_ep FROM table_name_22 WHERE segment_d = "fluorescent tubes" |
Which Tournament has a Semi finalists of mary pierce elena dementieva? | CREATE TABLE table_9730 ("Tournament" text,"Surface" text,"Week" text,"Winner" text,"Finalist" text,"Semi finalists" text) | SELECT "Tournament" FROM table_9730 WHERE "Semi finalists" = 'mary pierce elena dementieva' |
What's the predecessor of the Ekavian word vreme? | CREATE TABLE table_29852 ("English" text,"Predecessor" text,"Ekavian" text,"Ikavian" text,"Ijekavian" text,"Ijekavian development" text) | SELECT "Predecessor" FROM table_29852 WHERE "Ekavian" = 'vreme' |
Give the maximum product price for each product type in a bar chart, and show X-axis in asc order. | CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,pro... | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code |
what is diagnoses short title and diagnoses long title of diagnoses icd9 code 42823? | 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "42823" |
count the number of patients whose year of birth is less than 2152 and procedure short title is left heart cardiac cath? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2152" AND procedures.short_title = "Left heart cardiac cath" |
Find the number of web accelerators used for each Operating system, I want to display in ascending by the X. | CREATE TABLE browser (id int,name text,market_share real)CREATE TABLE Web_client_accelerator (id int,name text,Operating_system text,Client text,Connection text)CREATE TABLE accelerator_compatible_browser (accelerator_id int,browser_id int,compatible_since_year int) | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY Operating_system |
What is the vote total for elections after 2001 with 44.5% participation? | CREATE TABLE table_name_29 (total_votes VARCHAR,election VARCHAR,share_of_votes VARCHAR) | SELECT total_votes FROM table_name_29 WHERE election > 2001 AND share_of_votes = "44.5%" |
Find the name of dorms that can accommodate more than 300 students. | CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE dorm_amenity (amenid number,amenity_name text)CRE... | SELECT dorm_name FROM dorm WHERE student_capacity > 300 |
Who are the hosts for the 2004 event? | CREATE TABLE table_38863 ("Year" text,"Theme" text,"Host city" text,"Venue" text,"Hosts" text) | SELECT "Hosts" FROM table_38863 WHERE "Year" = '2004' |
What details do we have on the students who registered for courses most recently? | CREATE TABLE courses (course_id text,course_name text,course_description text,other_details text)CREATE TABLE candidate_assessments (candidate_id number,qualification text,assessment_date time,asessment_outcome_code text)CREATE TABLE student_course_registrations (student_id number,course_id number,registration_date tim... | SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1 |
What is the average number of people killed with a Perpetrator of wirjo, 42? | CREATE TABLE table_name_54 (killed INTEGER,perpetrator VARCHAR) | SELECT AVG(killed) FROM table_name_54 WHERE perpetrator = "wirjo, 42" |
What is the away team score of the game that was played at princes park? | CREATE TABLE table_name_47 (away_team VARCHAR,venue VARCHAR) | SELECT away_team AS score FROM table_name_47 WHERE venue = "princes park" |
Can you tell me the Country that has the Year(s) Won of 1988? | CREATE TABLE table_59090 ("Player" text,"Country" text,"Year(s) Won" text,"Total" real,"To par" real) | SELECT "Country" FROM table_59090 WHERE "Year(s) Won" = '1988' |
Which home team played an away team with the score of 12.15 (87)? | CREATE TABLE table_10227 ("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_10227 WHERE "Away team score" = '12.15 (87)' |
Which Week has an Air Date of august 2, 2008? | CREATE TABLE table_name_62 (week VARCHAR,air_date VARCHAR) | SELECT week FROM table_name_62 WHERE air_date = "august 2, 2008" |
What college did hunter henry go to? | CREATE TABLE table_name_30 (college VARCHAR,player VARCHAR) | SELECT college FROM table_name_30 WHERE player = "hunter henry" |
When was the venue mexico city, mexico with a goal of 8? | CREATE TABLE table_7821 ("Goal" real,"Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_7821 WHERE "Venue" = 'mexico city, mexico' AND "Goal" = '8' |
Top 50000 best score queries with more than one answer and one favorite. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditD... | SELECT ViewCount, CreationDate, Title, Body, Tags, Score, CommentCount, AnswerCount, FavoriteCount FROM Posts WHERE FavoriteCount > 10 AND AnswerCount > 1 AND Score > 100 ORDER BY Score DESC LIMIT 50000 |
what is admission location of subject name tracy farmer? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Tracy Farmer" |
Can you tell me the number of upper-level ITALIAN classes that will be offered for 11 credits this Spring ? | CREATE TABLE gsi (course_offering_id int,student_id int)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 requirement (requirement_id int,requirement varchar,college varchar)CREATE... | SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 11 AND course.department = 'ITALIAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'S... |
What is the distance of the Mooresbridge Stakes race? | CREATE TABLE table_24850630_4 (distance VARCHAR,race VARCHAR) | SELECT distance FROM table_24850630_4 WHERE race = "Mooresbridge Stakes" |
Which date has a Crowd greater than 28,000, and a Home team of geelong? | CREATE TABLE table_56252 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_56252 WHERE "Crowd" > '28,000' AND "Home team" = 'geelong' |
the first time in their first hospital encounter patient 004-65662 received a analgesics - bolus parenteral analgesics treatment? | 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 microlab (microlabid number,patientunitstayid number... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65662' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
Create a bar chart showing the total number across team, sort from high to low by the y axis. | CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE technician (technician_id ... | SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC |
where was the last conference held ? | CREATE TABLE table_204_278 (id number,"name of president" text,"picture" text,"life span" text,"year of presidency" text,"place of conference" text) | SELECT "place of conference" FROM table_204_278 ORDER BY "year of presidency" DESC LIMIT 1 |
Top StackOverflow users in Jakarta. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name te... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bangladesh%') AND Reputation >= 1000 ORDER BY Reputation DESC |
was the sao2 value of patient 006-80884 last measured on the current icu visit greater than the value first measured on the current icu visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intak... | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884') AND patient.unitdischargetime IS NULL) AND... |
What was the home team's score at junction oval? | CREATE TABLE table_name_17 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_17 WHERE venue = "junction oval" |
Who has the high assists when April 26 is the date? | CREATE TABLE table_2837 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "High assists" FROM table_2837 WHERE "Date" = 'April 26' |
Name the result/games for 54741 | CREATE TABLE table_24343 ("Type of Record" text,"Attendance" real,"Date/Year" text,"Stadium" text,"Result/Games" text) | SELECT "Result/Games" FROM table_24343 WHERE "Attendance" = '54741' |
What is the year of the ceremony with the original title ni iji sin? | CREATE TABLE table_name_98 (year__ceremony_ VARCHAR,original_title VARCHAR) | SELECT year__ceremony_ FROM table_name_98 WHERE original_title = "ničiji sin" |
What pick was Scott Glennie from the Western hockey league | CREATE TABLE table_name_62 (pick__number VARCHAR,league_from VARCHAR,player VARCHAR) | SELECT pick__number FROM table_name_62 WHERE league_from = "western hockey league" AND player = "scott glennie" |
Which team has a car # before 99, a Toyota, and is driven by Mike Skinner? | CREATE TABLE table_35210 ("Pos." real,"Car #" real,"Driver" text,"Make" text,"Team" text) | SELECT "Team" FROM table_35210 WHERE "Car #" < '99' AND "Make" = 'toyota' AND "Driver" = 'mike skinner' |
What is the lowest to par for Bob Charles? | CREATE TABLE table_name_91 (to_par INTEGER,player VARCHAR) | SELECT MIN(to_par) FROM table_name_91 WHERE player = "bob charles" |
What is the people's party with a 30.0% social democratic? | CREATE TABLE table_64113 ("Date Released" text,"Polling institute" text,"Socialist" text,"Social Democratic" text,"Green-Communist" text,"People's Party" text,"Left Bloc" text,"Lead" text) | SELECT "People's Party" FROM table_64113 WHERE "Social Democratic" = '30.0%' |
until 2104 how many patients were diagnosed with ganglion of joint within 2 months after diagnosis of ami nos, initial? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id n... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ganglion of joint'... |
What are the descriptions of the service types with product price above 100? | CREATE TABLE Services (Service_Type_Code VARCHAR,Product_Price INTEGER)CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR,Service_Type_Code VARCHAR) | SELECT T1.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 |
What was the qualification with more than 585 laps? | CREATE TABLE table_71302 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Qual" FROM table_71302 WHERE "Laps" = '585' |
What was the score for the opponent against Katerina Maleeva in the final? | CREATE TABLE table_49581 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Score" FROM table_49581 WHERE "Opponent in the final" = 'katerina maleeva' |
What is the lowest brup when long is 94? | CREATE TABLE table_26176081_29 (brup INTEGER,long VARCHAR) | SELECT MIN(brup) FROM table_26176081_29 WHERE long = 94 |
What is the smallest round resulting in a draw with an Opponent of mari kaneko? | CREATE TABLE table_14427 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" real,"Time" text) | SELECT MIN("Round") FROM table_14427 WHERE "Res." = 'draw' AND "Opponent" = 'mari kaneko' |
What is the sum of completions that led to completion percentages of 65.4 and attempts under 451? | CREATE TABLE table_name_33 (comp INTEGER,comp_percentage VARCHAR,att VARCHAR) | SELECT SUM(comp) FROM table_name_33 WHERE comp_percentage = 65.4 AND att < 451 |
List all headquarters and the number of companies in each headquarter, show in descending by the x axis. | CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABL... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC |
Tell me the label for formats of cd and album and year of 2008 | CREATE TABLE table_name_48 (label VARCHAR,year VARCHAR,formats VARCHAR,format VARCHAR) | SELECT label FROM table_name_48 WHERE formats = "cd" AND format = "album" AND year = 2008 |
For next Summer , after 11:45 A.M. , what upper level electives will be available ? | 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 ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '11:45' 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... |
List the number of companies for each building in a bar chart, order bar from low to high order. | CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion text)CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status t... | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY T2.name |
Who was drafted by the Baltimore Colts? | CREATE TABLE table_2508633_3 (player VARCHAR,nfl_team VARCHAR) | SELECT player FROM table_2508633_3 WHERE nfl_team = "Baltimore Colts" |
In the sixth round, what is the sum of fixtures when there were more than 15 clubs involved? | CREATE TABLE table_32041 ("Round" text,"Date(s)" text,"Clubs from the previous round" text,"Clubs involved" real,"Fixtures" real) | SELECT SUM("Fixtures") FROM table_32041 WHERE "Round" = 'sixth round' AND "Clubs involved" > '15' |
who were the candidates when the incumbent was ed derwinski? | CREATE TABLE table_1341718_14 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1341718_14 WHERE incumbent = "Ed Derwinski" |
What is the number of chapters listed for the fraternity with a headquarters in Austin, Texas? | CREATE TABLE table_10054296_1 (chapters INTEGER,classification VARCHAR,headquarters VARCHAR) | SELECT MAX(chapters) FROM table_10054296_1 WHERE classification = "Fraternity" AND headquarters = "Austin, Texas" |
Which Club has a Founded smaller than 1882, and a League of fa premier league? | CREATE TABLE table_name_76 (club VARCHAR,founded VARCHAR,league VARCHAR) | SELECT club FROM table_name_76 WHERE founded < 1882 AND league = "fa premier league" |
Who was the manager for the team with captain Neil Redfearn? | CREATE TABLE table_70936 ("Team" text,"Manager 1" text,"Captain" text,"Kit manufacturer" text,"Shirt sponsor" text) | SELECT "Manager 1" FROM table_70936 WHERE "Captain" = 'neil redfearn' |
Tell me the opponent that had a result of l 27-20 | CREATE TABLE table_name_84 (opponent VARCHAR,result VARCHAR) | SELECT opponent FROM table_name_84 WHERE result = "l 27-20" |
What is the party of the prime minister who left office on 11 March 1983? | CREATE TABLE table_61920 ("Rank:" real,"Prime Minister:" text,"Party:" text,"Assumed Office:" text,"Left Office:" text,"TOTAL Time in Office:" text) | SELECT "Party:" FROM table_61920 WHERE "Left Office:" = '11 march 1983' |
tell me what are the top five most common diagnoses of patients with a 40s age during the previous year? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_procedures (row_id number,icd9_code te... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... |
When south Melbourne was the home team, what was the away team? | CREATE TABLE table_54710 ("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_54710 WHERE "Home team" = 'south melbourne' |
What was the To par for the player who finished t56? | CREATE TABLE table_66650 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "To par" FROM table_66650 WHERE "Finish" = 't56' |
Which entrant has a Honda V6 engine and a Lotus 99t chassis? | CREATE TABLE table_name_42 (entrant VARCHAR,engine VARCHAR,chassis VARCHAR) | SELECT entrant FROM table_name_42 WHERE engine = "honda v6" AND chassis = "lotus 99t" |
What was South Melbourne's away team score? | CREATE TABLE table_name_7 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_7 WHERE away_team = "south melbourne" |
Which time/retired had 75 laps and Pedro de la Rosa as a driver? | CREATE TABLE table_57361 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_57361 WHERE "Laps" = '75' AND "Driver" = 'pedro de la rosa' |
Name the bowling style of the player born 16 march 1974 | CREATE TABLE table_51938 ("Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text) | SELECT "Bowling Style" FROM table_51938 WHERE "Date of Birth" = '16 march 1974' |
What is the least first elected for jeff busby? | CREATE TABLE table_1342393_23 (first_elected INTEGER,incumbent VARCHAR) | SELECT MIN(first_elected) FROM table_1342393_23 WHERE incumbent = "Jeff Busby" |
which country has the most uninominal deputies | CREATE TABLE table_204_246 (id number,"department" text,"total deputies" number,"uninominal deputies" number,"plurinominal deputies" number,"special indigenous\nor campesino deputies" number,"senators" number) | SELECT "department" FROM table_204_246 WHERE "uninominal deputies" = (SELECT MAX("uninominal deputies") FROM table_204_246) |
In which competition was Moradi's time 1:48.58? | CREATE TABLE table_13586 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Notes" text) | SELECT "Competition" FROM table_13586 WHERE "Notes" = '1:48.58' |
Which writer wrote episode 18-09 (652)? | CREATE TABLE table_36049 ("Episode" text,"Title" text,"Writer(s)" text,"Preservation" text,"Original airdate" text) | SELECT "Writer(s)" FROM table_36049 WHERE "Episode" = '18-09 (652)' |
Accepted Answers by Group Members based on specified dates. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostTags ... | SELECT Users.DisplayName, answers.Id AS "a.answerid", answers.ParentId AS "a.questionid", answers.CreationDate AS "a.cdate" FROM Posts AS questions LEFT JOIN Posts AS answers ON questions.AcceptedAnswerId = answers.Id LEFT JOIN Users AS users ON answers.OwnerUserId = Users.Id WHERE (answers.OwnerUserId = 5637321 OR ans... |
What is the Format of the Label with Catalog SBP 234999? | CREATE TABLE table_8092 ("Date" real,"Region" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Format" FROM table_8092 WHERE "Catalog" = 'sbp 234999' |
Which tournament was on the week of 24 october and champion is matt doyle 1 6, 6 1, 6 2? | CREATE TABLE table_31068 ("Week of" text,"Tournament" text,"Champion" text,"Runner-up" text,"Semifinalists" text,"Quarterfinalists" text) | SELECT "Tournament" FROM table_31068 WHERE "Week of" = '24 October' AND "Champion" = 'Matt Doyle 1–6, 6–1, 6–2' |
Who was the girl of the week 2 weeks before terri lynn farrow in the same month? | CREATE TABLE table_60105 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text) | SELECT "Week 2" FROM table_60105 WHERE "Week 4" = 'terri lynn farrow' |
What is the ydi minimum? | CREATE TABLE table_25773915_11 (ydl INTEGER) | SELECT MIN(ydl) FROM table_25773915_11 |
how many male patients are discharged to rehab/distinct part hosp? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP" |
What is the L2 cache for the core i7-2635QM? | CREATE TABLE table_name_65 (l2_cache VARCHAR,model_number VARCHAR) | SELECT l2_cache FROM table_name_65 WHERE model_number = "core i7-2635qm" |
What is the theme with dani as the winner? | CREATE TABLE table_name_96 (theme VARCHAR,winner VARCHAR) | SELECT theme FROM table_name_96 WHERE winner = "dani" |
What is the navigator for James? | CREATE TABLE table_name_3 (navigator VARCHAR,driver VARCHAR) | SELECT navigator FROM table_name_3 WHERE driver = "james" |
What station on the network is tv3? | CREATE TABLE table_20525 ("Channel" real,"Band" text,"Video Frequency" text,"Audio Frequency" text,"Station" text,"Network" text,"Transmission" text,"Format" text,"Status" text) | SELECT "Network" FROM table_20525 WHERE "Station" = 'TV3' |
What is every value for points per game if passing yards per game is 179.6? | CREATE TABLE table_29552 ("Season" text,"Points per Game" text,"Total Yards per Game" text,"Rushing Yards per Game" text,"Passing Yards per Game" text,"Sacks" text,"Interceptions" text) | SELECT "Points per Game" FROM table_29552 WHERE "Passing Yards per Game" = '179.6' |
what year saw georgy trouerbach nicole van hooren win the women's doubles? | CREATE TABLE table_68943 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Year" FROM table_68943 WHERE "Women's doubles" = 'georgy trouerbach nicole van hooren' |
What are the results for Bill Shuster? | CREATE TABLE table_62424 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text) | SELECT "Results" FROM table_62424 WHERE "Incumbent" = 'bill shuster' |
What is the lowest round of the position de player with an overall less than 84? | CREATE TABLE table_77150 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT MIN("Round") FROM table_77150 WHERE "Position" = 'de' AND "Overall" < '84' |
What is the name of the artist with a Single / Pack of guitar hero track pack 1? | CREATE TABLE table_69766 ("Year" real,"Song title" text,"Artist" text,"Master recording?" text,"Release date" text,"Single / Pack" text) | SELECT "Artist" FROM table_69766 WHERE "Single / Pack" = 'guitar hero track pack 1' |
Average Number of Answers if has accepted vs none accepted. Returns the average number of answers from all Q&As with at least 1 answer where the Question has an accepted answer vs questions that don't have accepted answers. The theory is that questions that have accepted answers may discourage more answers being added. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolea... | WITH Accepted AS (SELECT xID = 1, AVG(CAST(p.AnswerCount AS FLOAT)) AS AcceptedCount FROM Posts AS p INNER JOIN Posts AS a ON p.Id = a.ParentId INNER JOIN Votes AS v ON a.Id = v.PostId WHERE p.PostTypeId = 1 AND p.AnswerCount > 0 AND v.VoteTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL), NoAccepted AS (SELECT xID = 1, A... |
Which Rank has a Name of john curry, and Points larger than 338.43? | CREATE TABLE table_name_8 (rank INTEGER,name VARCHAR,points VARCHAR) | SELECT MAX(rank) FROM table_name_8 WHERE name = "john curry" AND points > 338.43 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.