instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the average Top-5 finishes with 2 as the Top-10 and a greater than 4 Top-25?
CREATE TABLE table_42614 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Top-5") FROM table_42614 WHERE "Top-10" = '2' AND "Top-25" > '4'
Find Team_Name and ACC_Percent , and visualize them by a bar chart, and order by the ACC_Percent in ascending.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
what's the district with candidates being harry lane englebright (r) unopposed
CREATE TABLE table_1342359_5 (district VARCHAR,candidates VARCHAR)
SELECT district FROM table_1342359_5 WHERE candidates = "Harry Lane Englebright (R) Unopposed"
how many hours have passed since patient 018-20179 had last received a procedure on the current hospital visit?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179...
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality.
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,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality
papers by emina torlak published at popl
CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE field (fieldid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphra...
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'emina torlak' AND venue.venueid = paper.venueid AND venue.venuename = 'popl' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
What's the total number of moves with a result of and a black of Anand before 1999?
CREATE TABLE table_59928 ("White" text,"Black" text,"Year" real,"Result" text,"Moves" real,"Tournament" text,"Opening" text)
SELECT COUNT("Moves") FROM table_59928 WHERE "Result" = '½–½' AND "Year" < '1999' AND "Black" = 'anand'
What is the highest Points, when Played is greater than 5?
CREATE TABLE table_48752 ("Rank" real,"Team" text,"Played" real,"Wins" real,"Ties" real,"Losses" real,"Points" real)
SELECT MAX("Points") FROM table_48752 WHERE "Played" > '5'
When did an away team score 14.19 (103)?
CREATE TABLE table_57037 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_57037 WHERE "Away team score" = '14.19 (103)'
Give me a bar chart that group and count names of technicians with a series of machines they are assigned to repair, sort X from high to low order.
CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Mac...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY Name DESC
What's the wold ranking of the index by Transparency International?
CREATE TABLE table_2200 ("Index (Year)" text,"Author / Editor / Source" text,"Year of publication" text,"Countries sampled" real,"World Ranking (1)" text,"Ranking L.A. (2)" text)
SELECT "World Ranking (1)" FROM table_2200 WHERE "Author / Editor / Source" = 'Transparency International'
What is the grid for the driver with an electrical time/retired and 51 laps?
CREATE TABLE table_name_43 (grid VARCHAR,time_retired VARCHAR,laps VARCHAR)
SELECT grid FROM table_name_43 WHERE time_retired = "electrical" AND laps = 51
What is the average February that has 18-26-10 as the record, with a game less than 54?
CREATE TABLE table_50809 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text)
SELECT AVG("February") FROM table_50809 WHERE "Record" = '18-26-10' AND "Game" < '54'
who was the opening act at the viper room ?
CREATE TABLE table_203_346 (id number,"date" text,"location" text,"venue" text,"opening act" text,"supporting" text)
SELECT "opening act" FROM table_203_346 WHERE "venue" = 'viper room'
Top Saudi Developer Named Fahad.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId nu...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, Views FROM Users WHERE (LOWER(Location) LIKE '%saudi%' OR LOWER(Location) LIKE '% ksa%') AND LOWER(DisplayName) LIKE '%fahad%' ORDER BY Reputation DESC
Which model has a maximum memory of 512 mb?
CREATE TABLE table_name_92 (model INTEGER,maximum_memory VARCHAR)
SELECT MAX(model) FROM table_name_92 WHERE maximum_memory = "512 mb"
Name the total number of model for amd opteron dual-core 2.6ghz
CREATE TABLE table_27765443_2 (model___computer_name VARCHAR,cpu_type VARCHAR)
SELECT COUNT(model___computer_name) FROM table_27765443_2 WHERE cpu_type = "AMD Opteron dual-core 2.6GHz"
how many times did patient 95280 receive periph nerve div nec the previous year?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id number,subject_id number,...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph nerve div nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95280) AND DATETIME(procedures...
Show me the proportion on what is the number of players who have points less than 30 for each position?
CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club...
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position
What was the result of the Best Actor in a Musical category?
CREATE TABLE table_62600 ("Year" real,"Award Ceremony" text,"Category" text,"Nominee" text,"Result" text)
SELECT "Result" FROM table_62600 WHERE "Category" = 'best actor in a musical'
What Launched has Time elapsed of 1991 days (5 yr, 5 mo, 12 d)?
CREATE TABLE table_name_31 (launched VARCHAR,time_elapsed VARCHAR)
SELECT launched FROM table_name_31 WHERE time_elapsed = "1991 days (5 yr, 5 mo, 12 d)"
What was the record on April 8?
CREATE TABLE table_34201 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_34201 WHERE "Date" = 'april 8'
what were the top four commonly used procedures that patients received in the same hospital visit after having received a vasodilating agent - iv - labetalol procedure the last year?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasod...
What is the most popular paper this year in CVPR ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)C...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citingpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'CVPR' GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citingpaperid) DESC
What are the ends for the player with a transfer fee of loan?
CREATE TABLE table_name_33 (ends VARCHAR,transfer_fee VARCHAR)
SELECT ends FROM table_name_33 WHERE transfer_fee = "loan"
what is booking class C
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date...
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE booking_class = 'C'
What's the downstream rate for the Itu g.992.2 having a version of ADSL?
CREATE TABLE table_name_2 (downstream_rate VARCHAR,version VARCHAR,standard_name VARCHAR)
SELECT downstream_rate FROM table_name_2 WHERE version = "adsl" AND standard_name = "itu g.992.2"
What was the air date of the episod that had 456.58 thousand viewers?
CREATE TABLE table_25657 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"N.Z. viewers (thousand)" text)
SELECT "Original air date" FROM table_25657 WHERE "N.Z. viewers (thousand)" = '456.58'
What is the highest opening week net gross of the movie ranked higher than 5 from Reliance Entertainment?
CREATE TABLE table_52394 ("Rank" real,"Movie" text,"Year" real,"Studio(s)" text,"Opening Week Nett Gross" real)
SELECT MAX("Opening Week Nett Gross") FROM table_52394 WHERE "Rank" < '5' AND "Studio(s)" = 'reliance entertainment'
What is teh stage with Daniele Bennati as the points classification and Giovanni VIsconti as the general classification?
CREATE TABLE table_35466 ("Stage" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text)
SELECT "Stage" FROM table_35466 WHERE "Points classification" = 'daniele bennati' AND "General classification" = 'giovanni visconti'
count how many hospital visits patient 021-239662 has in 2105.
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,orga...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '021-239662' AND STRFTIME('%y', patient.hospitaladmittime) = '2105'
Who owns the fm 101.3 frequency?
CREATE TABLE table_name_96 (owner VARCHAR,frequency VARCHAR)
SELECT owner FROM table_name_96 WHERE frequency = "fm 101.3"
What country is Trent Yawney from?
CREATE TABLE table_30565 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Nationality" FROM table_30565 WHERE "Player" = 'Trent Yawney'
All posts by user ID.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu...
SELECT Post.Id AS "post_link", Type.Name AS "type", Post.Score AS "score", Post.CreationDate AS "creationdate", COALESCE(Post.Tags, Parent.Tags) AS "tags" FROM Posts AS Post LEFT JOIN PostTypes AS Type ON Type.Id = Post.PostTypeId LEFT JOIN Posts AS Parent ON Parent.Id = Post.ParentId WHERE Post.OwnerUserId = '##UserID...
how many hours have passed since patient 1561 was admitted into the intensive care unit?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,l...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND icustays.outtime IS NULL
what is the properties of lithium when caesium is ki (1.7)?
CREATE TABLE table_name_17 (lithium VARCHAR,caesium VARCHAR)
SELECT lithium FROM table_name_17 WHERE caesium = "ki (1.7)"
What is the 3rd Liga from 2010-11?
CREATE TABLE table_39644 ("Date" text,"2nd Bundesliga 16th" text,"3rd Liga 3rd" text,"Game 1" text,"Game 2" text)
SELECT "3rd Liga 3rd" FROM table_39644 WHERE "Date" = '2010-11'
How old is each gender, on average Plot them as bar chart, I want to sort by the Y from high to low.
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
give me the number of patients whose diagnoses icd9 code is 44020 and lab test category is hematology?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "44020" AND lab."CATEGORY" = "Hematology"
How many Viewers have a Rank smaller than 2?
CREATE TABLE table_name_71 (viewers INTEGER,rank INTEGER)
SELECT SUM(viewers) FROM table_name_71 WHERE rank < 2
Which college's round is more than 4, when the overall is less than 237 and Ted Cottrell was the name?
CREATE TABLE table_38221 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "College" FROM table_38221 WHERE "Round" > '4' AND "Overall" < '237' AND "Name" = 'ted cottrell'
What was the result when Dundee were the Opponent at Venue A on 6 September 1986?
CREATE TABLE table_name_9 (result VARCHAR,date VARCHAR,opponent VARCHAR,venue VARCHAR)
SELECT result FROM table_name_9 WHERE opponent = "dundee" AND venue = "a" AND date = "6 september 1986"
Which year has 200 laps?
CREATE TABLE table_68194 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Year" FROM table_68194 WHERE "Laps" = '200'
Name the score which has record of 73-83
CREATE TABLE table_80088 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Score" FROM table_80088 WHERE "Record" = '73-83'
What is the Place of the Player with a Score of 68-73-66-74=281?
CREATE TABLE table_name_13 (place VARCHAR,score VARCHAR)
SELECT place FROM table_name_13 WHERE score = 68 - 73 - 66 - 74 = 281
How many figures are given for total number of South Asians in 2001 for the area where they were 4.4% of population in 2011?
CREATE TABLE table_21406 ("Province" text,"South Asians 2001" real,"% 2001" text,"South Asians 2011" real,"% 2011" text)
SELECT COUNT("South Asians 2001") FROM table_21406 WHERE "% 2011" = '4.4%'
Show each state and the number of addresses in each state by a bar chart.
CREATE TABLE Contacts (contact_id INTEGER,customer_id INTEGER,gender VARCHAR(1),first_name VARCHAR(80),last_name VARCHAR(50),contact_phone VARCHAR(80))CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_date DATETIME,order_status_code VARCHAR(15))CREATE TABLE Customers (customer_id INTEGER,payment_...
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county
What is the total number of appearances in the premier league when there were 10 appearances at UEFA and less than 4 at league cup?
CREATE TABLE table_name_53 (premier_league VARCHAR,UEfa_cup VARCHAR,league_cup VARCHAR)
SELECT COUNT(premier_league) FROM table_name_53 WHERE UEfa_cup = 10 AND league_cup < 4
when did patient 73595 receive the revise sm bowel anastom for the first time until 3 years ago?
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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedur...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'revise sm bowel anastom') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73595) AND ...
how many games had an attendance of more than 10,000 ?
CREATE TABLE table_204_495 (id number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"scorers" text)
SELECT COUNT(*) FROM table_204_495 WHERE "attendance" > 10000
What is the digital of Virgin [analogue]?
CREATE TABLE table_58972 ("Provider" text,"Years" text,"Free or pay" text,"No. of channels" text,"Colour" text,"Digital" text,"Transmission" text)
SELECT "Digital" FROM table_58972 WHERE "Provider" = 'virgin [analogue]'
when was number 4102 entered into service ?
CREATE TABLE table_203_27 (id number,"number" number,"serial no" number,"entered service" text,"withdrawn" text,"kilometres travelled" number)
SELECT "entered service" FROM table_203_27 WHERE "number" = 4102
HTML5 thread volume with accepted answers by month.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,...
SELECT COUNT(*) AS AnsweredVolume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<html5%' OR Tags LIKE '%<html-canvas>%' OR Tags LIKE '%<xhtml5>%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId >...
What is the maximum number of AFC championships?
CREATE TABLE table_23062 ("Team" text,"Division Titles" real,"Playoff Berths" real,"AFL Titles" real,"AFC Championships" real,"Super Bowl Championships" real)
SELECT MAX("AFC Championships") FROM table_23062
What is the sum of Sylvain Guintoli's laps?
CREATE TABLE table_56388 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" text)
SELECT SUM("Laps") FROM table_56388 WHERE "Rider" = 'sylvain guintoli'
give the title and description of diagnoses icd9 code 78630.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "78630"
Find all images by user 2284240.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCo...
SELECT Id AS "post_link", * FROM Posts WHERE OwnerUserId = 2284240 AND Body LIKE '%i.stack.imgur.com%'
Return a bar chart about the distribution of All_Games and School_ID , and order by the X in descending please.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC
when the value (int $1000) is 409566, what is the commodity?
CREATE TABLE table_24136 ("Rank" real,"Commodity" text,"Value (Int $1000)" real,"Production (MT)" real,"Quantity world rank" text,"Value world rank" text)
SELECT "Commodity" FROM table_24136 WHERE "Value (Int $1000)" = '409566'
Who is the opponent on November 14?
CREATE TABLE table_name_53 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_53 WHERE date = "november 14"
How many semifinalists has Romania had?
CREATE TABLE table_31410 ("Rank" real,"Country/Territory" text,"Miss Earth" text,"Miss Air" real,"Miss Water" real,"Miss Fire" real,"Semifinalists" real,"Total" real)
SELECT "Semifinalists" FROM table_31410 WHERE "Country/Territory" = 'Romania'
What is the sum of wins and the sum of losses less than 4 for teams larger than 20?
CREATE TABLE table_13486 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real)
SELECT SUM("Wins") FROM table_13486 WHERE "Losses" < '4' AND "Goals Against" > '20'
Show the names and ids of tourist attractions that are visited at most once.
CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR(15),Attraction_Type_Description VARCHAR(255))CREATE TABLE Tourist_Attraction_Features (Tourist_Attraction_ID INTEGER,Feature_ID INTEGER)CREATE TABLE Street_Markets (Market_ID INTEGER,Market_Details VARCHAR(255))CREATE TABLE Features (Feature_ID INTEGER,Featur...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and manager_id .
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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)...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
For each faculty rank, show the number of faculty members who have it Show bar chart, and I want to list from high to low by the X.
CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Activity (actid INTEGER,activity_...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank DESC
What is the date of the 4 strokes margin of victory?
CREATE TABLE table_name_6 (date VARCHAR,margin_of_victory VARCHAR)
SELECT date FROM table_name_6 WHERE margin_of_victory = "4 strokes"
What is Record, when Game is '36'?
CREATE TABLE table_45097 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Record" FROM table_45097 WHERE "Game" = '36'
How many yards did kevin swayne average, with a long carry over 7?
CREATE TABLE table_name_43 (avg INTEGER,player VARCHAR,long VARCHAR)
SELECT MIN(avg) FROM table_name_43 WHERE player = "kevin swayne" AND long > 7
How many calibers require the type LB/RN?
CREATE TABLE table_24444 ("Class" text,"Weapon" text,"Caliber" text,"Type" text,"Weight (g)" text,"Range (m)" text,"Velocity (m/s)" text,"Impact Energy" text,"Shots" real)
SELECT COUNT("Caliber") FROM table_24444 WHERE "Type" = 'LB/RN'
WHICH 2/3 (P) has a 2 (VF) of dhutish?
CREATE TABLE table_9015 ("Verb" text,"2 (VF)" text,"2 (F)" text,"3 (F)" text,"2/3 (P)" text)
SELECT "2/3 (P)" FROM table_9015 WHERE "2 (VF)" = 'তুই dhutish'
Many courses are taught by more than 2 professors , how many ?
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_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var...
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO...
Find the 'date became customers' of the customers whose ID is between 10 and 20, and count them by a bar chart, I want to show by the y axis in descending.
CREATE TABLE Order_Items (order_id INTEGER,product_id INTEGER,order_quantity VARCHAR(15))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 Customer_Contact_Channels (customer_id INTEGER,channel_...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
Find the id and local authority of the station with has the highest average high temperature.
CREATE TABLE station (id VARCHAR,local_authority VARCHAR)CREATE TABLE weekly_weather (station_id VARCHAR)
SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1
What was the gap from Thailand as of 2012 for China?
CREATE TABLE table_31523 ("Economy" text,"1980" real,"Gap from Thailand as of 1980 (times)" text,"1985" real,"1990" real,"1995" real,"2000" real,"2005" real,"2010" real,"2012" real,"Gap from Thailand as of 2012 (times)" text,"GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)" text,"GDP per ...
SELECT "Gap from Thailand as of 2012 (times)" FROM table_31523 WHERE "Economy" = 'China'
How many games have a Result of l, and a Record of 2-6?
CREATE TABLE table_name_17 (game VARCHAR,result VARCHAR,record VARCHAR)
SELECT COUNT(game) FROM table_name_17 WHERE result = "l" AND record = "2-6"
What market is Wessington Springs in
CREATE TABLE table_134729_3 (target_city__market VARCHAR,city_of_license VARCHAR)
SELECT target_city__market FROM table_134729_3 WHERE city_of_license = "Wessington Springs"
show me all the UA flights leaving DALLAS
CREATE TABLE airline (airline_code varchar,airline_name text,note text)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 month (month_number int,month_name text)CREATE TABLE food_service (meal_co...
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIRP...
Name the most district wide for 1639 other programs
CREATE TABLE table_26253 ("Year" text,"District-wide" real,"High schools" real,"Middle schools" real,"Elementary schools" real,"Other programs & adjustments" real)
SELECT MAX("District-wide") FROM table_26253 WHERE "Other programs & adjustments" = '1639'
Which License has an Actual Vaersion of 9.0?
CREATE TABLE table_name_18 (license VARCHAR,actual_version VARCHAR)
SELECT license FROM table_name_18 WHERE actual_version = "9.0"
Name the phoneme when the realizationis [ ]
CREATE TABLE table_name_16 (phoneme VARCHAR,realization VARCHAR)
SELECT phoneme FROM table_name_16 WHERE realization = "[ɑ]"
how many male patients are of american indian/alaska native ethnicity?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
What's the number of positions of the player playing in Minnesota North Stars?
CREATE TABLE table_23128 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT COUNT("Position") FROM table_23128 WHERE "NHL team" = 'Minnesota North Stars'
how many patients whose primary disease is s/p fall and lab test abnormal status is abnormal?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "abnormal"
How many bronze had a total less than 4 and gold bigger than 1?
CREATE TABLE table_70069 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_70069 WHERE "Total" < '4' AND "Gold" > '1'
how many patients whose diagnoses icd9 code is 57401 and lab test category is blood gas?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "57401" AND lab."CATEGORY" = "Blood Gas"
Who was playing when the score was 5 7, 5 7?
CREATE TABLE table_24655 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Opponents" FROM table_24655 WHERE "Score" = '5–7, 5–7'
What days of the week does PHIL 157 meet ?
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 DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
What was Fitzroy's score when they were the home team?
CREATE TABLE table_32722 ("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_32722 WHERE "Home team" = 'fitzroy'
Who is the partner with a runner-up outcome on April 6, 1992?
CREATE TABLE table_4362 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Partner" FROM table_4362 WHERE "Outcome" = 'runner-up' AND "Date" = 'april 6, 1992'
what is the number of patients whose admission year is less than 2170 and drug name is clopidogrel bisulfate?
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.admityear < "2170" AND prescriptions.drug = "Clopidogrel Bisulfate"
i would like to know the daily maximum amount of enteral formula volume/bolus amt (ml) that patient 033-22108 has received on their current hospital encounter.
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitst...
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 = '033-22108' AND patient.hospitaldischargetime IS ...
What is 1st Member, when 2nd Member is 'William Benne', and when Elected is '1300/01'?
CREATE TABLE table_61943 ("Summoned" text,"Elected" text,"Assembled" text,"1st member" text,"2nd member" text)
SELECT "1st member" FROM table_61943 WHERE "2nd member" = 'william benne' AND "Elected" = '1300/01'
what is the country when the iata is gva?
CREATE TABLE table_48134 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "Country" FROM table_48134 WHERE "IATA" = 'gva'
Which League has a FA Cup larger than 0, and a Player of simon read, and a League Cup larger than 1?
CREATE TABLE table_40662 ("Player" text,"Club" text,"League" real,"FA Cup" real,"FA Trophy" real,"League Cup" real,"Total" real)
SELECT MIN("League") FROM table_40662 WHERE "FA Cup" > '0' AND "Player" = 'simon read' AND "League Cup" > '1'
What is the air date for the episode written by Wendy Battles and directed by Oz Scott
CREATE TABLE table_17017 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "Original air date" FROM table_17017 WHERE "Written by" = 'Wendy Battles' AND "Directed by" = 'Oz Scott'
tell me the total of patient 80555's output on the current intensive care unit visit?
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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREA...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND icustays.outtime IS NULL)
when has patient 030-10559 last had the rbc minimum value in the last month?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime, 'start of mont...
What gender is allowed to attend the school that has a decile of 6 and a roll that is less than 179?
CREATE TABLE table_14942 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT "Gender" FROM table_14942 WHERE "Decile" = '6' AND "Roll" < '179'
If the coordinate velocity v dx/dt in units of c is (e 2 1)/(e 2 + 1) 0.761, what is the velocity angle in i-radians?
CREATE TABLE table_19991 ("Condition/Parameter" text,"Coordinate velocity v dx/dt in units of c" text,"Velocity angle \u03b7 in i-radians" text,"Proper velocity w dx/d\u03c4 in units of c" text,"Lorentz factor \u03b3 dt/d\u03c4 = E/mc 2" text)
SELECT "Velocity angle \u03b7 in i-radians" FROM table_19991 WHERE "Coordinate velocity v dx/dt in units of c" = '(e 2 − 1)/(e 2 + 1) ≅ 0.761'
Give me a bar chart for the total number of each dept name, and I want to list y axis from high to low order.
CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeri...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC