schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[Funding] { <col0>[funding_id]:[INT] <col1>[source]:[VARCHAR] <col2>[255]:[DECIMAL] } <table1>[Programs] { <col0>[program_id]:[INT] <col1>[name]:[VARCHAR] }
SELECT SUM( amount ) FROM `<table0>` F JOIN Programs P ON F.program_id = P.program_id WHERE F.source = 'Corporate Sponsor' AND P.name LIKE '%Music%';
What is the total funding from corporate sponsors for music programs?
<table0>[table_name_40] { <col0>[goals_against]:[VARCHAR] <col1>[position]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 4
How many Goals Against have a Position of 4?
<table0>[table_29219286_1] { <col0>[written_by]:[VARCHAR] <col1>[directed_by]:[VARCHAR] <col2>[no_in_season]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Ernest Dickerson" AND `<col2>` = 9
How many people wrote episode 9 in the season that was directed by Ernest Dickerson?
<table0>[Customer_Addresses] { <col0>[customer_id]:[INTEGER] <col1>[address_id]:[INTEGER] <col2>[date_address_from]:[DATETIME] <col3>[address_type]:[VARCHAR] <col4>[date_address_to]:[DATETIME] } <table1>[Customer_Orders] { <col0>[order_id]:[INTEGER] <col1>[customer_id]:[INTEGER] <col2>[order_status]:[VARCHAR] <col3>[o...
SELECT date_became_customer, COUNT( `<col3>` ) FROM `<table3>` WHERE `<col0>` BETWEEN 10 AND 20
What are the dates when customers with ids between 10 and 20 became customers, and count them by a bar chart
<table0>[DApps] { <col0>[DAppId]:[INT] <col1>[DAppName]:[VARCHAR] <col2>[RegulatorId]:[INT] } <table1>[Regulators] { <col0>[RegulatorId]:[INT] <col1>[RegulatorName]:[VARCHAR] <col2>[Region]:[VARCHAR] <col3>[INSERT]:[DApps] <col4>[DAppId]:[DAppName] <col5>[RegulatorId]:[VALUES] <col6>[App1]:[INSERT] <col7>[DApps]:[DApp...
SELECT d.DAppName, r.RegulatorName FROM `<table0>` d INNER JOIN Regulators r ON d.RegulatorId = r.RegulatorId WHERE r.Region = 'EU';
Show decentralized applications and their regulatory status in the EU.
<table0>[View_Unit_Status] { <col0>[apt_id]:[INTEGER] <col1>[apt_booking_id]:[INTEGER] <col2>[status_date]:[DATETIME] <col3>[available_yn]:[BIT] } <table1>[Apartment_Buildings] { <col0>[building_id]:[INTEGER] <col1>[building_short_name]:[CHAR] <col2>[building_full_name]:[VARCHAR] <col3>[building_description]:[VARCHAR]...
SELECT booking_start_date, COUNT( `<col4>` ) FROM `<table5>` AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT( `<col4>` )
How many apartment bookings for each year? Draw a bar chart binning booking start date by year interval, sort by the Y-axis in ascending.
<table0>[Method] { <col0>[integer]:[text] <col1>[FullComment]:[text] <col2>[Summary]:[text] <col3>[ApiCalls]:[text] <col4>[CommentIsXml]:[integer] <col5>[SampledAt]:[integer] <col6>[SolutionId]:[integer] <col7>[Lang]:[text] <col8>[NameTokenized]:[text] } <table1>[MethodParameter] { <col0>[integer]:[MethodId] <col1>[te...
SELECT SUBSTR( SUBSTR( Name, INSTR( Name, '.' ) + 1 ), 1, INSTR( SUBSTR( Name, INSTR( Name, '.' ) + 1 ), '.' ) - 1 ) task FROM `<table0>` WHERE `<col8>` = 'html parser feed'
What's the task of the method whose tokenized name is "html parser feed"?
<table0>[table_name_95] { <col0>[m939_series]:[VARCHAR] <col1>[wheelbase]:[VARCHAR] <col2>[m809_series]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "short" AND `<col2>` = "m817"
Name the M939 series for short wheelbase and M809 series of m817
<table0>[business] { <col0>[bid]:[int] <col1>[business_id]:[varchar] <col2>[name]:[varchar] <col3>[full_address]:[varchar] <col4>[city]:[varchar] <col5>[latitude]:[varchar] <col6>[longitude]:[varchar] <col7>[review_count]:[bigint] <col8>[is_open]:[tinyint] <col9>[rating]:[float] <col10>[state]:[varchar] } <table1>[cat...
SELECT COUNT( DISTINCT ( `<col4>` ) ) FROM `<table2>` WHERE `<col6>` = 'March'
Find the total number of reviews written in March
<table0>[customers] { <col0>[CustomerID]:[integer] <col1>[text]:[text] <col2>[StreetAddress]:[text] <col3>[City]:[text] <col4>[State]:[text] <col5>[ZipCode]:[integer] <col6>[Email]:[text] <col7>[PhoneNumber]:[text] <col8>[FirstPurchaseDate]:[date] <col9>[SubscribedToEmailList]:[text] <col10>[Gender]:[text] } <table1>[...
SELECT T2.LocationName FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TransactionID = 100885
Provide the name of the location where transaction no.100885 happened.
<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>[employees] { <col0>[EMPLOYEE_ID]:[...
SELECT HIRE_DATE, SUM( `<col9>` ) FROM `<table2>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table0>` )
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart.
<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 MIN( `<table0>`.age ) FROM `<table0>` WHERE `<table0>`.admission_type = "URGENT" AND `<table0>`.dob_year > "2090"
what is minimum age of patients whose admission type is urgent and year of birth is greater than 2090?
<table0>[CREATE] { <col0>[VIEW]:[recent_standards] <col1>[SELECT]:[design_standards] }
DROP VIEW recent_standards;
Delete the view recent_standards
<table0>[table_13762472_3] { <col0>[high_points]:[VARCHAR] <col1>[team]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "New Orleans/Oklahoma City"
How many players scored the most points when the opposing team was New Orleans/Oklahoma City?
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culture...
SELECT SUM( `<table5>`.cellvaluenumeric ) FROM `<table5>` WHERE `<table5>`.`<table7>`unitstayid IN ( SELECT `<table7>`.`<table7>`unitstayid FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '028-8188' ) ) AND `<...
what's the total amount of input of patient 028-8188?
<table0>[table_25346763_1] { <col0>[facility]:[VARCHAR] <col1>[year_opened]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "1954"
What facility opening in 1954?
<table0>[course_tags_count] { <col0>[course_id]:[int] <col1>[clear_grading]:[int] <col2>[pop_quiz]:[int] <col3>[group_projects]:[int] <col4>[inspirational]:[int] <col5>[long_lectures]:[int] <col6>[extra_credit]:[int] <col7>[few_tests]:[int] <col8>[good_feedback]:[int] <col9>[tough_tests]:[int] <col10>[heavy_papers]:[in...
SELECT COUNT( * ) > 0 FROM `<table14>` WHERE `<col2>` = 'EECS' AND `<col11>` = 'Y' AND `<col3>` = 620
Does a 620 lab exist ?
<table0>[table_2528382_1] { <col0>[lyricist]:[VARCHAR] <col1>[music_director]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Madan Mohan Kohli"
Who was the lyricist for the song with music directed by madan mohan kohli?
<table0>[table_name_73] { <col0>[ordered]:[VARCHAR] <col1>[name]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "algerine ( 2nd of `<col1>` )"
What ordered has algerine (2nd of name) as the name?
<table0>[program_course] { <col0>[program_id]:[int] <col1>[course_id]:[int] <col2>[workload]:[int] <col3>[category]:[varchar] } <table1>[offering_instructor] { <col0>[offering_instructor_id]:[int] <col1>[offering_id]:[int] <col2>[instructor_id]:[int] } <table2>[program_requirement] { <col0>[program_id]:[int] <col1>[c...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ( 'SP', 'SS', 'SU' ) AND semester.semester_id = c...
Which 100 -level classes are there for Spring or Summer terms ?
<table0>[NewsArticles] { <col0>[INT]:[title] <col1>[VARCHAR]:[255] <col2>[publication_date]:[DATE] }
SELECT DATE( `<col2>` ) AS publication_date, COUNT( * ) AS articles_per_day FROM `<table0>` WHERE `<col2>` >= CURDATE( ) - INTERVAL 1 MONTH GROUP BY publication_date;
How many news articles were published per day in the last month?
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.religion = "JEHOVAH'S WITNESS" AND lab.fluid = "Urine"
Find the jehovah's witness religious background patients who had urine lab tests.
<table0>[Courses] { <col0>[course_id]:[INTEGER] <col1>[author_id]:[INTEGER] <col2>[subject_id]:[INTEGER] <col3>[course_name]:[VARCHAR] <col4>[120]:[course_description] <col5>[VARCHAR]:[255] } <table1>[Subjects] { <col0>[subject_id]:[INTEGER] <col1>[subject_name]:[VARCHAR] } <table2>[Students] { <col0>[student_id]:[IN...
SELECT date_of_completion, COUNT( `<col4>` ) FROM `<table4>` AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT( `<col4>` ) DESC
A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, I want to sort in descending by the Y-axis.
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <...
SELECT `<table8>`.`<table8>`time FROM `<table8>` WHERE `<table8>`.`<table5>`unitstayid IN ( SELECT `<table5>`.`<table5>`unitstayid FROM `<table5>` WHERE `<table5>`.`<table5>`healthsystemstayid IN ( SELECT `<table5>`.`<table5>`healthsystemstayid FROM `<table5>` WHERE `<table5>`.uniquepid = '009-12985' ) ) AND `<table8>`...
when had patient 009-12985 last had urine catheter output until 2045 days ago?
<table0>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]...
SELECT HIRE_DATE, SUM( `<col9>` ) FROM `<table6>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table2>` )
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday.
<table0>[CountryRegion] { <col0>[CountryRegionCode]:[text] <col1>[text]:[ModifiedDate] } <table1>[Culture] { <col0>[CultureID]:[text] <col1>[text]:[ModifiedDate] } <table2>[Currency] { <col0>[CurrencyCode]:[text] <col1>[text]:[ModifiedDate] } <table3>[CountryRegionCurrency] { <col0>[CountryRegionCode]:[text] <col1>[...
SELECT T2.Name FROM `<table35>` AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID ORDER BY COUNT( T1.`<table35>`ID ) DESC LIMIT 1
Which product gets the most reviews?
<table0>[table_name_1] { <col0>[team]:[VARCHAR] <col1>[player]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "bill walker"
What team does Bill Walker play for?
<table0>[Claim_Headers] { <col0>[Claim_Header_ID]:[INTEGER] <col1>[Claim_Status_Code]:[CHAR] <col2>[Claim_Type_Code]:[CHAR] <col3>[Policy_ID]:[INTEGER] <col4>[Date_of_Claim]:[DATETIME] <col5>[Date_of_Settlement]:[DATETIME] <col6>[Amount_Claimed]:[DECIMAL] <col7>[Amount_Piad]:[DECIMAL] } <table1>[Claims_Processing_Stag...
SELECT Policy_Type_Code, COUNT( * ) FROM `<table6>` GROUP BY `<col2>` ORDER BY COUNT( * ) DESC
For each policy type, return its type code and its count in the record Visualize by bar chart, and could you order y-axis in desc order?
<table0>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table1>[offering_instructor] { <col0>[offering_instructor_id]:[int] <col1>[offering_id]:[int] <col2>[instructor_id]:[int] } <table2>[program] { <col0>[program_id]:[int] <col...
SELECT DISTINCT `<col4>` FROM `<table17>` WHERE `<col2>` = 'EECS' AND `<col3>` = 478
For EECS 478 , how many credits is it ?
<table0>[table_79080] { <col0>[Opposing]:[Teams] <col1>[text]:[real] <col2>[Date]:[text] <col3>[Venue]:[text] <col4>[Status]:[text] }
SELECT "Date" FROM `<table0>` WHERE "Opposing Teams" = 'australia' AND "Venue" = 'twickenham , london'
What is Date, when Opposing Teams is 'Australia', and when Venue is 'Twickenham , London'?
<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>[prescr...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` WHERE `<table3>`.ethnicity = "BLACK/AFRICAN AMERICAN" AND `<table3>`.days_stay > "0"
count the number of black/african american patients who stayed in the hospital for 1 or more days.
<table0>[users] { <col0>[INT]:[country] <col1>[VARCHAR]:[INSERT] } <table1>[posts] { <col0>[INT]:[user_id] <col1>[INT]:[likes] <col2>[INT]:[timestamp] <col3>[DATETIME]:[INSERT] }
SELECT COUNT( DISTINCT `<table1>`.user_id ) FROM `<table1>` INNER JOIN users ON `<table1>`.user_id = users.id WHERE users.country = 'MX' AND `<table1>`.timestamp >= DATE_SUB( CURRENT_DATE, INTERVAL 1 MONTH ) HAVING COUNT( `<table1>`.id ) > 1;
How many users from Mexico have posted more than once in the past month?
<table0>[table_name_75] { <col0>[home_team]:[VARCHAR] <col1>[venue]:[VARCHAR] }
SELECT `<col0>` AS score FROM `<table0>` WHERE `<col1>` = "western oval"
What was the home team score for the game played at Western Oval?
<table0>[table_57737] { <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 `<col2>` score" FROM `<table0>` WHERE "Venue" = 'punt road oval'
When did the away team score at Punt Road Oval?
<table0>[union_advocacy] { <col0>[INT]:[union_name] <col1>[TEXT]:[state] <col2>[TEXT]:[involved_in_advocacy] <col3>[BOOLEAN]:[INSERT] }
SELECT ( COUNT( * ) * 100.0 / ( SELECT COUNT( * ) FROM `<table0>` WHERE state = 'Illinois' ) ) AS percentage FROM `<table0>` WHERE involved_in_advocacy = true AND state = 'Illinois';
What is the percentage of members that are involved in labor rights advocacy in Illinois?
<table0>[table_40512] { <col0>[Year]:[real] <col1>[Competition]:[text] <col2>[Venue]:[text] <col3>[Position]:[text] <col4>[Event]:[text] }
SELECT "Position" FROM `<table0>` WHERE "Competition" = 'world athletics final' AND "Year" > '2008'
What position was played at the World Athletics Final Competition in a year more recent than 2008?
<table0>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table1>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm...
SELECT COUNT( * ) > 0 FROM `<table0>` WHERE `<table0>`.icustay_id IN ( SELECT `<table10>`.icustay_id FROM `<table10>` WHERE `<table10>`.hadm_id IN ( SELECT `<table15>`.hadm_id FROM `<table15>` WHERE `<table15>`.subject_id = 269 ) ) AND `<table0>`.itemid IN ( SELECT `<table2>`.itemid FROM `<table2>` WHERE `<table2>`.lab...
patient 269's arterial bp [systolic] was less than 119.0?
<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 COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id WHERE `<table1>`.discharge_location = "SNF" AND diagnoses.short_title = "Coagulat defect NEC/NOS"
count the number of patients who had discharge location as snf and diagnoses titled coagulat defect nec/nos.
<table0>[table_14649522_1] { <col0>[college]:[VARCHAR] <col1>[position]:[VARCHAR] <col2>[pick__number]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Wide Receiver" AND `<col2>` < 130.0
Which college was the wide receiver whose pick was less than 130.0 picked from?
<table0>[table_11677100_15] { <col0>[mlb_draft]:[VARCHAR] <col1>[hometown]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "High Point, NC"
How many players were from high point, nc?
<table0>[table_52761] { <col0>[Driver]:[text] <col1>[Constructor]:[text] <col2>[Laps]:[real] <col3>[Time]:[Retired] <col4>[text]:[Grid] }
SELECT AVG( "Laps" ) FROM `<table0>` WHERE "Time/Retired" = '+5 laps'
What is the average laps that had a time/retired of +5 laps?
<table0>[table_name_77] { <col0>[airport]:[VARCHAR] <col1>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "vietnam"
What airport is in Vietnam?
<table0>[classification] { <col0>[int]:[msid] <col1>[int]:[gid] } <table1>[tags] { <col0>[int]:[msid] <col1>[int]:[kid] } <table2>[movie] { <col0>[mid]:[int] <col1>[title]:[text] <col2>[release_year]:[int] <col3>[title_aka]:[text] <col4>[budget]:[text] } <table3>[tv_series] { <col0>[sid]:[int] <col1>[title]:[text] <...
SELECT `<col2>` FROM `<table4>` WHERE `<col4>` = 'Tehran'
Which actors were born in Tehran
<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 `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "delta"
How many patients with brain mass intracranial hemorrhage as their primary disease had delta an abnormal lab test status?
<table0>[table_name_73] { <col0>[to_par]:[VARCHAR] <col1>[player]:[VARCHAR] <col2>[total]:[VARCHAR] <col3>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` > 294 AND `<col3>` = "united states" AND `<col1>` = "lee trevino"
Lee Trevino of the United States with a total greater than 294 had what To par?
<table0>[table_name_98] { <col0>[roll]:[VARCHAR] <col1>[area]:[VARCHAR] <col2>[decile]:[VARCHAR] <col3>[authority]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col2>` = 7 AND `<col3>` = "state" AND `<col1>` = "macraes flat"
What is the total roll with a decile less than 7, and an authority of state, in the Macraes Flat area?
<table0>[Scientists] { <col0>[SSN]:[int] } <table1>[AssignedTo] { <col0>[Scientist]:[int] <col1>[Project]:[char] } <table2>[Projects] { <col0>[Code]:[Char] <col1>[Char]:[Hours] }
SELECT Name, COUNT( * ) FROM `<table2>` AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY Name DESC
Give me a histogram for what are the names of projects that require more than 300 hours, and how many scientists are assigned to each?, and list by the Name in desc.
<table0>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } <table1>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] }
SELECT Name, COUNT( Name ) FROM `<table0>` WHERE `<col2>` <= 200 GROUP BY Name ORDER BY COUNT( Name ) DESC
A bar chart for what are the number of the names of products with price at most 200?, display in descending by the Y.
<table0>[table_name_74] { <col0>[to_par]:[VARCHAR] <col1>[player]:[VARCHAR] <col2>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = 68 - 66 = 134 AND `<col1>` = "fred couples"
What is the to par for Fred Couples when the score is 68-66=134?
<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 diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id WHERE `<table1>`.admityear < "2187" AND diagnoses.long_title = "Cardiac tamponade"
what is the number of patients whose admission year is less than 2187 and diagnoses long title is cardiac tamponade?
<table0>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table1>[Users] { <col0>[num...
SELECT `<table16>`.Id AS "post_link", `<table16>`.Id, `<table16>`.Score, Tags.TagName AS "tagname" FROM `<table16>` INNER JOIN PostTags ON PostTags.PostId = `<table16>`.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE `<table16>`.PostTypeId = 1 AND Tags.TagName = @MyTag ORDER BY `<table16>`.Score DESC
all questions with a particular tag. how long before I get tag badges?
<table0>[essays] { <col0>[projectid]:[text] <col1>[teacher_acctid]:[text] <col2>[title]:[text] <col3>[short_description]:[text] <col4>[need_statement]:[text] <col5>[essay]:[text] } <table1>[projects] { <col0>[projectid]:[text] <col1>[teacher_acctid]:[text] <col2>[schoolid]:[text] <col3>[school_ncesid]:[text] <col4>[sc...
SELECT donationid, `<col10>` FROM `<table2>` ORDER BY `<col10>` DESC LIMIT 1
Who is the largest donor by amount? Give the donation id and the total amount of the donation.
<table0>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>...
SELECT * FROM ( SELECT DATE( CreationDate ) AS Date_Posted, SUM( CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END ) AS Questions, SUM( CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END ) AS Answers FROM `<table25>` WHERE YEAR( CreationDate ) = 2020 AND DeletionDate IS NULL GROUP BY DATE( CreationDate ) ) AS a FULL OUTER JOIN ( SELE...
Daily Activity Posts Comments Users.
<table0>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table1>[ReviewTaskStates] {...
SELECT `<table14>`.CreationDate, `<table14>`.Id AS "comment_link", `<table14>`.UserId AS "user_link", Users.Reputation FROM `<table14>` INNER JOIN Users ON `<table14>`.UserId = Users.Id WHERE LOWER( `<table14>`.Text ) LIKE LOWER( '%##SearchWord##%' ) AND `<table14>`.CreationDate BETWEEN DATEADD( DD, -'##DaysOld##', GET...
Comments containing [word] that are [days] old.
<table0>[economic_diversification] { <col0>[INT]:[effort_name] <col1>[VARCHAR]:[amount_of_investment] <col2>[DECIMAL]:[INSERT] }
SELECT effort_name, ROW_NUMBER( ) OVER ( ORDER BY amount_of_investment ASC ) as rank FROM economic_diversification;
What is the rank of each economic diversification effort in the 'economic_diversification' table, ordered by the amount of investment and ranked in ascending order?;
<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 prescriptions ON `<table0>`.hadm_id = prescriptions.hadm_id WHERE `<table0>`.age < "62" AND prescriptions.drug_type = "MAIN"
let me know the number of patients on main type drug prescription who are aged less than 62 years.
<table0>[table_name_34] { <col0>[opponent]:[VARCHAR] <col1>[attendance]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "60,594"
Which Opponent has Attendances of 60,594?
<table0>[diagnoses] { <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>`.marital_status = "SINGLE" AND lab.label = "Fibrin Degradation Products"
give the number of patients whose marital status is single and lab test name is fibrin degradation products.
<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>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE `<table3>`.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "BASE"
count the number of patients whose ethnicity is american indian/alaska native and drug type is base?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "51131"
how many patients whose admission location is emergency room admit and item id is 51131?
<table0>[international_visitors] { <col0>[INT]:[country] <col1>[VARCHAR]:[visit_month] <col2>[DATE]:[INSERT] }
SELECT MAX( MONTH( visit_month ) ) as max_month, COUNT( * ) as max_visitors FROM `<table0>` WHERE country = 'New Zealand' GROUP BY max_month;
What is the maximum number of international visitors to New Zealand in a month?
<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 prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PO"
which patients have po route of drug administration?
<table0>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table1>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table2>[airport] { <col0>[airport_code]:[varchar] <col...
SELECT DISTINCT flight.flight_id FROM `<table9>` AS AIRPORT_SERVICE_0, `<table9>` 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND f...
from LAS VEGAS to PHOENIX
<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 prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE `<table2>`.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "Clindamycin"
provide the number of patients whose admission location is clinic referral/premature and drug name is clindamycin?
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comme...
SELECT 'text' FROM `<table9>` WHERE Id = ( SELECT SuggestedEditId FROM `<table25>` WHERE Id = '##SuggestedEditId##' )
Get raw text of a suggested edit.
<table0>[table_19210115_1] { <col0>[location]:[VARCHAR] <col1>[nickname]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Owls"
Where is the University that is also called Owls?
<table0>[farmers] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[name] <col2>[VARCHAR]:[age] <col3>[INT]:[gender] <col4>[VARCHAR]:[location] <col5>[VARCHAR]:[INSERT] }
SELECT * FROM older_farmers;
Display records from the 'older_farmers' view
<table0>[table_name_92] { <col0>[rider]:[VARCHAR] <col1>[time]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "+2:11.524"
Which rider has a time of +2:11.524?
<table0>[table_17999] { <col0>[Season]:[real] <col1>[Season]:[Premiere] <col2>[Date]:[text] <col3>[Season]:[Finale] <col4>[Date]:[text] <col5>[Winner]:[text] <col6>[1st]:[Runner] <col7>[text]:[2nd] <col8>[Runner]:[text] }
SELECT "Season Finale Date" FROM `<table0>` WHERE "Winner" = 'Meiyang Chang'
When is the season finale of meiyang chang?
<table0>[table_name_56] { <col0>[round]:[INTEGER] <col1>[winning_driver]:[VARCHAR] <col2>[date]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "brendon hartley" AND `<col2>` = "27 april"
Which Round has the Winning Driver of brendon hartley, and a Date of 27 april?
<table0>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table1>[PostNotices] { <col0>[number]...
SELECT DisplayName, UpVotes FROM `<table19>` WHERE `<table19>`.Id = 22656
Finding the total upvotes for a specific user.
<table0>[table_name_59] { <col0>[pick]:[VARCHAR] <col1>[position]:[VARCHAR] <col2>[round]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "ol" AND `<col2>` < 6
What is Pick, when Position is OL, and when Round is less than 6?
<table0>[table_203_512] { <col0>[number]:[release] <col1>[date]:[text] <col2>[album]:[text] <col3>[catalog]:[number] <col4>[text]:[chart] <col5>[position]:[number] <col6>[notes]:[text] }
SELECT "album" FROM `<table0>` ORDER BY "release date" DESC LIMIT 1
what is the title of the last album ?
<table0>[readers] { <col0>[INT]:[name] <col1>[VARCHAR]:[100] <col2>[age]:[INT] <col3>[country]:[VARCHAR] <col4>[topic]:[VARCHAR] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE `<col3>` = 'USA' AND `<col4>` = 'Sports';
What is the average age of readers who prefer sports news in the US?
<table0>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table1>[PendingFlags] { <co...
SELECT * FROM `<table5>` WHERE AboutMe LIKE '%Valued Associate%' OR AboutMe LIKE '%Stack Exchange%' OR WebsiteUrl LIKE '%//stackexchange.com' OR WebsiteUrl LIKE '%//stackexchange.com/'
Moderator History (SO en espa ol).
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <co...
SELECT `<table7>`.`<table7>`name FROM `<table7>` WHERE `<table7>`.`<table2>`unitstayid IN ( SELECT `<table2>`.`<table2>`unitstayid FROM `<table2>` WHERE `<table2>`.`<table2>`healthsystemstayid IN ( SELECT `<table2>`.`<table2>`healthsystemstayid FROM `<table2>` WHERE `<table2>`.uniquepid = '005-19985' ) ) AND DATETIME( ...
what did patient 005-19985 receive for his or her first procedure during this year?
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table2>[vitalper...
SELECT t1.`<table0>`name FROM ( SELECT `<table0>`.`<table0>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table0>` WHERE `<table0>`.`<table6>`unitstayid IN ( SELECT `<table6>`.`<table6>`unitstayid FROM `<table6>` WHERE `<table6>`.age BETWEEN 20 AND 29 ) AND DATETIME( `<table0>`.`<table0>`resulttime...
what was the three most often taken lab test this year for patients 20s?
<table0>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table1>[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...
SELECT t3.spec_type_desc FROM ( SELECT t2.spec_type_desc, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT admissions.subject_id, `<table10>`.charttime FROM `<table10>` JOIN admissions ON `<table10>`.hadm_id = admissions.hadm_id WHERE `<table10>`.icd9_code = ( SELECT `<table5>`.icd9_code FROM `<table...
during the last year, what were the top four most frequent specimen tests given to a patient in the same month after the diagnosis of mal neo pyloric antrum?
<table0>[table_1610301_1] { <col0>[headquarters]:[VARCHAR] <col1>[code]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "HY"
Where is the headquarters of the place whose abbreviation is hy?
<table0>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table2>[PostHistoryTypes] { <col0>[number]...
SELECT PostId AS "post_link", COUNT( RelatedPostId ) AS count FROM `<table12>` WHERE LinkTypeId = 3 GROUP BY PostId ORDER BY COUNT( RelatedPostId ) DESC LIMIT 50
Most duplicated questions linked to a post.
<table0>[shop] { <col0>[Shop_ID]:[int] <col1>[Shop_Name]:[text] <col2>[Location]:[text] <col3>[Open_Date]:[text] <col4>[Open_Year]:[int] } <table1>[device] { <col0>[Device_ID]:[int] <col1>[Device]:[text] <col2>[Carrier]:[text] <col3>[Package_Version]:[text] <col4>[Applications]:[text] <col5>[Software_Platform]:[text] ...
SELECT Location, COUNT( `<col2>` ) FROM `<table0>` GROUP BY `<col2>` ORDER BY COUNT( `<col2>` ) DESC
Create a bar chart showing how many location across location, list Y from high to low order.
<table0>[table_name_16] { <col0>[finished]:[VARCHAR] <col1>[exited]:[VARCHAR] <col2>[entered]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "day 19" AND `<col2>` = "day 1"
What position did the celebrity finish that entered on day 1 and exited on day 19?
<table0>[exhibition_record] { <col0>[exhibition_id]:[VARCHAR] <col1>[attendance]:[VARCHAR] } <table1>[exhibition] { <col0>[exhibition_id]:[VARCHAR] <col1>[ticket_price]:[VARCHAR] }
SELECT COUNT( * ) FROM `<table0>` AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10
How many exhibitions have a attendance more than 100 or have a ticket price below 10?
<table0>[routes] { <col0>[rid]:[number] <col1>[dst_apid]:[number] <col2>[dst_ap]:[text] <col3>[src_apid]:[number] <col4>[src_ap]:[text] <col5>[alid]:[number] <col6>[airline]:[text] <col7>[codeshare]:[text] } <table1>[airports] { <col0>[apid]:[number] <col1>[name]:[text] <col2>[city]:[text] <col3>[country]:[text] <col4...
SELECT country, COUNT( * ) FROM `<table2>` GROUP BY `<col5>` ORDER BY COUNT( * ) DESC
How many airlines operate out of each country in descending order?
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col1...
SELECT School_ID, `<col4>` FROM `<table0>` GROUP BY `<col10>`
Show school id vs acc_percent as scatter plot use a different color for each All_Road
<table0>[table_name_94] { <col0>[outcome]:[VARCHAR] <col1>[partner]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "nicole arendt"
What is the outcome of the match when the partner is Nicole Arendt?
<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 AVG( `<table1>`.age ) FROM `<table1>` WHERE `<table1>`.expire_flag = "0" AND `<table1>`.diagnosis = "COPD EXACERBATION"
what is average age of patients whose death status is 0 and primary disease is copd exacerbation?
<table0>[Shipments] { <col0>[INT]:[company] <col1>[VARCHAR]:[255] <col2>[quantity]:[INT] <col3>[time]:[DATETIME] } <table1>[Time] { <col0>[INT]:[date] <col1>[DATE]:[quarter] <col2>[INT]:[INSERT] }
SELECT SUM( `<col2>` ) FROM `<table0>` S JOIN Time T ON S.time = T.date WHERE company = 'Oceanic Corp' AND quarter = 1;
What is the total number of containers shipped by company "Oceanic Corp" in the first quarter of 2020?
<table0>[program_course] { <col0>[program_id]:[int] <col1>[course_id]:[int] <col2>[workload]:[int] <col3>[category]:[varchar] } <table1>[course] { <col0>[course_id]:[int] <col1>[name]:[varchar] <col2>[department]:[varchar] <col3>[number]:[varchar] <col4>[credits]:[varchar] <col5>[advisory_requirement]:[varchar] <col6>...
SELECT DISTINCT `<col1>` FROM `<table2>` WHERE NOT `<col1>` IN ( SELECT INSTRUCTORalias1.name FROM `<table1>` AS COURSEalias0 INNER JOIN `<table1>`_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.`<table1>`_id = COURSE_OFFERINGalias0.`<table1>`_id INNER JOIN offering_`<table2>` AS OFFERING_INSTRUCTOR ON OFFERING_OFFE...
Who are the professors that have no experience teaching CLIMATE 380 ?
<table0>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditor...
SELECT s.userId, u.Id AS "user_link", u.CreationDate, s.questionCount, u.Reputation FROM ( SELECT u.Id AS userId, COUNT( p.Id ) AS questionCount FROM `<table21>` AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL GROUP BY u.Id ) AS s JOIN `<table21>` AS u ON s.userI...
New users with some reputation and some unanswered questions.
<table0>[table_train_181] { <col0>[int]:[systolic_blood_pressure_sbp] <col1>[int]:[fasting_plasma_glucose_fpg] <col2>[float]:[hemoglobin_a1c_hba1c] <col3>[float]:[hepatitis_c] <col4>[bool]:[hepatitis_b] <col5>[bool]:[exposure_to_hiv] <col6>[bool]:[diastolic_blood_pressure_dbp] <col7>[int]:[hypertension] <col8>[bool]:[N...
SELECT * FROM `<table0>` WHERE hemoglobin_a1c_hba1c >= 7.5 AND hemoglobin_a1c_hba1c <= 11.5
have hemoglobin a1c ( hba1c ) 7.5 _ 11.5 percent ( % )
<table0>[artist_festivals] { <col0>[artist_id]:[INT] <col1>[festival_name]:[VARCHAR] }
SELECT artist_id, COUNT( DISTINCT `<col1>` ) as festival_count FROM `<table0>` GROUP BY artist_id;
How many times has each artist performed at music festivals?
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <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] ...
SELECT JOB_ID, SUM( `<col9>` ) FROM `<table1>` WHERE `<col5>` < '2002-06-21' GROUP BY `<col6>`
For those employees who was hired before 2002-06-21, find job_id and the sum of manager_id , and group by attribute job_id, and visualize them by a bar chart.
<table0>[table_2668378_5] { <col0>[first_elected]:[VARCHAR] <col1>[district]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Kentucky 3"
Name the number of first elected for kentucky 3
<table0>[table_50919] { <col0>[Episode]:[text] <col1>[Air]:[Date] <col2>[text]:[Timeslot] <col3>[text]:[text] <col4>[Viewers]:[real] }
SELECT MAX( "Viewers" ) FROM `<table0>` WHERE "18-49" = '1.8/6'
What is the highest number of viewers for the episode that has an 18-49 of 1.8/6?
<table0>[CREATE] { <col0>[SCHEMA]:[exists] <col1>[biosensors]:[USE] } <table1>[exists] { <col0>[projects]:[INT] <col1>[name]:[VARCHAR] <col2>[100]:[country] <col3>[VARCHAR]:[100] <col4>[status]:[VARCHAR] <col5>[100]:[INSERT] <col6>[projects]:[name] <col7>[country]:[status] <col8>[VALUES]:[ProjectA] <col9>[USA]:[Comple...
SELECT projects.continent, projects.country, COUNT( * ) FROM biosensors.projects GROUP BY projects.continent, projects.country HAVING status = 'Completed' ORDER BY COUNT( * ) DESC;
Calculate the number of biosensor projects that have been completed in each country, grouped by continent.
<table0>[hospitals] { <col0>[INT]:[name] <col1>[TEXT]:[city] <col2>[TEXT]:[state] <col3>[TEXT]:[beds] }
SELECT state, COUNT( * ) FROM `<table0>` GROUP BY state;
What is the number of hospitals in each state?
<table0>[table_19061741_3] { <col0>[name]:[VARCHAR] <col1>[home_or_representative_town_or_province]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Guiguinto, Bulacan"
When guiguinto, bulacan is the home or representative town or province how many names are there?
<table0>[contractor] { <col0>[INT]:[name] <col1>[TEXT]:[INSERT] } <table1>[vehicle_manufacturing] { <col0>[contractor_id]:[INT] <col1>[manufacture_date]:[DATE] <col2>[quantity]:[INT] }
SELECT SUM( `<col2>` ) FROM `<table1>` WHERE `<col0>` = 1 AND `<col1>` BETWEEN '2022-01-01' AND '2022-03-31';
Find the number of military vehicles manufactured by contractor 'ACME Corp' in Q1 2022.
<table0>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table1>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[minutes_distant]:[int] } <ta...
SELECT DISTINCT flight.flight_id FROM `<table1>` AS AIRPORT_SERVICE_0, `<table1>` 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fligh...
i want to fly from BOSTON to DALLAS