instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many players are on this list? | CREATE TABLE table_23295 ("#" real,"Player" text,"Age" real,"Australian Open" real,"French Open" real,"Wimbledon" real,"US Open" real) | SELECT MAX("#") FROM table_23295 |
What is the highest debut year for player Joe Youlden, with goals larger than 0? | CREATE TABLE table_13759 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text) | SELECT MAX("Debut year") FROM table_13759 WHERE "Player" = 'joe youlden' AND "Goals" > '0' |
What are the name and level of catalog structure with level number between 5 and 1 Show bar chart, and list names in desc order please. | CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Catalog_Structure (catalog_level... | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_name DESC |
How many patients were diagnosed with mouth and pharyngeal cancer and their lab test status was delta? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Carcinoma in situ of lip, oral cavity, and pharynx" AND lab.flag = "delta" |
how many patients have procedure icd9 code 4562? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4562" |
What percentage of users were using other Mozilla browsers during the period in which 9.00% were using Chrome? | CREATE TABLE table_66076 ("Period" text,"Internet Explorer" text,"Firefox" text,"Chrome" text,"Safari" text,"Opera" text,"Other Mozilla" text,"Mobile" text) | SELECT "Other Mozilla" FROM table_66076 WHERE "Chrome" = '9.00%' |
What was the date of the show titled Beat the Star? | CREATE TABLE table_name_54 (date_aired VARCHAR,title VARCHAR) | SELECT date_aired FROM table_name_54 WHERE title = "beat the star" |
Which Lead has a Skip of ted appelman? | CREATE TABLE table_49160 ("Skip" text,"Third/Vice skip" text,"Second" text,"Lead" text,"City" text) | SELECT "Lead" FROM table_49160 WHERE "Skip" = 'ted appelman' |
What is the Airport with an IATA of TRZ? | CREATE TABLE table_name_51 (airport VARCHAR,iata VARCHAR) | SELECT airport FROM table_name_51 WHERE iata = "trz" |
Which Wins has a Top-5 of 6? | CREATE TABLE table_41697 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT AVG("Wins") FROM table_41697 WHERE "Top-5" = '6' |
what was the first building named as the tallest ? | CREATE TABLE table_203_105 (id number,"name" text,"street address" text,"years as tallest" text,"height\nft (m)" text,"floors" number) | SELECT "name" FROM table_203_105 ORDER BY id LIMIT 1 |
What is the number drawn when 3 have been lost? | CREATE TABLE table_67889 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Try BP" text,"Losing BP" text) | SELECT "Drawn" FROM table_67889 WHERE "Lost" = '3' |
What is the quantity preserved of the e-1 class? | CREATE TABLE table_name_17 (quantity_preserved VARCHAR,class VARCHAR) | SELECT quantity_preserved FROM table_name_17 WHERE class = "e-1" |
Pilot of g.v. alfyorov, and a Record description of altitude with kg (lb) payload, and a Type of mi-10 involved what date? | CREATE TABLE table_75318 ("Date" text,"Type" text,"Record description" text,"Achievement" text,"Pilot" text) | SELECT "Date" FROM table_75318 WHERE "Pilot" = 'g.v. alfyorov' AND "Record description" = 'altitude with kg (lb) payload' AND "Type" = 'mi-10' |
Find the phone number of performer 'Ashley'. | CREATE TABLE customer_orders (order_id number,customer_id number,store_id number,order_date time,planned_delivery_date time,actual_delivery_date time,other_order_details text)CREATE TABLE ref_service_types (service_type_code text,parent_service_type_code text,service_type_description text)CREATE TABLE bookings_services... | SELECT customer_phone FROM performers WHERE customer_name = "Ashley" |
Name the year for anton kriel chris cotillard | CREATE TABLE table_15027 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Year" FROM table_15027 WHERE "Men's doubles" = 'anton kriel chris cotillard' |
Delete me - trial query. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTas... | SELECT CreationDate FROM Comments WHERE UserId = '##UserId##' |
Bar graph to show the total number from different formats | CREATE TABLE genre (g_name varchar2(20),rating varchar2(10),most_popular_in 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 varchar2(20),f_id number(10),... | SELECT formats, COUNT(*) FROM files GROUP BY formats |
What is the sum for the 2000s to date that has 0 in the 1920s? | CREATE TABLE table_7583 ("1900s" real,"1920s" real,"1930s" real,"1940s" real,"1950s" real,"1960s" real,"1970s" real,"1980s" real,"1990s" real,"2000s to date" real,"Total to date" real) | SELECT SUM("2000s to date") FROM table_7583 WHERE "1920s" < '0' |
For each user, return the name and the average rating of reviews given by them Plot them as bar chart, could you display y-axis in ascending order? | CREATE TABLE review (a_id integer,u_id integer,i_id integer,rating integer,rank integer)CREATE TABLE useracct (u_id integer,name varchar(128))CREATE TABLE trust (source_u_id integer,target_u_id integer,trust integer)CREATE TABLE item (i_id integer,title varchar(20)) | SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY AVG(T2.rating) |
I want the average year of | CREATE TABLE table_name_14 (year INTEGER,chinese_title VARCHAR) | SELECT AVG(year) FROM table_name_14 WHERE chinese_title = "敗犬女王" |
provide the number of patients whose diagnoses icd9 code is 78321 and lab test abnormal status is abnormal? | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "78321" AND lab.flag = "abnormal" |
What was total attendance on the day they went 17-7? | CREATE TABLE table_name_17 (attendance VARCHAR,record VARCHAR) | SELECT COUNT(attendance) FROM table_name_17 WHERE record = "17-7" |
who had the high assists when the game was less than 13 and the score was w 75-66? | CREATE TABLE table_76287 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "High assists" FROM table_76287 WHERE "Game" < '13' AND "Score" = 'w 75-66' |
creatinine clearance < 60 ml / min | CREATE TABLE table_train_183 ("id" int,"anemia" bool,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"creatinine_clearance_cl" float,"panel_reactive_antibodies" int,"NOUSE" float) | SELECT * FROM table_train_183 WHERE creatinine_clearance_cl < 60 |
What was the highest home total? | CREATE TABLE table_29310 ("Team" text,"Home Gms" real,"Home Total" real,"Home Avg" real,"Top Home Crowd" text,"Road Gms" real,"Road Total" real,"Road Avg" real,"Overall Gms" real,"Overall Total" real,"Overall Avg" real) | SELECT MAX("Home Total") FROM table_29310 |
what is the number of post for 3rd finished | CREATE TABLE table_204_13 (id number,"finished" text,"post" number,"horse" text,"jockey" text,"trainer" text,"owner" text,"time / behind" text) | SELECT "post" FROM table_204_13 WHERE "finished" = 3 |
let me know the number of newborn patients who have prescription of base type medication. | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug_type = "BASE" |
Give me the comparison about ID over the meter_500 . | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Openin... | SELECT meter_500, ID FROM swimmer |
What was the score where the total points was 50? | CREATE TABLE table_48729 ("Total Points" real,"Score" text,"Premiers" text,"Runners Up" text,"Details" text) | SELECT "Score" FROM table_48729 WHERE "Total Points" = '50' |
When did the episode 1.13 air for the first time? | CREATE TABLE table_30445 ("Episode" text,"Date Aired" text,"Timeslot" text,"Rating" text,"Nightly Rank" real,"Weekly Rank" text) | SELECT "Date Aired" FROM table_30445 WHERE "Episode" = '1.13' |
what is the number of urgent hospital admission patients who have albuterol 0.083% neb soln prescription? | 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.admission_type = "URGENT" AND prescriptions.drug = "Albuterol 0.083% Neb Soln" |
Return the dates of ceremony and the results of all music festivals | CREATE TABLE music_festival (Date_of_ceremony VARCHAR,RESULT VARCHAR) | SELECT Date_of_ceremony, RESULT FROM music_festival |
What market is Wessington Springs in | CREATE TABLE table_18746 ("Frequency" text,"Call sign" text,"Name" text,"Format" text,"Owner" text,"Target city/ market" text,"City of license" text) | SELECT "Target city/ market" FROM table_18746 WHERE "City of license" = 'Wessington Springs' |
What is the average week number of all the matches where less than 22,604 people attended? | CREATE TABLE table_name_75 (week INTEGER,attendance INTEGER) | SELECT AVG(week) FROM table_name_75 WHERE attendance < 22 OFFSET 604 |
Find names and times of trains that run through stations for the local authority Chiltern. | CREATE TABLE station (id number,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id number,day_of_week text,high_temperature number,low_temperature number,precipitation number,wind_speed_mph number)CREATE TABLE train (id number,train_number number,name text,origin text,destinati... | SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" |
What is the horizontal bar score with a pommel horse of n/a, and the position is less than 27, and the parallel bars score is 15.800? | CREATE TABLE table_name_18 (horizontal_bar VARCHAR,parallel_bars VARCHAR,pommel_horse VARCHAR,position VARCHAR) | SELECT horizontal_bar FROM table_name_18 WHERE pommel_horse = "n/a" AND position < 27 AND parallel_bars = "15.800" |
How much has dave stockton earned? | CREATE TABLE table_name_41 (earnings__ INTEGER,player VARCHAR) | SELECT MAX(earnings__) AS $__ FROM table_name_41 WHERE player = "dave stockton" |
Name the total number of qualifiying for race 3 being 3 | CREATE TABLE table_20114 ("Pos." real,"Driver" text,"Qualifying" real,"Race 1" text,"Race 2" text,"Race 3" text,"Points" real) | SELECT COUNT("Qualifying") FROM table_20114 WHERE "Race 3" = '3' |
Stack bar chart of school_id vs All_Home based on acc road, and show in asc by the bar. | 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 ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road |
What date was the opponent in the final Barbara Paulus? | CREATE TABLE table_49579 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Date" FROM table_49579 WHERE "Opponent in the final" = 'barbara paulus' |
What is Country, when Points are more than 12? | CREATE TABLE table_name_30 (country VARCHAR,points INTEGER) | SELECT country FROM table_name_30 WHERE points > 12 |
What is the general classification of the stage 3 with Daniele Bennati as the points classification and Morris Possoni as the young rider classification. | CREATE TABLE table_name_21 (general_classification VARCHAR,stage VARCHAR,points_classification VARCHAR,young_rider_classification VARCHAR) | SELECT general_classification FROM table_name_21 WHERE points_classification = "daniele bennati" AND young_rider_classification = "morris possoni" AND stage = "3" |
What country has OF-1 Locotenent? | CREATE TABLE table_52036 ("Country" text,"OF-5" text,"OF-4" text,"OF-2" text,"OF-1" text) | SELECT "Country" FROM table_52036 WHERE "OF-1" = 'locotenent' |
Compute the total minimal baseprice across decor as a pie chart. | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor |
count the number of patients with drug code nado20 whose lab testfluid is pleural. | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NADO20" AND lab.fluid = "Pleural" |
Name the number of rank for stone park | CREATE TABLE table_25584 ("Rank" real,"Metropolitan area" text,"Principal city" text,"10,000+ places" real,"Densest incorporated place" text,"Density" text) | SELECT COUNT("Rank") FROM table_25584 WHERE "Densest incorporated place" = 'Stone Park' |
In what year was Montenegro the host country? | CREATE TABLE table_26669939_1 (year VARCHAR,host_country VARCHAR) | SELECT year FROM table_26669939_1 WHERE host_country = "Montenegro" |
what's the bubbles with attribute being onpopuphidden | CREATE TABLE table_1507852_5 (bubbles VARCHAR,attribute VARCHAR) | SELECT bubbles FROM table_1507852_5 WHERE attribute = "onpopuphidden" |
How many white ethnic background patients have left internal jugular vein thrombosis left arm edema as their primary disease? | 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 WHERE demographic.ethnicity = "WHITE" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" |
glycated hemoglobin a1c ( hba1c ) levels of at least 8 % up to and including 12 % as reported within 4 weeks of implant placement | CREATE TABLE table_train_260 ("id" int,"leukocyte_deficiencies" bool,"bleeding" int,"hemoglobin_a1c_hba1c" float,"leukocyte_dysfunction" bool,"renal_disease" bool,"hba1c" float,"serum_creatinine" float,"NOUSE" float) | SELECT * FROM table_train_260 WHERE hba1c >= 8 AND hemoglobin_a1c_hba1c <= 12 |
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of salary bin hire_date by time, order by the Y-axis from high to low. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC |
What is the total erp w of class c3, which has a frequency mhz less than 89.9? | CREATE TABLE table_79684 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT COUNT("ERP W") FROM table_79684 WHERE "Class" = 'c3' AND "Frequency MHz" < '89.9' |
how long did nicole fessel take ? | CREATE TABLE table_204_14 (id number,"rank" number,"bib" number,"athlete" text,"country" text,"time" text,"deficit" text,"note" text) | SELECT "time" FROM table_204_14 WHERE "athlete" = 'nicole fessel' |
A bar chart for what are the number of the last names for all scholarship students?, I want to order by the X-axis in ascending. | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE SportsInfo (StuID INTEGER,SportName VARCHAR(32),HoursPerWeek INTEGER,GamesPlayed INTEGER,OnScholarship VARCHAR(1))CREATE TABLE Video_Games (GameID INTEGER,GN... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY LName |
How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine? | CREATE TABLE table_70404 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT SUM("Year") FROM table_70404 WHERE "Entrant" = 'barclay nordica arrows bmw' AND "Engine" = 'cosworth v8' |
Tell me the result for harrogate | CREATE TABLE table_31997 ("Year" real,"Competition" text,"Date" text,"Location" text,"Score" text,"Result" text) | SELECT "Result" FROM table_31997 WHERE "Location" = 'harrogate' |
Where do the US import the most food ? | CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype text,lab text,pestcode text,testclass text,concen number,lod number,conunit text,confmethod text,confmethod2 text,annotate text,quantitate text,mean text,extract text,determin text)CREATE TABLE sampledata15 (sample_pk number,state text,year text,month te... | SELECT MAX(country) FROM sampledata15 |
Who is man of the match for match number 5? | CREATE TABLE table_17103566_1 (man_of_the_match VARCHAR,match_number VARCHAR) | SELECT man_of_the_match FROM table_17103566_1 WHERE match_number = 5 |
what are the top four most frequently diagnosed diagnoses that the patients have received within 2 months after being diagnosed with stroke education given? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'stroke education given') AS t1 JOIN (SEL... |
A pie chart for showing the number of the countries that have managers of age above 50 or below 46. | CREATE TABLE manager (Manager_ID int,Name text,Country text,Working_year_starts text,Age int,Level int)CREATE TABLE railway (Railway_ID int,Railway text,Builder text,Built text,Wheels text,Location text,ObjectNumber text)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE train (Train... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country |
what is the five year survival rate of the pulmonary aspiration patients? | 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 patient (uniquepid text,patienthealthsystemstayid num... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... |
Can you tell me the Rebounds that has the Name of pom baskets jena? | CREATE TABLE table_name_27 (rebounds VARCHAR,name VARCHAR) | SELECT rebounds FROM table_name_27 WHERE name = "pom baskets jena" |
What is the transfer window of the Leeds United source with a move from Motherwell? | CREATE TABLE table_name_52 (transfer_window VARCHAR,source VARCHAR,moving_from VARCHAR) | SELECT transfer_window FROM table_name_52 WHERE source = "leeds united" AND moving_from = "motherwell" |
Give me a histogram for what are the naems of all the projects, and how many scientists were assigned to each of them?, I want to list names in desc order. | CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Scientists (SSN int,Name Char(30)) | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC |
What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges? | CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text) | SELECT T1.pname, T2.cname FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes' |
WHAT IS THE HOME TEAM ON APRIL 25? | CREATE TABLE table_76823 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Home Team" FROM table_76823 WHERE "Date" = 'april 25' |
Name the country for 11,891 area | CREATE TABLE table_160510_5 (country VARCHAR,area VARCHAR) | SELECT country FROM table_160510_5 WHERE area = "11,891" |
What was the attendance for the North Melbourne's home game? | CREATE TABLE table_57261 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Crowd" FROM table_57261 WHERE "Home team" = 'north melbourne' |
what is minimum age of patients whose admission location is trsf within this facility and discharge location is disc-tran cancer/chldrn h? | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" |
until 2103, when did patient 028-56914 come for the last time to the hospital? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-56914' AND STRFTIME('%y', patient.hospitaladmittime) <= '2103' ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
Which country has an area of 871,980 square km? | CREATE TABLE table_name_15 (member_countries VARCHAR,area__km²_ VARCHAR) | SELECT member_countries FROM table_name_15 WHERE area__km²_ = "871,980" |
What is the name of the MySpace Band with an Original Airdate of 19 february 2008? | CREATE TABLE table_40935 ("Pilot" text,"Original Airdate" text,"Musical Guest/Song performed" text,"YouTube Hero" text,"MySpace Band" text) | SELECT "MySpace Band" FROM table_40935 WHERE "Original Airdate" = '19 february 2008' |
What finals have grant brebner as the name? | CREATE TABLE table_name_40 (finals VARCHAR,name VARCHAR) | SELECT finals FROM table_name_40 WHERE name = "grant brebner" |
team that scored more than 40 points against the jets that is not the miami dolphins | CREATE TABLE table_204_443 (id number,"week" number,"date" text,"opponent" text,"result" text,"game site" text,"attendance" number,"bye" text) | SELECT "opponent" FROM table_204_443 WHERE "result" > 40 AND "opponent" <> 'miami dolphins' |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute headquarter, and order Name in desc order please. | 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, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC |
Find the first names of teachers whose email address contains the word 'man'. | CREATE TABLE Teachers (first_name VARCHAR,email_address VARCHAR) | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' |
Show all donor names. | CREATE TABLE endowment (donator_name VARCHAR) | SELECT DISTINCT donator_name FROM endowment |
What is the June 21 ncaat baseball record for Fresno State Bulldogs? | CREATE TABLE table_22082 ("#" real,"Date" text,"Opponent" text,"Score" text,"Site/Stadium" text,"Win" text,"Loss" text,"Save" text,"Attendance" real,"Overall Record" text,"NCAAT Record" text) | SELECT "NCAAT Record" FROM table_22082 WHERE "Date" = 'June 21' |
Who won the gold when Kim Hyang-Mi won the bronze? | CREATE TABLE table_name_97 (gold VARCHAR,bronze VARCHAR) | SELECT gold FROM table_name_97 WHERE bronze = "kim hyang-mi" |
What is the highest number of bronze when silver is larger than 0, rank is larger than 3? | CREATE TABLE table_64132 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Bronze") FROM table_64132 WHERE "Silver" > '0' AND "Rank" > '3' |
For employees with first names that end with the letter m, give me a bar chart to show their average salary, and order Y-axis in desc order. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 ... | SELECT FIRST_NAME, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY AVG(SALARY) DESC |
For each product, show its name and the number of times it was ordered. Plot them as bar chart. | CREATE TABLE Products (product_id INTEGER,product_name VARCHAR(80),product_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_name VARCHAR(80),customer_details VARCHAR(255))CREATE TABLE Shipments (shipment_id INTEGER,order_id INTEGER,invoice_number INTEGER,shipment_tracking_number VARCHAR(80),shi... | SELECT T3.product_name, SUM(COUNT(*)) FROM Orders AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_name |
What is the nationality of the swimmer with a rank over 2 with a time of 55.77? | CREATE TABLE table_64284 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Nationality" FROM table_64284 WHERE "Rank" > '2' AND "Time" = '55.77' |
give me the number of patients whose admission year is less than 2112 and diagnoses long title is retained plastic fragments? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2112" AND diagnoses.long_title = "Retained plastic fragments" |
What was the original air date for episode number 6? | CREATE TABLE table_19587 ("Number of episode" real,"Number of season" real,"Title (original)" text,"Title (English)" text,"Original air date" text) | SELECT "Original air date" FROM table_19587 WHERE "Number of episode" = '6' |
Show the total number from each document type code | CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Statements... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code |
What is the Loss of the game at Nationwide Arena with a Score of 4 3? | CREATE TABLE table_name_42 (loss VARCHAR,score VARCHAR,arena VARCHAR) | SELECT loss FROM table_name_42 WHERE score = "4–3" AND arena = "nationwide arena" |
preexisting severe valvular heart disease | CREATE TABLE table_test_4 ("id" int,"ejection_fraction_ef" int,"systolic_blood_pressure_sbp" int,"active_infection" bool,"heart_disease" bool,"renal_disease" bool,"estimated_glomerular_filtration_rate_egfr" int,"cardiogenic_shock" bool,"diastolic_blood_pressure_dbp" int,"symptomatic_hypotension" bool,"severe_refractory... | SELECT * FROM table_test_4 WHERE heart_disease = 1 |
What's the lowest goal difference when the position is higher than 16? | CREATE TABLE table_name_85 (goal_difference INTEGER,position INTEGER) | SELECT MIN(goal_difference) FROM table_name_85 WHERE position > 16 |
How would an Italian say the Andalusian word coche? | CREATE TABLE table_name_78 (italian VARCHAR,andalusian VARCHAR) | SELECT italian FROM table_name_78 WHERE andalusian = "coche" |
evidence of sensitization on pra | CREATE TABLE table_train_272 ("id" int,"fasting_plasma_glucose_fpg" float,"creatinine_clearance_cl" float,"baseline_hemoglobin_hgb" float,"sensitization_on_pra" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_272 WHERE sensitization_on_pra = 1 |
If the position is 12th, what was the series? | CREATE TABLE table_2493 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text) | SELECT "Series" FROM table_2493 WHERE "Position" = '12th' |
Which Land (sqmi) has a GEO ID smaller than 3800587900? | CREATE TABLE table_64577 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" real,"Water (sqmi)" real,"Latitude" real,"Longitude" real,"GEO ID" real,"ANSI code" real) | SELECT MIN("Land ( sqmi )") FROM table_64577 WHERE "GEO ID" < '3800587900' |
Which cities have regional population above 10000000? | CREATE TABLE hosting_city (year number,match_id number,host_city text)CREATE TABLE match (match_id number,date text,venue text,score text,result text,competition text)CREATE TABLE city (city_id number,city text,hanzi text,hanyu_pinyin text,regional_population number,gdp number)CREATE TABLE temperature (city_id number,j... | SELECT city FROM city WHERE regional_population > 10000000 |
SELECT DISTINCT u.Id, DisplayName, Location, Aboutme, EmailHash, AccountId. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionD... | SELECT DISTINCT u.Id, DisplayName, Location, AboutMe, EmailHash, AccountId FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND u.Location LIKE '%London%' |
WHAT IS THE MUSIC WITH SAMBA? | CREATE TABLE table_name_6 (music VARCHAR,style VARCHAR) | SELECT music FROM table_name_6 WHERE style = "samba" |
how many people were diagnosed with cardiomyopathy and did not visit the hospital within 2 months during this year? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiomyopathy' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 's... |
among patients treated with drug psyllium, how many of them were aged below 48? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.drug = "Psyllium" |
How many grids for peter collins? | CREATE TABLE table_78386 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Grid") FROM table_78386 WHERE "Driver" = 'peter collins' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.