instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
has patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugn... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitaldischargetime IS NULL)) AND tr... |
get me the number of patients with self pay health insurance who were hospitalized for more than 29 days. | 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.insurance = "Self Pay" AND demographic.days_stay > "29" |
Who is safe if John and Nicole are eliminated? | CREATE TABLE table_12305325_4 (safe VARCHAR,eliminated VARCHAR) | SELECT safe FROM table_12305325_4 WHERE eliminated = "John and Nicole" |
i'd like flights going from BOSTON to ATLANTA leaving on 8 6 in the afternoon | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 6 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_n... |
What are the number of the first names of all students in Smith Hall?, and sort by the how many fname in asc. | CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Student (StuI... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) |
What is the average area that has a Capital of camag ey, with a Population (%) larger than 7.02? | CREATE TABLE table_name_25 (area__km²_ INTEGER,capital VARCHAR,population___percentage_ VARCHAR) | SELECT AVG(area__km²_) FROM table_name_25 WHERE capital = "camagüey" AND population___percentage_ > 7.02 |
How long is the UK's Ballochmyle Viaduct? | CREATE TABLE table_12777 ("Name" text,"Location" text,"Land" text,"Longest span in s metre (feet)" text,"Arch type" text,"Completed" text) | SELECT "Longest span in s metre ( feet )" FROM table_12777 WHERE "Land" = 'uk' AND "Name" = 'ballochmyle viaduct' |
What is the score of the game against away team queens park rangers on 23 january 1982? | CREATE TABLE table_name_63 (score VARCHAR,date VARCHAR,away_team VARCHAR) | SELECT score FROM table_name_63 WHERE date = "23 january 1982" AND away_team = "queens park rangers" |
How many people attended the game of a.f.c. totton? | CREATE TABLE table_11090 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Attendance" FROM table_11090 WHERE "Home team" = 'a.f.c. totton' |
i'd like to book the cheapest flight from ATLANTA to DENVER on 8 1 | CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE ground_service (city_code text,airpo... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, sort Y-axis from low to high order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 (EM... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(SALARY) |
What is the 100 year when 500 year is 153? | CREATE TABLE table_73268 ("Gas name" text,"Chemical formula" text,"Lifetime (years)" text,"20-yr" text,"100-yr" text,"500-yr" text) | SELECT "100-yr" FROM table_73268 WHERE "500-yr" = '153' |
what was the total attendance at the august 30 game against alabama ? | CREATE TABLE table_204_858 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT "attendance" FROM table_204_858 WHERE "date" = 'august 30' AND "opponent#" = 'alabama' |
Which team was in the 2012 clausura tournament? | CREATE TABLE table_74453 ("Tournament" text,"Player" text,"Nationality" text,"Team" text,"Games played" real,"Goals conceded" real,"Coefficient" text) | SELECT "Team" FROM table_74453 WHERE "Tournament" = '2012 Clausura' |
For each year, return the year and the average number of attendance at home games. | CREATE TABLE salary (year number,team_id text,league_id text,player_id text,salary number)CREATE TABLE postseason (year number,round text,team_id_winner text,league_id_winner text,team_id_loser text,league_id_loser text,wins number,losses number,ties number)CREATE TABLE manager_award_vote (award_id text,year number,lea... | SELECT year, AVG(attendance) FROM home_game GROUP BY year |
Which loss was on June 13? | CREATE TABLE table_70635 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Loss" FROM table_70635 WHERE "Date" = 'june 13' |
What percentage of people voted for Obama in Burlington? | CREATE TABLE table_20278716_2 (obama__percentage VARCHAR,county VARCHAR) | SELECT obama__percentage FROM table_20278716_2 WHERE county = "Burlington" |
A total larger than 302 and playoffs of 35 also list the total of regular seasons as what? | CREATE TABLE table_name_41 (regular_season INTEGER,playoffs VARCHAR,total VARCHAR) | SELECT SUM(regular_season) FROM table_name_41 WHERE playoffs = 35 AND total > 302 |
Which institution is private/catholic? | CREATE TABLE table_name_55 (institution VARCHAR,affiliation VARCHAR) | SELECT institution FROM table_name_55 WHERE affiliation = "private/catholic" |
What is the average height with the Highest mountain of hochgall? | CREATE TABLE table_name_54 (height__m_ INTEGER,highest_mountain VARCHAR) | SELECT AVG(height__m_) FROM table_name_54 WHERE highest_mountain = "hochgall" |
Show the race class and number of races in each class. | CREATE TABLE track (track_id number,name text,location text,seating number,year_opened number)CREATE TABLE race (race_id number,name text,class text,date text,track_id text) | SELECT class, COUNT(*) FROM race GROUP BY class |
Who is the third alternate for Germany? | CREATE TABLE table_53952 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text,"Alternate" text) | SELECT "Third" FROM table_53952 WHERE "Nation" = 'germany' |
what is average days of hospital stay of patients whose year of birth is greater than 2071? | 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 AVG(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2071" |
Which Year that has Notes of dnf? | CREATE TABLE table_42035 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Notes" text) | SELECT MIN("Year") FROM table_42035 WHERE "Notes" = 'dnf' |
What was the loss for Boris Picano-Nacci? | CREATE TABLE table_75985 ("Name" text,"Country" text,"Date(s)" text,"Loss" text,"Institution" text,"Market activity" text) | SELECT "Loss" FROM table_75985 WHERE "Name" = 'boris picano-nacci' |
Show the location codes and the number of documents in each location. Visualize by bar chart. | CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE Ref_Calendar (Calendar_Date DATETIME,Day_Number INTEGER)CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code |
What is the proportion of classes of all races? Give me a pie chart. | CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real) | SELECT Class, COUNT(Class) FROM race GROUP BY Class |
Which faith has a name of Belswains? | CREATE TABLE table_name_40 (faith VARCHAR,name VARCHAR) | SELECT faith FROM table_name_40 WHERE name = "belswains" |
Which Total is the highest one that has a Gold of 1, and a Nation of czechoslovakia? | CREATE TABLE table_name_29 (total INTEGER,gold VARCHAR,nation VARCHAR) | SELECT MAX(total) FROM table_name_29 WHERE gold = 1 AND nation = "czechoslovakia" |
who was the last character on bbc to be hiv positive ? | CREATE TABLE table_203_293 (id number,"years of appearance" text,"title" text,"network" text,"character name" text,"actor" text,"notes" text) | SELECT "character name" FROM table_203_293 WHERE "network" = 'bbc' ORDER BY "years of appearance" DESC LIMIT 1 |
which Streak has a Location/Attendance of staples center, and a Score of 67 89? | CREATE TABLE table_12529 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Streak" text) | SELECT "Streak" FROM table_12529 WHERE "Location/Attendance" = 'staples center' AND "Score" = '67–89' |
How many breadth entries are there when propulsion is jet? | CREATE TABLE table_28132970_5 (breadth VARCHAR,propulsion VARCHAR) | SELECT COUNT(breadth) FROM table_28132970_5 WHERE propulsion = "Jet" |
What was the 2nd leg score for Chemie Halle? | CREATE TABLE table_name_73 (team__number1 VARCHAR) | SELECT 2 AS nd_leg FROM table_name_73 WHERE team__number1 = "chemie halle" |
What is the date when the document 'Marry CV' was stored? | CREATE TABLE All_documents (date_stored VARCHAR,Document_name VARCHAR) | SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV" |
what is the total number of patients who had other exploration and decompression of spinal canal? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other exploration and decompression of spinal canal" |
please book for me a flight on TW from WASHINGTON to SAN FRANCISCO earliest possible time | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE days (days_code ... | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S... |
Who was the away team when the home team scored 17.17 (119)? | CREATE TABLE table_4516 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_4516 WHERE "Home team score" = '17.17 (119)' |
What team played in the 1964 Tokyo Games? | CREATE TABLE table_6154 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text) | SELECT "Name" FROM table_6154 WHERE "Games" = '1964 tokyo' |
how long os the longest track on the album ? | CREATE TABLE table_203_38 (id number,"#" number,"title" text,"producer(s)" text,"performer(s)" text,"length" text) | SELECT "length" FROM table_203_38 ORDER BY "length" DESC LIMIT 1 |
What other questions do Favoriters like?. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score nu... | SELECT Posts.Id AS "post_link", Posts.Score AS "score", COUNT(1) AS "favorited_by" FROM Votes AS "favorited_post" JOIN Votes AS "other_favorites" ON 'favorited_post'.UserId = 'other_favorites'.UserId JOIN Posts ON 'other_favorites'.PostId = Posts.Id WHERE 'favorited_post'.VoteTypeId = @FavoriteType AND 'other_favorites... |
Bar chart of total number of number of platforms from each location, could you show in descending by the y-axis please? | CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train_station (Train_ID int,Station_ID int) | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC |
What is the production code of the episode written by Jeff Filgo? | CREATE TABLE table_30180 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real) | SELECT MAX("Production code") FROM table_30180 WHERE "Written by" = 'Jeff Filgo' |
What is the L2 cache for the Mobile Pentium 333? | CREATE TABLE table_name_48 (l2_cache VARCHAR,model_number VARCHAR) | SELECT l2_cache FROM table_name_48 WHERE model_number = "mobile pentium 333" |
Name the oberliga for where tsv 1860 munich and borussia neunkirchen | CREATE TABLE table_967 ("Season" text,"Oberliga Bayern" text,"Oberliga Hessen" text,"Oberliga Baden-W\u00fcrttemberg" text,"Oberliga S\u00fcdwest" text) | SELECT "Oberliga Baden-W\u00fcrttemberg" FROM table_967 WHERE "Oberliga Bayern" = 'TSV 1860 Munich' AND "Oberliga S\u00fcdwest" = 'Borussia Neunkirchen' |
How many caps have a Date of Birth (Age) of 15 july 1981? | CREATE TABLE table_77715 ("Player" text,"Position" text,"Date of Birth (Age)" text,"Caps" real,"Club/province" text) | SELECT COUNT("Caps") FROM table_77715 WHERE "Date of Birth (Age)" = '15 july 1981' |
What is the highest rank for ben crenshaw after winning more than 14 times? | CREATE TABLE table_34219 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Wins" real) | SELECT MAX("Rank") FROM table_34219 WHERE "Player" = 'ben crenshaw' AND "Wins" > '14' |
What was the dominant religion (2002) of the Mala Remeta settlement? | CREATE TABLE table_27890 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text) | SELECT "Dominant religion (2002)" FROM table_27890 WHERE "Settlement" = 'Mala Remeta' |
How many draws were there when the conceded goals was numbered at 45? | CREATE TABLE table_18018248_2 (draws VARCHAR,goals_conceded VARCHAR) | SELECT COUNT(draws) FROM table_18018248_2 WHERE goals_conceded = 45 |
What is the name of the person with a total of 22? | CREATE TABLE table_name_6 (name VARCHAR,total VARCHAR) | SELECT name FROM table_name_6 WHERE total = 22 |
What is the album number for the record , simplified from the traditional Chinese name? | CREATE TABLE table_name_66 (album_number VARCHAR,chinese__simplified_ VARCHAR) | SELECT album_number FROM table_name_66 WHERE chinese__simplified_ = "情歌没有告诉你" |
find the number of patients on iv bolus route of drug administration who are married. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "MARRIED" AND prescriptions.route = "IV BOLUS" |
what number of patients diagnosed under icd9 code 78720 had government insurance? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,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,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "78720" |
What is the lowest rank from Great Britain with a time of 2:10.33? | CREATE TABLE table_name_40 (rank INTEGER,nationality VARCHAR,time VARCHAR) | SELECT MIN(rank) FROM table_name_40 WHERE nationality = "great britain" AND time = "2:10.33" |
Name the average gold for czech republic and bronze less than 1 when total is less than 14 | CREATE TABLE table_name_62 (gold INTEGER,nation VARCHAR,total VARCHAR,bronze VARCHAR) | SELECT AVG(gold) FROM table_name_62 WHERE total < 14 AND bronze < 1 AND nation = "czech republic" |
Who was the previous champion of the title won on July 7, 2010? | CREATE TABLE table_68146 ("Championship" text,"Champion(s)" text,"Previous champion(s)" text,"Date Won" text,"Location" text) | SELECT "Previous champion(s)" FROM table_68146 WHERE "Date Won" = 'july 7, 2010' |
Get all posts with tags = 'php' & 'javascript' & 'mysql'. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TA... | SELECT * FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId = (SELECT Id FROM Tags WHERE TagName = 'php')) |
what is the number of patients on sl route of drug administration who were diagnosed with accidents occurring in other specified places? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Accident in place NEC" AND prescriptions.route = "SL" |
What is Score, when Group Song is , and when Index is F2? | CREATE TABLE table_40378 ("Index" text,"Name" text,"Song" text,"Group Song" text,"Score" text) | SELECT "Score" FROM table_40378 WHERE "Group Song" = '就是你' AND "Index" = 'f2' |
Who directed the episode with the production code 10? | CREATE TABLE table_27989 ("Series #" real,"Episode title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" real) | SELECT "Directed by" FROM table_27989 WHERE "Prod. code" = '10' |
What is the surface of the match when the outcome was runner-up, and a Score of julia g rges polona hercog? | CREATE TABLE table_name_42 (surface VARCHAR,outcome VARCHAR,score VARCHAR) | SELECT surface FROM table_name_42 WHERE outcome = "runner-up" AND score = "julia görges polona hercog" |
In how many events was Puma 20 and abu dhabi 30? | CREATE TABLE table_26894949_2 (event VARCHAR,puma VARCHAR,abu_dhabi VARCHAR) | SELECT COUNT(event) FROM table_26894949_2 WHERE puma = "20" AND abu_dhabi = "30" |
What is the English word that is abbreviated . .? | CREATE TABLE table_name_23 (english_name VARCHAR,abbr VARCHAR) | SELECT english_name FROM table_name_23 WHERE abbr = "พ.ย." |
which country won swimming track & field when lexington won swimming and madison won volleyball | CREATE TABLE table_20793 ("School Year" text,"Volleyball" text,"Cross Country" text,"Soccer" text,"Tennis" text,"Golf" text,"Basketball" text,"Swimming" text,"Softball" text,"Track & Field" text) | SELECT "Track & Field" FROM table_20793 WHERE "Swimming" = 'Lexington' AND "Volleyball" = 'Madison' |
Show me a bar chart for what is the id and trade name of the medicines can interact with at least 3 enzymes?, and show X in asc order. | CREATE TABLE enzyme (id int,name text,Location text,Product text,Chromosome text,OMIM int,Porphyria text)CREATE TABLE medicine_enzyme_interaction (enzyme_id int,medicine_id int,interaction_type text)CREATE TABLE medicine (id int,name text,Trade_Name text,FDA_approved text) | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name |
What was the Attendance of August 26? | CREATE TABLE table_6294 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Attendance" FROM table_6294 WHERE "Date" = 'august 26' |
What's the total of Games with a Lost that's larger than 2, and has Points that's smaller than 0? | CREATE TABLE table_name_75 (games INTEGER,lost VARCHAR,points VARCHAR) | SELECT SUM(games) FROM table_name_75 WHERE lost > 2 AND points < 0 |
impaired renal function ( creatinine > 2 mg / dl ) at the time of cell therapy | CREATE TABLE table_test_15 ("id" int,"anemia" bool,"cell_therapy" bool,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"body_weight" float,"renal_disease" bool,"creatinine_clearance_cl" float,"active_hepatitis" bool,"chronic_inflammatory_disease" bool,"platelet_count" float,"NOUSE" float) | SELECT * FROM table_test_15 WHERE renal_disease = 1 OR creatinine_clearance_cl > 2 AND cell_therapy = 1 |
What team has a kit manufacturer of Umbro and Eric Cantona as captain? | CREATE TABLE table_name_41 (team VARCHAR,kit_manufacturer VARCHAR,captain VARCHAR) | SELECT team FROM table_name_41 WHERE kit_manufacturer = "umbro" AND captain = "eric cantona" |
Visualize a bar chart for the date and mean humidity for the days with the 3 largest maximum gust speeds. | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time 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 INTEGER,mean_humidity INT... | SELECT date, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
What is the result of the friendly match? | CREATE TABLE table_name_37 (result VARCHAR,competition VARCHAR) | SELECT result FROM table_name_37 WHERE competition = "friendly" |
Which location has the date of October 28? | CREATE TABLE table_26186 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Final Score" text,"Attendance" real,"Record" text) | SELECT "Location" FROM table_26186 WHERE "Date" = 'October 28' |
What is the total number of games at Toronto with less than 31 points? | CREATE TABLE table_49197 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT COUNT("Game") FROM table_49197 WHERE "Location" = 'toronto' AND "Points" < '31' |
What day in february was game 53? | CREATE TABLE table_34600 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text) | SELECT AVG("February") FROM table_34600 WHERE "Game" = '53' |
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, list from low to high by the y axis please. | 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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID v... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) |
What was the 2008 result associated with a 2009 of A and a 2011 of 2R? | CREATE TABLE table_67937 ("Tournament" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2008" FROM table_67937 WHERE "2009" = 'a' AND "2011" = '2r' |
What was the largest ethnic group in so ica? | CREATE TABLE table_27887 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text) | SELECT "Largest ethnic group (2002)" FROM table_27887 WHERE "Settlement" = 'Sočica' |
Which MLS team had a pick number of 32? | CREATE TABLE table_name_3 (mls_team VARCHAR,pick__number VARCHAR) | SELECT mls_team FROM table_name_3 WHERE pick__number = 32 |
What was the time for the man who scored 1 point? | CREATE TABLE table_74574 ("Place" real,"Rider" text,"Country" text,"Machine" text,"Speed" text,"Time" text,"Points" real) | SELECT "Time" FROM table_74574 WHERE "Points" = '1' |
What is the elected status of the Democratic party in 1989? | CREATE TABLE table_1341568_6 (status VARCHAR,party VARCHAR,elected VARCHAR) | SELECT status FROM table_1341568_6 WHERE party = "Democratic" AND elected = "1989" |
flight numbers from MINNEAPOLIS to LONG BEACH on 6 26 | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)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 flight (aircraft_code_sequence text,airline_code varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 26 AND date_day.month_number = 6 AN... |
In the match where Melbourne was the away team, how much did they score? | CREATE TABLE table_name_52 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_52 WHERE away_team = "melbourne" |
Which Date has a Builder of alco schenectady, and a Number larger than 835, and Works number of 56566? | CREATE TABLE table_name_19 (date INTEGER,works_number VARCHAR,builder VARCHAR,number VARCHAR) | SELECT AVG(date) FROM table_name_19 WHERE builder = "alco schenectady" AND number > 835 AND works_number = 56566 |
What was the Winning score for the Mynavi ABC Championship Tournament? | CREATE TABLE table_53824 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Winning score" FROM table_53824 WHERE "Tournament" = 'mynavi abc championship' |
What countries are the female artists who sung in the language Bangla from, and count them by a bar chart, and display Y-axis from high to low order. | CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre varchar2(50))CREATE TABLE files (f_id number(10),artist_name varchar2(50),file_size varchar2(20),duration varchar2(20),formats varchar2(20))CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country va... | SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country DESC |
Finds Posts with images ranked by score. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,Creati... | SELECT Score AS "Score", Id AS "post_link" FROM Posts WHERE PostTypeId = 2 AND Body LIKE '%http://i.imgur.com/%' ORDER BY Score |
in this year, how many patients were prescribed with hydrochlorothiazide within 2 months after receiving appl ext fix-tib/fibula? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE inputevents_cv (row_i... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'appl ext fi... |
What is Team, when Run 3 is 1:24.00? | CREATE TABLE table_10017 ("Rank" text,"Team" text,"Athletes" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text) | SELECT "Team" FROM table_10017 WHERE "Run 3" = '1:24.00' |
What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000? | CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text) | SELECT investor FROM entrepreneur WHERE money_requested > 140000 INTERSECT SELECT investor FROM entrepreneur WHERE money_requested < 120000 |
What was 2009, when 2012 was A, when 2003 was A, and then the Tournament was the Madrid Masters? | CREATE TABLE table_name_18 (tournament VARCHAR) | SELECT 2009 FROM table_name_18 WHERE 2012 = "a" AND 2003 = "a" AND tournament = "madrid masters" |
Which player had 6 assists? | CREATE TABLE table_27569 ("Player" text,"Games Played" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real) | SELECT "Player" FROM table_27569 WHERE "Assists" = '6' |
How many tries were for the 7 lost? | CREATE TABLE table_name_87 (tries_for VARCHAR,lost VARCHAR) | SELECT tries_for FROM table_name_87 WHERE lost = "7" |
What is the highest Jews and others 1? | CREATE TABLE table_25947046_1 (jews_and_others_1 INTEGER) | SELECT MAX(jews_and_others_1) FROM table_25947046_1 |
find out the number of patients with procedure icd9 code 9961 who have been discharged to skilled nursing facility. | 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.discharge_location = "SNF" AND procedures.icd9_code = "9961" |
Which 2010 has a 2009 of 0 / 4? | CREATE TABLE table_name_86 (Id VARCHAR) | SELECT 2010 FROM table_name_86 WHERE 2009 = "0 / 4" |
what is the latitude for the berlin township with a geo id less than 3801706260 | CREATE TABLE table_13343 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" real,"Water (sqmi)" real,"Latitude" real,"Longitude" real,"GEO ID" real,"ANSI code" real) | SELECT COUNT("Latitude") FROM table_13343 WHERE "Township" = 'berlin' AND "GEO ID" < '3801706260' |
In what year was Phil J. Welch first elected? | CREATE TABLE table_755 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "First elected" FROM table_755 WHERE "Incumbent" = 'Phil J. Welch' |
Draw a bar chart about the distribution of Name and Weight , rank by the X in asc. | 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 Name, Weight FROM people ORDER BY Name |
What is the away team from st kilda? | CREATE TABLE table_10272 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_10272 WHERE "Home team" = 'st kilda' |
What is the total average for Rank entries where the Lane listed is smaller than 4 and the Nationality listed is San Marino? | CREATE TABLE table_name_7 (rank INTEGER,lane VARCHAR,nationality VARCHAR) | SELECT AVG(rank) FROM table_name_7 WHERE lane < 4 AND nationality = "san marino" |
What bridge is a pratt pony through truss tyoe bridge? | CREATE TABLE table_45897 ("Name" text,"Listed" text,"Location" text,"County" text,"Type" text) | SELECT "Name" FROM table_45897 WHERE "Type" = 'pratt pony through truss' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.