schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[table_63692] { <col0>[School]:[text] <col1>[City]:[text] <col2>[Team]:[text] <col3>[County]:[text] <col4>[Year]:[Joined] <col5>[text]:[Year] <col6>[Left]:[text] }
SELECT "Year Left" FROM `<table0>` WHERE "Team Name" = 'hornets'
What year did the Hornets leave the conference?
<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 lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.gender = "M" AND lab.label = "Magnesium, Urine"
how many male patients tested for magnessium urine in lab?
<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"
provide the number of patients whose ethnicity is black/african american and days of hospital stay is greater than 0?
<table0>[table_203_383] { <col0>[number]:[week] <col1>[number]:[date] <col2>[text]:[opponent] <col3>[text]:[time] <col4>[text]:[game] <col5>[site]:[text] <col6>[text]:[result] <col7>[score]:[text] <col8>[record]:[text] <col9>[bye]:[text] }
SELECT "opponent" FROM `<table0>` ORDER BY id DESC LIMIT 1
against which opponent was the last game of the season ?
<table0>[table_27967] { <col0>[Series]:[real] <col1>[Season]:[real] <col2>[Title]:[text] <col3>[Director]:[text] <col4>[Writer]:[text] <col5>[Original]:[air] <col6>[date]:[text] }
SELECT MIN( "Series #" ) FROM `<table0>` WHERE "Title" = 'The 37-Year Itch'
When 'the 37-year itch' is the title what is the lowest series number?
<table0>[table_203_874] { <col0>[number]:[year] <col1>[number]:[competition] <col2>[text]:[venue] <col3>[text]:[position] <col4>[text]:[event] <col5>[text]:[notes] }
SELECT "competition" FROM `<table0>` WHERE "year" < ( SELECT "year" FROM `<table0>` WHERE "competition" = 'olympic games' AND "year" = 1996 ) ORDER BY "year" DESC LIMIT 1
what was the name of the competition that took place before the olympic games in 1996 ?
<table0>[regulatory_compliance] { <col0>[compliance_id]:[INT] <col1>[regulation_name]:[VARCHAR] <col2>[compliance_date]:[DATE] }
DELETE FROM `<table0>` WHERE `<col2>` < ( CURRENT_DATE - INTERVAL '2' YEAR );
Delete all records from the regulatory_compliance table where the compliance_date is older than 2 years
<table0>[table_name_87] { <col0>[average]:[INTEGER] <col1>[highest]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 5 OFFSET 078
What is the highest average number in attendance when the most in attendance is 5,078?
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.age < "41" AND lab.fluid = "Other Body Fluid"
give the number of patients aged below 41 years whose lab test fluid is other body fluid.
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentim...
SELECT `<table5>`.`<table5>`name FROM `<table5>` WHERE `<table5>`.`<table6>`unitstayid IN ( SELECT `<table6>`.`<table6>`unitstayid FROM `<table6>` WHERE `<table6>`.`<table6>`healthsystemstayid IN ( SELECT `<table6>`.`<table6>`healthsystemstayid FROM `<table6>` WHERE `<table6>`.uniquepid = '015-15167' ) ) AND STRFTIME( ...
what procedure did patient 015-15167 receive for the first time in 2100?
<table0>[BuildingTypes] { <col0>[TypeID]:[int] <col1>[TypeName]:[varchar] } <table1>[GreenBuildingCertifications] { <col0>[CertificationID]:[int] <col1>[TypeID]:[int] <col2>[CertificationName]:[varchar] }
SELECT `<table0>`.TypeName, GreenBuildingCertifications.CertificationName, COUNT( GreenBuildingCertifications.CertificationID ) FROM `<table0>` INNER JOIN GreenBuildingCertifications ON `<table0>`.TypeID = GreenBuildingCertifications.TypeID GROUP BY `<table0>`.TypeName, GreenBuildingCertifications.CertificationName;
List the Green Building certifications and their count for each building type in the SmartCities database.
<table0>[table_204_872] { <col0>[number]:[name] <col1>[text]:[completed] <col2>[text]:[architect] <col3>[text]:[location] <col4>[text]:[year] <col5>[listing]:[ref] }
SELECT "year of `<col5>` & ref( s )" FROM `<table0>` GROUP BY "year of `<col5>` & ref( s )" ORDER BY COUNT( "name" ) DESC LIMIT 1
which year has the most buildings listed ?
<table0>[hotel_tech_adoptions] { <col0>[INT]:[hotel_id] <col1>[INT]:[tech_type] <col2>[TEXT]:[installed_date] } <table1>[hotels] { <col0>[INT]:[name] <col1>[TEXT]:[city] <col2>[TEXT]:[country] <col3>[TEXT]:[has_ai_tech] }
SELECT 100.0 * COUNT( hta.hotel_id ) / ( SELECT COUNT( * ) FROM `<table1>` WHERE city = 'London' AND country = 'UK' ) FROM `<table0>` hta INNER JOIN `<table1>` h ON hta.hotel_id = h.id WHERE h.city = 'London' AND h.country = 'UK' AND tech_type = 'AI';
What is the percentage of hotels in London, UK that have adopted AI technology?
<table0>[table_203_555] { <col0>[number]:[place] <col1>[text]:[player] <col2>[text]:[country] <col3>[text]:[score] <col4>[text]:[par] <col5>[number]:[money] }
SELECT COUNT( "player" ) FROM `<table0>`
what were the total number of players ?
<table0>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table1>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table2>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2...
SELECT STATE_PROVINCE, COUNT( `<col4>` ) FROM `<table3>` GROUP BY `<col4>`
Give me a bar chart to compare the number of state provinces located in different cities.
<table0>[table_28789] { <col0>[real]:[real] <col1>[Title]:[text] <col2>[Directed]:[text] <col3>[Written]:[text] <col4>[Patient]:[Portrayer] <col5>[text]:[Original] <col6>[air]:[date] <col7>[text]:[Production] <col8>[code]:[text] }
SELECT "Original `<col6>` date" FROM `<table0>` WHERE "Title" = 'Monica Wilder'
What is the original air date of the episode with the title 'Monica Wilder'?
<table0>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table1>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[t...
SELECT COUNT( DISTINCT t1.subject_id ) FROM ( SELECT admissions.subject_id, `<table5>`.charttime FROM `<table5>` JOIN admissions ON `<table5>`.hadm_id = admissions.hadm_id WHERE `<table5>`.icd9_code = ( SELECT `<table10>`.icd9_code FROM `<table10>` WHERE `<table10>`.short_title = 'anemia-other chronic dis' ) AND DATETI...
how many people received a cont inv mec ven <96 hrs procedure within 2 months after they had been diagnosed with anemia-other chronic dis since 1 year ago?
<table0>[MilitaryEquipmentSales] { <col0>[INT]:[country] <col1>[VARCHAR]:[255] <col2>[product]:[VARCHAR] <col3>[255]:[quantity] <col4>[INT]:[sale_price] <col5>[DECIMAL]:[INSERT] }
SELECT SUM( quantity * sale_price ) FROM `<table0>` WHERE country IN ( 'United States', 'Canada' );
What are the total military equipment sales for the United States and Canada?
<table0>[table_name_47] { <col0>[rank]:[INTEGER] <col1>[director]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "john woo"
what is the highest rank for director john woo?
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <ta...
SELECT t3.`<table9>`name FROM ( SELECT t2.`<table9>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table9>`.`<table9>`time FROM `<table9>` JOIN patient ON `<table9>`.patientunitstayid = patient.patientunitstayid WHERE `<table9>`.`<table9>`name = 'coronary artery disease -...
list the four most common diagnoses that patients have been diagnosed with in the same month after being diagnosed with coronary artery disease - no previous cabg.
<table0>[table_name_99] { <col0>[laps]:[INTEGER] <col1>[grid]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 17
What is the highest number of laps for grid 17?
<table0>[gymnast] { <col0>[Gymnast_ID]:[VARCHAR] } <table1>[people] { <col0>[Hometown]:[VARCHAR] <col1>[People_ID]:[VARCHAR] }
SELECT T2.Hometown, COUNT( * ) FROM `<table0>` AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
What are the hometowns of gymnasts and the corresponding number of gymnasts?
<table0>[table_67110] { <col0>[Date]:[text] <col1>[Visiting]:[Team] <col2>[text]:[Final] <col3>[Score]:[text] <col4>[Host]:[Team] <col5>[text]:[Stadium] }
SELECT "Date" FROM `<table0>` WHERE "Visiting Team" = 'philadelphia eagles'
Name the date with visiting team of philadelphia eagles
<table0>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table1>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[numbe...
SELECT DISTINCT `<table9>`.`<table9>` FROM `<table9>` WHERE `<table9>`.event_type = '`<table15>`' AND `<table9>`.event_id IN ( SELECT `<table15>`.row_id FROM `<table15>` WHERE `<table15>`.icd9_code = ( SELECT `<table14>`.icd9_code FROM `<table14>` WHERE `<table14>`.short_title = 'blepharorrhaphy' ) )
what is the cost of the procedure called blepharorrhaphy?
<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>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3...
SELECT `<table3>`.admittime, procedures.icd9_code FROM `<table3>` INNER JOIN procedures ON `<table3>`.hadm_id = procedures.hadm_id WHERE `<table3>`.subject_id = "17772"
what is the admission time and procedure icd9 code of the patient id 17772?
<table0>[requirement] { <col0>[requirement_id]:[int] } <table1>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table2>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_num...
SELECT DISTINCT instructor.name FROM `<table5>` INNER JOIN `<table5>`_offering ON `<table5>`.`<table5>`_id = `<table5>`_offering.`<table5>`_id INNER JOIN offering_instructor ON offering_instructor.offering_id = `<table5>`_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instr...
For the upper-level classes , who is teaching them ?
<table0>[young_forest] { <col0>[INT]:[species] <col1>[VARCHAR]:[255] <col2>[age]:[INT] }
SELECT COUNT( * ) FROM `<table0>` WHERE species = 'Maple';
How many trees are there in the young_forest table for the species 'Maple'?
<table0>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table1>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:...
SELECT AVG( t1.c1 ) FROM ( SELECT SUM( `<table15>`.`<table15>` ) AS c1 FROM `<table15>` WHERE `<table15>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.icd9_code = ( SELECT `<table8>`.icd9_code FROM `<table8>` WHERE `<table8>`.short_title = 'debrid opn fx-tibia/fib' ) ) AND STRFTIME( '%y', `<t...
what is the average hospital cost that includes a procedure known as debrid opn fx-tibia/fib until 2104?
<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 lab.itemid = "51256" AND lab.flag = "delta"
how many of the patients with item id 51256 had abnormal delta lab test results?
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT t.TagName, COUNT( p.Id ) AS Posts, SUM( CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END ) AS Answered FROM `<table23>` AS t INNER JOIN Post`<table23>` AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ( 'aws-cognito', 'amazon-cognito', 'gluu', 'keycloak' ...
Tag Usage - User Authentication.
<table0>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[PostTypes] { <col0>[number]:[text] } <table2>[PostHistoryTypes] { <col0>[number]:[text] } <table3>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <...
SELECT ( SELECT COUNT( * ) FROM Posts, Users AS u WHERE Tags LIKE '%<##tag##>%' AND OwnerUserId = u.Id AND u.Reputation < 300 ) AS "below 300 rep", ( SELECT COUNT( * ) FROM Posts, Users AS u WHERE Tags LIKE '%<##tag##>%' AND OwnerUserId = u.Id ) AS "total"
Low rep users using tag.
<table0>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table1>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[numb...
SELECT SUM( `<table5>`.amount ) FROM `<table5>` WHERE `<table5>`.icustay_id IN ( SELECT `<table14>`.icustay_id FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table9>`.hadm_id FROM `<table9>` WHERE `<table9>`.subject_id = 23061 ) ) AND STRFTIME( '%y-%m-%d', `<table5>`.charttime ) <= '2105-12-28'
what is the total amount of input until 12/28/2105 patient 23061 had received?
<table0>[table_225093_4] { <col0>[date_successor_seated]:[VARCHAR] <col1>[district]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Massachusetts 2nd"
What is the date successor seated where Massachusetts 2nd is the district?
<table0>[t_kc21_t_kc24] { <col0>[MED_CLINIC_ID]:[text] <col1>[MED_SAFE_PAY_ID]:[number] } <table1>[t_kc24] { <col0>[ACCOUNT_DASH_DATE]:[time] <col1>[ACCOUNT_DASH_FLG]:[number] <col2>[CASH_PAY]:[number] <col3>[CIVIL_SUBSIDY]:[number] <col4>[CKC102]:[number] <col5>[CLINIC_ID]:[text] <col6>[CLINIC_SLT_DATE]:[time] <col7>...
SELECT `<table2>`.OUT_DIAG_DOC_CD, `<table2>`.OUT_DIAG_DOC_NM FROM `<table2>` WHERE `<table2>`.PERSON_ID = '69621807' GROUP BY `<table2>`.OUT_DIAG_DOC_CD ORDER BY COUNT( * ) DESC
69621807的团伙成员最常去看病的几位医生的排序看一下
<table0>[Ref_Document_Types] { <col0>[Document_Type_Code]:[CHAR] <col1>[Document_Type_Name]:[VARCHAR] <col2>[255]:[Document_Type_Description] <col3>[VARCHAR]:[255] } <table1>[Accounts] { <col0>[Account_ID]:[INTEGER] <col1>[Statement_ID]:[INTEGER] <col2>[Account_Details]:[VARCHAR] } <table2>[Documents_with_Expenses] {...
SELECT T1.Budget_Type_Code, COUNT( T1.Budget_Type_Code ) FROM `<table2>` AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY T1.Budget_Type_Code
Return a bar chart to show how many documents for different budget type code, and I want to sort X-axis in ascending order.
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table1>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table2>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varc...
SELECT HIRE_DATE, AVG( `<col10>` ) FROM `<table2>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table6>` WHERE `<col9>` BETWEEN 100 AND 200 )
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
<table0>[clients] { <col0>[INT]:[name] <col1>[TEXT]:[region] <col2>[TEXT]:[billing_amount] <col3>[DECIMAL]:[INSERT] }
SELECT SUM( billing_amount ) FROM `<table0>` WHERE region = 'new york';
What is the total billing amount for clients in the 'new york' region?
<table0>[table_name_57] { <col0>[result]:[VARCHAR] <col1>[round]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "sf"
What is Result, when Round is SF?
<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 ACC_Percent, `<col8>` FROM `<table0>` GROUP BY `<col3>`
Visualize the relationship between ACC_Percent and All_Games_Percent , and group by attribute ACC_Regular_Season.
<table0>[Catalog_Structure] { <col0>[catalog_level_number]:[INTEGER] <col1>[catalog_id]:[INTEGER] <col2>[catalog_level_name]:[VARCHAR] } <table1>[Attribute_Definitions] { <col0>[attribute_id]:[INTEGER] <col1>[attribute_name]:[VARCHAR] <col2>[attribute_data_type]:[VARCHAR] } <table2>[Catalog_Contents_Additional_Attrib...
SELECT catalog_level_name, `<col0>` FROM `<table0>` WHERE `<col0>` BETWEEN 5 AND 10 ORDER BY `<col0>`
Give me a histogram for what are the name and level of catalog structure with level number between 5 and 10, and sort y-axis in asc order.
<table0>[competition_result] { <col0>[Competition_ID]:[int] <col1>[Club_ID_1]:[int] <col2>[Club_ID_2]:[int] <col3>[Score]:[text] } <table1>[competition] { <col0>[Competition_ID]:[int] <col1>[Year]:[real] <col2>[Competition_type]:[text] <col3>[Country]:[text] } <table2>[player] { <col0>[Player_ID]:[int] <col1>[name]:[...
SELECT Competition_type, COUNT( `<col2>` ) FROM `<table1>` GROUP BY `<col2>` ORDER BY `<col2>` DESC
A bar chart showing the number of different competition types, display from high to low by the x axis.
<table0>[table_204_268] { <col0>[number]:[album] <col1>[single]:[text] <col2>[performer]:[text] <col3>[year]:[number] <col4>[variant]:[text] <col5>[notes]:[text] }
SELECT COUNT( "album/single" ) FROM `<table0>` WHERE "performer" IN ( 'martin carthy', 'ewan maccoll' )
how many albums are performed by martin carthy or ewan maccoll ?
<table0>[song] { <col0>[song_name]:[varchar2] <col1>[artist_name]:[varchar2] <col2>[country]:[varchar2] <col3>[f_id]:[number] <col4>[genre_is]:[varchar2] <col5>[rating]:[number] <col6>[languages]:[varchar2] <col7>[releasedate]:[Date] <col8>[resolution]:[number] } <table1>[genre] { <col0>[g_name]:[varchar2] <col1>[rati...
SELECT languages, AVG( `<col5>` ) FROM `<table0>` GROUP BY `<col6>` ORDER BY AVG( `<col5>` ) DESC
Show me a bar chart for what is the average rating of songs for each language?, and could you sort total number in desc order?
<table0>[mining_sites] { <col0>[INT]:[name] } <table1>[equipment_usage] { <col0>[site_id]:[INT] <col1>[equipment_type]:[VARCHAR] <col2>[usage_count]:[INT] <col3>[INSERT]:[mining_sites] <col4>[name]:[VALUES] <col5>[Site]:[Site] <col6>[Site]:[Site] }
SELECT ms.name, eu.equipment_type, eu.usage_count FROM `<table0>` ms INNER JOIN `<table1>` eu ON ms.id = eu.site_id WHERE eu.usage_count = ( SELECT MAX( `<col2>` ) FROM `<table1>` );
Find the mining sites that have used a specific type of equipment more than any other site.
<table0>[popularity] { <col0>[menu_id]:[INT] }
SELECT menu_name, price FROM menus WHERE menu_type = 'Entree' AND price > ( SELECT MIN( price ) FROM menus WHERE menu_type = 'Entree' ) AND `<col0>` NOT IN ( SELECT `<col0>` FROM `<table0>` WHERE `<table0>` = ( SELECT MIN( `<table0>` ) FROM `<table0>` ) );
Show menu items with higher prices than the least popular entrée.
<table0>[table_203_677] { <col0>[number]:[year] <col1>[number]:[competition] <col2>[text]:[venue] <col3>[text]:[position] <col4>[text]:[event] <col5>[text]:[notes] }
SELECT COUNT( * ) FROM `<table0>` WHERE "position" = 1
how many 1st place finished did he have ?
<table0>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table1>[compartment_class] { <col0>[compartment]:[varchar] <col1>[class_type]:[varchar] } <table2>[airport] { <col0>[airport_code]:[var...
SELECT DISTINCT fare.fare_id FROM `<table3>` AS AIRPORT_SERVICE_0, `<table3>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis WHERE ( ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'P...
what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way
<table0>[table_name_2] { <col0>[home_team]:[VARCHAR] <col1>[away_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "footscray"
Which team plays against Footscray as the home team?
<table0>[table_name_50] { <col0>[venue]:[VARCHAR] <col1>[away_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "hawthorn"
Where did Hawthorn have their away match against North Melbourne?
<table0>[construction_hours_br] { <col0>[worker_id]:[INT] <col1>[city]:[VARCHAR] <col2>[hours_worked]:[INT] <col3>[work_date]:[DATE] }
SELECT SUM( `<col2>` ) FROM `<table0>` WHERE `<col1>` = 'Rio de Janeiro' AND EXTRACT( MONTH FROM `<col3>` ) = 3 AND ( EXTRACT( YEAR FROM `<col3>` ) = 2019 OR EXTRACT( YEAR FROM `<col3>` ) = 2021 );
Show the total construction hours worked in 'Rio de Janeiro' for the month of 'March' in 2019 and 2021.
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT `<col0>` FROM `<table22>` AS pt WHERE pt.TagId = @t_id
Get all Post ids by tag name.
<table0>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <ta...
SELECT `<table14>`.org_name FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table16>`.hadm_id FROM `<table16>` WHERE `<table16>`.subject_id = 74624 AND NOT `<table16>`.dischtime IS NULL ORDER BY `<table16>`.admittime DESC LIMIT 1 ) AND `<table14>`.spec_type_desc = 'catheter tip-iv' AND NOT `<table14>`.org_name...
what was the organism that was detected during patient 74624's last catheter tip-iv test in their last hospital visit?
<table0>[paperdataset] { <col0>[paperid]:[int] <col1>[datasetid]:[int] } <table1>[venue] { <col0>[venueid]:[int] <col1>[venuename]:[varchar] } <table2>[paperfield] { <col0>[fieldid]:[int] <col1>[paperid]:[int] } <table3>[dataset] { <col0>[datasetid]:[int] <col1>[datasetname]:[varchar] } <table4>[journal] { <col0>[j...
SELECT DISTINCT paper.paperid FROM author, keyphrase, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = pape...
the papers on semantic parsing by li dong at acl in 2016
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", u.Id AS "user_link", u.Reputation, u.Location, u.LastAccessDate, COUNT( * ) AS AndroidAnswers FROM `<table19>` AS u, Posts AS p, Posts AS pp WHERE u.Id IN ( SELECT Id FROM `<table19>` WHERE LOWER( Location ) LIKE '%turkey%' OR UPPER( Location ) LIKE '%TR' O...
Top N android tagged question answerers in Turkey.
<table0>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationti...
SELECT t3.drugname FROM ( SELECT t2.drugname, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table9>`.drugstarttime FROM `<table9>` JOIN patient ON `<table9>`.patientunitstayid = patient.patientunitstayid WHERE `<table9>`.drugname = 'haloperidol lactate inj' AND STRFTIME( '%y',...
list the top four most frequent drugs that were prescribed to patients within 2 months after being prescribed with haloperidol lactate inj in 2103.
<table0>[table_name_50] { <col0>[race_name]:[VARCHAR] <col1>[circuit]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "pergusa"
What is the name of the race that has the pergusa Circuit?
<table0>[table_name_97] { <col0>[volume]:[VARCHAR] <col1>[weeks_on_top]:[VARCHAR] <col2>[artist]:[VARCHAR] }
SELECT `<col0>` AS :issue FROM `<table0>` WHERE `<col1>` > 1 AND `<col2>` = "peter cetera"
What Volume:Issue that has Peter Cetera as the artist and was on top for longer than 1 week?
<table0>[table_20883] { <col0>[Parameter]:[text] <col1>[1st]:[stage] <col2>[text]:[2nd] <col3>[stage]:[text] <col4>[3rd]:[stage] <col5>[text]:[4th] <col6>[stage]:[text] }
SELECT "Parameter" FROM `<table0>` WHERE "3rd stage" = '1.0 m'
Name the paarameter for 1.0 m 3rd stage
<table0>[student] { <col0>[student_id]:[int] <col1>[lastname]:[varchar] <col2>[firstname]:[varchar] <col3>[program_id]:[int] <col4>[declare_major]:[varchar] <col5>[total_credit]:[int] <col6>[total_gpa]:[float] <col7>[entered_as]:[varchar] <col8>[admit_term]:[int] <col9>[predicted_graduation_semester]:[int] <col10>[degr...
SELECT DISTINCT `<table9>`.department, `<table9>`.name, `<table9>`.number FROM `<table9>` INNER JOIN `<table9>`_offering ON `<table9>`.`<table9>`_id = `<table9>`_offering.`<table9>`_id INNER JOIN semester ON semester.semester_id = `<table9>`_offering.semester WHERE ( `<table9>`.number = 398 OR `<table9>`.number = 498 O...
What are the special topics classes options for next Winter ?
<table0>[TheaterTickets] { <col0>[INT]:[country] <col1>[VARCHAR]:[quarter] <col2>[INT]:[year] <col3>[INT]:[community] <col4>[VARCHAR]:[price] <col5>[FLOAT]:[INSERT] }
SELECT MAX( price ) FROM `<table0>` WHERE country = 'USA' AND quarter = 1 AND year = 2022 AND community = 'Latinx';
What was the maximum ticket price for Latinx theater productions in the USA in Q1 2022?
<table0>[table_26565917_2] { <col0>[title]:[VARCHAR] <col1>[no_in_season]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 5
what was the name of episode 5?
<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>[prescr...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN procedures ON `<table3>`.hadm_id = procedures.hadm_id WHERE `<table3>`.dob_year < "2175" AND procedures.icd9_code = "9915"
give me the number of patients with procedure icd9 code 9915 who were born before 2175.
<table0>[table_24559] { <col0>[real]:[real] <col1>[Title]:[text] <col2>[Directed]:[text] <col3>[Written]:[text] <col4>[air]:[date] <col5>[text]:[Production] <col6>[code]:[text] <col7>[viewers]:[million] }
SELECT "U.S. `<col7>` ( million )" FROM `<table0>` WHERE "Title" = 'Rabid'
How many millions of people in the US saw the episode titled 'Rabid'?
<table0>[peacekeeping_operations] { <col0>[operation_id]:[INT] <col1>[country]:[VARCHAR] <col2>[255]:[start_date] <col3>[DATE]:[INSERT] } <table1>[countries] { <col0>[country]:[VARCHAR] }
SELECT COUNT( * ) FROM `<table0>` INNER JOIN countries ON `<table0>`.country = countries.country WHERE `<col1>` = 'Country X' AND start_date >= '2010-01-01';
How many peacekeeping operations has Country X participated in since 2010?
<table0>[WINE] { <col0>[Grape]:[VARCHAR] <col1>[Appelation]:[VARCHAR] <col2>[VARCHAR]:[Score] }
SELECT Grape, Appelation, Name FROM `<table0>` WHERE Score > 93 ORDER BY Name
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
<table0>[table_44246] { <col0>[Fin]:[Pos] <col1>[text]:[Car] <col2>[text]:[Driver] <col3>[text]:[Team] <col4>[text]:[Laps] <col5>[text]:[Time] <col6>[Retired]:[text] <col7>[Grid]:[text] <col8>[Laps]:[Led] <col9>[text]:[Points] }
SELECT "Laps" FROM `<table0>` WHERE "Points" = 'lead changes: 13 between 8 drivers'
Which Laps has a Points of lead changes: 13 between 8 drivers?
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[tim...
SELECT t1.`<table3>`name FROM ( SELECT `<table3>`.`<table3>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table3>` WHERE STRFTIME( '%y', `<table3>`.`<table3>`time ) >= '2104' GROUP BY `<table3>`.`<table3>`name ) AS t1 WHERE t1.c1 <= 4
what are the four most frequent diagnoses since 2104?
<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 procedures ON `<table3>`.hadm_id = procedures.hadm_id WHERE `<table3>`.admityear < "2144" AND procedures.short_title = "Left heart cardiac cath"
how many patients whose admission year is less than 2144 and procedure short title is left heart cardiac cath?
<table0>[students] { <col0>[student_id]:[number] <col1>[student_details]:[text] } <table1>[people_addresses] { <col0>[person_address_id]:[number] <col1>[person_id]:[number] <col2>[address_id]:[number] <col3>[date_from]:[time] <col4>[date_to]:[time] } <table2>[people] { <col0>[person_id]:[number] <col1>[first_name]:[t...
SELECT T1.course_name FROM `<table3>` AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT( * ) DESC LIMIT 1
which course has most number of registered students?
<table0>[menu] { <col0>[menu_id]:[INT] <col1>[item_name]:[VARCHAR] <col2>[255]:[category] <col3>[VARCHAR]:[255] <col4>[price]:[DECIMAL] <col5>[inventory_count]:[INT] <col6>[last_updated]:[TIMESTAMP] } <table1>[orders] { <col0>[order_id]:[INT] <col1>[menu_id]:[INT] <col2>[order_date]:[TIMESTAMP] <col3>[quantity]:[INT] ...
SELECT `<table0>`.item_name, SUM( CASE WHEN EXTRACT( MONTH FROM order_date ) = EXTRACT( MONTH FROM CURRENT_DATE ) THEN quantity ELSE 0 END ) - SUM( CASE WHEN EXTRACT( MONTH FROM order_date ) = EXTRACT( MONTH FROM CURRENT_DATE - INTERVAL '1 month' ) THEN quantity ELSE 0 END ) as total_orders_diff FROM `<table0>` JOIN or...
What is the difference in total orders between the current month and the previous month for each menu item?
<table0>[WastewaterTreatmentFacilities] { <col0>[FacilityID]:[INT] <col1>[FacilityName]:[VARCHAR] <col2>[255]:[Address] <col3>[VARCHAR]:[255] <col4>[City]:[VARCHAR] <col5>[255]:[State] <col6>[VARCHAR]:[255] <col7>[ZipCode]:[VARCHAR] } <table1>[WaterUsage] { <col0>[UsageID]:[INT] <col1>[FacilityID]:[INT] <col2>[UsageDa...
SELECT UsageID, SUM( `<col3>` ) OVER ( ORDER BY `<col2>` ) FROM `<table1>` WHERE `<col1>` = 1;
What is the cumulative water usage for the Blue Ridge Wastewater Treatment Plant up to a specific date?
<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 `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.admission_location = "TRSF WITHIN THIS FACILITY" AND `<table4>`.diagnosis = "UPPER GI BLEED"
give me the number of patients whose admission location is trsf within this facility and primary disease is upper gi bleed?
<table0>[Country] { <col0>[CountryCode]:[text] <col1>[ShortName]:[text] <col2>[TableName]:[text] <col3>[LongName]:[text] <col4>[Alpha2Code]:[text] <col5>[CurrencyUnit]:[text] <col6>[SpecialNotes]:[text] <col7>[Region]:[text] <col8>[IncomeGroup]:[text] <col9>[Wb2Code]:[text] <col10>[NationalAccountsBaseYear]:[text] <col...
SELECT `<table0>`Code, `<col7>` FROM `<table0>` WHERE ( `<col8>` = 'High income: OECD' OR `<col8>` = 'High income: nonOECD' ) AND `<col7>` LIKE '%Asia%'
Which high income group countries are from Asia?
<table0>[Climate] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[location] <col2>[VARCHAR]:[255] <col3>[temperature]:[DECIMAL] } <table1>[IndigenousCommunities] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[name] <col2>[VARCHAR]:[255] <col3>[climate_id]:[INT] <col4>[FOREIGN]:[KEY] <col5>[climate_id]:[REFERENCES] }
SELECT `<table1>`.name FROM `<table1>` INNER JOIN Climate ON `<table1>`.climate_id = Climate.id WHERE Climate.temperature < -20;
Which indigenous communities live in climates with temperatures below -20 degrees Celsius?
<table0>[Aquaculture_Farms] { <col0>[INT]:[region] <col1>[VARCHAR]:[255] <col2>[temperature]:[DECIMAL] <col3>[month]:[INT] }
SELECT `<table0>`.id FROM `<table0>` WHERE `<table0>`.region = 'South America' AND `<table0>`.temperature < 15 AND `<table0>`.month = 1;
List all aquaculture farms in South America with water temperatures below 15 degrees Celsius in January.
<table0>[party_host] { <col0>[Party_ID]:[int] <col1>[Host_ID]:[int] <col2>[Is_Main_in_Charge]:[bool] } <table1>[host] { <col0>[Host_ID]:[int] <col1>[text]:[Nationality] <col2>[text]:[Age] } <table2>[party] { <col0>[Party_ID]:[int] <col1>[Party_Theme]:[text] <col2>[Location]:[text] <col3>[First_year]:[text] <col4>[Las...
SELECT Last_year, COUNT( `<col4>` ) FROM `<table2>` WHERE `<col1>` = "Spring" OR `<col1>` = "Teqnology" ORDER BY COUNT( `<col4>` ) DESC
What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Bin the last year into weekday interval and count them, and could you display y-axis in descending order please?
<table0>[table_test_11] { <col0>[int]:[left_ventricular_ejection_fraction_lvef] <col1>[int]:[systolic_blood_pressure_sbp] <col2>[int]:[tachycardia] <col3>[int]:[bradycardia] <col4>[int]:[renal_disease] <col5>[bool]:[allergy_to_aspirin] <col6>[bool]:[temperature] <col7>[float]:[creatinine_clearance_cl] <col8>[float]:[di...
SELECT * FROM `<table0>` WHERE serum_creatinine > 140
serum creatinine > 140 umol / l
<table0>[table_train_167] { <col0>[int]:[alt] <col1>[float]:[body_weight] <col2>[float]:[ast] <col3>[float]:[hematocrit_hct] <col4>[float]:[thyroid_stimulating_hormone_stsh] <col5>[int]:[body_mass_index_bmi] <col6>[float]:[fasting_glucose] <col7>[int]:[NOUSE] }
SELECT * FROM `<table0>` WHERE thyroid_stimulating_hormone_stsh < 6
sensitive thyroid _ stimulating hormone ( stsh ) < 6
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>...
SELECT COUNT( DISTINCT t1.uniquepid ) FROM ( SELECT patient.uniquepid, `<table9>`.`<table9>`time FROM `<table9>` JOIN patient ON `<table9>`.patientunitstayid = patient.patientunitstayid WHERE `<table9>`.`<table9>`name = 'hypotension' AND DATETIME( `<table9>`.`<table9>`time ) >= DATETIME( CURRENT_TIME( ), '-3 year' ) ) ...
since 3 years ago how many patients were diagnosed with hypotension within 2 months after the previous diagnosis of encephalopathy - post-anoxic?
<table0>[table_name_33] { <col0>[platform_s]:[VARCHAR] <col1>[developer_s]:[VARCHAR] }
SELECT platform_s_ FROM `<table0>` WHERE developer_s_ = "rockstar games"
What's the platform that has Rockstar Games as the developer?
<table0>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } <table1>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] }
SELECT T2.Name, T2.Revenue FROM `<table1>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of revenue , and group by attribute name.
<table0>[table_28181401_4] { <col0>[attendance]:[INTEGER] <col1>[round]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Semi Final ( 2nd leg )"
When semi final (2nd leg) is the round what is the highest attendance?
<table0>[table_28190363_1] { <col0>[network]:[VARCHAR] <col1>[judges]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Pete Goffe-Wood Andrew Atkinson Benny Masekwameng"
How many networks are there that include the judges pete goffe-wood andrew atkinson benny masekwameng?
<table0>[table_name_70] { <col0>[control]:[VARCHAR] <col1>[conservative_party]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "10 ( +5 )"
What was the control for the year with a Conservative Party result of 10 (+5)?
<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 U.Id AS "user_link", ( SELECT COUNT( Pt.Id ) FROM `<table22>` AS Pt, PostHistoryTypes AS Pht, PostHistory AS Ph, Tags AS T WHERE Pt.Id = Ph.PostHistoryTypeId AND U.Id = Ph.UserId AND Pht.Id = 24 AND Pt.Id IN ( 4, 5 ) AND ( Ph.PostId = T.ExcerptPostId OR Ph.PostId = T.WikiPostId ) ) AS "edits" FROM `<table0>` AS ...
Users with the most Tag Wiki Edits.
<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>[Customer_Policies] { <col0>[Policy_ID]:[INTEGER] <col1>[Customer_ID]:[INTEGER] <col2>[Policy_Type_Code]:[CHAR] <col3>[Start_Da...
SELECT Date_Claim_Settled, COUNT( `<col3>` ) FROM `<table4>` GROUP BY `<col3>` ORDER BY `<col3>`
Tell me the trend about the claim dates using a trend line, and could you show Date_Claim_Settled from low to high order please?
<table0>[table_name_81] { <col0>[pick]:[INTEGER] <col1>[round]:[VARCHAR] <col2>[college]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 3 AND `<col2>` = "northwestern state"
What was the average pick of northwestern state college under round 3?
<table0>[FitnessMembers] { <col0>[member_id]:[INT] <col1>[name]:[VARCHAR] <col2>[age]:[INT] <col3>[gender]:[VARCHAR] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE `<col3>` = 'Male';
What is the average age of male members from the FitnessMembers table?
<table0>[stadium] { <col0>[int]:[name] <col1>[text]:[Home_Games] <col2>[int]:[Average_Attendance] <col3>[real]:[Total_Attendance] <col4>[real]:[Capacity_Percentage] } <table1>[injury_accident] { <col0>[game_id]:[int] <col1>[int]:[Player] <col2>[text]:[Injury] <col3>[text]:[Number_of_matches] <col4>[text]:[Source] } <...
SELECT T1.id, COUNT( * ) FROM `<table0>` AS T1 JOIN game AS T2 ON T1.id = T2.`<table0>`_id GROUP BY T1.id
How many games has each stadium held. Show scatter chart.
<table0>[Has_Allergy] { <col0>[StuID]:[INTEGER] <col1>[Allergy]:[VARCHAR] } <table1>[Student] { <col0>[StuID]:[INTEGER] <col1>[LName]:[VARCHAR] <col2>[Fname]:[VARCHAR] <col3>[Age]:[INTEGER] <col4>[Sex]:[VARCHAR] <col5>[Major]:[INTEGER] <col6>[Advisor]:[INTEGER] <col7>[city_code]:[VARCHAR] } <table2>[Allergy_Type] { <...
SELECT Advisor, COUNT( * ) FROM `<table1>` GROUP BY `<col6>`
Show me a scatter plot of advisor and the total number for .
<table0>[STUDENT] { <col0>[Age]:[INTEGER] <col1>[Sex]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "F"
What is the average age of female (sex is F) students?
<table0>[table_name_5] { <col0>[date]:[VARCHAR] <col1>[visitor]:[VARCHAR] <col2>[record]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "chicago black hawks" AND `<col2>` = "2–2"
What is the Date that chicago black hawks has a Record of 2–2?
<table0>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table1>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table2>[f...
SELECT DISTINCT flight.flight_id FROM `<table18>` AS AIRPORT_SERVICE_0, `<table18>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
i want to see the cheapest flight from DENVER to PITTSBURGH
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[tim...
SELECT COUNT( DISTINCT `<table7>`.`<table7>`unitstayid ) FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '033-29268' )
what is the number of times patient 033-29268 goes to the icu.
<table0>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table1>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[admissions] { <col0>[row_id]:[number] <col...
SELECT `<table7>`.short_title FROM `<table7>` WHERE `<table7>`.icd9_code IN ( SELECT t1.icd9_code FROM ( SELECT `<table15>`.icd9_code, COUNT( `<table15>`.charttime ) AS c1 FROM `<table15>` WHERE `<table15>`.hadm_id IN ( SELECT `<table2>`.hadm_id FROM `<table2>` WHERE `<table2>`.subject_id = 90369 ) AND DATETIME( `<tabl...
what was the name of the procedure that's been performed to patient 90369 two or more times until 46 months ago?
<table0>[table_203_595] { <col0>[number]:[year] <col1>[number]:[division] <col2>[number]:[league] <col3>[text]:[reg] <col4>[season]:[text] <col5>[playoffs]:[text] <col6>[open]:[cup] }
SELECT MIN( "year" ) FROM `<table0>` WHERE "league" = 'usl second division'
what year is the first usl second division league listed ?
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT OwnerUserId AS "user_link", AVG( Score ) AS MedianScore FROM ( SELECT OwnerUserId, Score, ROW_NUMBER( ) OVER ( PARTITION BY OwnerUserId ORDER BY Score ) AS RowAsc, ROW_NUMBER( ) OVER ( PARTITION BY OwnerUserId ORDER BY Score DESC ) AS RowDesc FROM `<table19>` INNER JOIN Users ON Users.Id = OwnerUserId WHERE User...
Users (with minimum rep) ranked by Median Post Score. Under construction
<table0>[table_56964] { <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 "Venue" FROM `<table0>` WHERE "Away `<col2>` score" = '10.11 ( 71 )'
What is the name of the venue where the away team scored 10.11 (71)?
<table0>[table_name_64] { <col0>[location]:[VARCHAR] <col1>[name]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "evans"
What was the locaction of the Evans test blast?
<table0>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table1>[SuggestedEdits] { <col0>[number]:[PostI...
SELECT OwnerUserId AS "user_link", COUNT( * ) - COUNT( AcceptedAnswerId ) AS HasNoAccept, COUNT( AcceptedAnswerId ) AS HasAccepted FROM `<table16>` WHERE PostTypeId = 1 AND OwnerUserId > 0 AND CommunityOwnedDate IS NULL AND AnswerCount > 0 GROUP BY OwnerUserId HAVING COUNT( * ) > '##MaxAcceptRatio:int?10##' * COUNT( Ac...
Has the most questions with only very few accept vote.