instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
show me the flights from BOSTON to OAKLAND
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
What was the attendance for the March 6 game, where one of the teams had 53 points.
CREATE TABLE table_name_55 (attendance VARCHAR,points VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_55 WHERE points = 53 AND date = "march 6"
WHich is 2014 Santander included 2011 Perth of 470?
CREATE TABLE table_15741 ("Discipline" text,"2003 Cadiz" text,"2007 Cascais" text,"2011 Perth" text,"2014 Santander" text)
SELECT "2014 Santander" FROM table_15741 WHERE "2011 Perth" = '470'
who are all the visitor with a record of 25 18
CREATE TABLE table_72241 ("#" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text)
SELECT "Visitor" FROM table_72241 WHERE "Record" = '25–18'
When the % of boundary by water is 63% what is the overall number of zip code prefix(es)?
CREATE TABLE table_964 ("IN No." real,"County Name" text,"Establishment Date (SW Indiana) (History) (Statehood)" text,"County Seat" text,"Time Zone" text,"Population (2010) (Rank)" text,"Area sq mi (km 2) (Rank)" text,"Twps" real,"ZIP code Prefix(es)" text,"% of Boundary by water" text)
SELECT COUNT("ZIP code Prefix(es)") FROM table_964 WHERE "% of Boundary by water" = '63%'
Which Losses have a Season larger than 1941, and a Team of hamilton wildcats, and Ties of 0?
CREATE TABLE table_37068 ("Season" real,"Team" text,"Games" real,"Wins" real,"Losses" real,"Ties" real)
SELECT "Losses" FROM table_37068 WHERE "Season" > '1941' AND "Team" = 'hamilton wildcats' AND "Ties" = '0'
What was the average points for Hopkins before 1956?
CREATE TABLE table_15041 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT AVG("Points") FROM table_15041 WHERE "Entrant" = 'hopkins' AND "Year" < '1956'
What is the model that was made in the years 2011 2012-?
CREATE TABLE table_name_27 (model VARCHAR,years VARCHAR)
SELECT model FROM table_name_27 WHERE years = "2011 2012-"
What is the road team of game 6 with Philadelphia as the home team?
CREATE TABLE table_6551 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text)
SELECT "Road Team" FROM table_6551 WHERE "Home Team" = 'philadelphia' AND "Game" = 'game 6'
What team has Windy Hill as their home venue
CREATE TABLE table_32566 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_32566 WHERE "Venue" = 'windy hill'
What was the passing result for the measure with a description of bus and truck operating license bill?
CREATE TABLE table_256286_19 (passed VARCHAR,description VARCHAR)
SELECT passed FROM table_256286_19 WHERE description = "Bus and Truck Operating License Bill"
what's the transmbeingsion with trim being xe (2009)
CREATE TABLE table_18950 ("Trim" text,"Engine" text,"Displacement" text,"Power" text,"Torque" text,"Transmission" text,"Fuel Mileage (latest EPA mpg - US)" text)
SELECT "Transmission" FROM table_18950 WHERE "Trim" = 'XE (2009)'
What is the partition id of the user named 'Iron Man'.
CREATE TABLE user_profiles (partitionid VARCHAR,name VARCHAR)
SELECT partitionid FROM user_profiles WHERE name = 'Iron Man'
What is Richmond's away team score versus Geelong?
CREATE TABLE table_name_96 (away_team VARCHAR)
SELECT away_team AS score FROM table_name_96 WHERE away_team = "richmond"
Which label has a date of 1987?
CREATE TABLE table_name_52 (label VARCHAR,date VARCHAR)
SELECT label FROM table_name_52 WHERE date = "1987"
what is the callsign for analog 19?
CREATE TABLE table_15353 ("Media market name" text,"Callsign" text,"Analog" text,"Digital" text,"Affiliation" text)
SELECT "Callsign" FROM table_15353 WHERE "Analog" = '19'
Which team played against the away team that scored 5.5 (35)?
CREATE TABLE table_54823 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_54823 WHERE "Away team score" = '5.5 (35)'
For those records from the products and each product's manufacturer, find name and the sum of manufacturer , and group by attribute name, and visualize them by a bar chart, and display from high to low by the Name.
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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
Is RCNSCI 270 Core ?
CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id in...
SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'RCNSCI' AND course.number = 270 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
What is the car number for Jeff Simmons on the Rahal Letterman team?
CREATE TABLE table_9558 ("Fin. Pos" text,"Car No." text,"Driver" text,"Team" text,"Laps" text,"Time/Retired" text,"Grid" text,"Laps Led" text,"Points" text)
SELECT "Car No." FROM table_9558 WHERE "Team" = 'rahal letterman' AND "Driver" = 'jeff simmons'
What is the lowest league goals that have 0 as the FA Cup Apps, with 1 (3) as totals apps?
CREATE TABLE table_58797 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"Total Apps" text,"Total Goals" real)
SELECT MIN("League Goals") FROM table_58797 WHERE "FA Cup Apps" = '0' AND "Total Apps" = '1 (3)'
what were the four most common prescription drugs for patients who had been diagnosed with septic shock previously within 2 months, since 2105?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock' AND STRFTIME('%y', diagnosis.diagnos...
What is the away team's score when hawthorn is away?
CREATE TABLE table_33740 ("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_33740 WHERE "Away team" = 'hawthorn'
show me all the flights from DENVER and all the flights from MIAMI that arrive at BALTIMORE around noon
CREATE TABLE flight_fare (flight_id int,fare_id int)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 equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE food_servi...
SELECT DISTINCT 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 ((flight.arrival_time <= 1230 AND flight.arrival_time >= 1130) AND CITY_2.city_code = AIRPORT_SERVICE_2.cit...
What size is a 30 frames per minute
CREATE TABLE table_520 ("Frame size" text,"Width" real,"Height" real,"Mpix" text,"Aspect Ratio" text,"Maximum fps" real,"Maximum fps HDRx" real,"least compression at 24 fps" text,"least compression at maximum fps" text)
SELECT "Frame size" FROM table_520 WHERE "Maximum fps" = '30'
How many number in series's are written by Greg Haddrick?
CREATE TABLE table_24535 ("No. in total" text,"No. in series" text,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT COUNT("No. in series") FROM table_24535 WHERE "Written by" = 'Greg Haddrick'
Which first election for the labor party is James Sharpe a part of?
CREATE TABLE table_53015 ("Member" text,"Party" text,"Electorate" text,"State" text,"First elected" text)
SELECT "First elected" FROM table_53015 WHERE "Party" = 'labor' AND "Member" = 'james sharpe'
How many Egyptian restaurant are there in Edinburgh ?
CREATE TABLE category (id int,business_id varchar,category_name varchar)CREATE TABLE checkin (cid int,business_id varchar,count int,day varchar)CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TABLE user (uid int,user_id varchar,name varchar)CREAT...
SELECT COUNT(DISTINCT (business.name)) FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Edinburgh' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Egyptian'
For all employees in the same department as Clara excluding Clara, bin their hire date into the day of week interval, and count how many employees in each month for a bar chart, and rank total number in ascending order.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") AND FIRST_NAME <> "Clara" ORDER BY COUNT(HIRE_DATE)
count the number of patients who are dead after being diagnosed with fx orbital floor-closed in the same month since 2102.
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_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,had...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
How many Tries against has a Try diff of 17 and Points for smaller than 80?
CREATE TABLE table_42082 ("Team" text,"Tries for" real,"Tries against" real,"Try diff" text,"Points for" real,"Points against" real,"Points diff" text)
SELECT COUNT("Tries against") FROM table_42082 WHERE "Try diff" = '–17' AND "Points for" < '80'
What is the smallest amount of touchdowns when there is a total player and a number of field goals of more than 0?
CREATE TABLE table_name_88 (touchdowns INTEGER,player VARCHAR,field_goals VARCHAR)
SELECT MIN(touchdowns) FROM table_name_88 WHERE player = "total" AND field_goals > 0
Name the total number of Draws when goals for is 58 and losses is 12 when goal differences is less than 21
CREATE TABLE table_name_45 (draws VARCHAR,goal_difference VARCHAR,goals_for VARCHAR,losses VARCHAR)
SELECT COUNT(draws) FROM table_name_45 WHERE goals_for = 58 AND losses = 12 AND goal_difference < 21
What venue had a tie?
CREATE TABLE table_name_84 (tied VARCHAR)
SELECT tied FROM table_name_84 WHERE "venue" = "venue"
Getting all users from Cuba.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Re...
SELECT Reputation, DisplayName, Location FROM Users ORDER BY Reputation DESC
What's the number of touchdowns that Snow made that had 0 field goals, more than 5 points, and more than 0 extra points?
CREATE TABLE table_34978 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT MIN("Touchdowns") FROM table_34978 WHERE "Points" > '5' AND "Field goals" = '0' AND "Player" = 'snow' AND "Extra points" > '0'
EECS students take what Other classes ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)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_d...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id
show me flights from DENVER to BOSTON on tuesday
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE date_day (month_number int,day_numbe...
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 = 22 AND date_day.month_number = 3 AND da...
What are the names and ids of customers whose address contains TN. Visualize by pie chart.
CREATE TABLE Staff_Department_Assignments (staff_id INTEGER,department_id INTEGER,date_assigned_from DATETIME,job_title_code VARCHAR(10),date_assigned_to DATETIME)CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Department_Store_Chain (dept_store_chain_id INTEGER,dept_sto...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
provide the number of patients whose admission location is emergency room admit and procedure short title is opn lft hemicolectmy nec?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Opn lft hemicolectmy NEC"
Name the total number of swimsuits for evening gowns less than 8.21 and average of 8.453 with interview less than 9.09
CREATE TABLE table_name_54 (swimsuit VARCHAR,average VARCHAR,interview VARCHAR,evening_gown VARCHAR)
SELECT COUNT(swimsuit) FROM table_name_54 WHERE interview < 9.09 AND evening_gown < 8.21 AND average = 8.453
what game had a doubles round in 1979
CREATE TABLE table_37269 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Mixed doubles" FROM table_37269 WHERE "Year" = '1979'
What is the average number of laps associated with a Time/Retired of +1:14.801?
CREATE TABLE table_name_78 (laps INTEGER,time_retired VARCHAR)
SELECT AVG(laps) FROM table_name_78 WHERE time_retired = "+1:14.801"
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name , I want to show names in asc order.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_P...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME
Show the name, time, and service for all trains.
CREATE TABLE train (name VARCHAR,TIME VARCHAR,service VARCHAR)
SELECT name, TIME, service FROM train
give me the number of patients whose admission year is less than 2124 and drug route is iv bolus?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2124" AND prescriptions.route = "IV BOLUS"
Give me the comparison about ACC_Percent over the All_Neutral , and rank by the total number in desc.
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 All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
How many cuts did Gary Clark make?
CREATE TABLE table_28540609_2 (cuts_made VARCHAR,player VARCHAR)
SELECT cuts_made FROM table_28540609_2 WHERE player = "Gary Clark"
what was the organism found in the last bronchoalveolar lavage test of patient 97395 in this month?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395) AND microbiologyevents.spec_type_desc = 'bronchoalveolar lavage' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.char...
If the original air date is February 4, 2003, what is the episode title?
CREATE TABLE table_25534 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Title" FROM table_25534 WHERE "Original air date" = 'February 4, 2003'
Tell me the long for TD's of 4
CREATE TABLE table_57357 ("Player" text,"Car." real,"Yards" text,"Avg." text,"TD's" real,"Long" text)
SELECT "Long" FROM table_57357 WHERE "TD's" = '4'
how many parsing papers did ACL 2014 have ?
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE field (fieldid int)CREATE TABLE author (a...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
Questions bookmarked or commented on by user.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionD...
SELECT q.Id AS "post_link", q.CreationDate, q.Score, q.Tags, b.CreationDate AS "Bookmark date", c.CreationDate AS "Comment date", c.Id AS "comment_link" FROM Posts AS q LEFT OUTER JOIN Votes AS b ON q.Id = b.PostId AND b.VoteTypeId = 5 AND b.UserId = '##UserId:int##' LEFT JOIN LATERAL (SELECT Id, CreationDate FROM Comm...
Which of the airport names contains the word 'international'?
CREATE TABLE airport (name VARCHAR)
SELECT name FROM airport WHERE name LIKE '%international%'
what is season 6 sum of both the number of times processing ID 2397162 was assigned and the number of times chip chalmers managed an episode
CREATE TABLE table_10953197_6 (no_in_season INTEGER,director VARCHAR,production_code VARCHAR)
SELECT MAX(no_in_season) FROM table_10953197_6 WHERE director = "Chip Chalmers" AND production_code = "2397162"
In the United Kingdom, what company has an unknown date and is an energy business?
CREATE TABLE table_name_35 (company VARCHAR,country VARCHAR,business VARCHAR,date VARCHAR)
SELECT company FROM table_name_35 WHERE business = "energy" AND date = "unknown" AND country = "united kingdom"
List of edits where edit summary contains given keyword.
CREATE TABLE Posts (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,Tags text,Ans...
SELECT PostId AS "post_link", Comment, UserId AS "user_link", CreationDate FROM PostHistory WHERE UserId = '##userid##' AND Comment LIKE '%##keyword##%' ORDER BY CreationDate
how many patients underwent coronar arteriogr-2 cath after having been diagnosed with long-term use anticoagul within the same month?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_i...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use anti...
when patient 017-24595 was first discharged from the hospital?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '017-24595' ORDER BY patient.hospitaldischargetime LIMIT 1
Who directed the episode that originally aired on January 15, 2008?
CREATE TABLE table_13301516_1 (directed_by VARCHAR,original_air_date VARCHAR)
SELECT directed_by FROM table_13301516_1 WHERE original_air_date = "January 15, 2008"
What is the sum of Silver with a Bronze that is larger than 0 with a Gold smaller than 0?
CREATE TABLE table_7650 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Silver") FROM table_7650 WHERE "Bronze" > '0' AND "Gold" < '0'
Who was the female contestant on the Original season of Fresh Meat?
CREATE TABLE table_22746 ("Player" text,"Original Season" text,"Gender" text,"Eliminated" text,"Placing" text)
SELECT "Player" FROM table_22746 WHERE "Original Season" = 'Fresh Meat' AND "Gender" = 'Female'
What is the number for the University of Dublin with their Cultural and Educational Panel of 5, and an Industrial and Commercial Panel with less than 9?
CREATE TABLE table_41257 ("Administrative Panel" real,"Agricultural Panel" real,"Cultural and Educational Panel" real,"Industrial and Commercial Panel" real,"Labour Panel" real,"National University of Ireland" real,"University of Dublin" real,"Nominated by the Taoiseach" real,"Total" real)
SELECT COUNT("University of Dublin") FROM table_41257 WHERE "Cultural and Educational Panel" = '5' AND "Industrial and Commercial Panel" < '9'
How many co-singers were there when Parveen Babi co-starred?
CREATE TABLE table_2528382_5 (singers VARCHAR,Co VARCHAR,co_stars VARCHAR)
SELECT COUNT(Co) - singers FROM table_2528382_5 WHERE co_stars = "Parveen Babi"
Show the number of documents in different ending date Bin ending date by year interval and group by location code with a group line chart, I want to display by the Date_in_Locaton_To from high to low.
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE Documents_to_be_Destroyed (Document_ID I...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To DESC
what is the total number of nations that did not win gold ?
CREATE TABLE table_204_302 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_204_302 WHERE "gold" = 0
count the number of patients whose procedure icd9 code is 8968 and drug type is additive?
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8968" AND prescriptions.drug_type = "ADDITIVE"
What was the net seat gain in the race john a. elston (r) 88.4% luella twining (s) 11.6%?
CREATE TABLE table_18738 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Result" FROM table_18738 WHERE "Candidates" = 'John A. Elston (R) 88.4% Luella Twining (S) 11.6%'
Who is the head coach for the team that plays at Altrincham Ice Dome?
CREATE TABLE table_26365 ("Team" text,"City/Area" text,"Arena" text,"Founded" real,"Joined" real,"Head Coach" text,"Captain" text)
SELECT "Head Coach" FROM table_26365 WHERE "Arena" = 'Altrincham Ice Dome'
which region appears more on this list , france or united states ?
CREATE TABLE table_204_17 (id number,"region" text,"date" text,"format" text,"version(s)" text,"label" text)
SELECT "region" FROM table_204_17 WHERE "region" IN ('france', 'united states') GROUP BY "region" ORDER BY COUNT(*) DESC LIMIT 1
what did patient 021-93953 first have as an output on the last intensive care unit visit?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid num...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-93953') AND NOT patient.unitdischargetime IS NULL ORDER ...
What was the total for christina liebherr?
CREATE TABLE table_52540 ("Rider" text,"Horse" text,"Faults" text,"Round 1 + 2A + 2B + 3A Points" text,"Total" real)
SELECT MIN("Total") FROM table_52540 WHERE "Rider" = 'christina liebherr'
How many judges were there for the eliminated couple?
CREATE TABLE table_73947 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text)
SELECT "Judges" FROM table_73947 WHERE "Result" = 'Eliminated'
Which Wins have a Rank of 3?
CREATE TABLE table_5080 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Events" real,"Wins" real)
SELECT AVG("Wins") FROM table_5080 WHERE "Rank" = '3'
what airlines go to PITTSBURGH
CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required var...
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
How many people were in attendance on the game on April 8, 2007?
CREATE TABLE table_69182 ("Date" text,"Opponent" text,"Result" text,"Game Site" text,"Attendance" text)
SELECT "Attendance" FROM table_69182 WHERE "Date" = 'april 8, 2007'
when was the first time that patient 002-64535 was prescribed with potassium chloride and aspirin at the same time since 09/2105?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'potassium chloride' AND patient.uniquepid = '002-64535' AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-09') AS ...
When Gigi Fern ndez Natalia Zvereva 6 2, 6 1 won, who was the Tier II Runner-up?
CREATE TABLE table_name_85 (runner_up VARCHAR,tier VARCHAR,winner VARCHAR)
SELECT runner_up FROM table_name_85 WHERE tier = "tier ii" AND winner = "gigi fernández natalia zvereva 6–2, 6–1"
What is the gold number when the total is 8 and bronze is more than 4?
CREATE TABLE table_name_19 (gold INTEGER,total VARCHAR,bronze VARCHAR)
SELECT AVG(gold) FROM table_name_19 WHERE total = 8 AND bronze > 4
Compare the number of items in each color scheme using a bar chart, and sort Y in desc order.
CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY COUNT(color) DESC
what is the minimum cost of hospital that involves a procedure called ins drug-elut coronry st last year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins drug-elut coronry st')) AND DATETIME(cost.chargetime,...
How many total Time listings have a 0.209 React entry and a Rank that is greater than 7?
CREATE TABLE table_79303 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real)
SELECT COUNT("Time") FROM table_79303 WHERE "React" = '0.209' AND "Rank" > '7'
What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?
CREATE TABLE invoice_line_items (order_item_id number,invoice_number number,product_id number,product_title text,product_quantity text,product_price number,derived_product_cost number,derived_vat_payable number,derived_total_cost number)CREATE TABLE financial_transactions (transaction_id number,account_id number,invoic...
SELECT T2.invoice_number, T2.invoice_date FROM financial_transactions AS T1 JOIN invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1
What percentage of browsers were using Safari during the period in which 31.27% were using Firefox?
CREATE TABLE table_name_62 (safari VARCHAR,firefox VARCHAR)
SELECT safari FROM table_name_62 WHERE firefox = "31.27%"
What was the result for Julius Kahn's first election of 1898?
CREATE TABLE table_36245 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text)
SELECT "Result" FROM table_36245 WHERE "First elected" = '1898' AND "Incumbent" = 'julius kahn'
What is the name of the airport located in Russia with an IATA of KRR?
CREATE TABLE table_name_30 (airport VARCHAR,country VARCHAR,iata VARCHAR)
SELECT airport FROM table_name_30 WHERE country = "russia" AND iata = "krr"
most recent papers of ali farhadi
CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE field (fieldid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE T...
SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.year = (SELECT MIN(PAPERalias1.year) FROM author AS AUTHORalias1, paper AS PAPERalias1, writes AS WRITESalias1 WHERE AUTHORalias1.authorname = 'ali farhadi' AND WRITESalias1.authorid = AUTHORalias1.aut...
when was the last time patient 4718 was having greater than 90.0 heart rate until 770 days ago?
CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (...
SELECT chartevents.charttime 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 = 4718)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
A bar chart for finding the number of the 'date became customers' of the customers whose ID is between 10 and 20, and I want to show by the y axis in descending.
CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),date_became_customer DATETIME,other_customer_details VARCHAR(255))CREATE TABLE Products (product_id INTEGER,product_details VARCHAR(255))CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_address_f...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
which DL flights depart from SAN FRANCISCO heading toward BOSTON after 1200
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE month (month_number int,month_name ...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
when was the last time that patient 8016 had pe 24 fs po intake on last month/27?
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locat...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
for how many years did the player who graduated from stanford play for Grizzlies?
CREATE TABLE table_name_11 (years_for_grizzlies VARCHAR,school_club_team VARCHAR)
SELECT years_for_grizzlies FROM table_name_11 WHERE school_club_team = "stanford"
What is the number of guests for the Viking Ingvar, built earlier than 1990?
CREATE TABLE table_name_46 (guests INTEGER,ship_name VARCHAR,year_built VARCHAR)
SELECT AVG(guests) FROM table_name_46 WHERE ship_name = "viking ingvar" AND year_built < 1990
What is the official name of the municipality whose name in Spanish is Vitoria?
CREATE TABLE table_31419 ("Official name" text,"INE code" real,"Name in Spanish" text,"Name in Basque" text,"Population (2007)" real)
SELECT "Official name" FROM table_31419 WHERE "Name in Spanish" = 'Vitoria'
Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number)CREATE TABLE products (code number,name text,price number,manufacturer number)
SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')
When brive is the proceed to quarter final how many were eliminated from competition?
CREATE TABLE table_30177 ("Proceed to Quarter-final" text,"Match points" text,"Aggregate score" text,"Points margin" real,"Eliminated from competition" text)
SELECT COUNT("Eliminated from competition") FROM table_30177 WHERE "Proceed to Quarter-final" = 'Brive'
Who else has commented on the same posts?.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti...
SELECT u.Id AS "Other User ID", u.DisplayName AS "Name", u.Reputation AS "Reputation", co.CreationDate AS "Comment Date", p.Id AS "Answer ID", pp.Id AS "Question ID", pp.Title AS "Title" FROM Posts AS p JOIN Posts AS pp ON pp.Id = p.ParentId JOIN Comments AS c ON c.PostId = p.Id JOIN Comments AS co ON co.PostId = p.Id ...
What is the latest Semantic Parsing paper from Nabil Aouf 's group ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE field (fieldid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numcit...
SELECT DISTINCT paper.year, writes.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Nabil Aouf' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid O...
Which player's pick is 160?
CREATE TABLE table_name_48 (player VARCHAR,pick VARCHAR)
SELECT player FROM table_name_48 WHERE pick = 160
which other 1986 film came after love 86 ?
CREATE TABLE table_204_723 (id number,"year" number,"film" text,"role" text,"notes" text)
SELECT "film" FROM table_204_723 WHERE id = (SELECT id FROM table_204_723 WHERE "film" = 'love 86') + 1