instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the capacity for the institution of university of alberta?
CREATE TABLE table_74149 ("Institution" text,"Team" text,"City" text,"Province" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Endowment" text,"Football stadium" text,"Capacity" real)
SELECT "Capacity" FROM table_74149 WHERE "Institution" = 'University of Alberta'
What date were the high assists rondo (5) and the high rebounds rondo (10)?
CREATE TABLE table_name_18 (date VARCHAR,high_assists VARCHAR,high_rebounds VARCHAR)
SELECT date FROM table_name_18 WHERE high_assists = "rondo (5)" AND high_rebounds = "rondo (10)"
Is ENGR 996 having class on Friday ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)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_prerequisite (pre_course_id int,cour...
SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ENGR' AND course.number = 996 AND semester.semester = 'WN' AND semester.year = 2016
How many Opponents have a Result of win, and Nuggets points smaller than 115, and an Opponent of washington?
CREATE TABLE table_44614 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Nuggets points" real,"Opponents" real,"Record" text,"Streak" text)
SELECT SUM("Opponents") FROM table_44614 WHERE "Result" = 'win' AND "Nuggets points" < '115' AND "Opponent" = 'washington'
Tell me the record for a time in seconds smaller than 5.22.
CREATE TABLE table_name_45 (record VARCHAR,time__seconds_ INTEGER)
SELECT record FROM table_name_45 WHERE time__seconds_ < 5.22
Which Surface has an Opponent of rafael nadal, and an Event of 2?
CREATE TABLE table_66229 ("!Event" real,"Round" text,"Surface" text,"Winner" text,"Opponent" text,"Result" text)
SELECT "Surface" FROM table_66229 WHERE "Opponent" = 'rafael nadal' AND "!Event" = '2'
Which Years at club have Games smaller than 7, and Goals larger than 2, and a Player of john frazer?
CREATE TABLE table_name_10 (years_at_club VARCHAR,player VARCHAR,games VARCHAR,goals VARCHAR)
SELECT years_at_club FROM table_name_10 WHERE games < 7 AND goals > 2 AND player = "john frazer"
What was the position of the player with 57 goals?
CREATE TABLE table_29483890_1 (position VARCHAR,goals VARCHAR)
SELECT position FROM table_29483890_1 WHERE goals = 57
What is the highest position the album Where we belong, which had an issue date higher than 9, had?
CREATE TABLE table_name_14 (highest_position VARCHAR,issue_date VARCHAR,album_title VARCHAR)
SELECT COUNT(highest_position) FROM table_name_14 WHERE issue_date < 9 AND album_title = "where we belong"
What college did Matt Freeman go to?
CREATE TABLE table_name_46 (college VARCHAR,player VARCHAR)
SELECT college FROM table_name_46 WHERE player = "matt freeman"
What was the sum of attendance for games with a time of 3:23?
CREATE TABLE table_46573 ("Game" real,"Date" text,"Location" text,"Time" text,"Attendance" real)
SELECT SUM("Attendance") FROM table_46573 WHERE "Time" = '3:23'
was patient 14671 prescribed medication this month?
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id numbe...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
list the flights and departure times for flights leaving DALLAS FORT WORTH for BOSTON after 1800
CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE aircr...
SELECT DISTINCT flight.departure_time, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT ...
What papers has Yoav Artzi written ?
CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperdataset (paperid int,datasetid ...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Yoav Artzi' AND writes.authorid = author.authorid
What is the value of total costs (2005) in the Coldstream municipality?
CREATE TABLE table_12340907_1 (total_costs__2005_ VARCHAR,municipality VARCHAR)
SELECT total_costs__2005_ FROM table_12340907_1 WHERE municipality = "Coldstream"
How many candidates won the election in the district whose incumbent is Bud Shuster?
CREATE TABLE table_1341604_39 (candidates VARCHAR,incumbent VARCHAR)
SELECT COUNT(candidates) FROM table_1341604_39 WHERE incumbent = "Bud Shuster"
What are the average star ratings of each movie title? Could you return me a bar chart?
CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title
When paul moor is on the europe team who is on the usa team?
CREATE TABLE table_1989 ("Match no." real,"Match Type" text,"Team Europe" text,"Score" text,"Team USA" text,"Progressive Total" text)
SELECT "Team USA" FROM table_1989 WHERE "Team Europe" = 'Paul Moor'
When did the season premiere that had a viewer rank of #6?
CREATE TABLE table_name_12 (season VARCHAR,viewer_rank___number_ VARCHAR)
SELECT season AS premiere FROM table_name_12 WHERE viewer_rank___number_ = "#6"
What are the titles of papers published by 'Jeremy Gibbons'?
CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE inst (instid number,name text,country text)CREATE TABLE papers (paperid number,title text)CREATE TABLE authors (authid number,lname text,fname text)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
What is the most mintage with common eider as the theme, and the year less than 2008?
CREATE TABLE table_name_57 (mintage INTEGER,theme VARCHAR,year VARCHAR)
SELECT MAX(mintage) FROM table_name_57 WHERE theme = "common eider" AND year < 2008
What is the home team score when the away team scored 9.11 (65)?
CREATE TABLE table_10168 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Date" text)
SELECT "Home team score" FROM table_10168 WHERE "Away team score" = '9.11 (65)'
how many patients are divorced and operated with procedure circumcision?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Circumcision"
Plot the average of age by grouped by class as a bar graph, and show by the bar in descending.
CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text)CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC
calculate the maximum age of asian ethnic background patients who were hospitalized for 23 days.
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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23"
Show how many flights each pilot has flied in a pie chart.
CREATE TABLE airport (id int,City text,Country text,IATA text,ICAO text,name text)CREATE TABLE flight (id int,Vehicle_Flight_number text,Date text,Pilot text,Velocity real,Altitude real,airport_id int,company_id int)CREATE TABLE operate_company (id int,name text,Type text,Principal_activities text,Incorporated_in text,...
SELECT Pilot, COUNT(Pilot) FROM flight GROUP BY Pilot
How big is the 494 class ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 494
Who directed Episode 8?
CREATE TABLE table_16442 ("Series #" real,"Episode #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Directed by" FROM table_16442 WHERE "Episode #" = '8'
What is the low draw total for yarragon teams with over 3 wins, and under 966 against?
CREATE TABLE table_53993 ("Mid Gippsland FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Draws") FROM table_53993 WHERE "Wins" > '3' AND "Mid Gippsland FL" = 'yarragon' AND "Against" < '966'
what is the name of the last player on this chart ?
CREATE TABLE table_203_305 (id number,"round" number,"#" number,"player" text,"nationality" text,"college/junior/club team (league)" text)
SELECT "player" FROM table_203_305 ORDER BY id DESC LIMIT 1
What week was September 24, 2000 on?
CREATE TABLE table_11134 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT SUM("Week") FROM table_11134 WHERE "Date" = 'september 24, 2000'
On what surface was the match played with a score of 4 6, 6 3, 6 1?
CREATE TABLE table_40384 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text)
SELECT "Surface" FROM table_40384 WHERE "Score" = '4–6, 6–3, 6–1'
what country had the most top 10 finishers in the men 's 15 kilometre classical ?
CREATE TABLE table_204_81 (id number,"rank" number,"bib" number,"name" text,"country" text,"time" text,"deficit" text)
SELECT "country" FROM table_204_81 WHERE id <= 10 GROUP BY "country" ORDER BY COUNT(*) DESC LIMIT 1
What is the average rating for tv asahi?
CREATE TABLE table_73028 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Time Frame" text,"Starring Actors" text,"Theme Song(s)" text,"Episodes" real,"Average Ratings" text)
SELECT "Average Ratings" FROM table_73028 WHERE "TV Station" = 'TV Asahi'
What is the rank when RR2 has 4 points?
CREATE TABLE table_24435 ("Team name" text,"Races" real,"Won" real,"RR1 Pts." real,"RR2 Pts." real,"RR3 Pts." real,"Total Pts." real,"Ranking" real)
SELECT "Ranking" FROM table_24435 WHERE "RR2 Pts." = '4'
Give me the comparison about ACC_Percent over the Team_Name by a bar chart, display by the x-axis in asc.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name
Which position does bert coan play?
CREATE TABLE table_36024 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text)
SELECT "Position" FROM table_36024 WHERE "Player" = 'bert coan'
When Estudiantes was team #2, what was their agg. value?
CREATE TABLE table_name_28 (agg VARCHAR,team__number2 VARCHAR)
SELECT agg FROM table_name_28 WHERE team__number2 = "estudiantes"
give me a flight from NEWARK to TAMPA on friday
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE flight_stop (flight_id int,...
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 = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat...
How many times is the award ceremony laurence olivier award, result is won and the nominee is imelda staunton?
CREATE TABLE table_62311 ("Year" real,"Award Ceremony" text,"Category" text,"Nominee" text,"Result" text)
SELECT COUNT("Year") FROM table_62311 WHERE "Award Ceremony" = 'laurence olivier award' AND "Result" = 'won' AND "Nominee" = 'imelda staunton'
Searching comments on two keywords inclusive.
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,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT c.CreationDate, c.Text, c.Id AS "comment_link", c.PostId AS "post_link" FROM Comments AS c WHERE Text LIKE '%##keyword1##%' AND Text LIKE '%##keyword2##%' LIMIT 100
Which incumbent was first elected in 1936?
CREATE TABLE table_1341897_45 (incumbent VARCHAR,first_elected VARCHAR)
SELECT incumbent FROM table_1341897_45 WHERE first_elected = 1936
how many exposures where there when the total exposure time is 105,000s?
CREATE TABLE table_2583036_1 (exposures VARCHAR,total_exposure_time VARCHAR)
SELECT exposures FROM table_2583036_1 WHERE total_exposure_time = "105,000s"
Which Points have a Name of denis kornilov?
CREATE TABLE table_name_69 (points INTEGER,name VARCHAR)
SELECT AVG(points) FROM table_name_69 WHERE name = "denis kornilov"
where is dar o cvitanich from before transferring to ajax ?
CREATE TABLE table_204_402 (id number,"rank" number,"player" text,"from" text,"to" text,"transfer fee\n(\u20ac million)" number,"year" number)
SELECT "from" FROM table_204_402 WHERE "player" = 'dario cvitanich' AND "to" = 'ajax'
Which Venue has Notes of 58.48 m?
CREATE TABLE table_14032 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text)
SELECT "Venue" FROM table_14032 WHERE "Notes" = '58.48 m'
Show me how many type by type in a histogram, and sort by the y axis in desc.
CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type) DESC
What was the loss of the game when the record was 16 15?
CREATE TABLE table_67283 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Loss" FROM table_67283 WHERE "Record" = '16–15'
What are the competitions that occurred before 2006 in SVK Nitra?
CREATE TABLE table_name_10 (competition VARCHAR,year VARCHAR,venue VARCHAR)
SELECT competition FROM table_name_10 WHERE year < 2006 AND venue = "svk nitra"
When was the incumbent from the Virginia 10 district first elected?
CREATE TABLE table_28936 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "First elected" FROM table_28936 WHERE "District" = 'Virginia 10'
which all time player is after derek cockroft ?
CREATE TABLE table_204_602 (id number,"name" text,"position" text,"height" text,"weight" number,"date of birth" text,"current/last known team" text)
SELECT "name" FROM table_204_602 WHERE id = (SELECT id FROM table_204_602 WHERE "name" = 'derek cockroft') + 1
Who wrote the episode that had 1.08 million U.S. viewers?
CREATE TABLE table_28323 ("Series No." real,"Episode No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "Written by" FROM table_28323 WHERE "U.S. viewers (millions)" = '1.08'
how many times do patient 378 get a anticardiolipin antibody igg test in the first hospital visit?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code tex...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anticardiolipin antibody igg') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 378 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit...
the team that last played on may 17th ,2009
CREATE TABLE table_203_656 (id number,"date" text,"opponent" text,"venue" text,"result" text,"scorers" text,"report" text)
SELECT "opponent" FROM table_203_656 WHERE "date" = 'may 17, 2009 - 15:00'
What was the open cup results in 2004?
CREATE TABLE table_17673 ("Year" text,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Open Cup" FROM table_17673 WHERE "Year" = '2004'
What was the Population (2011) when the Population (2006) was less than 7083, and the Population density less than 342.8, and the Change (%) of 5, and an Area (km ) larger than 4.5?
CREATE TABLE table_name_2 (population__2011_ VARCHAR,area__km²_ VARCHAR,change___percentage_ VARCHAR,population__2006_ VARCHAR,population_density VARCHAR)
SELECT COUNT(population__2011_) FROM table_name_2 WHERE population__2006_ < 7083 AND population_density < 342.8 AND change___percentage_ = 5 AND area__km²_ > 4.5
What Championship has a Score in the final of 2 6, 6 2, 7 5?
CREATE TABLE table_name_16 (championship VARCHAR,score_in_the_final VARCHAR)
SELECT championship FROM table_name_16 WHERE score_in_the_final = "2–6, 6–2, 7–5"
On broadcast date is 28march1970, how many people tuned in?
CREATE TABLE table_2102898_1 (viewers__in_millions_ VARCHAR,broadcast_date VARCHAR)
SELECT viewers__in_millions_ FROM table_2102898_1 WHERE broadcast_date = "28March1970"
List top 10 employee work longest in the company. List employee's first and last name.
CREATE TABLE employees (first_name VARCHAR,last_name VARCHAR,hire_date VARCHAR)
SELECT first_name, last_name FROM employees ORDER BY hire_date LIMIT 10
What is the compound name listed where marine organism is worm
CREATE TABLE table_12715053_1 (compound_name VARCHAR,marine_organism_α VARCHAR)
SELECT compound_name FROM table_12715053_1 WHERE marine_organism_α = "Worm"
what is the difference in heart rate patient 22897 is experiencing second measured on the last intensive care unit visit compared to the value first measured on the last intensive care unit visit?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost nu...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
how many patients were diagnosed for electrolyte and fluid disorder not elsewhere classified and the drug administration route is sl?
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 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,sho...
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 = "Electrolyte and fluid disorders not elsewhere classified" AND prescriptions.route = "SL"
when did patient 62983 get the oxygen saturation lab test last time until 26 months ago?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'oxygen saturation') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(...
Which letter has an operator of VeriSign and an AS-number of AS26415?
CREATE TABLE table_46739 ("Letter" text,"IPv6 address" text,"AS-number" text,"Operator" text,"Location #sites (global/local)" text,"Software" text)
SELECT "Letter" FROM table_46739 WHERE "Operator" = 'verisign' AND "AS-number" = 'as26415'
Top users in Sri Lanka in Scala , Play framework.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,Use...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", U.Id AS "user_link", U.Age, U.Location, U.Reputation, U.UpVotes, U.DownVotes FROM Users AS U WHERE U.Id IN (SELECT DISTINCT U.Id FROM Users AS U INNER JOIN Posts AS P ON U.Id = P.OwnerUserId INNER JOIN PostTags AS PT ON PT.PostId = P.Id INNER JOIN Tags AS T ON...
what is the earliest flight from BOSTON to SAN FRANCISCO on 11 7
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE ...
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 = 'SAN FRANCISCO' AND date_day.day_number = 7 AND date_day.month_number = 1...
What is Authors, when Novelty is Gen Nov, when Location is South Africa, and when Name is Criocephalosaurus?
CREATE TABLE table_name_90 (authors VARCHAR,name VARCHAR,novelty VARCHAR,location VARCHAR)
SELECT authors FROM table_name_90 WHERE novelty = "gen nov" AND location = "south africa" AND name = "criocephalosaurus"
what was the monthly maximum intake of analgesic other (volume) that patient 002-7771 had received until 1056 days ago?
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 lab (labid number,patientunitstayid number,labname text,...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.celllabel = 'analge...
in total , how many times were they promoted ?
CREATE TABLE table_204_117 (id number,"season" number,"level" text,"division" text,"section" text,"position" text,"movements" text)
SELECT COUNT(*) FROM table_204_117 WHERE "movements" = 'promoted'
What's the average number of Laps, that had a start of 25, with a Qual of 138.063?
CREATE TABLE table_name_21 (laps INTEGER,start VARCHAR,qual VARCHAR)
SELECT AVG(laps) FROM table_name_21 WHERE start = "25" AND qual = "138.063"
A bar chart for what are the number of the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?, and I want to rank total number in ascending order.
CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth)
find the diagnosis icd9 code for patient id 7578 and the number of days of his hospital stay.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT demographic.days_stay, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "7578"
What's the wind when the time was 19.32?
CREATE TABLE table_79419 ("Time" text,"Wind" text,"Athlete" text,"Nationality" text,"Location of race" text,"Date" text)
SELECT "Wind" FROM table_79419 WHERE "Time" = '19.32'
Return the weights of entrepreneurs, ordered descending by amount of money requested.
CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text)CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)
SELECT T2.weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.money_requested DESC
What NFL team picked a player from Jackson State?
CREATE TABLE table_2508633_9 (nfl_team VARCHAR,college VARCHAR)
SELECT nfl_team FROM table_2508633_9 WHERE college = "Jackson State"
since 50 months ago has patient 99747 been prescribed calcium gluconate, labetalol, or meropenem?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE procedures_icd (row_id number,subject_id ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99747) AND prescriptions.drug IN ('calcium gluconate', 'labetalol', 'meropenem') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-50 month')
Which District has a First Elected of 1904 and an Incumbent of Duncan E. Mckinlay?
CREATE TABLE table_name_31 (district VARCHAR,first_elected VARCHAR,incumbent VARCHAR)
SELECT district FROM table_name_31 WHERE first_elected = 1904 AND incumbent = "duncan e. mckinlay"
Which Silver has a Total of 1, and a Rank of 12?
CREATE TABLE table_65530 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Silver") FROM table_65530 WHERE "Total" = '1' AND "Rank" = '12'
what is the number of patients whose admission year is less than 2166 and procedure long title is arterial catheterization?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2166" AND procedures.long_title = "Arterial catheterization"
What is the number of students in Fall 09 from the state that had 3940 in Fall 07?
CREATE TABLE table_19823 ("States" text,"Fall 05" real,"Fall 06" real,"Fall 07" real,"Fall 08" real,"Fall 09" real)
SELECT MAX("Fall 09") FROM table_19823 WHERE "Fall 07" = '3940'
What is the fastest time for athlete Jason Smyth?
CREATE TABLE table_name_40 (fastest_time__s_ VARCHAR,athlete VARCHAR)
SELECT fastest_time__s_ FROM table_name_40 WHERE athlete = "jason smyth"
What is the language, when 'house' is 'balay', when 'three' is 'tatlo', and when 'four' is 'apat'?
CREATE TABLE table_43847 ("English" text,"three" text,"four" text,"person" text,"house" text,"coconut" text,"what" text,"fire" text)
SELECT "English" FROM table_43847 WHERE "house" = 'balay' AND "three" = 'tatlo' AND "four" = 'apat'
What are the different budget type codes, and how many documents are there for each Plot them as bar chart, and display bar from low to high order.
CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CR...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code
what was the design on the first issued plates ?
CREATE TABLE table_203_498 (id number,"first issued" text,"design" text,"slogan" text,"serial format" text,"serials issued" text,"notes" text)
SELECT "design" FROM table_203_498 ORDER BY "first issued" LIMIT 1
What is Opponent, when Round is World Group?
CREATE TABLE table_62013 ("Outcome" text,"Edition" real,"Round" text,"Opponent Team" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Opponent" FROM table_62013 WHERE "Round" = 'world group'
What is the value for Position, when the Series is the Macau Grand Prix, and when the Season is before 2007?
CREATE TABLE table_name_98 (position VARCHAR,series VARCHAR,season VARCHAR)
SELECT position FROM table_name_98 WHERE series = "macau grand prix" AND season < 2007
What is the Away team score with north melbourne as home team?
CREATE TABLE table_53010 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_53010 WHERE "Home team" = 'north melbourne'
Draw a bar chart of product type code versus minimal product price
CREATE TABLE Suppliers (supplier_id INTEGER,supplier_name VARCHAR(80),supplier_phone VARCHAR(80))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Products (product_...
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code
Find the name of the most expensive hardware product.
CREATE TABLE products (product_name VARCHAR,product_type_code VARCHAR,product_price VARCHAR)
SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1
what was the organism name found in 05/this year in patient 031-1337's last sputum, expectorated microbiology test?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid ...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' AND DATETIM...
provide the number of patients whose discharge location is snf and primary disease is hyperglycemia?
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,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA"
What was the score against san antonio?
CREATE TABLE table_72456 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Score" FROM table_72456 WHERE "Team" = 'San Antonio'
What rank has a population of 4839400?
CREATE TABLE table_50761 ("Rank" real,"City" text,"Population" text,"Definition" text,"Country" text)
SELECT MIN("Rank") FROM table_50761 WHERE "Population" = '4839400'
did patient 24971 be prescribed warfarin, albuterol mdi, or glucagon on their last 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE labevents (row_id numbe...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24971 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug IN ('warfarin', 'albuterol mdi', 'glucagon')
please give me flights available from DENVER to PHILADELPHIA
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_stop ...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
what is the number of patients whose year of death is less than or equal to 2183 and item id is 51351?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2183.0" AND lab.itemid = "51351"
What is the average number of draws for Mortlake club when they have less than 0 wins?
CREATE TABLE table_name_11 (draws INTEGER,club VARCHAR,wins VARCHAR)
SELECT AVG(draws) FROM table_name_11 WHERE club = "mortlake" AND wins < 0
Top users for the Cassandra tag for the year.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Pen...
SELECT Users.DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate > '201...
who is the points classification in stage 1?
CREATE TABLE table_78049 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Trofeo Fast Team" text)
SELECT "Points classification" FROM table_78049 WHERE "Stage" = '1'
What is the Time of the Rowers from Belgium?
CREATE TABLE table_66668 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Time" FROM table_66668 WHERE "Country" = 'belgium'