instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the release price (USD) of the microprocessor with a model number pentium dual-core t2330?
CREATE TABLE table_name_32 (release_price___usd__ VARCHAR,model_number VARCHAR)
SELECT release_price___usd__ FROM table_name_32 WHERE model_number = "pentium dual-core t2330"
what is average age of patients whose marital status is single and year of birth is greater than 2098?
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 diagnoses (subject_id text,hadm_id tex...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2098"
in 2102, what were the five most often ordered lab tests for patients who had previously been diagnosed with facial bone fracture - nasal fracture within 2 months?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresul...
SELECT t3.labname FROM (SELECT t2.labname, 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 = 'facial bone fracture - nasal fracture' AND STRFTIME(...
what is the total number of patients who had pneumonitis due to inhalation of food or vomitus and discharged to snf
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Pneumonitis due to inhalation of food or vomitus"
What is the largest overall where the position was linebacker and the pick number was more than 9?
CREATE TABLE table_name_32 (overall INTEGER,position VARCHAR,pick__number VARCHAR)
SELECT MAX(overall) FROM table_name_32 WHERE position = "linebacker" AND pick__number > 9
Name the rank where the municipality is sunndal?
CREATE TABLE table_17586 ("Rank" real,"Peak" text,"Elevation (m)" real,"Prominence (m)" real,"Isolation (km)" real,"Municipality" text,"County" text)
SELECT "Rank" FROM table_17586 WHERE "Municipality" = 'Sunndal'
What is the score for the date of December 7?
CREATE TABLE table_73524 ("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_73524 WHERE "Date" = 'December 7'
what is the most silver when bronze is more than 0, total is more than 1, gold is more than 0 and the nation is china (chn)?
CREATE TABLE table_13502 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Silver") FROM table_13502 WHERE "Bronze" > '0' AND "Total" > '1' AND "Gold" > '0' AND "Nation" = 'china (chn)'
List the number of enginners in a stacked bar chart. The x-axis is last name and group by skill description.
CREATE TABLE Skills (skill_id INTEGER,skill_code VARCHAR(20),skill_description VARCHAR(255))CREATE TABLE Third_Party_Companies (company_id INTEGER,company_type VARCHAR(5),company_name VARCHAR(255),company_address VARCHAR(255),other_company_details VARCHAR(255))CREATE TABLE Part_Faults (part_fault_id INTEGER,part_id INT...
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name
Which Semifinalists has a Champions of michael chang 6-0 6-4?
CREATE TABLE table_name_86 (semifinalists VARCHAR,champions VARCHAR)
SELECT semifinalists FROM table_name_86 WHERE champions = "michael chang 6-0 6-4"
Castrol Perkins Motorsport and the winner Russell Ingall was in what location/state?
CREATE TABLE table_name_82 (location___state VARCHAR,team VARCHAR,winner VARCHAR)
SELECT location___state FROM table_name_82 WHERE team = "castrol perkins motorsport" AND winner = "russell ingall"
which language does the patient charles deshay prefer?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT demographic.language FROM demographic WHERE demographic.name = "Charles Deshay"
Which description is dated 1962?
CREATE TABLE table_52961 ("Number & Name" text,"Description" text,"Livery" text,"Owner(s)" text,"Date" text)
SELECT "Description" FROM table_52961 WHERE "Date" = '1962'
How many byes has a draw larger than 0?
CREATE TABLE table_name_55 (byes VARCHAR,draws INTEGER)
SELECT COUNT(byes) FROM table_name_55 WHERE draws > 0
Return the names and ids of customers who have TN in their address by a pie chart.
CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Department_Store_Chain (dept_store_chain_id INTEGER,dept_store_chain_name VARCHAR(80))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Staff_Department_Assignments (staff_id INTEGER,depar...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
show me round trip tickets from NEW YORK to MIAMI
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit...
What is the lowest number of games played where they tied more than 7 of them?
CREATE TABLE table_45480 ("Competition" text,"Played" real,"Draw" real,"Lost" real,"Favour" real,"Against" real)
SELECT MIN("Played") FROM table_45480 WHERE "Draw" > '7'
Tell me the total number of gold for bronze more than 0 and total more than 100
CREATE TABLE table_31618 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_31618 WHERE "Bronze" > '0' AND "Rank" = 'total' AND "Total" > '100'
Who was the coach in 1953?
CREATE TABLE table_name_19 (coach VARCHAR,year VARCHAR)
SELECT coach FROM table_name_19 WHERE year = "1953"
provide the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and age is less than 61?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "61"
provide the number of patients whose days of hospital stay is greater than 1 and drug route is nu?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.route = "NU"
What week was the record 0-5?
CREATE TABLE table_name_96 (week VARCHAR,record VARCHAR)
SELECT week FROM table_name_96 WHERE record = "0-5"
What's the change over previous year as a whole in the period in which the change over same quarter the previous year was up 2.8%?
CREATE TABLE table_1634 ("Period" text,"% trains arriving within 5 mins of scheduled time (over three months)" text,"Change over same quarter the previous year" text,"% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text,"Change over previous year as a whole" text)
SELECT "Change over previous year as a whole" FROM table_1634 WHERE "Change over same quarter the previous year" = 'Up 2.8%'
What value for 2013 corresponds to the US Open Tournament?
CREATE TABLE table_33201 ("Tournament" text,"2007" text,"2011" text,"2012" text,"2013" text)
SELECT "2013" FROM table_33201 WHERE "Tournament" = 'us open'
count the number of patients that were diagnosed with congestive heart failure - right-sided and didn't come back to the hospital within 2 months until 2104.
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 (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure - right-sided' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1...
Give me a line chart, that bins all date of transactions into the weekday interval, and the count for each bin.
CREATE TABLE Lots (lot_id INTEGER,investor_id INTEGER,lot_details VARCHAR(255))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DECIMAL(19,4),share_count VARCHAR(40),other_details VARCHAR(255))CREATE TABLE Investor...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions
top 100 tags since july 1.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation numbe...
SELECT Tags, ViewCount, CommentCount, Score, FavoriteCount FROM Posts WHERE CreationDate > '2020-07-01' ORDER BY ViewCount DESC LIMIT 100
what artist won in 1953
CREATE TABLE table_34580 ("Position" text,"Artist" text,"Single" text,"Year" text,"Weeks" text)
SELECT "Artist" FROM table_34580 WHERE "Year" = '1953'
Questions with 'what have you tried comments' between two dates.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Cl...
SELECT COUNT(*) AS QuestionCount, SUM(A.TriedComments) AS TriedCount FROM (SELECT SUM(CASE WHEN C.Text LIKE '%have you tried%' OR c.Text LIKE '%you have tried%' THEN 1 ELSE 0 END) AS TriedComments, P.Id FROM Posts AS P LEFT JOIN Comments AS C ON C.PostId = P.Id WHERE P.CreationDate BETWEEN @pStartDate AND @pEndDate AND...
What is the date that a game at the Alltel Stadium had a final score of 6-20?
CREATE TABLE table_name_48 (date VARCHAR,stadium VARCHAR,final_score VARCHAR)
SELECT date FROM table_name_48 WHERE stadium = "alltel stadium" AND final_score = "6-20"
what is the wind speed when brenda morehead was in the united states?
CREATE TABLE table_70806 ("Rank" real,"Fastest time (s)" real,"Wind (m/s)" real,"Athlete" text,"Nation" text,"Date" text,"Location" text)
SELECT MIN("Wind (m/s)") FROM table_70806 WHERE "Nation" = 'united states' AND "Athlete" = 'brenda morehead'
what is the number of patients whose diagnoses long title is pressure ulcer, stage iv and lab test abnormal status is delta?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
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.long_title = "Pressure ulcer, stage IV" AND lab.flag = "delta"
Plot how many country by grouped by country as a bar graph, rank from low to high by the bars please.
CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text)CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int)
SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY Country
What are the directions for the guardian whose weapon is kha ga (sword)?
CREATE TABLE table_100518_1 (direction VARCHAR,weapon VARCHAR)
SELECT direction FROM table_100518_1 WHERE weapon = "Khaḍga (sword)"
Good and Bad code examples.
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 COUNT(*) FROM Posts WHERE Body LIKE '%<code>%' AND ParentId IN (1109022, 151777, 541966, 1016896, 6343166, 477572, 2591036, 3145089, 2201917, 5033012, 600207, 3035692, 1560788, 2091465, 531427, 2139134, 6495898, 3166501, 4605527, 2736389, 2150078, 6200533, 867518, 2471935, 3624280, 2459916, 1667278, 2795833, 231...
Who is the runner-up of the season with Tanel Sokk as the finals MVP and Alar Varrak as the champion's coach?
CREATE TABLE table_36303 ("Season" text,"Winner" text,"Result" text,"Runner-up" text,"1st of Regular Season" text,"Record" text,"Champion's Coach" text,"Finals MVP" text)
SELECT "Runner-up" FROM table_36303 WHERE "Finals MVP" = 'tanel sokk' AND "Champion's Coach" = 'alar varrak'
What was the playoff result in 2002?
CREATE TABLE table_17672 ("Year" text,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Playoffs" FROM table_17672 WHERE "Year" = '2002'
how much is the daily minimum weight of patient 9294 since 2105?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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...
SELECT MIN(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 = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
Repeated `Comment` for `PostHistoryTypeId IN (33, 34)`.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)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 numb...
SELECT Comment, COUNT(*) AS "Count" FROM PostHistory WHERE PostHistoryTypeId IN (33, 34) GROUP BY Comment HAVING COUNT(*) > 2 ORDER BY 'Count' DESC
Show the sum of account details for different statement details in a bar chart, and sort in ascending by the y-axis.
CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER...
SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY SUM(Account_Details)
mention the age and procedure long title of patient with patient id 2560.
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
What is the Music for Team anna guzik & rafa kami ski that has a Points Jury of 24 (7,5,6,6)?
CREATE TABLE table_name_35 (music VARCHAR,team VARCHAR,points_jury VARCHAR)
SELECT music FROM table_name_35 WHERE team = "anna guzik & rafał kamiński" AND points_jury = "24 (7,5,6,6)"
A bar chart for what are the number of the names of all products?, and sort by the Y-axis in asc.
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 Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name)
When did the playoffs reached Conference Finals?
CREATE TABLE table_15409403_1 (year VARCHAR,playoffs VARCHAR)
SELECT year FROM table_15409403_1 WHERE playoffs = "Conference Finals"
When beauval is the name what is the lowest population of 2011?
CREATE TABLE table_22727 ("Name" text,"Population (2011)" real,"Population (2006)" real,"Change (%)" text,"Land area (km\u00b2)" text,"Population density (per km\u00b2)" text)
SELECT MIN("Population (2011)") FROM table_22727 WHERE "Name" = 'Beauval'
Show the park of the roller coaster with the highest speed.
CREATE TABLE roller_coaster (roller_coaster_id number,name text,park text,country_id number,length number,height number,speed text,opened text,status text)CREATE TABLE country (country_id number,name text,population number,area number,languages text)
SELECT park FROM roller_coaster ORDER BY speed DESC LIMIT 1
indicate the yearly minimum amount of heartrate for patient 016-34108.
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstay...
SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108')) AND NOT vitalperiodic.heartrate IS NULL...
how many metoprolol tartrate 25 mg tab prescriptions since 4 years ago have been prescribed?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'metoprolol tartrate 25 mg tab' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')
Which actors first appeared in episode 'Blink' 1, 2, 3?
CREATE TABLE table_16572 ("Character" text,"Portrayed by" text,"First appearance" text,"Last appearance" text,"Duration" text,"Episodes" text)
SELECT "Portrayed by" FROM table_16572 WHERE "First appearance" = 'Blink" 1, 2, 3'
Which Date has a Venue of bucharest?
CREATE TABLE table_name_3 (date VARCHAR,venue VARCHAR)
SELECT date FROM table_name_3 WHERE venue = "bucharest"
What is the last name of the author that has published the most papers?
CREATE TABLE authorship (authid VARCHAR,paperid VARCHAR)CREATE TABLE papers (paperid VARCHAR)CREATE TABLE authors (lname VARCHAR,fname VARCHAR,authid VARCHAR)
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
how many patients whose discharge location is dead/expired and procedure short title is contrast aortogram?
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.short_title = "Contrast aortogram"
Which Venue has a Competition of pl group b, and a Score of 2-2?
CREATE TABLE table_75461 ("Date" text,"Venue" text,"Opponents" text,"Score" text,"Competition" text)
SELECT "Venue" FROM table_75461 WHERE "Competition" = 'pl group b' AND "Score" = '2-2'
How many grids were there races with more than 10 laps and a time of +34.121?
CREATE TABLE table_name_83 (grid VARCHAR,time VARCHAR,laps VARCHAR)
SELECT COUNT(grid) FROM table_name_83 WHERE time = "+34.121" AND laps > 10
How many linkedin have Facebook as the site, with a myspace less than 64?
CREATE TABLE table_34026 ("Site" text,"Bebo" real,"Facebook" real,"Friendster" real,"LinkedIn" real,"MySpace" real,"Ning" real,"Orkut" real,"Plaxo" real)
SELECT COUNT("LinkedIn") FROM table_34026 WHERE "Site" = 'facebook' AND "MySpace" < '64'
What is the total attendance with a Report of sd.hr, and a Score of 3 1, and a Date of 14 apr 2001?
CREATE TABLE table_name_22 (attendance INTEGER,date VARCHAR,report VARCHAR,score VARCHAR)
SELECT SUM(attendance) FROM table_name_22 WHERE report = "sd.hr" AND score = "3–1" AND date = "14 apr 2001"
When Hawthorn is the away team, what is their score?
CREATE TABLE table_50492 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_50492 WHERE "Away team" = 'hawthorn'
Find the name of the airport in the city of Goroka.
CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,elevation number,iata text,icao text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid ...
SELECT name FROM airports WHERE city = 'Goroka'
Which types of policy are chosen by more than 2 customers? Give me the policy type codes.
CREATE TABLE staff (staff_id number,staff_details text)CREATE TABLE claim_headers (claim_header_id number,claim_status_code text,claim_type_code text,policy_id number,date_of_claim time,date_of_settlement time,amount_claimed number,amount_piad number)CREATE TABLE policies (policy_id number,customer_id number,policy_typ...
SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2
What is the number of disposals when marks is 134?
CREATE TABLE table_name_84 (disposals VARCHAR,marks VARCHAR)
SELECT disposals FROM table_name_84 WHERE marks = "134"
What is the lowest to par for Bob Charles?
CREATE TABLE table_60242 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT MIN("To par") FROM table_60242 WHERE "Player" = 'bob charles'
What is the Call sign for the ERP W 19?
CREATE TABLE table_37353 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text)
SELECT "Call sign" FROM table_37353 WHERE "ERP W" = '19'
I want to know the proportion of the total number for each time of day.
CREATE TABLE broadcast_share (Channel_ID int,Program_ID int,Date text,Share_in_percent real)CREATE TABLE broadcast (Channel_ID int,Program_ID int,Time_of_day text)CREATE TABLE program (Program_ID int,Name text,Origin text,Launch real,Owner text)CREATE TABLE channel (Channel_ID int,Name text,Owner text,Share_in_percent ...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day
Name the common name for rhampholeon spectrum
CREATE TABLE table_175442_1 (common_name VARCHAR,scientific_name VARCHAR)
SELECT common_name FROM table_175442_1 WHERE scientific_name = "Rhampholeon spectrum"
What was the date of the game when North Melbourne was the away team?
CREATE TABLE table_name_10 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_10 WHERE away_team = "north melbourne"
is there a flight from DENVER to SAN FRANCISCO on CO leaving after 1200 o'clock in the afternoon
CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_descrip...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_...
tell me the percentile of mcv 97.0 in patients of the same age as patient 2127 during the last hospital visit?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status t...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE...
Name the most top-5 for wins less than 0 and events less than 16
CREATE TABLE table_6263 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MAX("Top-5") FROM table_6263 WHERE "Events" < '16' AND "Wins" < '0'
I want the lowest Laps for time/retired of engine and driver of charles de tornaco
CREATE TABLE table_name_22 (laps INTEGER,time_retired VARCHAR,driver VARCHAR)
SELECT MIN(laps) FROM table_name_22 WHERE time_retired = "engine" AND driver = "charles de tornaco"
show me DL flights from DALLAS to DENVER
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE code_description (code varchar,description text)CREATE ...
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 = 'DALLAS...
show me the DAILY flight schedule between BOSTON and PITTSBURGH
CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fl...
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CIT...
Name the viewers for the episode directed by tony phelan
CREATE TABLE table_23030 ("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 "U.S. viewers (millions)" FROM table_23030 WHERE "Directed by" = 'Tony Phelan'
A bar chart shows the distribution of Team_Name and ACC_Percent , and list X in asc order please.
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
What area is named Mackenzie college?
CREATE TABLE table_name_50 (area VARCHAR,name VARCHAR)
SELECT area FROM table_name_50 WHERE name = "mackenzie college"
What nationality was peter slamiar?
CREATE TABLE table_2886617_6 (nationality VARCHAR,player VARCHAR)
SELECT nationality FROM table_2886617_6 WHERE player = "Peter Slamiar"
What is the last episode in the season that had 3.91 million viewers in the US?
CREATE TABLE table_30975 ("Season no." real,"Series no." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT MIN("Season no.") FROM table_30975 WHERE "U.S. viewers (millions)" = '3.91'
provide the number of patients whose insurance is medicare and year of birth is less than 2182?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dob_year < "2182"
What is the team for the position in table 19th?
CREATE TABLE table_24231638_3 (team VARCHAR,position_in_table VARCHAR)
SELECT team FROM table_24231638_3 WHERE position_in_table = "19th"
What is the maximum point for climbers whose country is United Kingdom?
CREATE TABLE climber (Points INTEGER,Country VARCHAR)
SELECT MAX(Points) FROM climber WHERE Country = "United Kingdom"
What are the top 5 countries by number of invoices and how many do they have?
CREATE TABLE customers (id number,first_name text,last_name text,company text,address text,city text,state text,country text,postal_code text,phone text,fax text,email text,support_rep_id number)CREATE TABLE sqlite_sequence (name text,seq text)CREATE TABLE albums (id number,title text,artist_id number)CREATE TABLE empl...
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
Rood & Taylor of o, and a Buechel & Manhart spelling (pronunciation) of o had what university of Minnesota?
CREATE TABLE table_6741 ("Buechel & Manhart spelling (pronunciation)" text,"Ullrich" text,"Brandon University" text,"Deloria & Boas" text,"Dakota Mission" text,"Rood & Taylor" text,"Riggs" text,"Williamson" text,"University of Minnesota" text,"White Hat" text)
SELECT "University of Minnesota" FROM table_6741 WHERE "Rood & Taylor" = 'o' AND "Buechel & Manhart spelling (pronunciation)" = 'o'
For the Hockey East conference, what is the total number of win percentages when there are less than 4 bids?
CREATE TABLE table_74489 ("Conference" text,"# of Bids" real,"Record" text,"Win %" real,"Regional Finals" real)
SELECT COUNT("Win %") FROM table_74489 WHERE "Conference" = 'hockey east' AND "# of Bids" < '4'
What is every entry for area if capital is Port-au-Prince?
CREATE TABLE table_31374 ("Country with flag" text,"Area (km\u00b2)" real,"Population (1 July 2005 est.)" real,"Population density (per km\u00b2)" text,"Capital" text)
SELECT "Area (km\u00b2)" FROM table_31374 WHERE "Capital" = 'Port-au-Prince'
what is primary disease of subject name kelly gallardo?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Kelly Gallardo"
What type of local government area is Yalata?
CREATE TABLE table_26268 ("Local Government Area" text,"Type" text,"Major Town" text,"Land Area (km\u00b2)" text,"Pop. 2006" real,"Density km \u22122" real,"Towns" real,"Est." real)
SELECT "Type" FROM table_26268 WHERE "Local Government Area" = 'Yalata'
For which Game 4, did David Boyle play in Game 3?
CREATE TABLE table_name_41 (game_4 VARCHAR,game_3 VARCHAR)
SELECT game_4 FROM table_name_41 WHERE game_3 = "david boyle"
List the number of the name of all playlist, display by the x-axis from high to low please.
CREATE TABLE tracks (id INTEGER,name VARCHAR(200),album_id INTEGER,media_type_id INTEGER,genre_id INTEGER,composer VARCHAR(220),milliseconds INTEGER,bytes INTEGER,unit_price NUMERIC(10,2))CREATE TABLE artists (id INTEGER,name VARCHAR(120))CREATE TABLE genres (id INTEGER,name VARCHAR(120))CREATE TABLE playlist_tracks (p...
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY name DESC
Count of questions, comments, answers with tag over time.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReaso...
SELECT DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS "week", Tags.TagName, COUNT(DISTINCT Posts.Id) AS Posts, SUM(Posts.AnswerCount) AS Answers, SUM(Posts.CommentCount) AS Comments FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE ...
Return the duration of the actor with the greatest age.
CREATE TABLE musical (musical_id number,name text,year number,award text,category text,nominee text,result text)CREATE TABLE actor (actor_id number,name text,musical_id number,character text,duration text,age number)
SELECT duration FROM actor ORDER BY age DESC LIMIT 1
What is the name of the customer who has made the minimum amount of payment in one claim?
CREATE TABLE claims_processing_stages (claim_stage_id number,next_claim_stage_id number,claim_status_name text,claim_status_description text)CREATE TABLE claims_documents (claim_id number,document_type_code text,created_by_staff_id number,created_date number)CREATE TABLE policies (policy_id number,customer_id number,po...
SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT MIN(amount_piad) FROM claim_headers)
Which commander received complement larger than 240 , guns of 66 and ship of revolutie?
CREATE TABLE table_name_62 (commander VARCHAR,ship VARCHAR,complement VARCHAR,guns VARCHAR)
SELECT commander FROM table_name_62 WHERE complement > 240 AND guns = "66" AND ship = "revolutie"
which is the least region charted on this chart
CREATE TABLE table_204_277 (id number,"region" text,"country" text,"location" text,"size (m)" text,"payload (metric tonnes)" text,"degrees of freedom" number,"x horiz disp (mm)" number,"y horiz disp (mm)" number,"z vert disp (mm)" number,"x horiz vel (mm/s)" number,"y horiz vel (mm/s)" number,"z vert vel (mm/s)" number...
SELECT "region" FROM table_204_277 GROUP BY "region" ORDER BY COUNT(*) LIMIT 1
how many hours has passed since patient 022-199074 had a glucose laboratory test for the first time on this hospital visit?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '022-199074' AND patient.hos...
I want the constructor for brakes and grid less than 14
CREATE TABLE table_name_39 (constructor VARCHAR,time_retired VARCHAR,grid VARCHAR)
SELECT constructor FROM table_name_39 WHERE time_retired = "brakes" AND grid < 14
Give the proportion of what is the name of every city that has at least 15 stations and how many stations does it have?
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INT...
SELECT city, COUNT(*) FROM station GROUP BY city
What is the best restaurant in san francisco for french food ?
CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM location AS LOCATIONalias1, restaurant AS RESTAURANTalias1 W...
Who made the decisions in the game whose first star was V. Lecavalier?
CREATE TABLE table_29604 ("Game" real,"Date" text,"Opponent" text,"Score" text,"First Star" text,"Decision" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Decision" FROM table_29604 WHERE "First Star" = 'V. Lecavalier'
count the number of current patients whose age is in their 50s.
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 time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)C...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 50 AND 59
was respiration from patient 013-38992 greater than 19.0 on 12/31/last year?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patientheal...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND vitalperiodic.respiration > 19.0 AND NOT vitalperio...
What are the number of the completion dates of all the tests that have result 'Fail'?, show from high to low by the Y.
CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Student_Course_Enro...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC