instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Find the number of voting records in total.
CREATE TABLE VOTING_RECORD (Id VARCHAR)
SELECT COUNT(*) FROM VOTING_RECORD
What is the 2006 census population when the area is 159?
CREATE TABLE table_28891101_3 (census_2006_population VARCHAR,area__km_2__ VARCHAR)
SELECT COUNT(census_2006_population) FROM table_28891101_3 WHERE area__km_2__ = 159
What was the biggest draws, for wins under 4, and points of 20-18?
CREATE TABLE table_52412 ("Position" real,"Club" text,"Played" real,"Points" text,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MAX("Draws") FROM table_52412 WHERE "Points" = '20-18' AND "Wins" < '4'
What is the Team when the match was in buenos aires , argentina?
CREATE TABLE table_41784 ("Year" real,"Country" text,"Team" text,"Individual" text,"Location" text)
SELECT "Team" FROM table_41784 WHERE "Location" = 'buenos aires , argentina'
count the number of times that patient 005-46456 had received a protein - csf test during the previous month?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND lab.labname = 'protein - csf' AND DATETIME(lab.labresulttime, 'start of mon...
When the average away attendance is 1.889 in the Superettan, what's the average home attendance?
CREATE TABLE table_22178 ("Season" real,"Average Attendance Home" text,"Highest Attendance Home" text,"Average Attendance Away" text,"Highest Attendance Away" text,"Division / Section" text,"Level" text,"Average Attendance League" text)
SELECT "Average Attendance Home" FROM table_22178 WHERE "Division / Section" = 'Superettan' AND "Average Attendance Away" = '1.889'
what is the round when the position is (c)?
CREATE TABLE table_name_85 (round INTEGER,position VARCHAR)
SELECT MAX(round) FROM table_name_85 WHERE position = "(c)"
What is the quantity of class B V?
CREATE TABLE table_62451 ("Class" text,"Number(s)" text,"Quantity" text,"Year(s) of Manufacture" text,"Type" text)
SELECT "Quantity" FROM table_62451 WHERE "Class" = 'b v'
What is the Date of attack of the ship with iron ore sunk by u-101 *?
CREATE TABLE table_name_39 (date_of_attack VARCHAR,fate VARCHAR,cargo VARCHAR)
SELECT date_of_attack FROM table_name_39 WHERE fate = "sunk by u-101 *" AND cargo = "iron ore"
where is a good place in mountain view for arabic food ?
CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
What are the product id and product type of the cheapest product?
CREATE TABLE products (product_id VARCHAR,product_type_code VARCHAR,product_price VARCHAR)
SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1
Which game site has an Opponent of buffalo bills?
CREATE TABLE table_name_75 (game_site VARCHAR,opponent VARCHAR)
SELECT game_site FROM table_name_75 WHERE opponent = "buffalo bills"
how many patients stayed in hospital for more than 10 days and procedured for coronary arteriography using two catheters?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters"
For each station, just simply show its longitude and the average duration of trips that started from the station using a scatter chart.
CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ...
SELECT long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
Which tournament has a Date of april 20, 1987?
CREATE TABLE table_68760 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Tournament" FROM table_68760 WHERE "Date" = 'april 20, 1987'
How many players played each position. Plot them as bar chart.
CREATE TABLE team (Team_id int,Name text)CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE country ...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
what rider finished next after jonas folger ?
CREATE TABLE table_204_603 (id number,"pos" text,"no" number,"rider" text,"bike" text,"laps" number,"time" text,"grid" number,"points" number)
SELECT "rider" FROM table_204_603 WHERE "pos" = (SELECT "pos" FROM table_204_603 WHERE "rider" = 'jonas folger') + 1
Name the number of shows when there was 2 million views
CREATE TABLE table_18069 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT COUNT("U.S. viewers (million)") FROM table_18069 WHERE "No. in season" = '2'
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between salary and manager_id in a scatter chart.
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 departments (DEPARTMENT_ID decimal(4,...
SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
had patient 016-1459's systemicdiastolic been normal.
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_bp...
For a vehicle below 25 feet, that was retired in 2005 and had a navistar t444e engine, what was the total width?
CREATE TABLE table_name_11 (width__inches_ VARCHAR,length__feet_ VARCHAR,engine VARCHAR,retired VARCHAR)
SELECT COUNT(width__inches_) FROM table_name_11 WHERE engine = "navistar t444e" AND retired = "2005" AND length__feet_ < 25
What is the sum of FA Cup goals when there are 19 league goals?
CREATE TABLE table_name_5 (fa_cup_goals INTEGER,league_goals VARCHAR)
SELECT SUM(fa_cup_goals) FROM table_name_5 WHERE league_goals = "19"
Name the least year for evonne goolagong helen gourlay
CREATE TABLE table_2009095_2 (year INTEGER,opponents VARCHAR)
SELECT MIN(year) FROM table_2009095_2 WHERE opponents = "Evonne Goolagong Helen Gourlay"
What laps have a Time of +28.778?
CREATE TABLE table_32745 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Laps" FROM table_32745 WHERE "Time" = '+28.778'
Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to display from high to low by the y-axis.
CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) DESC
Highest and lowest voted posts.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,Re...
SELECT 'site://questions/' + CAST(Id AS TEXT) AS "question_with_highest_score" FROM Posts ORDER BY Score DESC LIMIT 1
How many cuts did he make at the PGA championship in 3 events?
CREATE TABLE table_79764 ("Tournament" text,"Wins" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MAX("Cuts made") FROM table_79764 WHERE "Tournament" = 'pga championship' AND "Events" > '3'
JavaScript MVC Framework Trends (Bottom-Tier, from TodoMVC) (# of Questions per Month).
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
What is the order # for the original artist sarah mclachlan?
CREATE TABLE table_28485 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Order #" FROM table_28485 WHERE "Original artist" = 'Sarah McLachlan'
Show all advisors who have at least two students.
CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE plays_games (s...
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) >= 2
for how many days did the subject id 64208 stay in the hospital?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "64208"
what episode had the highest rating ?
CREATE TABLE table_204_384 (id number,"#" number,"air date" text,"timeslot (est)" text,"season" text,"rating" number,"share" number,"18-49 (rating/share)" text,"viewers (m)" number,"weekly rank (#)" number)
SELECT "air date" FROM table_204_384 ORDER BY "rating" DESC LIMIT 1
What is the fewest total goals scored for players with under 171 league appearances, 151 total appearances, and the DF position?
CREATE TABLE table_68093 ("Name" text,"Position" text,"Club career" text,"League apps" real,"League goals" real,"Total apps" real,"Total goals" real)
SELECT MIN("Total goals") FROM table_68093 WHERE "League apps" < '171' AND "Total apps" = '151' AND "Position" = 'df'
what is the properties of potassium when lithium is h a l o g e n s and sodium is bromine?
CREATE TABLE table_name_76 (potassium VARCHAR,lithium VARCHAR,sodium VARCHAR)
SELECT potassium FROM table_name_76 WHERE lithium = "h a l o g e n s" AND sodium = "bromine"
Which loss had a record of 79-49?
CREATE TABLE table_name_7 (loss VARCHAR,record VARCHAR)
SELECT loss FROM table_name_7 WHERE record = "79-49"
Which Record has a Date of june 26?
CREATE TABLE table_9281 ("Date" text,"Opponent" text,"Score" text,"Result" text,"Record" text)
SELECT "Record" FROM table_9281 WHERE "Date" = 'june 26'
Opponent of chicago bears involved what date?
CREATE TABLE table_36262 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" real)
SELECT "Date" FROM table_36262 WHERE "Opponent" = 'chicago bears'
Which Blagojevich (D) happened on october 16, 2006?
CREATE TABLE table_name_77 (blagojevich__d_ VARCHAR,date VARCHAR)
SELECT blagojevich__d_ FROM table_name_77 WHERE date = "october 16, 2006"
What was the result for the years after 2001?
CREATE TABLE table_66513 ("Year" real,"Category" text,"Nominee(s)" text,"Episode" text,"Result" text)
SELECT "Result" FROM table_66513 WHERE "Year" > '2001'
When 120 is the number in series who is the writer?
CREATE TABLE table_27061 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT "Written by" FROM table_27061 WHERE "No. in series" = '120'
Give me the comparison about meter_100 over the meter_500 by a bar chart, rank in asc by the bar.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Openin...
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500
What is the movie that Paul Schneider directed?
CREATE TABLE table_34133 ("Year" text,"Title" text,"Director" text,"Distributor(s)" text,"Box office" text)
SELECT "Title" FROM table_34133 WHERE "Director" = 'paul schneider'
what's the wii points with title and source being ts shin taikyoku: igo d j 2700-mon
CREATE TABLE table_18894 ("Title and Source" text,"Developer(s)/Publisher(s)" text,"JP -210-" text,"NA -350-" text,"PAL -295-" text,"Wii Points" text)
SELECT "Wii Points" FROM table_18894 WHERE "Title and Source" = 'Tsūshin Taikyoku: Igo Dōjō 2700-Mon'
WHich Score has a Date on november 11?
CREATE TABLE table_name_30 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_30 WHERE date = "november 11"
body mass index >= 18 and <= 32 kg / m2 at screening
CREATE TABLE table_train_108 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"deficiency_to_iga" bool,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"NOUSE" float)
SELECT * FROM table_train_108 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32
Give me a histogram for what are the different names and credit scores of customers who have taken a loan?, and I want to order X in asc order please.
CREATE TABLE customer (cust_ID varchar(3),cust_name varchar(20),acc_type char(1),acc_bal int,no_of_loans int,credit_score int,branch_ID int,state varchar(20))CREATE TABLE bank (branch_ID int,bname varchar(20),no_of_customers int,city varchar(10),state varchar(20))CREATE TABLE loan (loan_ID varchar(3),loan_type varchar(...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name
What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner?
CREATE TABLE table_name_87 (city___state VARCHAR,winner VARCHAR)
SELECT city___state FROM table_name_87 WHERE winner = "russell ingall larry perkins"
How many feet in length are there when the length is 106.1 meters?
CREATE TABLE table_20624 ("No." real,"Name" text,"Mi from Kingston" text,"Km from Kingston" text,"Parish" text,"Length feet" real,"Length meters" text)
SELECT COUNT("Length feet") FROM table_20624 WHERE "Length meters" = '106.1'
which player did not have positive yardage ?
CREATE TABLE table_203_8 (id number,"player" text,"rec." number,"yards" number,"avg." number,"td's" number,"long" number)
SELECT "player" FROM table_203_8 WHERE "yards" <= 0
What is the lowest salary in departments with average salary greater than the overall average. Plot them as bar chart.
CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE department (dept_name varchar(20),building varchar(15),budget numeric(12,2))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE advisor (s_ID varchar(5...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart, could you list by the total number in ascending?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer)
When dennis ross (r) unopposed is the candidate what is the party?
CREATE TABLE table_3186 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed'
Find the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and could you list y axis in ascending order?
CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))...
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon)
Which scorer plays for Aldershot and has scored a total of 19 League goals?
CREATE TABLE table_name_17 (scorer VARCHAR,club VARCHAR,league_goals VARCHAR)
SELECT scorer FROM table_name_17 WHERE club = "aldershot" AND league_goals = "19"
What is the score of the tournament with olivier dela tre as the opponent in the final?
CREATE TABLE table_name_41 (score VARCHAR,opponent_in_the_final VARCHAR)
SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître"
Which Match has a Competition of Group Stage on 2000-09-17?
CREATE TABLE table_43669 ("Match" text,"Date" text,"Location" text,"Lineup" text,"Result" text,"Competition" text)
SELECT "Match" FROM table_43669 WHERE "Competition" = 'group stage' AND "Date" = '2000-09-17'
On what date was Anniston Army Depot (SE Industrial Area) deleted?
CREATE TABLE table_name_8 (deleted VARCHAR,name VARCHAR)
SELECT deleted FROM table_name_8 WHERE name = "anniston army depot (se industrial area)"
what is the score when the opponent is ann grossman?
CREATE TABLE table_name_79 (score VARCHAR,opponent VARCHAR)
SELECT score FROM table_name_79 WHERE opponent = "ann grossman"
Do any classes not have lab sessions ?
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 offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE course (course_id int,name varchar,...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
What is the pos for the New York Knicks?
CREATE TABLE table_14577 ("Pos." text,"Player" text,"Team" text,"Height" text,"Weight" real,"First round" real,"Final round" text)
SELECT "Pos." FROM table_14577 WHERE "Team" = 'new york knicks'
Name the points classification for levi leipheimer
CREATE TABLE table_30923 ("Stage" real,"Winner" text,"General classification" text,"Mountains Classification" text,"Points classification" text,"Sprints Classification" text,"Team Classification" text)
SELECT "Points classification" FROM table_30923 WHERE "General classification" = 'Levi Leipheimer'
From what town was Steve Zakuani?
CREATE TABLE table_32389 ("Player" text,"Home Town" text,"College/Prior" text,"Drafting Team" text,"Graduated" real)
SELECT "Home Town" FROM table_32389 WHERE "Player" = 'steve zakuani'
Which loss has a Date of april 26?
CREATE TABLE table_69565 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Loss" FROM table_69565 WHERE "Date" = 'april 26'
Name the opponent with record of 6-2
CREATE TABLE table_name_19 (opponent VARCHAR,record VARCHAR)
SELECT opponent FROM table_name_19 WHERE record = "6-2"
what flights has CO from ATLANTA
CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_descrip...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIR...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of email and employee_id , sort in ascending by the EMAIL.
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 EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
what was the smallest number of votes before 2003 ?
CREATE TABLE table_203_330 (id number,"year of election" number,"candidates elected" number,"# of seats available" number,"# of votes" number,"% of popular vote" text)
SELECT MIN("# of votes") FROM table_203_330 WHERE "year of election" < 2003
what is the total average cost of a hospital that includes a drug called insulin regular human 100 unit/ml ij soln until 2103?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'insulin regular human 100 unit/ml ij soln')) A...
Class 746 has been taught by Prof. Beth Wilensky how many times ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 746 AND instructor.name LIKE '%Beth Wilensky%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offer...
Name the para for 1.5% commewijne
CREATE TABLE table_21150 ("Religion" text,"Suriname" text,"Paramaribo" text,"Wanica" text,"Nickerie" text,"Coronie" text,"Saramacca" text,"Commewijne" text,"Marowijne" text,"Para" text,"Brokopondo" text,"Sipaliwini" text)
SELECT "Para" FROM table_21150 WHERE "Commewijne" = '1.5%'
how many patients are discharged to disc-tran cancer/chldrn h and lab tested for basophils?
CREATE TABLE diagnoses (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_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils"
when is the opponent lyoto machida?
CREATE TABLE table_name_94 (date VARCHAR,opponent VARCHAR)
SELECT date FROM table_name_94 WHERE opponent = "lyoto machida"
Which Points have a Club of cf calvo sotelo, and a Goal Difference larger than -3?
CREATE TABLE table_name_9 (points INTEGER,club VARCHAR,goal_difference VARCHAR)
SELECT MAX(points) FROM table_name_9 WHERE club = "cf calvo sotelo" AND goal_difference > -3
Which 1st leg that has hemofarm?
CREATE TABLE table_name_12 (team__number1 VARCHAR)
SELECT 1 AS st_leg FROM table_name_12 WHERE team__number1 = "hemofarm"
Users who downvoted you the most.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR...
SELECT Score FROM Posts WHERE Id = 298680
How many patients admitted before the year 2144 had a lab test named heparin and Imw?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW"
From what Country is T6 Place Player Tom Weiskopf?
CREATE TABLE table_name_12 (country VARCHAR,place VARCHAR,player VARCHAR)
SELECT country FROM table_name_12 WHERE place = "t6" AND player = "tom weiskopf"
Who was the home team who played plymouth argyle?
CREATE TABLE table_27158 ("Tie no" real,"Home team" text,"Score 1" text,"Away team" text,"Attendance" real,"Date" text)
SELECT "Home team" FROM table_27158 WHERE "Away team" = 'Plymouth Argyle'
What manufacturer won the race on November 2?
CREATE TABLE table_21919 ("Year" real,"Date" text,"Driver" text,"Manufacturer" text,"Laps" real,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text)
SELECT "Manufacturer" FROM table_21919 WHERE "Date" = 'November 2'
What is the manner of departure for the date of appointment 24 may 2010?
CREATE TABLE table_26998135_2 (manner_of_departure VARCHAR,date_of_appointment VARCHAR)
SELECT manner_of_departure FROM table_26998135_2 WHERE date_of_appointment = "24 May 2010"
What position had notes of 20km and a year earlier than 2002?
CREATE TABLE table_68809 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text)
SELECT "Position" FROM table_68809 WHERE "Notes" = '20km' AND "Year" < '2002'
At which games did Tunisia win a bronze in the men's 1500 m freestyle?
CREATE TABLE table_37303 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text)
SELECT "Games" FROM table_37303 WHERE "Medal" = 'bronze' AND "Event" = 'men''s 1500 m freestyle'
what's the total number of species in the peruvian amazon with 8411 species in the world
CREATE TABLE table_72211 ("Taxonomy" text,"Species in the world" real,"Species in Peru" real,"Species in the Peruvian Amazon" real,"Peru Vs. world (Percent)" real,"Peruvian Amazon Vs. Peru (Percent)" real)
SELECT COUNT("Species in the Peruvian Amazon") FROM table_72211 WHERE "Species in the world" = '8411'
when was the first time in 12/this year that patient 015-59552 was prescribed for a medication?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND DATETIME(medication.drugstarttime, 'start of ...
What is the most recent year founded with an enrollment of 42,708?
CREATE TABLE table_46242 ("School" text,"Location" text,"Founded" real,"Enrollment" real,"Nickname" text)
SELECT MAX("Founded") FROM table_46242 WHERE "Enrollment" = '42,708'
systolic blood pressure ( supine ) <= 90 mmhg;
CREATE TABLE table_test_29 ("id" int,"bleeding" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"heart_disease" bool,"trauma" bool,"renal_disease" bool,"creatinine_clearance_cl" float,"hemorrhagic_stroke" bool,"platelet_count" float,"surgery" bool,"thromb...
SELECT * FROM table_test_29 WHERE systolic_blood_pressure_sbp <= 90
What Slalom was Switzerland in?
CREATE TABLE table_name_2 (slalom VARCHAR,country VARCHAR)
SELECT slalom FROM table_name_2 WHERE country = "switzerland"
Calculate the average age of patients with aortic insufficiency re-do sternotomy aortic valve replacement who stayed in hospital for 10 days.
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "10"
What are the names of catalog entries with level number 8, and count them by a bar chart, and order by the X in descending.
CREATE TABLE Catalog_Structure (catalog_level_number INTEGER,catalog_id INTEGER,catalog_level_name VARCHAR(50))CREATE TABLE Catalog_Contents (catalog_entry_id INTEGER,catalog_level_number INTEGER,parent_entry_id INTEGER,previous_entry_id INTEGER,next_entry_id INTEGER,catalog_entry_name VARCHAR(80),product_stock_number ...
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name DESC
Name the date for hard surface and tournament of fort walton beach
CREATE TABLE table_69264 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Date" FROM table_69264 WHERE "Surface" = 'hard' AND "Tournament" = 'fort walton beach'
How many departments for each building? Draw a bar chart, show Y from high to low order.
CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE time_slot (time_slot_id varchar(4),day varch...
SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY COUNT(building) DESC
How many results finished in a loss?
CREATE TABLE table_20745444_1 (tar_heels_points VARCHAR,result VARCHAR)
SELECT COUNT(tar_heels_points) FROM table_20745444_1 WHERE result = "Loss"
What was the date of the game when Colorado was the visiting team and Chicago was the home team?
CREATE TABLE table_name_36 (date VARCHAR,visitor VARCHAR,home VARCHAR)
SELECT date FROM table_name_36 WHERE visitor = "colorado" AND home = "chicago"
how many patients under the age of 55 had drug route as td?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.route = "TD"
What is the average number of points in the 2012 season, which has less than 1 wins and less than 0 podiums?
CREATE TABLE table_name_11 (points INTEGER,podiums VARCHAR,wins VARCHAR,season VARCHAR)
SELECT AVG(points) FROM table_name_11 WHERE wins < 1 AND season = "2012" AND podiums < 0
Show the statuses of roller coasters longer than 3300 or higher than 100.
CREATE TABLE roller_coaster (Status VARCHAR,LENGTH VARCHAR,Height VARCHAR)
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
find the icu stay id for the patient with patient id 3343.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "3343"
When was the result 0 3?
CREATE TABLE table_62201 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT "Date" FROM table_62201 WHERE "Result" = '0–3'
What is the score if Millwall is the Home Team?
CREATE TABLE table_13197 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Score" FROM table_13197 WHERE "Home team" = 'millwall'
What's the lowest number of points with fewer than 8 losses and fewer than 24 games for the vancouver burrards?
CREATE TABLE table_80426 ("Season" text,"Team Name" text,"Games" real,"Losses" real,"Points" real)
SELECT MIN("Points") FROM table_80426 WHERE "Losses" < '8' AND "Team Name" = 'vancouver burrards' AND "Games" < '24'