schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[Creation...
SELECT 'Books' AS id_type, ROUND( AVG( CAST( Score AS FLOAT ) ), 2 ) AS score FROM `<table21>` AS p WHERE p.Tags LIKE '%identification%' AND ( p.Tags + p.Body LIKE '%book%' OR p.Tags + p.Body LIKE '%story%' ) UNION SELECT 'Films' AS id_type, ROUND( AVG( CAST( Score AS FLOAT ) ), 2 ) AS score FROM `<table21>` AS p WHERE...
Comparison of ID requests for books vs films.
<table0>[diagnoses] { <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>[lab...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` WHERE `<table3>`.days_stay > "20" AND `<table3>`.admityear < "2144"
give me the number of patients whose days of hospital stay is greater than 20 and admission year is less than 2144?
<table0>[products] { <col0>[INT]:[company] <col1>[VARCHAR]:[255] <col2>[price]:[DECIMAL] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE company = 'DEF';
What is the average price of products from company 'DEF'?
<table0>[table_name_18] { <col0>[player]:[VARCHAR] <col1>[jersey_number_s]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE jersey_number_s_ = "2"
Which player wears the number 2 on his jersey?
<table0>[marine_species] { <col0>[INT]:[name] <col1>[TEXT]:[ocean] <col2>[TEXT]:[affected_by_safety_issues] <col3>[BOOLEAN]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE ocean = 'Atlantic' AND affected_by_safety_issues = TRUE;
What is the total number of marine species in the Atlantic Ocean that are affected by maritime safety issues?
<table0>[carbon_prices] { <col0>[country]:[VARCHAR] <col1>[price]:[DECIMAL] }
SELECT AVG( `<col1>` ) FROM `<table0>` WHERE `<col0>` IN ( 'European Union', 'United States' );
What is the average carbon price in the European Union and United States?
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[...
SELECT COUNT( DISTINCT `<table3>`.uniquepid ) FROM `<table3>` WHERE `<table3>`.hospitaldischargetime IS NULL
how many patients have been admitted?
<table0>[Invoice_Items] { <col0>[Invoice_Item_ID]:[INTEGER] <col1>[Invoice_ID]:[INTEGER] <col2>[Order_ID]:[INTEGER] <col3>[Order_Item_ID]:[INTEGER] <col4>[Product_ID]:[INTEGER] <col5>[Order_Quantity]:[INTEGER] <col6>[Other_Item_Details]:[VARCHAR] } <table1>[Addresses] { <col0>[Address_ID]:[VARCHAR] <col1>[100]:[Line_1...
SELECT Store_Name, COUNT( Store_Name ) FROM `<table17>` AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name DESC
What are the number of the names of the workshop groups that have bookings with status code 'stop'?, sort Store_Name in desc order.
<table0>[student_record] { <col0>[student_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[grade]:[varchar] <col4>[varchar]:[transfer_source] <col5>[varchar]:[earn_credit] <col6>[varchar]:[repeat_term] <col7>[varchar]:[test_id] } <table1>[semester] { <col0>[semester_id]:[int] } <table2>[program_require...
SELECT DISTINCT `<col3>` FROM `<table4>` WHERE ( `<col7>` LIKE '%Mental Health and Mental Disorders of Children and Youth%' OR `<col1>` LIKE '%Mental Health and Mental Disorders of Children and Youth%' ) AND `<col2>` = 'EECS'
The course number for the Mental Health and Mental Disorders of Children and Youth class is what ?
<table0>[table_test_31] { <col0>[int]:[ejection_fraction_ef] <col1>[int]:[macular_disease] <col2>[bool]:[systemic] <col3>[bool]:[alt] <col4>[float]:[iud] <col5>[bool]:[condom_with_spermicide] <col6>[bool]:[gender] <col7>[string]:[meropenem] <col8>[bool]:[non_q_wave_myocardial_infarction] <col9>[bool]:[hbcab] <col10>[bo...
SELECT * FROM `<table0>` WHERE ejection_fraction_ef <= 35 AND ( coronary_conduit = 1 OR unprotected_left_main_coronary_artery = 1 )
ejection fraction <= 35 % and at least one of the following criteria: intervention on the last patent coronary conduit, or intervention on an unprotected left main coronary artery
<table0>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table1>[VoteTypes] { <col0>[number]:[text] } <table2>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table3>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoti...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM `<table12>` WHERE ( Location LIKE '%##city?slovenska##%' COLLATE Latin1_General_CI_AI ) AND LENGTH( Location ) > 1 ORDER BY Reputation DESC LIMIT 500
Location containing the given string.
<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>`.admityear < "2131" AND lab.label = "Albumin/Creatinine, Urine"
count the number of patients whose admission year is less than 2131 and lab test name is albumin/creatinine, urine?
<table0>[table_23670057_1] { <col0>[VARCHAR]:[height__m] }
SELECT no FROM `<table0>` WHERE height__m_ = "1.96"
Name the number for 1.96 height
<table0>[table_203_765] { <col0>[number]:[genre] <col1>[text]:[date] <col2>[text]:[japanese] <col3>[title]:[original] <col4>[title]:[text] <col5>[english]:[title] <col6>[text]:[scoring] <col7>[text]:[notes] }
SELECT MAX( "date" ) FROM `<table0>` WHERE "genre" = 'television scores'
what was the last year of the television scores in the genre category ?
<table0>[table_24257] { <col0>[series]:[real] <col1>[season]:[real] <col2>[Title]:[text] <col3>[Directed]:[text] <col4>[Written]:[text] <col5>[Original]:[air] <col6>[date]:[text] <col7>[Production]:[code] <col8>[real]:[viewers] <col9>[millions]:[text] }
SELECT "Production code" FROM `<table0>` WHERE "Title" = 'A Wrong Day''s Journey into Right'
What is the production code for the episode title 'A Wrong Day's Journey into Right'?
<table0>[table_203_370] { <col0>[number]:[year] <col1>[number]:[competition] <col2>[text]:[venue] <col3>[text]:[position] <col4>[text]:[event] <col5>[text]:[notes] }
SELECT COUNT( * ) FROM `<table0>` WHERE "competition" = 'olympic games'
how many times in total did ikangaa run the marathon in the olympic games ?
<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 `<table8>`.drugname FROM `<table8>` WHERE `<table8>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '017-101426' ) ) AND DATETIME( `<tab...
what was the first drug prescribed until 9 months ago to patient 017-101426?
<table0>[WaterConservation] { <col0>[INT]:[Initiative] <col1>[VARCHAR]:[Savings] <col2>[DECIMAL]:[Date] <col3>[DATE]:[INSERT] }
SELECT Initiative, AVG( Savings ) FROM `<table0>` WHERE Date = '2021-09-01' GROUP BY Initiative HAVING AVG( Savings ) > 70;
What were the water conservation initiatives with an average savings of over 70 m³ on September 1, 2021?
<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>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar...
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, visualize a scatter chart about the correlation between commission_pct and department_id .
<table0>[t_kc22] { <col0>[number]:[CHA_ITEM_LEV] <col1>[number]:[DATA_ID] <col2>[text]:[DIRE_TYPE] <col3>[number]:[DOSE_FORM] <col4>[text]:[DOSE_UNIT] <col5>[text]:[EACH_DOSAGE] <col6>[text]:[EXP_OCC_DATE] <col7>[time]:[FLX_MED_ORG_ID] <col8>[text]:[FXBZ] <col9>[number]:[HOSP_DOC_CD] <col10>[text]:[HOSP_DOC_NM] <col11>...
SELECT ( SELECT COUNT( * ) FROM `<table0>` WHERE `<table0>`.STA_DATE BETWEEN '2016-11-23' AND '2018-06-23' AND `<table0>`.MED_INV_ITEM_TYPE = '手术费' GROUP BY `<table0>`.MED_ORG_DEPT_CD ORDER BY COUNT( * ) DESC LIMIT 1 ) - ( SELECT COUNT( * ) FROM `<table0>` WHERE `<table0>`.STA_DATE BETWEEN '2016-11-23' AND '2018-06-23'...
你知道排名第一与手术量排名倒数第一的科室的手术量从16年11月23日到18年6月23日相差多少么?
<table0>[table_name_53] { <col0>[population_est__2012]:[VARCHAR] <col1>[capital]:[VARCHAR] <col2>[house_seat_s]:[VARCHAR] }
SELECT COUNT( population_est__2012_ ) FROM `<table0>` WHERE `<col1>` = "montpelier" AND house_seat_s_ > 1
How many populations have a capital of Montpelier and more than 1 House seat?
<table0>[table_name_67] { <col0>[election]:[INTEGER] <col1>[outcome_of_election]:[VARCHAR] <col2>[seats]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "minority in parliament" AND `<col2>` = "2"
What is the earliest election with 2 seats and the outcome of the election of minority in parliament?
<table0>[diagnoses] { <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>[lab...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.admission_type = "URGENT" AND lab.itemid = "50803"
count the number of patients whose admission type is urgent and item id is 50803?
<table0>[table_204_779] { <col0>[number]:[network] <col1>[name]:[text] <col2>[flagship]:[text] <col3>[programming]:[type] <col4>[text]:[owner] <col5>[text]:[affiliates] }
SELECT AVG( "affiliates" ) FROM `<table0>`
what is the average number of affiliates that a given network will have ?
<table0>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table1>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table2>[flight_stop] { <col0>[flight_id]:[int] <col1>[stop_number]:[int] <col2>...
SELECT DISTINCT flight.flight_id FROM `<table5>` AS AIRPORT_SERVICE_0, `<table5>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_d...
list all AA flights from PHOENIX to MILWAUKEE on wednesday
<table0>[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] } <table1>[Course] { <col0>[CID]:[VARCHAR] <col1>[CName]:[VARCHAR] <col2>[Credits]:[INTEGER] <col3>[Instr...
SELECT Credits, `<col3>` FROM `<table1>` ORDER BY `<col2>`
Return a scatter chart about the correlation between Credits and Instructor .
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]...
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 = '027-156601' ) ) AND `<table8>...
until 08/30/2105 when did patient 027-156601 get ns ivf for the last time?
<table0>[table_1342198_36] { <col0>[result]:[VARCHAR] <col1>[incumbent]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Tom Steed"
What was the result when incumbent Tom Steed was elected?
<table0>[table_72810] { <col0>[text]:[Latitude] <col1>[text]:[Longitude] <col2>[text]:[Diameter] <col3>[text]:[Year] <col4>[named]:[real] <col5>[origin]:[text] }
SELECT COUNT( "Diameter ( km )" ) FROM `<table0>` WHERE "Longitude" = '109.9E'
At a longitude of 109.9e, how many features were found?
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[tex...
SELECT 24 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table7>`.`<table7>`time ) ) FROM `<table7>` WHERE `<table7>`.`<table4>`unitstayid IN ( SELECT `<table4>`.`<table4>`unitstayid FROM `<table4>` WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table...
how many hours have elapsed since the last time patient 022-187132 received a treatment during the current hospital visit?
<table0>[table_54553] { <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 "Home team" FROM `<table0>` WHERE "Away `<col2>` score" = '13.11 ( 89 )'
What is the name of the home team that played an away team who scored 13.11 (89)?
<table0>[currencies] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[exchange_rate]:[DECIMAL] } <table1>[donations] { <col0>[INT]:[donor_id] <col1>[INT]:[donation_date] <col2>[DATE]:[DECIMAL] <col3>[currency_id]:[INT] }
SELECT currencies.name, SUM( `<table1>`.amount * currencies.exchange_rate ) FROM `<table1>` JOIN currencies ON `<table1>`.currency_id = currencies.id WHERE `<table1>`.donation_date BETWEEN DATE_SUB( CURRENT_DATE, INTERVAL 6 MONTH ) AND CURRENT_DATE GROUP BY `<table1>`.currency_id;
What is the total value of donations by currency in the last 6 months?
<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 MIN( `<table3>`.age ) FROM `<table3>` WHERE `<table3>`.insurance = "Private" AND `<table3>`.dod_year < "2183.0"
what is the minimum age of patients with private insurance and year of death before 2183?
<table0>[water_temperature] { <col0>[INT]:[location] <col1>[VARCHAR]:[temperature] <col2>[FLOAT]:[measurement_date] <col3>[DATE]:[INSERT] }
SELECT MAX( temperature ) FROM `<table0>` WHERE location = 'Indian Ocean' AND measurement_date BETWEEN '2011-01-01' AND '2021-12-31' GROUP BY location;
What is the maximum water temperature in the Indian Ocean during the last 10 years?
<table0>[table_14609295_4] { <col0>[season]:[VARCHAR] <col1>[overall]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "24-10"
What season was the overall record 24-10?
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admissi...
SELECT COUNT( * ) > 0 FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 10811 ) AND `<table4>`.spec_type_desc = 'stool' AND NOT `<table4>`.org_name IS NULL AND STRFTIME( '%y-%m', `<table4>`.charttime ) <= '2104-01' ORDER BY `<table4>`.charttime DESC LI...
was there any organism detected in patient 10811's last stool microbiological test until 01/2104?
<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 MAX( t1.c1 ) FROM ( SELECT COUNT( DISTINCT `<table3>`.patientunitstayid ) AS c1 FROM `<table3>` WHERE `<table3>`.`<table3>`name = 'cholangitis' AND STRFTIME( '%y', `<table3>`.`<table3>`time ) <= '2102' GROUP BY STRFTIME( '%y-%m', `<table3>`.`<table3>`time ) ) AS t1
what was the maximum monthly number of patients who had cholangitis until 2102?
<table0>[table_53662] { <col0>[Entrant]:[text] <col1>[Constructor]:[text] <col2>[Chassis]:[text] <col3>[Tyre]:[text] <col4>[Driver]:[text] <col5>[Rounds]:[text] }
SELECT "Entrant" FROM `<table0>` WHERE "Constructor" = 'maserati' AND "Tyre" = 'p' AND "Chassis" = '250f a6gcm' AND "Driver" = 'luigi villoresi'
Can you say what was the entrant of maserati built item with a Tyre of p with a chassis of 250f a6gcm that was driven by Luigi Villoresi?
<table0>[table_203_203] { <col0>[number]:[year] <col1>[number]:[majors] <col2>[number]:[atp] <col3>[wins]:[number] <col4>[total]:[wins] <col5>[number]:[earnings] <col6>[number]:[money] <col7>[list]:[rank] }
SELECT "year" FROM `<table0>` ORDER BY "earnings ( us$ )" LIMIT 1
in which year was the least amount of earnings won ?
<table0>[table_30058355_7] { <col0>[sat_27_aug]:[VARCHAR] <col1>[thurs_25_aug]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "23' 56.90 94.528mph"
What is every entry for Saturday August 27 when the entry for Thursday August 25 is 23' 56.90 94.528mph?
<table0>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[d_icd_diagnoses] { <...
SELECT `<table6>`.charttime FROM `<table6>` WHERE `<table6>`.icustay_id IN ( SELECT `<table4>`.icustay_id FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table15>`.hadm_id FROM `<table15>` WHERE `<table15>`.subject_id = 12775 ) ) AND `<table6>`.itemid IN ( SELECT `<table11>`.itemid FROM `<table11>` WHERE `<table...
when did patient 12775 first got the minimum of heart rate yesterday?
<table0>[table_name_21] { <col0>[rd__number]:[VARCHAR] <col1>[pick__number]:[INTEGER] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 5
How many rounds exist for picks under 5?
<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 `<table3>`.name FROM `<table3>` WHERE `<table3>`.subject_id = "3343"
what is subject name of subject id 3343?
<table0>[table_19507] { <col0>[Rank]:[real] <col1>[State]:[text] <col2>[Revenue]:[millions] <col3>[text]:[Population] <col4>[real]:[Revenue] <col5>[capita]:[text] <col6>[Spending]:[millions] <col7>[text]:[Spending] <col8>[capita]:[text] <col9>[Net]:[contribution] <col10>[capita]:[text] <col11>[Presidential]:[majority] ...
SELECT COUNT( "Presidential `<col14>` 2000/2004" ) FROM `<table0>` WHERE "Obamacare: Fed/ State/ Partnership" = 'Utah shop'
How many times was presidential majority 2000/2004 recorded when obamacare: fed/ state/ partnership was Utah shop?
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN diagnoses ON `<table4>`.hadm_id = diagnoses.hadm_id WHERE `<table4>`.insurance = "Self Pay" AND diagnoses.icd9_code = "5761"
get me the number of self pay insurance patients who have diagnoses icd9 code 5761.
<table0>[table_203_600] { <col0>[number]:[rank] <col1>[text]:[country] <col2>[text]:[winners] <col3>[number]:[runners] <col4>[number]:[finals] <col5>[total]:[number] }
SELECT "country" FROM `<table0>` WHERE "country" IN ( 'france', 'croatia' ) ORDER BY "finals total" DESC LIMIT 1
did france or croatia have a larger finals total ?
<table0>[table_name_12] { <col0>[constructor]:[VARCHAR] <col1>[rank]:[VARCHAR] <col2>[driver]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` > 10 AND `<col2>` = "joe james"
Who constructed Joe James car when his rank was more than 10?
<table0>[table_45879] { <col0>[Round]:[real] <col1>[Player]:[text] <col2>[Position]:[text] <col3>[Nationality]:[text] <col4>[College]:[junior] <col5>[club]:[team] <col6>[league]:[text] }
SELECT "Player" FROM `<table0>` WHERE "Nationality" = 'russia'
What player is from Russia?
<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 COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN procedures ON `<table2>`.hadm_id = procedures.hadm_id WHERE `<table2>`.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND procedures.short_title = "Opn mitral valvuloplasty"
what number of patients with squamous cell carcinoma oral tongue/sda had the procedure titled opn mitral valvuloplasty?
<table0>[table_203_777] { <col0>[number]:[years] <col1>[text]:[building] <col2>[text]:[city] <col3>[text]:[height] <col4>[ctbuh]:[text] <col5>[floors]:[number] }
SELECT "building" FROM `<table0>` WHERE "years" > ( SELECT "years" FROM `<table0>` WHERE "building" = 'toronto-dominion centre' ) ORDER BY "years" LIMIT 1
what was the tallest building in canada after the toronto dominion center ?
<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 `<table0>`.dischtime FROM `<table0>` WHERE `<table0>`.subject_id = 25815 AND STRFTIME( '%y', `<table0>`.dischtime ) <= '2101' ORDER BY `<table0>`.dischtime LIMIT 1
when was the first time of hospital discharge of patient 25815 until 2101?
<table0>[table_254234_1] { <col0>[VARCHAR]:[iso] }
SELECT COUNT( gb ) FROM `<table0>` WHERE iso_№ = "CN-65"
How many gb's have an iso number of cn-65?
<table0>[provinces] { <col0>[INT]:[name] <col1>[TEXT]:[INSERT] } <table1>[dance_forms] { <col0>[INT]:[province_id] <col1>[INT]:[name] <col2>[TEXT]:[year_preserved] <col3>[INT]:[INSERT] }
SELECT p.name, MIN( df.year_preserved ) FROM `<table0>` p JOIN dance_forms df ON p.id = df.province_id GROUP BY p.id;
What is the minimum number of years a traditional dance form has been preserved in each province of China?
<table0>[table_name_6] { <col0>[date]:[VARCHAR] <col1>[time]:[VARCHAR] <col2>[game]:[VARCHAR] <col3>[location]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` < 5 AND `<col3>` = "oakland-alameda county coliseum" AND `<col1>` = "3:40"
What date was at Oakland-Alameda County Coliseum with a time of 3:40 and a game less than 5?
<table0>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[PostTypes] { <col0>[number]:[text] } <table2>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table3>[ReviewTaskResults] { <col0>[number]:[ReviewTa...
WITH CreatorDates AS ( SELECT DISTINCT CAST( p.CreationDate AS DATE ) AS "date", ou.Id, ou.Reputation FROM `<table7>` AS p INNER JOIN Users AS ou ON p.OwnerUserId = ou.Id ), EditorDates AS ( SELECT DISTINCT CAST( p.CreationDate AS DATE ) AS "date", eu.Id, eu.Reputation FROM `<table7>` AS p LEFT JOIN Users AS eu ON p.La...
Unique + active users, last month.
<table0>[fish_data] { <col0>[species]:[VARCHAR] <col1>[255]:[dissolved_oxygen] <col2>[FLOAT]:[INSERT] }
SELECT species, AVG( dissolved_oxygen ) FROM `<table0>` GROUP BY species;
What is the average dissolved oxygen level for each species in the 'fish_data' table?
<table0>[american_social_good] { <col0>[budget]:[INT] }
SELECT MIN( budget ) FROM american_social_good;
What is the minimum budget allocated to technology for social good initiatives in America?
<table0>[table_name_67] { <col0>[employee__real_name]:[VARCHAR] <col1>[pick__number]:[INTEGER] }
SELECT employee__real_name_ FROM `<table0>` WHERE `<col1>` > 9
What is the real name of the Pick # that is greater than 9?
<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 `<table4>`.culturesite FROM `<table4>` WHERE `<table4>`.`<table6>`unitstayid IN ( SELECT `<table6>`.`<table6>`unitstayid FROM `<table6>` WHERE `<table6>`.`<table6>`healthsystemstayid IN ( SELECT `<table6>`.`<table6>`healthsystemstayid FROM `<table6>` WHERE `<table6>`.uniquepid = '031-3507' ) ) AND STRFTIME( '%y-...
tell me the name of the specimen test that patient 031-3507 first received in 12/2103?
<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 lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.admission_type = "ELECTIVE" AND lab.label = "Creatinine, Urine"
what is the number of patients whose admission type is elective and lab test name is creatinine, urine?
<table0>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table1>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text] <col2>[note]:[text] } <table2>[restriction] { <col0>[restriction_code]:[text] <col1>[advance_purchase]:[int] <col2>[stopovers]:[text] <col3>[...
SELECT DISTINCT fare.fare_id FROM `<table8>` AS AIRPORT_SERVICE_0, `<table8>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1...
okay we're going from WASHINGTON to DENVER FIRST class ticket i'd like to know the cost of a FIRST class ticket
<table0>[days] { <col0>[days_code]:[varchar] <col1>[day_name]:[varchar] } <table1>[flight_leg] { <col0>[flight_id]:[int] <col1>[leg_number]:[int] <col2>[leg_flight]:[int] } <table2>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table3>[state] { <col0>[state_code]:[text] <col1>[state_name]:...
SELECT DISTINCT flight.flight_id FROM `<table10>` AS AIRPORT_SERVICE_0, `<table10>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 2 AND date_day.month_number = 8 AND dat...
display all flights from PITTSBURGH to SAN FRANCISCO on 8 2
<table0>[table_name_30] { <col0>[pick]:[INTEGER] <col1>[player]:[VARCHAR] <col2>[round]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "lonnie brockman" AND `<col2>` < 9
What was the highest Pick for Lonnie Brockman before round 9?
<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 diagnoses ON `<table0>`.hadm_id = diagnoses.hadm_id WHERE `<table0>`.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Mixed acid-base bal dis"
count the number of patients whose admission location is emergency room admit and diagnoses short title is mixed acid-base bal dis?
<table0>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] } <table1>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Nam...
SELECT All_Road, `<col4>` FROM `<table1>`
Show me about the distribution of All_Road and ACC_Percent in a bar chart.
<table0>[cotton_products] { <col0>[INT]:[name] <col1>[VARCHAR]:[production_cost] <col2>[DECIMAL]:[material] }
SELECT CONCAT( org.material, ' vs ', conv.material ) AS cost_comparison, ABS( org.production_cost - conv.production_cost ) AS production_cost_difference FROM `<table0>` org, `<table0>` conv WHERE org.material = 'organic_cotton' AND conv.material = 'conventional_cotton';
What is the production cost difference between organic cotton and conventional cotton?
<table0>[table_name_83] { <col0>[played]:[INTEGER] <col1>[drawn]:[VARCHAR] <col2>[points]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 1 AND `<col2>` > 4
Which average Played has a Drawn smaller than 1, and Points larger than 4?
<table0>[table_17641206_4] { <col0>[directed_by]:[VARCHAR] <col1>[written_by]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "John Sullivan"
Who was the director when the writer was John Sullivan?
<table0>[table_1341423_32] { <col0>[district]:[VARCHAR] <col1>[incumbent]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Carolyn McCarthy"
Name the district for carolyn mccarthy
<table0>[research_spending] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[chemical_name] <col2>[VARCHAR]:[255] <col3>[production_plant]:[VARCHAR] <col4>[255]:[research_spending_per_product] <col5>[DECIMAL]:[INSERT] }
SELECT AVG( `<table0>`_per_product ) FROM `<table0>` WHERE `<col3>` LIKE '%Asia%';
Find the average research spending per product for chemicals produced in Asian plants.
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] ...
SELECT t1.`<table9>`name FROM ( SELECT `<table9>`.`<table9>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table9>` WHERE DATETIME( `<table9>`.`<table9>`time ) <= DATETIME( CURRENT_TIME( ), '-1 year' ) GROUP BY `<table9>`.`<table9>`name ) AS t1 WHERE t1.c1 <= 5
what is the top five of the most frequent diagnosis until 1 year ago?
<table0>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table1>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table2>[...
SELECT COUNT( * ) FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table5>`.hadm_id FROM `<table5>` WHERE `<table5>`.subject_id = 42829 ) AND `<table14>`.drug = 'metoclopramide' AND DATETIME( `<table14>`.startdate, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-0 month' )
how many times was the metoclopramide prescribed in this month for patient 42829?
<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>[Votes] { <col0>[number]:[PostId] <col1>...
SELECT Reputation, COUNT( Id ) FROM `<table18>` WHERE Reputation >= '##min?125##' GROUP BY Reputation ORDER BY Reputation
Breakdown of users by reputation.
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]...
SELECT `<table2>`.culturesite FROM `<table2>` WHERE `<table2>`.`<table6>`unitstayid IN ( SELECT `<table6>`.`<table6>`unitstayid FROM `<table6>` WHERE `<table6>`.`<table6>`healthsystemstayid IN ( SELECT `<table6>`.`<table6>`healthsystemstayid FROM `<table6>` WHERE `<table6>`.uniquepid = '031-15666' ) ) AND STRFTIME( '%y...
what specimen test was given to patient 031-15666 for the first time since 09/2104?
<table0>[table_name_55] { <col0>[to_par]:[VARCHAR] <col1>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 72 - 71 - 65 - 69 = 277
What is the to par of the player with a 72-71-65-69=277 score?
<table0>[enrollments] { <col0>[INT]:[enrollment_date] <col1>[DATE]:[student_id] <col2>[INT]:[program] <col3>[VARCHAR]:[INSERT] }
SELECT COUNT( DISTINCT student_id ) as num_enrolled FROM `<table0>` WHERE program = 'Open Pedagogy' AND enrollment_date >= DATEADD( month, -6, GETDATE( ) );
How many students have enrolled in the open pedagogy program in the past 6 months?
<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 T1.Name, T1.Code FROM `<table1>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute name, show names in asc order please.
<table0>[table_26986076_5] { <col0>[mon_23_aug]:[VARCHAR] <col1>[tues_24_aug]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "21' 18.87 106.209mph"
When 21' 18.87 106.209mph is Tuesday August 24th what is Monday August 23rd?
<table0>[table_23963073_1] { <col0>[artist]:[VARCHAR] <col1>[date_of_publication]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 1966
Who was the artist who worked on the stories published in 1966?
<table0>[rural_infrastructure] { <col0>[INT]:[project_name] <col1>[VARCHAR]:[255] <col2>[budget]:[INT] }
DELETE FROM `<table0>` WHERE `<col2>` < 50000;
Delete all records in the 'rural_infrastructure' table where the budget is less than 50000.
<table0>[rd_expenditure] { <col0>[drug_name]:[TEXT] <col1>[region]:[TEXT] }
SELECT SUM( amount ) FROM `<table0>` WHERE `<col1>` = 'Europe';
What is the total R&D expenditure for drugs in 'Europe'?
<table0>[countries] { <col0>[country_id]:[INT] <col1>[country_name]:[VARCHAR] } <table1>[student_lifelong_learning] { <col0>[student_id]:[INT] <col1>[country_id]:[INT] <col2>[course_completion]:[BOOLEAN] }
SELECT country_id, country_name, COUNT( * ) as completion_count FROM `<table1>` GROUP BY country_id, country_name ORDER BY completion_count DESC;
What is the number of students who have completed a lifelong learning course in each country, ordered by the number of completions?
<table0>[table_1952065_4] { <col0>[division_championships]:[VARCHAR] <col1>[teams_with_division_titles]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Pittsburgh Steelers"
How many division championships did the Pittsburgh Steelers have?
<table0>[table_203_794] { <col0>[number]:[year] <col1>[number]:[location] <col2>[text]:[attendance] <col3>[number]:[theme] <col4>[phrase]:[text] <col5>[messages]:[text] <col6>[host]:[text] <col7>[opening]:[general] <col8>[session]:[guest] <col9>[text]:[closing] <col10>[general]:[session] <col11>[guest]:[text] <col12>[s...
SELECT "year" FROM `<table0>` WHERE "host" = 'mike rhodin' ORDER BY "year" LIMIT 1
what was the first year in which mike rhodin was the host ?
<table0>[defense_innovation] { <col0>[INT]:[innovation_name] <col1>[VARCHAR]:[description] <col2>[TEXT]:[technology_innovation] <col3>[VARCHAR]:[year] <col4>[INT]:[INSERT] }
SELECT technology_innovation FROM `<table0>` ORDER BY year ASC LIMIT 1;
What is the earliest 'technology_innovation' in the 'defense_innovation' table?
<table0>[Donations] { <col0>[org_name]:[TEXT] <col1>[donation_amount]:[INTEGER] <col2>[donation_date]:[DATE] }
SELECT org_name, SUM( `<col1>` ) FROM `<table0>` WHERE `<col2>` BETWEEN '2020-01-01' AND '2020-12-31' GROUP BY org_name;
What was the total amount of donations received by each organization in 2020?
<table0>[class_of_service] { <col0>[booking_class]:[varchar] <col1>[rank]:[int] <col2>[class_description]:[text] } <table1>[flight_fare] { <col0>[flight_id]:[int] <col1>[fare_id]:[int] } <table2>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table3>[month] { <col0>[month_number]:[int] <col...
SELECT DISTINCT fare.fare_id FROM `<table21>` AS AIRPORT_SERVICE_0, `<table21>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ( ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
let 's see how much would a direct flight from ATLANTA to DENVER be on 5 7
<table0>[table_name_80] { <col0>[winner]:[VARCHAR] <col1>[surface]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "carpet ( i )"
Who is the Winner, when the Surface is Carpet (i)?
<table0>[table_203_737] { <col0>[number]:[number] <col1>[employer]:[text] <col2>[employees]:[number] }
SELECT SUM( "# of employees" ) FROM `<table0>` WHERE "#" <= 3
how many employees does the first three employers have combined ?
<table0>[table_name_11] { <col0>[legs_lost]:[VARCHAR] <col1>[player]:[VARCHAR] <col2>[played]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "trina gulliver" AND `<col2>` > 3
How many legs were lost for Trina Gulliver with more than 3 played?
<table0>[party] { <col0>[Party_ID]:[int] <col1>[Minister]:[text] <col2>[Took_office]:[text] <col3>[Left_office]:[text] <col4>[Region_ID]:[int] <col5>[Party_name]:[text] } <table1>[member] { <col0>[Member_ID]:[int] <col1>[Member_Name]:[text] <col2>[Party_ID]:[text] <col3>[In_office]:[text] } <table2>[party_events] { <...
SELECT Party_name, COUNT( * ) FROM `<table1>` AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT( * )
Show all party names and the number of members in each party Show bar chart, and order the total number in ascending order.
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[regions] { <col0>[REGION_ID]...
SELECT HIRE_DATE, `<col9>` FROM `<table3>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table5>` ) ORDER BY `<col5>`
For those employees who did not have any job in the past, for manager_id, hire_date, visualize the trend, and sort by the X in ascending.
<table0>[election] { <col0>[Election_ID]:[int] <col1>[Representative_ID]:[int] <col2>[Date]:[text] <col3>[Votes]:[real] <col4>[Vote_Percent]:[real] <col5>[Seats]:[real] <col6>[Place]:[real] } <table1>[representative] { <col0>[Representative_ID]:[int] <col1>[text]:[State] <col2>[text]:[Party] <col3>[text]:[Lifespan] }...
SELECT Party, COUNT( * ) FROM `<table1>` GROUP BY Party
Pie. what are the different parties of representative? Show the party name and the number of representatives in each party.
<table0>[deep_sea_exploration] { <col0>[project_id]:[INT] <col1>[country]:[VARCHAR] <col2>[funding_amount]:[FLOAT] }
SELECT country, funding_amount FROM deep_sea_exploration;
List all countries with deep-sea exploration projects and their respective funding amounts.
<table0>[table_name_37] { <col0>[name]:[VARCHAR] <col1>[date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "24 september"
What was the name of the race on 24 September?
<table0>[space_debris] { <col0>[debris_id]:[INT] <col1>[PRIMARY]:[KEY] <col2>[material]:[VARCHAR] <col3>[weight]:[FLOAT] }
SELECT material, SUM( `<col3>` ) AS total_weight FROM `<table0>` GROUP BY material;
What is the total weight of space debris for each material type?
<table0>[workers] { <col0>[worker_id]:[INT] <col1>[sector]:[VARCHAR] <col2>[255]:[job_title] <col3>[VARCHAR]:[255] }
SELECT job_title, COUNT( * ) FROM `<table0>` WHERE `<col1>` = 'Circular Economy' GROUP BY job_title;
What is the total number of workers employed in the circular economy sector, by job title?
<table0>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table1>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table2>[fare_basis] { <col0>[fare_basis_code]:[text] <col1>[booking_class]:[text] <col2>[class_type]:[text] <col3>[premium]:[text] <col4>[...
SELECT DISTINCT flight.flight_id FROM `<table20>` AS AIRPORT_SERVICE_0, `<table20>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( ( ( ( ( flight.arrival_time < flight.departure_time ) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_...
all flights from BOSTON to PHILADELPHIA which show up on tuesday afternoon
<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 DISTINCT `<table5>`.`<table5>` FROM `<table5>` WHERE `<table5>`.eventtype = '`<table7>`' AND `<table5>`.eventid IN ( SELECT `<table7>`.`<table7>`id FROM `<table7>` WHERE `<table7>`.`<table7>`name = 's/p surgery for cancer - colon' )
how much do diagnosis of s/p surgery for cancer - colon cost?
<table0>[fare_basis] { <col0>[fare_basis_code]:[text] <col1>[booking_class]:[text] <col2>[class_type]:[text] <col3>[premium]:[text] <col4>[economy]:[text] <col5>[discounted]:[text] <col6>[night]:[text] <col7>[season]:[text] <col8>[basis_days]:[text] } <table1>[restriction] { <col0>[restriction_code]:[text] <col1>[adva...
SELECT DISTINCT flight.flight_id FROM `<table5>` AS AIRPORT_SERVICE_0, `<table5>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO...
i'd like to make a trip from WASHINGTON to SAN FRANCISCO