schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[CLASS] { <col0>[CLASS_CODE]:[varchar] <col1>[CRS_CODE]:[varchar] <col2>[CLASS_SECTION]:[varchar] <col3>[CLASS_TIME]:[varchar] <col4>[CLASS_ROOM]:[varchar] <col5>[PROF_NUM]:[int] } <table1>[DEPARTMENT] { <col0>[DEPT_CODE]:[varchar] <col1>[DEPT_NAME]:[varchar] <col2>[SCHOOL_CODE]:[varchar] <col3>[EMP_NUM]:[int]...
SELECT DEPT_CODE, COUNT( * ) FROM `<table6>` WHERE `<col4>` = 'Ph.D.' GROUP BY `<col1>`
Find the number of professors with a Ph.D. degree in each department. Show bar chart.
<table0>[table_name_71] { <col0>[country]:[VARCHAR] <col1>[wins]:[INTEGER] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` > 2
Which Country has a number of Wins larger than 2?
<table0>[table_name_37] { <col0>[game]:[VARCHAR] <col1>[opponent]:[VARCHAR] <col2>[opponents]:[VARCHAR] <col3>[nets_points]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col2>` < 118 AND `<col3>` > 109 AND `<col1>` = "washington"
How many games had fewer than 118 opponents and more than 109 net points with an opponent of Washington?
<table0>[table_204_428] { <col0>[number]:[season] <col1>[text]:[east] <col2>[superleague]:[text] <col3>[east]:[premier] <col4>[league]:[text] <col5>[east]:[region] <col6>[south]:[division] <col7>[text]:[east] <col8>[region]:[central] <col9>[division]:[text] <col10>[east]:[region] <col11>[north]:[division] }
SELECT "season" - "season" FROM `<table0>`
how many years are there in a season ?
<table0>[table_1341577_36] { <col0>[party]:[VARCHAR] <col1>[incumbent]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Tom Luken"
Which party does Tom Luken belong to?
<table0>[table_name_64] { <col0>[sector]:[VARCHAR] <col1>[incorporated]:[INTEGER] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 1983
What is the sector of the company with an incorporated date before 1983?
<table0>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table1>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table2>[locations] { <col0>[LOCATION_ID]:[...
SELECT JOB_ID, `<col0>` FROM `<table5>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table4>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col6>` DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and employee_id in a bar chart, I want to show in descending by the bars.
<table0>[table_name_39] { <col0>[tournament]:[VARCHAR] <col1>[outcome]:[VARCHAR] <col2>[opponents]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "winner" AND `<col2>` = "kerry-anne guse corina morariu"
what is the tournament when the outcome is winner and the opponents is kerry-anne guse corina morariu?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>...
SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN procedures ON `<table1>`.hadm_id = procedures.hadm_id WHERE `<table1>`.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "9390"
give me the number of patients whose discharge location is disc-tran cancer/chldrn h and procedure icd9 code is 9390?
<table0>[table_23239946_3] { <col0>[position]:[INTEGER] }
SELECT MAX( `<col0>` ) FROM `<table0>`
How many positions are there in Canadian Nascar?
<table0>[patients] { <col0>[patient_id]:[INT] <col1>[age]:[INT] <col2>[gender]:[TEXT] <col3>[state]:[TEXT] <col4>[date]:[DATE] }
SELECT AVG( `<col1>` ) FROM `<table0>` WHERE `<col3>` = 'California' AND `<col4>` LIKE '2020-%' AND procedure = 'Flu shot';
What is the average age of patients who received a flu shot in the state of California in 2020?
<table0>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wednesday]:[varchar] <col9>[thursday]:[varchar] <col10>[friday]:[varchar] <col11>[...
SELECT DISTINCT `<table14>`.department, `<table14>`.name, `<table14>`.number, semester.semester FROM `<table14>` INNER JOIN area ON `<table14>`.`<table14>`_id = area.`<table14>`_id INNER JOIN `<table14>`_offering ON `<table14>`.`<table14>`_id = `<table14>`_offering.`<table14>`_id INNER JOIN semester ON semester.semeste...
What classes for computational science will be available in the Winter or Fall 2006 ?
<table0>[table_203_701] { <col0>[number]:[number] <col1>[title]:[text] <col2>[featured]:[guest] <col3>[text]:[producer] <col4>[text]:[length] }
SELECT COUNT( "title" ) FROM `<table0>` WHERE "featured guest( s )" = 'kyza and skriblah'
how many songs have kyza and skriblah as the featured guests ?
<table0>[table_204_195] { <col0>[number]:[team] <col1>[text]:[home] <col2>[city]:[text] <col3>[stadium]:[text] <col4>[capacity]:[number] <col5>[season]:[text] }
SELECT COUNT( "stadium" ) FROM `<table0>` WHERE "capacity" > 2000
how many stadiums hold ore than 2000 people ?
<table0>[table_name_40] { <col0>[producer_director]:[VARCHAR] <col1>[film]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "fear beneath"
Who was the Producer/Director of Fear Beneath?
<table0>[latam_afforestation_finance] { <col0>[country]:[VARCHAR] <col1>[year]:[INT] <col2>[FLOAT]:[INSERT] }
SELECT country, SUM( amount ) as total_finance FROM `<table0>` WHERE `<col1>` BETWEEN 2015 AND 2020 AND sector = 'Afforestation' GROUP BY country;
What is the total climate finance allocated to Latin American countries for afforestation between 2015 and 2020?
<table0>[table_26202940_6] { <col0>[VARCHAR]:[score_in_the_final] }
SELECT COUNT( no ) FROM `<table0>` WHERE score_in_the_final = "6–3, 6–4, 7–6 ( 13–11 )"
How many numbers correspond to the score in the final of 6 3, 6 4, 7 6 (13 11)?
<table0>[table_25239] { <col0>[Rnd]:[real] <col1>[Date]:[text] <col2>[Race]:[text] <col3>[Length]:[text] <col4>[Track]:[text] <col5>[Location]:[text] <col6>[Type]:[text] <col7>[Pole]:[Position] <col8>[text]:[Winning] <col9>[Driver]:[text] }
SELECT MAX( "Rnd" ) FROM `<table0>` WHERE "Race Name" = 'Daily Empress Indy Silverstone'
Daily Empress Indy Silverstone took place on which round?
<table0>[table_1301373_7] { <col0>[captain]:[VARCHAR] <col1>[international_marquee]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Emile Heskey"
Name the captain for emile heskey
<table0>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[v...
SELECT `<table14>`.valuenum FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table11>`.hadm_id FROM `<table11>` WHERE `<table11>`.subject_id = 10624 ) AND `<table14>`.itemid IN ( SELECT `<table15>`.itemid FROM `<table15>` WHERE `<table15>`.label = 'platelet count' ) AND STRFTIME( '%y-%m', `<table14>`.charttime ...
what was the last platelet count in patient 10624 since 03/2105?
<table0>[table_name_73] { <col0>[nickname]:[VARCHAR] <col1>[age___ma]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE age___ma__ = "4.9"
Name the nickname with age of 4.9
<table0>[table_name_82] { <col0>[save]:[VARCHAR] <col1>[opponent]:[VARCHAR] <col2>[date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "yankees" AND `<col2>` = "july 25"
What is the save when Yankees are the opponents on July 25?
<table0>[table_name_14] { <col0>[d_46_]:[VARCHAR] <col1>[d_50_]:[VARCHAR] }
SELECT d_46_√ FROM `<table0>` WHERE d_50_√ = "d 50 √"
What is the D 46 √ when the D 50 √ is d 50 √?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la...
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN procedures ON `<table4>`.hadm_id = procedures.hadm_id INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE procedures.long_title = "Endoscopic sphincterotomy and papillotomy" AND lab.fluid = "Ascites"
How many patients had an ascitic fluid lab test and had an endoscopic sphincterotomy and papillotomy procedure done?
<table0>[table_49995] { <col0>[Tournament]:[text] <col1>[1980]:[text] <col2>[1981]:[text] <col3>[1982]:[text] <col4>[1983]:[text] <col5>[1984]:[text] <col6>[1985]:[text] <col7>[1986]:[text] <col8>[1987]:[text] <col9>[Career]:[text] }
SELECT "1980" FROM `<table0>` WHERE "1984" = '1r' AND "1981" = '1r'
What is the 1980 value with a 1r in 1984 and a 1r in 1981?
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text]...
SELECT `<table0>`.route FROM `<table0>` WHERE `<table0>`.subject_id = "6983"
How is the drug administered to patient with patient id 6983?
<table0>[table_63617] { <col0>[Season]:[text] <col1>[Competition]:[text] <col2>[Round]:[text] <col3>[Opposition]:[text] <col4>[Score]:[text] }
SELECT "Season" FROM `<table0>` WHERE "Score" = '0–2 ( a ), 3–1 ( h )'
What is the Season of the game with a Score of 0 2 (a), 3 1 (h)?
<table0>[table_203_296] { <col0>[number]:[country] <col1>[text]:[total] <col2>[gdp]:[nominal] <col3>[billion]:[text] <col4>[gdp]:[capita] <col5>[ppp]:[text] <col6>[gdp]:[growth] <col7>[n2007]:[2011] <col8>[number]:[hdi] }
SELECT "country" FROM `<table0>` ORDER BY "total `<col2>` ( nominal )\n( `<col3>` us$ )" DESC LIMIT 1
which is the top african nation that earns the most gdp in billions ?
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>...
SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN procedures ON `<table0>`.hadm_id = procedures.hadm_id WHERE `<table0>`.insurance = "Private" AND procedures.long_title = "Endoscopic removal of stone( s ) from biliary tract"
report the number of private insurance patients who had endoscopic removal of stone(s) from biliary tract.
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varc...
SELECT JOB_ID, SUM( `<col9>` ) FROM `<table2>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%' GROUP BY `<col6>` ORDER BY SUM( `<col9>` )
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, could you rank total number of manager id in ascending order please?
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table2>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varcha...
SELECT COMMISSION_PCT, `<col10>` FROM `<table4>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40
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, what is the relationship between commission_pct and department_id ?
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[t...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.admission_type = "ELECTIVE" AND lab.label = "Triglycer"
how many patients are with admission type elective and with lab test name triglycer?
<table0>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table1>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] ...
SELECT PHONE_NUMBER, `<col8>` FROM `<table1>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table5>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col4>` DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, sort bar from high to low order please.
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN procedures ON `<table2>`.hadm_id = procedures.hadm_id WHERE `<table2>`.dod_year <= "2155.0" AND procedures.icd9_code = "598"
How many of the patients with icd9 code 598 died in or before the 2115?
<table0>[table_name_35] { <col0>[date]:[VARCHAR] <col1>[home_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "stockport county"
What is the date with home team of Stockport County?
<table0>[comment_instructor] { <col0>[instructor_id]:[int] <col1>[student_id]:[int] <col2>[score]:[int] <col3>[comment_text]:[varchar] } <table1>[course_prerequisite] { <col0>[pre_course_id]:[int] <col1>[course_id]:[int] } <table2>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:...
SELECT DISTINCT `<col5>` FROM `<table13>` WHERE `<col2>` = 'REES' AND `<col3>` = 402
Name some useful courses before REES 402 .
<table0>[Artists] { <col0>[INT]:[name] } <table1>[Works] { <col0>[INT]:[artist_id] <col1>[INT]:[title] } <table2>[Gallery_Works] { <col0>[INT]:[gallery_id] <col1>[INT]:[work_id] } <table3>[Galleries] { <col0>[INT]:[name] <col1>[VARCHAR]:[city] <col2>[VARCHAR]:[INSERT] }
SELECT a.name, COUNT( w.id ) as num_works FROM `<table0>` a JOIN Works w ON a.id = w.artist_id JOIN Gallery_Works gw ON w.id = gw.work_id JOIN Galleries g ON gw.gallery_id = g.id WHERE g.city = 'Madrid' GROUP BY a.name ORDER BY num_works DESC LIMIT 3;
List the top 3 most popular artists in Madrid, based on the number of works exhibited in galleries, and show their names and the number of works.
<table0>[table_name_95] { <col0>[college]:[VARCHAR] <col1>[pick]:[VARCHAR] <col2>[team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` > 130 AND `<col2>` = "new york jets"
Which college did the player picked larger than 130 by the New York Jets go to?
<table0>[table_202_205] { <col0>[number]:[year] <col1>[text]:[title] <col2>[text]:[role] <col3>[text]:[notes] }
SELECT COUNT( "title" ) FROM `<table0>` WHERE "role" <> 'phineas bogg'
in how many titles on this list did he not play the role of phineas bogg ?
<table0>[ProvincePrograms] { <col0>[Province]:[VARCHAR] <col1>[255]:[Programs] <col2>[INT]:[Success] <col3>[BOOLEAN]:[INSERT] }
SELECT Province, COUNT( * ) FILTER ( WHERE Success ) * 1.0 / COUNT( * ) as SuccessRate FROM `<table0>` GROUP BY `<col0>` ORDER BY SuccessRate DESC;
What is the ratio of successful community education programs to total programs for each province, ordered by the success rate in descending order?
<table0>[CREATE] { <col0>[SCHEMA]:[exists] <col1>[genetics]:[USE] } <table1>[exists] { <col0>[projects]:[INT] <col1>[PRIMARY]:[KEY] <col2>[name]:[VARCHAR] <col3>[255]:[lead_researcher] <col4>[VARCHAR]:[255] <col5>[INSERT]:[projects] <col6>[name]:[lead_researcher] <col7>[VALUES]:[ProjectX] <col8>[Jane]:[Doe] <col9>[Pro...
SELECT * FROM projects;
List all genetic research projects and their respective lead researchers.
<table0>[table_203_8] { <col0>[number]:[player] <col1>[text]:[rec] <col2>[number]:[yards] <col3>[number]:[avg] <col4>[number]:[number] <col5>[long]:[number] }
SELECT "player" FROM `<table0>` WHERE "yards" < 0
who is the only player to have a negative yard average ?
<table0>[animals] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[name] <col2>[VARCHAR]:[species] <col3>[VARCHAR]:[population] }
DELETE FROM `<table0>` WHERE id = 2;
Delete the record with id 2 from the 'animals' table
<table0>[table_19359427_6] { <col0>[date_of_appointment]:[VARCHAR] <col1>[position_in_table]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "21st"
When was the new manager of the team on 21st position appointed?
<table0>[table_name_48] { <col0>[date]:[VARCHAR] <col1>[scorers]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "mccoist ( 3 ), johnston, butcher, steven"
When was the scorer mccoist (3), johnston, butcher, steven?
<table0>[table_name_71] { <col0>[to_par]:[VARCHAR] <col1>[player]:[VARCHAR] <col2>[place]:[VARCHAR] <col3>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = "t3" AND `<col3>` = "united states" AND `<col1>` = "steve flesch"
what was steve flesch's to par when he was placed at t3 in the united states?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN diagnoses ON `<table2>`.hadm_id = diagnoses.hadm_id INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "45821" AND lab.fluid = "Urine"
give me the number of patients whose diagnoses icd9 code is 45821 and lab test fluid is urine?
<table0>[table_dev_4] { <col0>[int]:[hypothyroidism] <col1>[bool]:[serum_bicarbonate] <col2>[int]:[c_peptide_level] <col3>[float]:[autoimmune_disease] <col4>[bool]:[hemoglobin_a1c_hba1c] <col5>[float]:[positive_serum] <col6>[bool]:[inhaled_steroids] <col7>[bool]:[diabetic_ketoacidosis] <col8>[bool]:[creatinine_clearanc...
SELECT * FROM `<table0>` WHERE chronic_inflammatory = 1 OR autoimmune_disease = 1 OR hypothyroidism = 1 OR asthma = 1 AND inhaled_steroids = 1
chronic inflammatory or autoimmune disease with the exception of well _ controlled hypothyroidism or intermittent or mild persistent asthma not requiring the use of daily inhaled steroids
<table0>[nyc_buses] { <col0>[INT]:[route_id] <col1>[VARCHAR]:[speed] <col2>[INT]:[timestamp] }
SELECT AVG( speed ) FROM `<table0>` WHERE route_id IS NOT NULL;
Find the average speed of public buses in New York City.
<table0>[table_name_89] { <col0>[construction]:[VARCHAR] <col1>[name__wade_giles]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE name__wade_giles_ = "fu-hsing"
Which Construction is named of fu-hsing?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[...
SELECT MAX( `<table1>`.days_stay ) FROM `<table1>` WHERE `<table1>`.age >= "79"
calculate the maximum days for which patients aged 79 years or more were hospitalized.
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[demogr...
SELECT MIN( `<table2>`.age ) FROM `<table2>` WHERE `<table2>`.admission_location = "TRSF WITHIN THIS FACILITY" AND `<table2>`.discharge_location = "REHAB/DISTINCT PART HOSP"
calculate minimum age of the patients admitted to trsf within this facility who were discharged to rehab/distinct part hosp
<table0>[table_72365] { <col0>[District]:[text] <col1>[Incumbent]:[text] <col2>[Party]:[text] <col3>[elected]:[real] <col4>[Results]:[text] <col5>[Candidates]:[text] }
SELECT "Candidates" FROM `<table0>` WHERE "Incumbent" = 'Jerry Costello'
Who were the candidates in the district where Jerry Costello won?
<table0>[fda_approval] { <col0>[drug]:[varchar] <col1>[255]:[year] <col2>[int]:[INSERT] }
SELECT `<col0>` FROM `<table0>` WHERE year = 2018;
Which drugs were approved by the FDA in 2018?
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate...
SELECT TagName, COUNT( * ) FROM `<table5>` AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ( 'swing' ) GROUP BY TagName ORDER BY COUNT( * ) DESC
Question per tag (javafx, swing) over time.
<table0>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[et...
SELECT COUNT( * ) > 0 FROM `<table7>` WHERE `<table7>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '010-26737' ) ) AND `<table7>`.respiratio...
has patient 010-26737 had normal levels of respiration during a month before?
<table0>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table1>[Votes] { <col0>[number]:[PostId] <col1>[nu...
SELECT COUNT( * ) FROM `<table8>` WHERE Body LIKE '%.superuser.com%' AND CreationDate > CURRENT_TIMESTAMP( ) - 30
Super User posts linked to from SO.
<table0>[movies] { <col0>[INT]:[title] <col1>[VARCHAR]:[255] <col2>[genre]:[VARCHAR] <col3>[production_year]:[INT] <col4>[country]:[VARCHAR] }
SELECT genre, COUNT( * ) as count FROM `<table0>` WHERE `<col4>` = 'UK' GROUP BY genre;
What is the distribution of genres in movies produced in the UK?
<table0>[table_58270] { <col0>[Home]:[team] <col1>[text]:[Home] <col2>[team]:[score] <col3>[text]:[Away] <col4>[team]:[text] <col5>[Away]:[team] <col6>[score]:[text] <col7>[Venue]:[text] <col8>[Crowd]:[real] <col9>[Date]:[text] }
SELECT "Away team" FROM `<table0>` WHERE "Venue" = 'western oval'
Tell me the away team for venue of western oval
<table0>[table_25030512_24] { <col0>[result]:[VARCHAR] <col1>[incumbent]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Barney Frank"
Name the result for barney frank
<table0>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]...
SELECT DISTINCT `<table2>`.`<table2>` FROM `<table2>` WHERE `<table2>`.event_type = '`<table8>`' AND `<table2>`.event_id IN ( SELECT `<table8>`.row_id FROM `<table8>` WHERE `<table8>`.itemid IN ( SELECT `<table9>`.itemid FROM `<table9>` WHERE `<table9>`.label = 'bilirubin, total, body fluid' ) )
tell me the cost of a lab bilirubin, total, body fluid test?
<table0>[defense_projects] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[contractor_id]:[INT] <col3>[original_completion_date]:[DATE] <col4>[current_completion_date]:[DATE] } <table1>[contractors] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] }
SELECT d.name, c.name as contractor_name, d.original_completion_date, d.current_completion_date, DATEDIFF( d.current_completion_date, d.original_completion_date ) as delay_days FROM `<table0>` d JOIN contractors c ON d.contractor_id = c.id WHERE DATEDIFF( d.current_completion_date, d.original_completion_date ) > 30;
List all defense projects that have experienced delays of more than 30 days, along with their original and current completion dates, and the names of the contractors responsible for each project.
<table0>[Invoices] { <col0>[invoice_number]:[INTEGER] <col1>[order_id]:[INTEGER] <col2>[invoice_date]:[DATETIME] } <table1>[Financial_Transactions] { <col0>[transaction_id]:[INTEGER] <col1>[account_id]:[INTEGER] <col2>[invoice_number]:[INTEGER] <col3>[transaction_type]:[VARCHAR] <col4>[transaction_date]:[DATETIME] <co...
SELECT invoice_number, COUNT( * ) FROM `<table1>` GROUP BY `<col2>`
Plot a scatter chart, invoice number by the total number .
<table0>[table_name_98] { <col0>[date]:[VARCHAR] <col1>[home]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "ny rangers"
On what date were the NY Rangers home?
<table0>[Investment_Strategies] { <col0>[strategy_id]:[INT] <col1>[strategy_name]:[VARCHAR] <col2>[AUM]:[DECIMAL] }
SELECT strategy_name, SUM( `<col2>` * 1.03 ) AS total_AUM FROM `<table0>` GROUP BY strategy_name;
What are the total assets under management (AUM) for each investment strategy, including a 3% management fee?
<table0>[water_usage] { <col0>[country]:[VARCHAR] <col1>[255]:[usage] <col2>[FLOAT]:[date] <col3>[DATE]:[INSERT] }
SELECT country, SUM( usage ) FROM ( SELECT country, usage, ROW_NUMBER( ) OVER ( PARTITION BY `<col0>` ORDER BY usage DESC ) as rank FROM `<table0>` WHERE date >= '2021-01-01' GROUP BY country, usage ) subquery WHERE rank <= 5 GROUP BY country;
What is the total water usage in the top 5 water-consuming countries in the past year?
<table0>[table_name_35] { <col0>[apps]:[INTEGER] <col1>[level]:[VARCHAR] <col2>[season]:[VARCHAR] <col3>[team]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col2>` > 2008 AND `<col3>` = "kairat" AND `<col1>` < 1
What is the highest Apps of kairat after 2008 and a Level smaller than 1?
<table0>[investments] { <col0>[INT]:[sector] <col1>[VARCHAR]:[risk_level] }
SELECT AVG( risk_level ) FROM `<table0>` WHERE sector = 'green_technology'
What is the average risk level for 'green_technology' investments?
<table0>[table_train_239] { <col0>[int]:[basal_c_peptide] <col1>[float]:[body_weight] <col2>[float]:[renal_disease] <col3>[bool]:[creatinine_clearance_cl] <col4>[float]:[serum_creatinine] <col5>[float]:[stimulated] <col6>[bool]:[body_mass_index_bmi] <col7>[float]:[NOUSE] }
SELECT * FROM `<table0>` WHERE renal_disease = 1 OR serum_creatinine > 0.5
patients with unstable renal function _ serum creatinine greater than 0.5 mg / dl above baseline.
<table0>[table_name_13] { <col0>[goals]:[INTEGER] <col1>[apps]:[VARCHAR] <col2>[rank]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 234 AND `<col2>` < 8
What is the average number of goals of the player with 234 apps and a rank above 8?
<table0>[table_1458666_4] { <col0>[total_wins]:[INTEGER] }
SELECT MIN( `<col0>` ) FROM `<table0>`
what is the value for minimum total wins
<table0>[AwardsMisc] { <col0>[name]:[text] <col1>[text]:[award] <col2>[text]:[year] <col3>[integer]:[lgID] <col4>[text]:[note] } <table1>[HOF] { <col0>[year]:[integer] <col1>[hofID]:[text] <col2>[name]:[text] <col3>[category]:[text] } <table2>[Teams] { <col0>[year]:[integer] <col1>[lgID]:[text] <col2>[tmID]:[text] <c...
SELECT firstName, lastName, `<col25>` - `<col19>` FROM `<table5>` WHERE `<col10>` IS NULL AND `<col25>` IS NOT NULL
For all the deceased players who are good at both left and right hand, list the player's name and the age when he died.
<table0>[current] { <col0>[ballotpedia_id]:[text] <col1>[bioguide_id]:[text] <col2>[birthday_bio]:[date] <col3>[cspan_id]:[real] <col4>[fec_id]:[text] <col5>[first_name]:[text] <col6>[gender_bio]:[text] <col7>[google_entity_id_id]:[text] <col8>[govtrack_id]:[integer] <col9>[house_history_id]:[real] <col10>[icpsr_id]:[r...
SELECT T2.party, T2.state FROM `<table0>` AS T1 INNER JOIN ``<table0>`-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state
What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
<table0>[table_name_85] { <col0>[score]:[VARCHAR] <col1>[opponent_in_the_final]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "michaela pochabová"
What was the score versus Michaela Pochabová?
<table0>[trip] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[user_id] <col2>[INT]:[trip_start_time] <col3>[TIMESTAMP]:[trip_end_time] <col4>[TIMESTAMP]:[trip_mode] <col5>[VARCHAR]:[255] <col6>[trip_distance]:[FLOAT] }
SELECT * FROM `<table0>` WHERE `<table0>`_mode IN ( 'Bike Share', 'E-Scooter', 'Microtransit' ) AND user_id IN ( SELECT DISTINCT user_id FROM `<table0>` WHERE location = 'New York' );
List all records from the trip table for shared mobility users in New York.
<table0>[products] { <col0>[product_id]:[INT] <col1>[is_circular]:[BOOLEAN] <col2>[country]:[VARCHAR] <col3>[quantity]:[INT] }
SELECT MIN( `<table0>`.quantity ) FROM `<table0>` WHERE `<table0>`.is_circular = true AND `<table0>`.country = 'Developing';
What is the minimum quantity of a product that is part of a circular supply chain and is produced in a developing country?
<table0>[table_28914] { <col0>[District]:[text] <col1>[Incumbent]:[text] <col2>[Party]:[text] <col3>[elected]:[text] <col4>[Result]:[text] <col5>[Candidates]:[text] }
SELECT "Party" FROM `<table0>` WHERE "Result" = 'Lost re-election Democratic-Republican hold'
Which party experienced a result of lost re-election democratic-republican hold?
<table0>[table_69995] { <col0>[Date]:[text] <col1>[Visitor]:[text] <col2>[Score]:[text] <col3>[Home]:[text] <col4>[Record]:[text] }
SELECT "Score" FROM `<table0>` WHERE "Visitor" = 'montreal maroons' AND "Date" = 'december 28'
What's the Score with the Visitor of Montreal Maroons and has a Date of December 28?
<table0>[Payments] { <col0>[Payment_ID]:[INTEGER] <col1>[Settlement_ID]:[INTEGER] <col2>[Payment_Method_Code]:[VARCHAR] <col3>[255]:[Date_Payment_Made] <col4>[DATE]:[Amount_Payment] } <table1>[Customers] { <col0>[Customer_ID]:[INTEGER] <col1>[Customer_Details]:[VARCHAR] } <table2>[Claims] { <col0>[Claim_ID]:[INTEGER]...
SELECT T1.Claim_ID, COUNT( * ) FROM `<table2>` AS T1 JOIN Settlements AS T2 ON T1.Claim_ID = T2.Claim_ID GROUP BY T1.Claim_ID
Scatter. how many settlements does each claim correspond to? List the claim id and the number of settlements.
<table0>[Genre_Concerts_2] { <col0>[year]:[INT] <col1>[genre]:[VARCHAR] <col2>[revenue]:[FLOAT] }
SELECT genre, SUM( `<col2>` ) FROM `<table0>` WHERE `<col0>` = 2019 GROUP BY genre;
What was the total revenue for a specific genre's concert ticket sales in 2019?
<table0>[inventory] { <col0>[INT]:[garment_name] <col1>[VARCHAR]:[material] <col2>[VARCHAR]:[quantity_manufactured] <col3>[INT]:[quantity_sold] }
SELECT material, SUM( quantity_manufactured - quantity_sold ) AS total_unsold_quantity FROM `<table0>` GROUP BY material;
What is the total quantity of unsold garments, grouped by their material type, that are present in the 'inventory' table?
<table0>[patients] { <col0>[INT]:[age] <col1>[INT]:[gender] <col2>[TEXT]:[state] <col3>[TEXT]:[disease] <col4>[TEXT]:[INSERT] }
SELECT AVG( age ) FROM `<table0>` WHERE state = 'California' AND disease = 'Chlamydia';
What is the average age of patients who tested positive for chlamydia in California?
<table0>[table_name_32] { <col0>[teams]:[VARCHAR] <col1>[league]:[VARCHAR] <col2>[away]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "bundesliga" AND `<col2>` = "3-2"
What team has a league of bundesliga, and an away of 3-2?
<table0>[table_name_57] { <col0>[year_s__won]:[VARCHAR] <col1>[finish]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "t27"
When the finish is t27 what is the year (s) won?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>...
SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN lab ON `<table1>`.hadm_id = lab.hadm_id WHERE `<table1>`.dob_year < "2089" AND lab.fluid = "Pleural"
how many patients whose year of birth is less than 2089 and lab test fluid is pleural?
<table0>[candidate] { <col0>[Candidate_ID]:[int] <col1>[People_ID]:[int] <col2>[Poll_Source]:[text] <col3>[Date]:[text] <col4>[Support_rate]:[real] <col5>[Consider_rate]:[real] <col6>[Oppose_rate]:[real] <col7>[Unsure_rate]:[real] } <table1>[people] { <col0>[People_ID]:[int] <col1>[Sex]:[text] <col2>[text]:[Date_of_Bi...
SELECT Sex, SUM( Height ) FROM `<table1>` GROUP BY `<col1>` ORDER BY `<col1>`
Give me the comparison about the sum of Height over the Sex , and group by attribute Sex by a bar chart, and rank x axis in ascending order.
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col...
SELECT 24 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table3>`.`<table3>`resulttime ) ) FROM `<table3>` WHERE `<table3>`.`<table7>`unitstayid IN ( SELECT `<table7>`.`<table7>`unitstayid FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `...
how many hours have elapsed since patient 006-10390 first received a laboratory platelets x 1000 test on their current hospital visit?
<table0>[table_name_96] { <col0>[laps]:[INTEGER] <col1>[grid]:[VARCHAR] <col2>[manufacturer]:[VARCHAR] <col3>[rider]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col2>` = "gilera" AND `<col3>` = "marco simoncelli" AND `<col1>` < 8
what is the smallest number of laps marco simoncelli has with grid less than 8 and gilera as the manufacturer?
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstay...
SELECT `<table4>`.drugstarttime FROM `<table4>` WHERE `<table4>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '009-2181' ) ) AND `<table4>`.d...
when did patient 009-2181 receive his/her last prescription for 10 ml cup : magnesium hydroxide 2400 mg/10ml po susp in 08/2105?
<table0>[table_17058116_5] { <col0>[location_attendance]:[VARCHAR] <col1>[game]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 13
In how many locations did Game 13 take place?
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col...
SELECT HIRE_DATE, SUM( `<col10>` ) FROM `<table1>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%' ORDER BY SUM( `<col10>` ) DESC
For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart, list by the y axis in desc.
<table0>[police_department] { <col0>[INT]:[district_name] <col1>[VARCHAR]:[officer_count] <col2>[INT]:[INSERT] }
SELECT district_name, officer_count, officer_count/SUM( officer_count ) OVER ( ) * 100 AS percentage FROM police_department;
How many police officers are assigned to each district?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[...
SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id WHERE `<table1>`.admityear < "2119" AND diagnoses.icd9_code = "70714"
Count the number of patients who were admitted to hospital before the year 2119 that have diagnoses icd9 code 70714.
<table0>[table_204_903] { <col0>[number]:[title] <col1>[text]:[character] <col2>[text]:[broadcaster] <col3>[text]:[episodes] <col4>[number]:[date] }
SELECT "broadcaster" FROM `<table0>` WHERE "title" = 'blandings'
blandings and death in paradise both aired on which broadcaster ?
<table0>[table_52046] { <col0>[Current]:[Governor] <col1>[text]:[State] <col2>[text]:[Past] <col3>[text]:[Took] <col4>[office]:[real] <col5>[Current]:[term] }
SELECT "State" FROM `<table0>` WHERE "Current Governor" = 'susana martinez'
What state is susana martinez from?
<table0>[food_aid] { <col0>[INT]:[year] <col1>[INT]:[delivery_status] <col2>[VARCHAR]:[origin_country] <col3>[VARCHAR]:[quantity] <col4>[INT]:[INSERT] }
SELECT SUM( quantity ) FROM `<table0>` WHERE year = 2018 AND delivery_status = 'delivered' AND origin_country = 'USA';
What was the total amount of food aid (in metric tons) distributed in 2018, having a delivery_status of "delivered" and originating from "USA"?
<table0>[table_name_93] { <col0>[d_50_]:[VARCHAR] <col1>[d_47_]:[VARCHAR] }
SELECT d_50_√ FROM `<table0>` WHERE d_47_√ = "r 27 √"
What is the D 50 √ when the D 47 √ is r 27 √?
<table0>[table_47676] { <col0>[Team]:[text] <col1>[Agg]:[text] <col2>[Team]:[text] <col3>[1st]:[leg] <col4>[text]:[2nd] <col5>[leg]:[text] }
SELECT "Team 2" FROM `<table0>` WHERE "2nd leg" = '0-3 1'
What is Team 2, when 2nd Leg is 0-3 1?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[lab] {...
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.label = "C4"
give me the number of patients whose admission location is transfer from hosp/extram and lab test name is c4?
<table0>[table_name_51] { <col0>[competition]:[VARCHAR] <col1>[venue]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "stade fernand fournier, arles"
Which competition took place at Stade Fernand Fournier, Arles?