instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
how many cases of multivitamins prescriptions have occurred until 2 years ago?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabe...
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-2 year')
when there were 48 32 clubs?
CREATE TABLE table_63484 ("Round" text,"Main date" text,"Number of fixtures" real,"Clubs" text,"New entries this round" text)
SELECT "New entries this round" FROM table_63484 WHERE "Clubs" = '48 → 32'
Who won the gold in 1958?
CREATE TABLE table_49626 ("Year" text,"Gold" text,"Silver" text,"Bronze" text,"Host city / cities" text,"Host country / countries" text)
SELECT "Gold" FROM table_49626 WHERE "Year" = '1958'
What is the attendance in the bye week after week 5?
CREATE TABLE table_name_40 (attendance VARCHAR,week VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_name_40 WHERE week > 5 AND opponent = "bye"
Find the id and star rating of each hotel and sort them in increasing order of price.
CREATE TABLE tourist_attraction_features (tourist_attraction_id number,feature_id number)CREATE TABLE shops (shop_id number,shop_details text)CREATE TABLE royal_family (royal_family_id number,royal_family_details text)CREATE TABLE hotels (hotel_id number,star_rating_code text,pets_allowed_yn text,price_range number,oth...
SELECT hotel_id, star_rating_code FROM hotels ORDER BY price_range
What is the country that has the format of cd, the label of sony music and the catalogue no sicp-2055?
CREATE TABLE table_name_61 (country VARCHAR,catalogue_no VARCHAR,format VARCHAR,label VARCHAR)
SELECT country FROM table_name_61 WHERE format = "cd" AND label = "sony music" AND catalogue_no = "sicp-2055"
What was the number of high assists for game 1?
CREATE TABLE table_name_94 (high_assists VARCHAR,game VARCHAR)
SELECT high_assists FROM table_name_94 WHERE game = 1
Give me the proportion about the location of each party with a pie chart.
CREATE TABLE party (Party_ID int,Party_Theme text,Location text,First_year text,Last_year text,Number_of_hosts int)CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)CREATE TABLE host (Host_ID int,Name text,Nationality text,Age text)
SELECT Location, COUNT(Location) FROM party GROUP BY Location
Which event has a Method of submission (triangle choke), and an Opponent of thiago tavares?
CREATE TABLE table_name_33 (event VARCHAR,method VARCHAR,opponent VARCHAR)
SELECT event FROM table_name_33 WHERE method = "submission (triangle choke)" AND opponent = "thiago tavares"
show flights from NEW YORK to LAS VEGAS
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, flight 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.city_name = 'LAS V...
What is the palce number of Russia, which has 6 ropes of 19.425 and a total less than 38.925?
CREATE TABLE table_34375 ("Place" real,"Nation" text,"6 Ropes" real,"4 Hoops,2 Clubs" real,"Total" real)
SELECT SUM("Place") FROM table_34375 WHERE "6 Ropes" = '19.425' AND "Nation" = 'russia' AND "Total" < '38.925'
Find the number of tweets in record.
CREATE TABLE user_profiles (uid number,name text,email text,partitionid number,followers number)CREATE TABLE follows (f1 number,f2 number)CREATE TABLE tweets (id number,uid number,text text,createdate time)
SELECT COUNT(*) FROM tweets
What is the result on November 1, 1992?
CREATE TABLE table_name_53 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_53 WHERE date = "november 1, 1992"
What is the average ties when the team is montreal victorias and the games played is more than 8?
CREATE TABLE table_name_73 (ties INTEGER,team VARCHAR,games_played VARCHAR)
SELECT AVG(ties) FROM table_name_73 WHERE team = "montreal victorias" AND games_played > 8
Who is the monarch when became heir; reason is 13 july 1783 father succeeded?
CREATE TABLE table_28720 ("Monarch" text,"Heir" text,"Status" text,"Relationship to Monarch" text,"Became heir; reason" text,"Ceased to be heir; reason" text,"Next in succession" text)
SELECT "Monarch" FROM table_28720 WHERE "Became heir; reason" = '13 July 1783 father succeeded'
What is Example Spelled Free, when Example Spelled Checked is 'op / p/ ('on')'?
CREATE TABLE table_78608 ("Letter" text,"Pronunciation spelled free" text,"Pronunciation spelled checked" text,"Example spelled free" text,"Example spelled checked" text)
SELECT "Example spelled free" FROM table_78608 WHERE "Example spelled checked" = 'op /ɔp/ ("on")'
Name the result for lukas smital and home
CREATE TABLE table_21348 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text,"Man of the Match" text)
SELECT "Result" FROM table_21348 WHERE "Man of the Match" = 'Lukas Smital' AND "Venue" = 'Home'
When was the average year that the number of floors was greater than 75?
CREATE TABLE table_name_78 (year INTEGER,floors INTEGER)
SELECT AVG(year) FROM table_name_78 WHERE floors > 75
what is the maximum norwegian americans (2000) where norwegian americans (1990) is 9170
CREATE TABLE table_17229 ("State" text,"Norwegian Americans (1980)" real,"Percent (1980)" text,"Norwegian Americans (1990)" real,"Percent (1990)" text,"Norwegian Americans (2000)" real,"Percent (2000)" text,"Norwegian Americans (2009)" real,"Percent (2009)" text)
SELECT MAX("Norwegian Americans (2000)") FROM table_17229 WHERE "Norwegian Americans (1990)" = '9170'
What size was the crowd when Hawthorn was the home team?
CREATE TABLE table_name_62 (crowd VARCHAR,home_team VARCHAR)
SELECT COUNT(crowd) FROM table_name_62 WHERE home_team = "hawthorn"
what is the title of the first track on the best of benassi bros greatest hit album ?
CREATE TABLE table_203_771 (id number,"#" number,"artist" text,"featuring" text,"title" text,"version" text,"length" text)
SELECT "title" FROM table_203_771 ORDER BY "#" LIMIT 1
what are the four most frequently prescribed drugs for patients who were also prescribed oxycodone-acetaminophen elixir previously during the same month until 2104?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_procedures (r...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxycodone-acetaminophen elixir' AND STRFTIME('%y', prescriptions....
Who was the runner-up at the Broadmoor Arena before 2008?
CREATE TABLE table_64556 ("Year" real,"Champion" text,"Score" text,"Runner-up" text,"City" text,"Arena" text)
SELECT "Runner-up" FROM table_64556 WHERE "Year" < '2008' AND "Arena" = 'broadmoor arena'
What was the home team score when the away team was Carlton?
CREATE TABLE table_name_43 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team AS score FROM table_name_43 WHERE away_team = "carlton"
Show the title and score of the movie with a bar chart, and I want to show Y-axis in descending order.
CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars DESC
how many patients whose admission type is urgent and procedure short title is hemodialysis?
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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Hemodialysis"
How many viewers saw the episode written by kevin biegel & bill lawrence?
CREATE TABLE table_27987623_1 (us_viewers__in_million_ VARCHAR,written_by VARCHAR)
SELECT us_viewers__in_million_ FROM table_27987623_1 WHERE written_by = "Kevin Biegel & Bill Lawrence"
What's the bronze medal count for Rank 33 when the silver count was less than 2 and the total was more than 4?
CREATE TABLE table_64195 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_64195 WHERE "Silver" < '2' AND "Total" > '4' AND "Rank" = '33'
What is Constellation, when HD Designation is 'HD197076'?
CREATE TABLE table_name_82 (constellation VARCHAR,hd_designation VARCHAR)
SELECT constellation FROM table_name_82 WHERE hd_designation = "hd197076"
How many years have 78 for points?
CREATE TABLE table_name_24 (year VARCHAR,points VARCHAR)
SELECT COUNT(year) FROM table_name_24 WHERE points = 78
Show me a bar chart with the product name and their frequency.
CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50))CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(15),product_name VARCHAR(80),product_price DOUBLE)CREATE TABLE Customer_Addres...
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute headquarter.
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
when was the last time that patient 1902 has the minimum bicarbonate since 47 months ago?
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 text,ethnicity text,age number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id nu...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-47...
What is City, when ASTC Member is No, when State is California, and when AAM Member is Yes?
CREATE TABLE table_name_62 (city VARCHAR,aam_member VARCHAR,astc_member VARCHAR,state VARCHAR)
SELECT city FROM table_name_62 WHERE astc_member = "no" AND state = "california" AND aam_member = "yes"
What is the sum of Overall, when College is 'Arkansas State', and when Pick is less than 17?
CREATE TABLE table_name_22 (overall INTEGER,college VARCHAR,pick VARCHAR)
SELECT SUM(overall) FROM table_name_22 WHERE college = "arkansas state" AND pick < 17
Does the s35 model have bluetooth?
CREATE TABLE table_60168 ("Model" text,"Screen size" text,"Bluetooth" text,"FM transmitter" text,"Flash" text)
SELECT "Bluetooth" FROM table_60168 WHERE "Model" = 's35'
how many silver medals did satheesha rai win according to the table ?
CREATE TABLE table_204_103 (id number,"medal" text,"name" text,"sport" text,"event" text)
SELECT COUNT("medal") FROM table_204_103 WHERE "name" = 'satheesha rai'
What is the IUPAC name for chloroform?
CREATE TABLE table_35703 ("Molecular formula" text,"IUPAC name" text,"CAS registry number" text,"Common name" text,"Other names" text)
SELECT "IUPAC name" FROM table_35703 WHERE "Common name" = 'chloroform'
What date has 104-113 as the score?
CREATE TABLE table_name_17 (date VARCHAR,score VARCHAR)
SELECT date FROM table_name_17 WHERE score = "104-113"
What location did the event kotc: mortal sins take place?
CREATE TABLE table_77287 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Location" FROM table_77287 WHERE "Event" = 'kotc: mortal sins'
What date was the match against carlisle united?
CREATE TABLE table_name_65 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_65 WHERE away_team = "carlisle united"
Plot the total number by grouped by country as a bar graph, and could you rank by the x-axis in desc?
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)CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country DESC
when was the first time patient 78221 was prescribed medicine via po route until 08/2101?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type t...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' ORDER BY prescriptions.startdate LIMIT 1
provide the number of patients whose language is port and days of hospital stay is greater than 3?
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.language = "PORT" AND demographic.days_stay > "3"
what category is for tom shankland, director?
CREATE TABLE table_name_56 (category VARCHAR,director_s_ VARCHAR)
SELECT category FROM table_name_56 WHERE director_s_ = "tom shankland"
Who held the same position in 2014 that Danielle Button held in 2013?
CREATE TABLE table_name_49 (Id VARCHAR)
SELECT 2014 FROM table_name_49 WHERE 2013 = "danielle button"
what was the last intake given to patient 013-28507 today.
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 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 = '013-28507')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
What is the lowest week that has Minnesota Vikings as the opponent?
CREATE TABLE table_name_75 (week INTEGER,opponent VARCHAR)
SELECT MIN(week) FROM table_name_75 WHERE opponent = "minnesota vikings"
Who was responsible for the design of the Jasper National Park theme?
CREATE TABLE table_11900773_5 (design VARCHAR,theme VARCHAR)
SELECT design FROM table_11900773_5 WHERE theme = "Jasper National Park"
give me the five most common output events since 2 years ago?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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)C...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5)
how many people died after being diagnosed with ac stomach ulcer w hem within 2 months during this year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom te...
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 much did the home team Hawthorn score?
CREATE TABLE table_53982 ("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_53982 WHERE "Home team" = 'hawthorn'
What is Year(s) Won, when Total is '145', and when Country is 'United States'?
CREATE TABLE table_name_40 (year_s__won VARCHAR,total VARCHAR,country VARCHAR)
SELECT year_s__won FROM table_name_40 WHERE total = 145 AND country = "united states"
Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.
CREATE TABLE checking (balance VARCHAR,custid VARCHAR)CREATE TABLE savings (balance VARCHAR,custid VARCHAR)
SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance
How many games drawn for the team that lost 11 and had 748 points?
CREATE TABLE table_1676073_12 (drawn VARCHAR,lost VARCHAR,points_for VARCHAR)
SELECT drawn FROM table_1676073_12 WHERE lost = "11" AND points_for = "748"
If the song choice is Coba and the order number is 10, what is the result?
CREATE TABLE table_25261 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Result" FROM table_25261 WHERE "Order #" = '10' AND "Song choice" = 'Coba'
What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
CREATE TABLE customer_orders (order_id number,customer_id number,order_status text,order_date time,order_details text)CREATE TABLE customers (customer_id number,payment_method text,customer_name text,date_became_customer time,other_customer_details text)CREATE TABLE customer_contact_channels (customer_id number,channel...
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
When is the appointment date for outgoing manager Petrik Sander?
CREATE TABLE table_name_60 (date_of_appointment VARCHAR,outgoing_manager VARCHAR)
SELECT date_of_appointment FROM table_name_60 WHERE outgoing_manager = "petrik sander"
Show me minimal weight by sex in a histogram, order total number from high to low order.
CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY MIN(Weight) DESC
What was the score of the game played on December 17, with a H/A/N of H?
CREATE TABLE table_8036 ("Date" text,"H/A/N" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_8036 WHERE "H/A/N" = 'h' AND "Date" = 'december 17'
Which venue hosted South Melbourne?
CREATE TABLE table_32936 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_32936 WHERE "Away team" = 'south melbourne'
how many parts does detroit red wings person urban nordin play
CREATE TABLE table_30571 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT COUNT("Position") FROM table_30571 WHERE "NHL team" = 'Detroit Red Wings' AND "Player" = 'Urban Nordin'
Which venue had a city of Manchester before 2003?
CREATE TABLE table_39573 ("Score" text,"Opposition" text,"Venue" text,"City" text,"Year" real)
SELECT "Venue" FROM table_39573 WHERE "City" = 'manchester' AND "Year" < '2003'
What is the Original Title of the movie directed by Aigars Grauba?
CREATE TABLE table_name_36 (original_title VARCHAR,director VARCHAR)
SELECT original_title FROM table_name_36 WHERE director = "aigars grauba"
what is procedure long title of subject id 29541?
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 procedures.long_title FROM procedures WHERE procedures.subject_id = "29541"
What is High Rebounds, when Game is greater than 33, and when Score is 'W 132-101'?
CREATE TABLE table_48438 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_48438 WHERE "Game" > '33' AND "Score" = 'w 132-101'
What's the old bulgarian word for ?
CREATE TABLE table_6465 ("English name" text,"Bulgarian name" text,"Bulgarian name (Transliteration)" text,"Old Bulgarian Names" text,"Old Bulgarian name (Transliteration)" text,"Old Bulgarian name - Meaning" text)
SELECT "Old Bulgarian name - Meaning" FROM table_6465 WHERE "Old Bulgarian Names" = 'тръвен'
Show the average of artists' age by country, I want to rank Y in ascending order.
CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY AVG(Age)
How many losses has more than 59 goals against and more than 17 position?
CREATE TABLE table_67968 ("Position" real,"Club" text,"Played" real,"Points" text,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MIN("Losses") FROM table_67968 WHERE "Goals against" > '59' AND "Position" > '17'
What is the Black (Hispanic/Non-Hispanic) value having a white (Hispanic/Non-Hispanic) under 80.6, Asian (Hispanic/Non-Hispanic) of 0.1, Amerindian (Hispanic/Non-Hispanic) under 0.6000000000000001, and municipality of Vega Baja?
CREATE TABLE table_name_63 (black__both_hispanic_and_non_hispanic_ VARCHAR,municipality__2010_ VARCHAR,amerindian__both_hispanic_and_non_hispanic_ VARCHAR,white__both_hispanic_and_non_hispanic_ VARCHAR,n_asia__both_hispanic_and_non_hispanic_ VARCHAR)
SELECT black__both_hispanic_and_non_hispanic_ FROM table_name_63 WHERE white__both_hispanic_and_non_hispanic_ < 80.6 AND n_asia__both_hispanic_and_non_hispanic_ = 0.1 AND amerindian__both_hispanic_and_non_hispanic_ < 0.6000000000000001 AND municipality__2010_ = "vega baja"
How many different writers have written the episode with series number 8?
CREATE TABLE table_26439 ("No. by series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production number" real,"U.S. viewers (in millions)" text)
SELECT COUNT("Written by") FROM table_26439 WHERE "No. by series" = '8'
List phone number and email address of customer with more than 2000 outstanding balance.
CREATE TABLE customers (customer_id number,customer_address_id number,customer_status_code text,date_became_customer time,date_of_birth time,first_name text,last_name text,amount_outstanding number,email_address text,phone_number text,cell_mobile_phone_number text)CREATE TABLE lessons (lesson_id number,customer_id numb...
SELECT phone_number, email_address FROM customers WHERE amount_outstanding > 2000
What's the Bronze with the Year of 1998?
CREATE TABLE table_74891 ("Year" real,"Location" text,"Gold" text,"Silver" text,"Bronze" text)
SELECT "Bronze" FROM table_74891 WHERE "Year" = '1998'
how many patients whose admission year is less than 2187 and drug route is tp?
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 procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2187" AND prescriptions.route = "TP"
What site has an orbit of Leo, a decay (UTC) of still in orbit, and a magnetosphere research?
CREATE TABLE table_58347 ("Date and time (UTC)" text,"Rocket" text,"Site" text,"Orbit" text,"Function" text,"Decay (UTC)" text)
SELECT "Site" FROM table_58347 WHERE "Orbit" = 'leo' AND "Decay ( UTC )" = 'still in orbit' AND "Function" = 'magnetosphere research'
How many states-first place are there for the office of Governor?
CREATE TABLE table_23632 ("Candidate" text,"Office" text,"Home state" text,"Popular vote" real,"States \u2013 first place" real,"States \u2013 second place" real,"States \u2013 third place" text)
SELECT COUNT("States \u2013 first place") FROM table_23632 WHERE "Office" = 'Governor'
Which club has fewer than 40 seasons in Liga MX and 65 seasons in the top division?
CREATE TABLE table_name_32 (club VARCHAR,number_of_seasons_in_liga_mx VARCHAR,number_of_seasons_in_top_division VARCHAR)
SELECT club FROM table_name_32 WHERE number_of_seasons_in_liga_mx < 40 AND number_of_seasons_in_top_division = 65
What was the record against Boston?
CREATE TABLE table_20294 ("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_20294 WHERE "Team" = 'Boston'
What is the number eliminated for the person with a time of 12:38?
CREATE TABLE table_40331 ("Eliminated" text,"Wrestler" text,"Entered" real,"Eliminated by" text,"Time" text)
SELECT "Eliminated by" FROM table_40331 WHERE "Time" = '12:38'
Where is the location of a team with a 3-2 record?
CREATE TABLE table_51763 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text)
SELECT "Location" FROM table_51763 WHERE "Record" = '3-2'
how many patients had the diagnosis short title encephalopathy nos
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS"
What is the method of resolution for the fight against akihiro gono?
CREATE TABLE table_name_31 (method VARCHAR,opponent VARCHAR)
SELECT method FROM table_name_31 WHERE opponent = "akihiro gono"
Tell me the number of gold for albania with a silver of 1 and total less than 1
CREATE TABLE table_51648 ("Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_51648 WHERE "Silver" = '1' AND "Nation" = 'albania' AND "Total" < '1'
What is the order number for the theme of Mariah Carey?
CREATE TABLE table_1333 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Order #" FROM table_1333 WHERE "Theme" = 'Mariah Carey'
what was the difference between the number of laps alex figge completed and the number of laps that will power completed ?
CREATE TABLE table_203_761 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT ABS((SELECT "laps" FROM table_203_761 WHERE "driver" = 'alex figge') - (SELECT "laps" FROM table_203_761 WHERE "driver" = 'will power'))
how many days have passed since first time on their current hospital visit patient 60136 stayed in the ward 14?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL)) AND transfers....
When is the earliest year the venue is in gothenburg, sweden?
CREATE TABLE table_name_69 (year INTEGER,venue VARCHAR)
SELECT MIN(year) FROM table_name_69 WHERE venue = "gothenburg, sweden"
On what date did Aymo Maggi win the Rome Grand Prix ?
CREATE TABLE table_name_6 (date VARCHAR,winning_driver VARCHAR,name VARCHAR)
SELECT date FROM table_name_6 WHERE winning_driver = "aymo maggi" AND name = "rome grand prix"
How many years have a Player name of ronnie bull?
CREATE TABLE table_67763 ("Year" real,"Pick" text,"Player name" text,"College" text,"Position" text)
SELECT SUM("Year") FROM table_67763 WHERE "Player name" = 'ronnie bull'
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 phone_number and manager_id .
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
What is the outgoing manager when the date of vacancy is 10 october 2010?
CREATE TABLE table_29717 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Table" text,"Incoming manager" text,"Date of appointment" text)
SELECT "Outgoing manager" FROM table_29717 WHERE "Date of vacancy" = '10 October 2010'
how many patients under the age of 58 had hemodialysis?
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 WHERE demographic.age < "58" AND procedures.long_title = "Hemodialysis"
Top Total Score From Comments.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id nu...
SELECT UserId AS "user_link", SUM(Score) AS "total_score", COUNT(*) AS "#comments" FROM Comments WHERE UserId IN ('##UserID##') GROUP BY UserId ORDER BY SUM(Score) DESC
What is the score of the match with deportes savio as the away team?
CREATE TABLE table_name_57 (score VARCHAR,away VARCHAR)
SELECT score FROM table_name_57 WHERE away = "deportes savio"
What was the outcome for the match at the leipzig tournament with a score w/o?
CREATE TABLE table_34783 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Outcome" FROM table_34783 WHERE "Tournament" = 'leipzig' AND "Score" = 'w/o'
Shell looks for data in tables and joins some..
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 PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate...
SELECT Posts.Id, Posts.Score, Posts.ParentId FROM Posts JOIN Comments ON Posts.Id = Comments.PostId
Show different teams of technicians and the number of technicians in each team with a bar chart, and order Y in ascending order.
CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE repair_assignm...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*)
what is the date for the game in prague for the world group, consolation round competition?
CREATE TABLE table_78157 ("Year" text,"Competition" text,"Date" text,"Location" text,"Score" text,"Result" text)
SELECT "Date" FROM table_78157 WHERE "Location" = 'prague' AND "Competition" = 'world group, consolation round'
Which Label has a Country of canada, and a Format of cd/digital download?
CREATE TABLE table_60537 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue number(s)" text)
SELECT "Label" FROM table_60537 WHERE "Country" = 'canada' AND "Format" = 'cd/digital download'
when was patient 006-254182 prescribed thiamine 100 mg tab last in 05/last year?
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 medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND medication.drugname = 'thiamine 100 mg tab' ...