instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
When did an away team have a score of 12.9 (81)?
CREATE TABLE table_57218 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_57218 WHERE "Away team score" = '12.9 (81)'
What is the order number that has Aretha Franklin as the original artist?
CREATE TABLE table_75717 ("Week #" text,"Theme" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Order #" FROM table_75717 WHERE "Original artist" = 'aretha franklin'
Search keyword in user comments.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu...
SELECT CONCAT('http://stackoverflow.com/questions/', PostId), Score, Text, CreationDate FROM Comments WHERE Text LIKE '%##Keyword1##%' AND Text LIKE '%##Keyword2##%' AND Text LIKE '%##Keyword3##%' COLLATE Latin1_General_100_CI_AI_SC ORDER BY CreationDate DESC
Comments asking for the age of the house.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body te...
SELECT PostId AS "post_link", Text FROM Comments WHERE LOWER(Text) LIKE '%what%age%house%?%' OR LOWER(Text) LIKE '%how%old%house%?%'
What is the total number of team classifications when the young rider classification leader was Salvatore Commesso and the combativity award winner was Jacky Durand?
CREATE TABLE table_2267345_2 (team_classification VARCHAR,young_rider_classification VARCHAR,combativity_award VARCHAR)
SELECT COUNT(team_classification) FROM table_2267345_2 WHERE young_rider_classification = "Salvatore Commesso" AND combativity_award = "Jacky Durand"
what was the first entered service date in the table ?
CREATE TABLE table_204_882 (id number,"number" number,"builder" text,"entered service" text,"withdrawn" text,"notes" text)
SELECT "entered service" FROM table_204_882 WHERE id = 1
What is Prime Mover of Model FM CFA-16-4?
CREATE TABLE table_57300 ("Model" text,"Build year" text,"Total produced" real,"Wheel arrangement" text,"Prime mover" text,"Power output" text)
SELECT "Prime mover" FROM table_57300 WHERE "Model" = 'fm cfa-16-4'
Which engine received 0 points in 1988?
CREATE TABLE table_name_44 (engine_s_ VARCHAR,points VARCHAR,year VARCHAR)
SELECT engine_s_ FROM table_name_44 WHERE points = 0 AND year = 1988
what is the recording date when the title is screech owl blues?
CREATE TABLE table_9903 ("Matrix" real,"Recording date" text,"Title" text,"Accompaniment" text,"Paramount Issue No." real,"Sandra Lieb Classification" text,"JSP 77933" text,"Document DOCD" real)
SELECT "Recording date" FROM table_9903 WHERE "Title" = 'screech owl blues'
when did patient 12307 since 5 years ago for the last time leave the hospital?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,char...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 12307 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY admissions.dischtime DESC LIMIT 1
What is the high total for players with over 15 solo tackles?
CREATE TABLE table_72059 ("Player" text,"Solo" real,"Total" real,"Sacks" text,"Fumble force" real,"Fumble rec" real)
SELECT MAX("Total") FROM table_72059 WHERE "Solo" > '15'
provide the number of patients whose diagnoses long title is cellulitis and abscess of leg, except foot and drug type is main?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cellulitis and abscess of leg, except foot" AND prescriptions.drug_type = "MAIN"
which competitor came in first for this race ?
CREATE TABLE table_204_713 (id number,"rank" number,"bib" number,"athlete" text,"country" text,"time" text,"deficit" text)
SELECT "athlete" FROM table_204_713 WHERE id = 1
54 is the game where location attendance are.
CREATE TABLE table_21269 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_21269 WHERE "Game" = '54'
What is the label of release we are the rage with a cd format?
CREATE TABLE table_name_28 (label VARCHAR,format VARCHAR,release VARCHAR)
SELECT label FROM table_name_28 WHERE format = "cd" AND release = "we are the rage"
What are the student ids of students who don't have any allergies?
CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)
SELECT stuid FROM student EXCEPT SELECT stuid FROM has_allergy
who is the opponent in the final when the tournament is cagnes-sur-mer?
CREATE TABLE table_name_64 (opponent_in_the_final VARCHAR,tournament VARCHAR)
SELECT opponent_in_the_final FROM table_name_64 WHERE tournament = "cagnes-sur-mer"
Who Votes to Close, Reopen, Delete, Undelete the Most?.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n...
SELECT v.* FROM Users AS u INNER JOIN Votes AS v ON u.Id = v.UserId WHERE u.Id = '##UserId:int##' AND v.VoteTypeId IN (6, 7, 10, 11) ORDER BY v.VoteTypeId
show me all flights from PITTSBURGH which leave tomorrow and arrive in BOSTON
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND da...
in the last year what are the top three most common drugs prescribed to patients within 2 months after entral infus nutrit sub?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE icustays (row_id number,subject_id number,h...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
Which Visa 4 has besart berisha as Visa 1?
CREATE TABLE table_name_42 (visa_4 VARCHAR,visa_1 VARCHAR)
SELECT visa_4 FROM table_name_42 WHERE visa_1 = "besart berisha"
Name the date for q ngyu n y m
CREATE TABLE table_20578 ("Date (CE)" text,"Text" text,"Simplified characters" text,"Traditional characters" text,"Pinyin" text,"Wade-Giles" text,"Literal meaning" text)
SELECT "Date (CE)" FROM table_20578 WHERE "Pinyin" = 'qíngyuán … yìmǎ'
What are the first names and department numbers for employees with last name McEwen?
CREATE TABLE employees (employee_id number,first_name text,last_name text,email text,phone_number text,hire_date time,job_id text,salary number,commission_pct number,manager_id number,department_id number)CREATE TABLE jobs (job_id text,job_title text,min_salary number,max_salary number)CREATE TABLE countries (country_i...
SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'
Who wrote the episode that was directed by dan lerner?
CREATE TABLE table_15749 ("Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" real)
SELECT "Written by" FROM table_15749 WHERE "Directed by" = 'dan lerner'
how many republicans were elected after 2000 ?
CREATE TABLE table_204_400 (id number,"district" number,"senator" text,"party" text,"caucus" text,"first elected" number,"counties represented" text)
SELECT COUNT(*) FROM table_204_400 WHERE "party" = 'republican' AND "first elected" > 2000
Find the names of customers whose name contains 'Diana'.
CREATE TABLE customers (customer_id number,customer_details text)CREATE TABLE claims_documents (claim_id number,document_type_code text,created_by_staff_id number,created_date number)CREATE TABLE policies (policy_id number,customer_id number,policy_type_code text,start_date time,end_date time)CREATE TABLE claims_proces...
SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%"
14-17 was published in 1836 . when was the previous one published ?
CREATE TABLE table_204_549 (id number,"series\nnumber" text,"key" text,"composed" text,"published" text,"opus no." text,"brown" text,"kobylanska" text,"chominski" text,"dedication" text,"notes" text)
SELECT "published" FROM table_204_549 WHERE id = (SELECT id FROM table_204_549 WHERE "series\nnumber" = '14-17') - 1
give me the number of patients whose marital status is married and item id is 51288?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51288"
When was the most recent game that he partnered with nicklas kulti and they scored 3 6, 7 6, 6 4?
CREATE TABLE table_name_19 (date INTEGER,partner VARCHAR,score VARCHAR)
SELECT MAX(date) FROM table_name_19 WHERE partner = "nicklas kulti" AND score = "3–6, 7–6, 6–4"
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, and list in ascending by the bars please.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
what were the five most frequently ordered specimen tests ordered for patients who had previously been diagnosed with cirrhosis of liver nos in the same hospital encounter, during a year before?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE microbiologyevents (row_id number,subject_i...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos...
What is the rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438?
CREATE TABLE table_70058 ("Rank" real,"Circuit" text,"Headquarters" text,"Screens" real,"Sites" real)
SELECT AVG("Rank") FROM table_70058 WHERE "Headquarters" = 'toronto, on' AND "Screens" < '1,438'
what age does patient 95892 have in this hospital encounter?
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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,had...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 95892 AND admissions.dischtime IS NULL
How many bronzes for the nation ranked 14th, with over 14 golds and over 25 silvers?
CREATE TABLE table_39702 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_39702 WHERE "Gold" > '14' AND "Rank" = '14' AND "Silver" > '25'
Show the number of cards in different card type code in a pie chart.
CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))C...
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code
Name the average rank for west germany when gold is more than 1
CREATE TABLE table_name_15 (rank INTEGER,nation VARCHAR,gold VARCHAR)
SELECT AVG(rank) FROM table_name_15 WHERE nation = "west germany" AND gold > 1
What was the loss of the Red Sox game when they had a record of 77 67?
CREATE TABLE table_name_74 (loss VARCHAR,record VARCHAR)
SELECT loss FROM table_name_74 WHERE record = "77–67"
What is the notes for the vehicle built in 1917?
CREATE TABLE table_11199 ("Builder" text,"Type" text,"Built" text,"Bought" real,"Notes" text)
SELECT "Notes" FROM table_11199 WHERE "Built" = '1917'
provide the number of patients whose marital status is married and diagnoses long title is awaiting organ transplant status?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Awaiting organ transplant status"
What are the enrollment dates of all the tests that have result 'Pass', and count them by a line chart, I want to show by the x axis in desc please.
CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC
Name the loss when record was 72-62 and attendance more than 49,155
CREATE TABLE table_14406 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Loss" FROM table_14406 WHERE "Attendance" > '49,155' AND "Record" = '72-62'
Which students have professors as their advisors? Find their student ids.
CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone...
SELECT T2.stuid FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T1.rank = "Professor"
how many patients whose procedure long title is open and other right hemicolectomy and lab test fluid is pleural?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open and other right hemicolectomy" AND lab.fluid = "Pleural"
what is average age of patients whose ethnicity is black/african american and age is greater than or equal to 45?
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 AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "45"
Which Country has a Place of t10, and a Player of tony jacklin?
CREATE TABLE table_name_2 (country VARCHAR,place VARCHAR,player VARCHAR)
SELECT country FROM table_name_2 WHERE place = "t10" AND player = "tony jacklin"
What is the special when the challenger is dominique bouchet?
CREATE TABLE table_23982399_12 (special VARCHAR,challenger VARCHAR)
SELECT special FROM table_23982399_12 WHERE challenger = "Dominique Bouchet"
What is the Population of the New Bandon Parish with an Area km 2 larger than 326.76?
CREATE TABLE table_77207 ("Official Name" text,"Status" text,"Area km 2" real,"Population" real,"Census Ranking" text)
SELECT MAX("Population") FROM table_77207 WHERE "Area km 2" > '326.76' AND "Official Name" = 'new bandon'
Give me a bar chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'.
CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE Timed_Locations_of_Things (thing_id INTEGER,Date_and_Time DATETIME,Location_Code CHAR(15))CREATE TABLE Timed_Status_of_Things (thing_id INTEGER,Date_and_Date DATETIME,Status_of_Thing_Code CH...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code
Which College has a Round smaller than 2?
CREATE TABLE table_51068 ("Round" real,"Pick" real,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_51068 WHERE "Round" < '2'
what is the competition when the result is won and the date is september 13, 1996?
CREATE TABLE table_63978 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Competition" FROM table_63978 WHERE "Result" = 'won' AND "Date" = 'september 13, 1996'
Who is the opponent with a time of 1:16?
CREATE TABLE table_name_58 (opponent VARCHAR,time VARCHAR)
SELECT opponent FROM table_name_58 WHERE time = "1:16"
Number of deleted posts for user.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,Own...
SELECT * FROM PostHistory WHERE PostHistory.UserId = @UserId
How many bronzes have 1 as the total, with spain (esp) as the nation, and a gold greater than 0?
CREATE TABLE table_name_31 (bronze VARCHAR,gold VARCHAR,total VARCHAR,nation VARCHAR)
SELECT COUNT(bronze) FROM table_name_31 WHERE total = 1 AND nation = "spain (esp)" AND gold > 0
What was the score on March 5 at Vancouver?
CREATE TABLE table_name_42 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_42 WHERE date = "march 5"
Win % larger than 47.1, and a Matches smaller than 145 had what lowest lost?
CREATE TABLE table_39301 ("Nationality" text,"Matches" real,"Drawn" real,"Lost" real,"Win %" real)
SELECT MIN("Lost") FROM table_39301 WHERE "Win %" > '47.1' AND "Matches" < '145'
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the sum of code , and group by attribute founder, display total number of code from high to low order.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
What is the BIOMEDE 556 course about ?
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 course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credi...
SELECT DISTINCT description, name FROM course WHERE department = 'BIOMEDE' AND number = 556
What are the full names and department ids for the lowest paid employees across all departments.
CREATE TABLE regions (region_id number,region_name text)CREATE TABLE countries (country_id text,country_name text,region_id number)CREATE TABLE job_history (employee_id number,start_date time,end_date time,job_id text,department_id number)CREATE TABLE departments (department_id number,department_name text,manager_id nu...
SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)
i need information on flights from TORONTO to SAN DIEGO
CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal...
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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE ...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
Show teams that have suffered more than three eliminations.
CREATE TABLE wrestler (wrestler_id number,name text,reign text,days_held text,location text,event text)CREATE TABLE elimination (elimination_id text,wrestler_id text,team text,eliminated_by text,elimination_move text,time text)
SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3
Who was the opponent in London, England in a round less than 2?
CREATE TABLE table_name_62 (opponent VARCHAR,location VARCHAR,round VARCHAR)
SELECT opponent FROM table_name_62 WHERE location = "london, england" AND round < 2
Name the country with a score of 69-71=140.
CREATE TABLE table_47688 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_47688 WHERE "Score" = '69-71=140'
What's the nominee for best supporting actress?
CREATE TABLE table_name_86 (nominee VARCHAR,category VARCHAR)
SELECT nominee FROM table_name_86 WHERE category = "best supporting actress"
What is the episode number where Jim Sweeney was performer 1 and Mike Mcshane was performer 4?
CREATE TABLE table_name_25 (episode INTEGER,performer_1 VARCHAR,performer_4 VARCHAR)
SELECT SUM(episode) FROM table_name_25 WHERE performer_1 = "jim sweeney" AND performer_4 = "mike mcshane"
What are the names of all the documents, as well as the access counts of each, ordered alphabetically.
CREATE TABLE Document_Structures (document_structure_code VARCHAR(15),parent_document_structure_code VARCHAR(15),document_structure_description VARCHAR(80))CREATE TABLE Documents (document_code VARCHAR(15),document_structure_code VARCHAR(15),document_type_code VARCHAR(15),access_count INTEGER,document_name VARCHAR(80))...
SELECT document_name, access_count FROM Documents ORDER BY document_name
What was the score for the game against the New Jersey Nets?
CREATE TABLE table_name_14 (score VARCHAR,opponent VARCHAR)
SELECT score FROM table_name_14 WHERE opponent = "new jersey nets"
Which supercharger gear ratio has a Octane rating of 68?
CREATE TABLE table_58537 ("Engine" text,"Power,continuous" text,"Power,takeoff" text,"Compression ratio" text,"Supercharger gear ratio" text,"Octane rating" text,"Dry weight" text)
SELECT "Supercharger gear ratio" FROM table_58537 WHERE "Octane rating" = '68'
how many candidates with district being california 7
CREATE TABLE table_72431 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT COUNT("Candidates") FROM table_72431 WHERE "District" = 'California 7'
What is the Country of the Player with a To par of +4 and Score of 73-71-73=217?
CREATE TABLE table_name_94 (country VARCHAR,to_par VARCHAR,score VARCHAR)
SELECT country FROM table_name_94 WHERE to_par = "+4" AND score = 73 - 71 - 73 = 217
What is the Game number on March 30?
CREATE TABLE table_name_33 (game VARCHAR,date VARCHAR)
SELECT game FROM table_name_33 WHERE date = "march 30"
Top users by skills in a given location.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId numb...
SELECT Users.Id AS "user_link", SUM(CASE WHEN Tags.TagName = '##Skill1##' THEN Answers.Score ELSE 0 END) AS Score1, SUM(CASE WHEN Tags.TagName = '##Skill2##' THEN Answers.Score ELSE 0 END) AS Score2 FROM Posts AS Answers INNER JOIN Posts AS ParentQuestions ON ParentQuestions.Id = Answers.ParentId INNER JOIN Users AS Us...
of the top 10 most heavily populated census subdivisions in 2011 , how many located were in ontario ?
CREATE TABLE table_203_834 (id number,"rank" number,"census subdivision" text,"province" text,"type" text,"land area\n(km2,2011)" number,"population 2011" number,"population 2006" number,"population 2001" number,"population 1996" number,"change in % 2006-2011" number,"change in % 1996-2011" number)
SELECT COUNT("census subdivision") FROM table_203_834 WHERE "population 2011" IN (SELECT "population 2011" FROM table_203_834 ORDER BY "population 2011" DESC LIMIT 10) AND "province" = 'ontario'
tg ( triglyceride ) greater than 400 mg / dl
CREATE TABLE table_train_113 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"body_weight" float,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"triglyceride_tg" float,"NOUSE" float)
SELECT * FROM table_train_113 WHERE triglyceride_tg >= 400
Name the drawn with lost of 3 and points of 88
CREATE TABLE table_14366 ("Club" text,"Played" 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 "Drawn" FROM table_14366 WHERE "Lost" = '3' AND "Points" = '88'
What is Name, when Prize is '$279.330'?
CREATE TABLE table_43937 ("Rank" text,"Event" text,"Place" text,"Name" text,"Prize" text)
SELECT "Name" FROM table_43937 WHERE "Prize" = '$279.330'
provide the number of patients whose primary disease is stemi and days of hospital stay is greater than 4?
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.diagnosis = "STEMI" AND demographic.days_stay > "4"
Who was the highest picked defensive end
CREATE TABLE table_1226 ("Round #" real,"Pick #" real,"Player" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_1226 WHERE "Position" = 'Defensive end'
What is the highest S D with a 2420 (220) [3H] paroxetine and an N D less than 393.8?
CREATE TABLE table_65229 ("[ 3 H]CFT" real,"[ 3 H]Nisoxetine" text,"[ 3 H]Paroxetine" text,"N \u00f7 D" real,"S \u00f7 D" real)
SELECT MAX("S \u00f7 D") FROM table_65229 WHERE "[ 3 H]Paroxetine" = '2420 (220)' AND "N \u00f7 D" < '393.8'
what flights takeoff and land at MKE
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_n...
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
How many tracks belong to rock genre?
CREATE TABLE mediatype (mediatypeid number,name text)CREATE TABLE invoiceline (invoicelineid number,invoiceid number,trackid number,unitprice number,quantity number)CREATE TABLE customer (customerid number,firstname text,lastname text,company text,address text,city text,state text,country text,postalcode text,phone tex...
SELECT COUNT(*) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock"
What is the fastest lap in the Le Mans Bugatti circuit?
CREATE TABLE table_74932 ("Circuit" text,"Date" text,"Pole position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Winning manufacturer" text)
SELECT "Fastest Lap" FROM table_74932 WHERE "Circuit" = 'le mans bugatti'
did patient 54825 undergo until 1 year ago a rt/left heart card cath procedure?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_typ...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND DATETIME(pro...
What is the pick number for the player Chris Gomez?
CREATE TABLE table_6042 ("Pick #" real,"MLS Team" text,"Player" text,"Position" text,"Affiliation" text)
SELECT SUM("Pick #") FROM table_6042 WHERE "Player" = 'chris gomez'
What's the total of Sweden (SWE) having less than 1 silver?
CREATE TABLE table_79718 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Total") FROM table_79718 WHERE "Nation" = 'sweden (swe)' AND "Silver" < '1'
give me the number of patients whose primary disease is left femur fracture and year of birth is less than 2071?
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 WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND demographic.dob_year < "2071"
What home team had 2 ties?
CREATE TABLE table_79605 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Home team" FROM table_79605 WHERE "Tie no" = '2'
What's the earliest year with a role of alvin seville simon seville david 'dave' seville, and a Title of alvin and the chipmunks meet the wolfman?
CREATE TABLE table_name_18 (year INTEGER,role VARCHAR,title VARCHAR)
SELECT MIN(year) FROM table_name_18 WHERE role = "alvin seville simon seville david 'dave' seville" AND title = "alvin and the chipmunks meet the wolfman"
What was the Nickname that had a No. 0, and Years in Competition of 1982-2003?
CREATE TABLE table_34197 ("Club" text,"Nickname" text,"Years in Competition" text,"No. of Premierships" real,"Premiership Years" text)
SELECT "Nickname" FROM table_34197 WHERE "No. of Premierships" = '0' AND "Years in Competition" = '1982-2003'
If the distance is 55.7, what is the name of the constellation?
CREATE TABLE table_22198 ("HD designation" text,"Constellation" text,"Distance (ly)" text,"Spectral type" text,"Signal power (kW)" real,"Date sent" text,"Arrival date" text)
SELECT "Constellation" FROM table_22198 WHERE "Distance ( ly )" = '55.7'
Who is the outgoing manager when the team is simurq pfc?
CREATE TABLE table_27057070_3 (outgoing_manager VARCHAR,team VARCHAR)
SELECT outgoing_manager FROM table_27057070_3 WHERE team = "Simurq PFC"
What is the location where ed c. kingsley was the runner-up in 1939?
CREATE TABLE table_name_63 (location VARCHAR,runner_up VARCHAR,year VARCHAR)
SELECT location FROM table_name_63 WHERE runner_up = "ed c. kingsley" AND year = "1939"
Which year or years did a team win 174 games and had an assist number less than 17?
CREATE TABLE table_32597 ("Rank" real,"Player" text,"Nation" text,"Assist" real,"Games" real,"Years" text)
SELECT "Years" FROM table_32597 WHERE "Assist" < '17' AND "Games" = '174'
Which type has a quantity of 11?
CREATE TABLE table_name_29 (type VARCHAR,quantity VARCHAR)
SELECT type FROM table_name_29 WHERE quantity = 11
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number by a bar chart, list from low to high by the names.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25)...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
What is Michal Pivonka's pick number?
CREATE TABLE table_2850912_3 (pick__number VARCHAR,player VARCHAR)
SELECT COUNT(pick__number) FROM table_2850912_3 WHERE player = "Michal Pivonka"
Bar chart x axis nationality y axis the total number
CREATE TABLE host (Host_ID int,Name text,Nationality text,Age text)CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)CREATE TABLE party (Party_ID int,Party_Theme text,Location text,First_year text,Last_year text,Number_of_hosts int)
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
when was the first time patient 27703 had a chest tubes cticu ct 1 output on last month/04?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto 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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,l...
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 = 27703)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ches...
what was the number of labor councillors in 1964 ?
CREATE TABLE table_204_349 (id number,"year" number,"conservative\ncouncillors" number,"labour\ncouncillors" number,"independent\ncouncillors" number,"liberal\ncouncillors" number)
SELECT "labour\ncouncillors" FROM table_204_349 WHERE "year" = 1964
Name the Prominence of the Mountain Peak of matchless mountain pb?
CREATE TABLE table_name_81 (prominence VARCHAR,mountain_peak VARCHAR)
SELECT prominence FROM table_name_81 WHERE mountain_peak = "matchless mountain pb"