schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[Rooms] { <col0>[bedType]:[VARCHAR] <col1>[basePrice]:[INTEGER] }
SELECT bedType, AVG( `<col1>` ) FROM `<table0>` GROUP BY `<col0>`
What is the average base price of different bed type? List bed type and average base price.
<table0>[Investors] { <col0>[investor_id]:[INTEGER] <col1>[Investor_details]:[VARCHAR] } <table1>[Purchases] { <col0>[purchase_transaction_id]:[INTEGER] <col1>[purchase_details]:[VARCHAR] } <table2>[Transactions_Lots] { <col0>[transaction_id]:[INTEGER] <col1>[lot_id]:[INTEGER] } <table3>[Sales] { <col0>[sales_transa...
SELECT investor_id, COUNT( * ) FROM `<table6>` GROUP BY `<col1>`
Show the number of transactions for different investors. Plot them as scatter chart.
<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>[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 Id, TagName, Count FROM `<table25>` WHERE TagName = 'google-apps-script'
Whats up with the constructor tag.
<table0>[mzjzjlb] { <col0>[HXPLC]:[number] <col1>[HZXM]:[text] <col2>[JLSJ]:[time] <col3>[JZJSSJ]:[time] <col4>[JZKSBM]:[text] <col5>[JZKSMC]:[text] <col6>[JZKSRQ]:[time] <col7>[JZLSH]:[text] <col8>[JZZDBM]:[text] <col9>[JZZDSM]:[text] <col10>[JZZTDM]:[number] <col11>[JZZTMC]:[text] <col12>[text]:[KLX] <col13>[number]:...
SELECT AVG( jyjgzbb.JCZBJGDL ), MIN( jyjgzbb.JCZBJGDL ), MAX( jyjgzbb.JCZBJGDL ) FROM `<table0>` JOIN jybgb JOIN jyjgzbb JOIN hz_info_`<table0>` ON hz_info_`<table0>`.YLJGDM = jybgb.YLJGDM_MZJZJLB AND `<table0>`.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_`<ta...
由门诊诊断为硅肺Ⅲ期的检测的三碘甲状腺原氨酸数值的平均值以及最值分别是多少?
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <t...
SELECT `<table8>`.`<table8>`name FROM `<table8>` WHERE `<table8>`.`<table4>`unitstayid IN ( SELECT `<table4>`.`<table4>`unitstayid FROM `<table4>` WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table4>` WHERE `<table4>`.uniquepid = '027-185580' AND NOT `<table4>...
what is the first test that patient 027-185580 had in their last hospital encounter?
<table0>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table1>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate...
SELECT COUNT( * ) FROM `<table5>` WHERE `<table5>`.icustay_id IN ( SELECT `<table8>`.icustay_id FROM `<table8>` WHERE `<table8>`.hadm_id IN ( SELECT `<table3>`.hadm_id FROM `<table3>` WHERE `<table3>`.subject_id = 3369 ) ) AND `<table5>`.itemid IN ( SELECT `<table12>`.itemid FROM `<table12>` WHERE `<table12>`.label = '...
count the number of times patient 3369 has had an intake of ultracal until 01/16/2102.
<table0>[table_12842068_1] { <col0>[film_title_used_in_nomination]:[VARCHAR] <col1>[submitting_country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Lebanon"
What was the title of the movie from lebanon?
<table0>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text] <col2>[note]:[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>[food_service] { <col0>[mea...
SELECT DISTINCT flight.flight_id FROM `<table22>` AS AIRPORT_SERVICE_0, `<table22>` 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 = 'ATLANTA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_d...
what is the earliest flight from WASHINGTON to ATLANTA leaving on wednesday september fourth
<table0>[table_name_99] { <col0>[country]:[VARCHAR] <col1>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 69 - 71 - 66 = 206
What is the Country of the Player with a Score of 69-71-66=206?
<table0>[south_africa_solar] { <col0>[INT]:[name] <col1>[TEXT]:[country] <col2>[TEXT]:[installed_capacity] <col3>[INT]:[INSERT] }
SELECT SUM( installed_capacity ) FROM `<table0>` WHERE country = 'South Africa';
What is the total installed capacity of solar panels in South Africa?
<table0>[table_dev_18] { <col0>[int]:[bleeding] <col1>[int]:[chronic_anticoagulant_therapy] <col2>[bool]:[renal_disease] <col3>[bool]:[hyperlipidemia] <col4>[bool]:[creatinine_clearance_cl] <col5>[float]:[chronic_hemostasis_disorders] <col6>[bool]:[significant_proteinuria] <col7>[bool]:[platelet_count] <col8>[float]:[t...
SELECT * FROM `<table0>` WHERE bleeding = 1 OR ( platelet_count < 80000 OR inr > 1.5 ) OR chronic_hemostasis_disorders = 1 OR chronic_anticoagulant_therapy = 1 OR ( heparin = 1 OR chronic_warfarin_therapy = 1 )
increased risk of bleeding ( platelet count < 80000 ; inr > 1.5 ) , other chronic hemostasis disorders, or treatment with chronic anticoagulant therapy ( i.e., heparin or warfarin ) .
<table0>[PostHistoryTypes] { <col0>[number]:[text] } <table1>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table2>[Comments] { <col0>[number]:[PostId] <col1>[numb...
SELECT DISTINCT `<table20>`.Id, `<table20>`.TagName, 'site://tags/' + `<table20>`.TagName + '/info|Url' AS Url, LENGTH( Posts.Body ) FROM `<table20>` LEFT JOIN Posts ON Posts.Id = `<table20>`.WikiPostId OR Posts.Id = `<table20>`.ExcerptPostId WHERE ( LOWER( Posts.Body ) LIKE '%secure.wikimedia.org%' ) ORDER BY `<table2...
Tag wikis with old wikimedia links.
<table0>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[disch...
SELECT t3.`<table1>`name FROM ( SELECT t2.`<table1>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table5>`.`<table5>`time FROM `<table5>` JOIN patient ON `<table5>`.patientunitstayid = patient.patientunitstayid WHERE `<table5>`.`<table5>`name = 'glucocorticoid administra...
since 1 year ago, what were the top four most frequent laboratory tests ordered for patients within 2 months after receiving a glucocorticoid administration - oral?
<table0>[table_train_21] { <col0>[int]:[pregnancy_or_lactation] <col1>[bool]:[severe_sepsis] <col2>[bool]:[systolic_blood_pressure_sbp] <col3>[int]:[active_infection] <col4>[bool]:[limited_care] <col5>[bool]:[septic_shock] <col6>[bool]:[coagulopathy] <col7>[bool]:[age] <col8>[float]:[lactate] <col9>[int]:[NOUSE] }
SELECT * FROM `<table0>` WHERE age < 18 OR pregnancy_or_lactation = 1 OR limited_care = 1
patients < 18 years of age, pregnant patients, and patients with limitations of care.
<table0>[procedures_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>[admiss...
SELECT `<table14>`.long_title FROM `<table14>` WHERE `<table14>`.short_title = 'blood inf dt cen ven cth' UNION SELECT `<table3>`.long_title FROM `<table3>` WHERE `<table3>`.short_title = 'blood inf dt cen ven cth'
whats the unabbreviated version of blood inf dt cen ven cth.
<table0>[mobile_subscribers] { <col0>[subscriber_id]:[INT] <col1>[region]:[VARCHAR] <col2>[255]:[INSERT] }
SELECT region, COUNT( * ) as subscriber_count, ROW_NUMBER( ) OVER ( ORDER BY COUNT( * ) DESC ) as rank FROM `<table0>` GROUP BY `<col1>` HAVING rank <= 2;
List regions with the highest mobile subscriber concentration, showing top 2 regions only.
<table0>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table1>[Users] { <col0>[number]:[Reputation] <col1>[number]:[Creation...
SELECT DATEPART( hour, CreationDate ) AS Hour, AVG( CAST( ViewCount AS FLOAT ) ) AS "average_views" FROM `<table13>` WHERE PostTypeId = 1 AND CreationDate > DATEADD( year, -2, GETUTCDATE( ) ) GROUP BY DATEPART( hour, CreationDate ) ORDER BY Hour
Question Views by Hour (last 2 years).
<table0>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[disch...
SELECT `<table2>`.observationtime FROM `<table2>` WHERE `<table2>`.`<table0>`unitstayid IN ( SELECT `<table0>`.`<table0>`unitstayid FROM `<table0>` WHERE `<table0>`.`<table0>`healthsystemstayid IN ( SELECT `<table0>`.`<table0>`healthsystemstayid FROM `<table0>` WHERE `<table0>`.uniquepid = '004-64091' ) ) AND NOT `<tab...
when was the last measuring of respiration of patient 004-64091 yesterday?
<table0>[table_9774] { <col0>[Episode]:[text] <col1>[Original]:[airdate] <col2>[text]:[Episode] <col3>[title]:[text] <col4>[Doctor]:[episode] <col5>[text]:[Webcast] <col6>[link]:[text] }
SELECT "Doctor Who episode" FROM `<table0>` WHERE "Original airdate ( UK )" = '14 may 2005'
Which Doctor Who episode has an Original airdate (UK) of 14 may 2005?
<table0>[player] { <col0>[Player_ID]:[int] <col1>[Player]:[text] <col2>[Years_Played]:[text] <col3>[Total_WL]:[text] <col4>[Singles_WL]:[text] <col5>[Doubles_WL]:[text] <col6>[Team]:[int] } <table1>[country] { <col0>[Country_id]:[int] <col1>[Country_name]:[text] <col2>[Capital]:[text] <col3>[Official_native_language]:...
SELECT Position, COUNT( * ) FROM `<table2>` GROUP BY `<col2>` ORDER BY `<col2>` DESC
Draw a bar chart for how many players played each position?, order names in desc order.
<table0>[table_203_603] { <col0>[number]:[service] <col1>[text]:[service] <col2>[text]:[bit] <col3>[rate]:[text] <col4>[audio]:[channels] <col5>[text]:[description] <col6>[text]:[analogue] <col7>[availability]:[text] }
SELECT COUNT( * ) FROM `<table0>` WHERE "description" = 'christian'
what is the number of christian radio stations broadcasted by mxr yorkshire ?
<table0>[table_203_590] { <col0>[number]:[date] <col1>[text]:[venue] <col2>[text]:[opponents] <col3>[text]:[score] <col4>[text]:[competition] <col5>[text]:[scotland] <col6>[scorer]:[text] }
SELECT SUM( "score" ) FROM `<table0>` WHERE "competition" = 'friendly'
how many total points did scotland score in friendly competitions ?
<table0>[station] { <col0>[INTEGER]:[name] <col1>[TEXT]:[lat] <col2>[NUMERIC]:[long] <col3>[NUMERIC]:[dock_count] <col4>[INTEGER]:[city] <col5>[TEXT]:[installation_date] } <table1>[weather] { <col0>[date]:[TEXT] <col1>[max_temperature_f]:[INTEGER] <col2>[mean_temperature_f]:[INTEGER] <col3>[min_temperature_f]:[INTEGER...
SELECT city, COUNT( * ) FROM `<table0>` GROUP BY city ORDER BY COUNT( * ) DESC
List the name and the number of stations for all the cities that have at least 15 stations Show bar chart, and list in desc by the Y.
<table0>[Incidents] { <col0>[IncidentID]:[INT] <col1>[IncidentDate]:[DATE] <col2>[AircraftModel]:[VARCHAR] <col3>[IncidentType]:[VARCHAR] <col4>[Description]:[TEXT] <col5>[NumberOfPeople]:[INT] <col6>[Fatalities]:[INT] }
DELETE FROM `<table0>` WHERE `<col2>` = 'B737 MAX';
Delete all incidents involving the Boeing 737 MAX
<table0>[bookings] { <col0>[booking_id]:[INT] <col1>[hotel_id]:[INT] <col2>[booking_channel]:[TEXT] <col3>[revenue]:[FLOAT] }
SELECT booking_channel, SUM( `<col3>` ) FROM `<table0>` GROUP BY booking_channel;
What is the total revenue generated by each OTA channel?
<table0>[table_name_50] { <col0>[population]:[INTEGER] <col1>[area_km_2]:[VARCHAR] <col2>[official_name]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 342.4 AND `<col2>` = "northfield"
What is the population of northfield parish that has an area less than 342.4?
<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 prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE `<table3>`.admityear < "2165" AND prescriptions.route = "TP"
how many patients admitted before the year 2165 have tp route of drug administration?
<table0>[table_58664] { <col0>[Position]:[real] <col1>[Team]:[text] <col2>[Played]:[real] <col3>[Drawn]:[real] <col4>[Lost]:[real] <col5>[Goals]:[real] <col6>[Goals]:[real] <col7>[Goal]:[Difference] <col8>[text]:[Points] }
SELECT SUM( "Position" ) FROM `<table0>` WHERE "Points 1" > '23' AND "Goals For" = '77'
What is the sum of Position, when Points 1 is greater than 23, and when Goals For is '77'?
<table0>[table_3283] { <col0>[Player]:[text] <col1>[Position]:[text] <col2>[Starter]:[text] <col3>[Touchdowns]:[real] <col4>[Extra]:[points] <col5>[real]:[Field] <col6>[goals]:[real] <col7>[Points]:[real] }
SELECT MIN( "Extra points" ) FROM `<table0>`
What is the smallest number of extra points?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[...
SELECT AVG( `<table1>`.age ) FROM `<table1>` WHERE `<table1>`.admission_location = "PHYS REFERRAL/NORMAL DELI" AND `<table1>`.diagnosis = "CELO-VESSICLE FISTULA"
calculate the average age of office admitted patients who have celo-vessicle fistula primary disease.
<table0>[table_75596] { <col0>[Outcome]:[text] <col1>[Date]:[text] <col2>[Tournament]:[text] <col3>[Surface]:[text] <col4>[Opponent]:[text] <col5>[Score]:[text] }
SELECT "Score" FROM `<table0>` WHERE "Opponent" = 'duk-hee lee'
What was the score of the match against duk-hee lee?
<table0>[investments] { <col0>[investment_id]:[INT] <col1>[sector]:[VARCHAR] <col2>[investment_amount]:[INT] <col3>[investment_date]:[DATE] }
SELECT EXTRACT( YEAR FROM `<col3>` ) as year, COUNT( * ) as total_`<table0>` FROM `<table0>` WHERE `<col1>` = 'Education' GROUP BY year ORDER BY year ASC;
What is the total number of investments in the education sector, broken down by year?
<table0>[public] { <col0>[emissions_data]:[serial] <col1>[PRIMARY]:[KEY] <col2>[vehicle_type]:[varchar] <col3>[255]:[location] <col4>[varchar]:[255] <col5>[co2_emission]:[numeric] }
SELECT AVG( co2_emission ) FROM public.emissions_data WHERE vehicle_type = 'Hybrid' AND location = 'Urban';
What is the average CO2 emission of hybrid vehicles in 'urban' areas?
<table0>[table_name_68] { <col0>[player]:[VARCHAR] <col1>[to_par]:[VARCHAR] <col2>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "e" AND `<col2>` = "united states"
Which Player has a To par of e, and a Country of united states?
<table0>[table_55097] { <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 `<col2>` score" FROM `<table0>` WHERE "Away `<col2>` score" = '7.13 ( 55 )'
When the away team scored 7.13 (55), who were they playing?
<table0>[table_6239] { <col0>[Year]:[real] <col1>[Manufacturer]:[text] <col2>[Start]:[text] <col3>[Finish]:[text] <col4>[Team]:[text] }
SELECT AVG( "Year" ) FROM `<table0>` WHERE "Finish" = '22' AND "Team" = 'swan'
Which Year has a Finish of 22, and a Team of swan?
<table0>[trip] { <col0>[INTEGER]:[duration] <col1>[INTEGER]:[start_date] <col2>[TEXT]:[start_station_name] <col3>[TEXT]:[start_station_id] <col4>[INTEGER]:[end_date] <col5>[TEXT]:[end_station_name] <col6>[TEXT]:[end_station_id] <col7>[INTEGER]:[bike_id] <col8>[INTEGER]:[subscription_type] <col9>[TEXT]:[zip_code] } <ta...
SELECT city, MAX( lat ) FROM `<table3>` GROUP BY city ORDER BY city DESC
For each city, what is the highest latitude for its stations Visualize by bar chart, show in descending by the names.
<table0>[Fares] { <col0>[INT]:[vehicle_type] <col1>[VARCHAR]:[fare] <col2>[DECIMAL]:[INSERT] }
SELECT vehicle_type, AVG( fare ) FROM `<table0>` GROUP BY vehicle_type;
What is the average fare collected from each vehicle type?
<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 t1.`<table2>`name FROM ( SELECT `<table2>`.`<table2>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table2>` WHERE `<table2>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.age BETWEEN 30 AND 39 ) AND STRFTIME( '%y', `<table2>`.`<table2>`time...
tell me what were the top five most common procedures of the patients in the 30s since 2100?
<table0>[authors] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[country]:[VARCHAR] <col3>[255]:[INSERT] } <table1>[papers] { <col0>[INT]:[title] <col1>[VARCHAR]:[255] <col2>[published_date]:[DATE] <col3>[author_id]:[INT] } <table2>[topics] { <col0>[INT]:[paper_id] <col1>[INT]:[title] <col2>[VARCHAR]:[255] }
SELECT authors.country, COUNT( * ) FROM `<table1>` JOIN authors ON `<table1>`.author_id = authors.id JOIN topics ON `<table1>`.id = topics.paper_id WHERE topics.title = 'Algorithmic Fairness' AND YEAR( `<table1>`.published_date ) = YEAR( CURRENT_DATE( ) ) GROUP BY authors.country;
How many papers on algorithmic fairness were published in the past year by authors from each country, in the AI Research database?
<table0>[Customers] { <col0>[customer_id]:[number] <col1>[customer_name]:[text] <col2>[customer_details]:[text] } <table1>[Invoices] { <col0>[invoice_number]:[number] <col1>[invoice_date]:[time] <col2>[invoice_details]:[text] } <table2>[Orders] { <col0>[order_id]:[number] <col1>[customer_id]:[number] <col2>[order_sta...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = "Cancel" AND T4.product_name = "food" GROUP BY T1.customer_id HAVING count( * ) >= 1
Which customers have ever canceled the purchase of the product "food" (the item status is "Cancel")?
<table0>[table_name_26] { <col0>[athlete]:[VARCHAR] <col1>[semifinal]:[VARCHAR] <col2>[event]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "did not advance" AND `<col2>` = "light heavyweight –81 kg"
For the light heavyweight –81 kg event that did not advance to semifinal, who was the athlete?
<table0>[table_35974] { <col0>[Date]:[text] <col1>[Opponent]:[text] <col2>[Score]:[text] <col3>[Loss]:[text] <col4>[Attendance]:[real] <col5>[Record]:[text] }
SELECT "Attendance" FROM `<table0>` WHERE "Record" = '16–29'
Record of 16 29 is how many attendance?
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <ta...
WITH Raw AS ( SELECT Id, PostTypeId, DATEDIFF( day, CreationDate, LAG( CreationDate ) OVER ( PARTITION BY OwnerUserId, PostTypeId ORDER BY CreationDate DESC ) ) AS DayToNext, CASE WHEN NOT ClosedDate IS NULL OR Score < 0 THEN -1 WHEN Score > 0 THEN 1 ELSE 0 END AS Sign FROM `<table24>` WHERE PostTypeId <= 2 AND OwnerUs...
Effect of the post score to the delay until the next post of the same type. Both scale a base2 log
<table0>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_...
SELECT JOB_ID, COUNT( `<col6>` ) FROM `<table0>` WHERE `<col7>` < ( SELECT MIN( `<col7>` ) FROM `<table0>` WHERE `<col6>` = 'MK_MAN' ) GROUP BY `<col6>` ORDER BY `<col6>` DESC
Group and count the job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN for visualizing a bar chart, and rank by the names in desc.
<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>[region] { <col0>[...
SELECT Left_office, COUNT( `<col3>` ) FROM `<table0>` GROUP BY `<col1>`
How many parties of the time they took office, binning the left office into Weekday interval, and then split by the minister's name.
<table0>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table1>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table2>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[var...
SELECT DISTINCT flight.flight_id FROM `<table2>` AS AIRPORT_SERVICE_0, `<table2>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( ( ( date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.airline_code = 'DL' ...
what flights are available on DL from DALLAS to ATLANTA on monday morning
<table0>[table_name_59] { <col0>[competition]:[VARCHAR] <col1>[venue]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "singapore"
What's the competition that happened in Singapore?
<table0>[table_204_882] { <col0>[number]:[number] <col1>[number]:[builder] <col2>[text]:[entered] <col3>[service]:[text] <col4>[withdrawn]:[text] <col5>[notes]:[text] }
SELECT "number" FROM `<table0>` WHERE "number" <> 445 AND "withdrawn" = ( SELECT "withdrawn" FROM `<table0>` WHERE "number" = 445 )
which locomotive was withdrawn from service in the same year as 445 ?
<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>`.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND prescriptions.route = "DIALYS"
give me the number of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant and drug route is dialys?
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatme...
SELECT `<table6>`.`<table6>`resulttime FROM `<table6>` WHERE `<table6>`.`<table7>`unitstayid IN ( SELECT `<table7>`.`<table7>`unitstayid FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '025-44842' ) ) AND STRF...
when was patient 025-44842 given for the last time a lab test since 09/2102?
<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>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[chartt...
SELECT COUNT( * ) > 0 FROM `<table7>` WHERE `<table7>`.icustay_id IN ( SELECT `<table14>`.icustay_id FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table16>`.hadm_id FROM `<table16>` WHERE `<table16>`.subject_id = 26156 ) AND NOT `<table14>`.outtime IS NULL ORDER BY `<table14>`.intime DESC LIMIT 1 ) AND `<tab...
on the last icu visit, was patient 26156's heart rate ever less than 83.0?
<table0>[time_zone] { <col0>[time_zone_code]:[text] <col1>[time_zone_name]:[text] <col2>[hours_from_gmt]:[int] } <table1>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table2>[state] { <col0>[state_code]:[text] <col1>[state_name]:[t...
SELECT DISTINCT flight.flight_id FROM `<table21>` AS AIRPORT_SERVICE_0, `<table21>` 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 = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AN...
show me nonstop flights from MONTREAL to ORLANDO
<table0>[table_2155836_1] { <col0>[hdi__2011]:[VARCHAR] <col1>[country]:[VARCHAR] }
SELECT hdi__2011_ FROM `<table0>` WHERE `<col1>` = "Tunisia"
What is the HDI for 2011 in Tunisia?
<table0>[table_name_55] { <col0>[country]:[VARCHAR] <col1>[player]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "josé maría olazábal"
What is Country, when Player is "José María Olazábal"?
<table0>[table_204_104] { <col0>[number]:[title] <col1>[text]:[genre] <col2>[text]:[sub] <col3>[u00addivisions]:[text] <col4>[libretto]:[text] <col5>[premiere]:[date] <col6>[text]:[place] <col7>[theatre]:[text] <col8>[notes]:[text] }
SELECT "title" FROM `<table0>` WHERE "premiere date" > ( SELECT "premiere date" FROM `<table0>` WHERE "title" = 'candalide' ) ORDER BY "premiere date" LIMIT 1
which title premiered directly after candalide ?
<table0>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table2>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[n...
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table15>`.hadm_id FROM `<table15>` WHERE `<table15>`.spec_type_desc = 'bone marrow' AND DATETIME( `<table15>`.charttime, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-1 year' ) )
what was the number of patients that were tested during the last year for bone marrow microbiology?
<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, SUM( `<col9>` ) FROM `<table5>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table4>` ) ORDER BY SUM( `<col9>` )
For those employees who did not have any job in the past, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, could you list in ascending by the y axis?
<table0>[organizations] { <col0>[INT]:[name] <col1>[TEXT]:[location] <col2>[TEXT]:[donations] <col3>[DECIMAL]:[INSERT] }
SELECT MIN( donations ) FROM `<table0>` WHERE location = 'South America';
What is the minimum amount of donations received by an organization in South America?
<table0>[table_name_90] { <col0>[rank]:[VARCHAR] <col1>[title]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "best friends"
What rank did Best Friends receive?
<table0>[table_204_9] { <col0>[number]:[week] <col1>[number]:[date] <col2>[text]:[opponent] <col3>[text]:[result] <col4>[text]:[attendance] }
SELECT COUNT( "opponent" ) FROM `<table0>`
what is the total number of opponent ?
<table0>[vendors] { <col0>[vendor_id]:[INT] <col1>[vendor_location]:[VARCHAR] <col2>[product_type]:[VARCHAR] } <table1>[products] { <col0>[product_id]:[INT] <col1>[product_name]:[VARCHAR] <col2>[price]:[DECIMAL] }
SELECT AVG( `<col2>` ) FROM `<table1>` JOIN vendors ON `<table1>`.product_name = vendors.product_type WHERE vendors.vendor_location = 'Asia-Pacific';
What is the average price of organic fruits sold by vendors located in the Asia-Pacific region?
<table0>[table_203_241] { <col0>[number]:[name] <col1>[text]:[founded] <col2>[number]:[defunct] <col3>[number]:[country] <col4>[text]:[publisher] <col5>[text]:[topics] <col6>[text]:[external] <col7>[link]:[text] }
SELECT "name" FROM `<table0>` WHERE "name" <> 'ace' AND "founded" = ( SELECT "founded" FROM `<table0>` WHERE "name" = 'ace' )
what other company has the same founding year as ace ?
<table0>[table_2271] { <col0>[Butadiene]:[text] <col1>[min]:[u22121] <col2>[u00b0C]:[u00b1] <col3>[absolute]:[text] <col4>[min]:[u22121] <col5>[u00b0C]:[u00b1] <col6>[relative]:[text] <col7>[u0394H]:[u2021] <col8>[kcal]:[mol] <col9>[u22121]:[text] <col10>[u0394S]:[u2021] <col11>[cal]:[mol] <col12>[u22121]:[u22121] }
SELECT COUNT( "\u0394S \u2021 /cal mol \u22121 K \u22121" ) FROM `<table0>` WHERE "-Butadiene" = '1,2-dimethylene-cyclohexane'
Name the number of s /cal mol 1 k 1 for butadiene being 1,2-dimethylene-cyclohexane
<table0>[table_name_93] { <col0>[l2_cache]:[VARCHAR] <col1>[frequency]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "750mhz"
What is the L2 cache for the processor with a 750MHz frequency?
<table0>[table_name_63] { <col0>[engine]:[VARCHAR] <col1>[team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "tasman motorsports"
What engine does the Tasman Motorsports team have?
<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>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[te...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN procedures ON `<table3>`.hadm_id = procedures.hadm_id WHERE `<table3>`.dod_year <= "2180.0" AND procedures.icd9_code = "4105"
provide the number of patients whose year of death is less than or equal to 2180 and procedure icd9 code is 4105?
<table0>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table1>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosist...
SELECT COUNT( DISTINCT t1.uniquepid ) FROM ( SELECT patient.uniquepid, `<table1>`.`<table1>`time FROM `<table1>` JOIN patient ON `<table1>`.patientunitstayid = patient.patientunitstayid WHERE `<table1>`.`<table1>`name = 'acute respiratory failure' AND DATETIME( `<table1>`.`<table1>`time, 'start of year' ) = DATETIME( C...
what number of patients were prescribed piperacillin-tazobactam 3.375 g mini-bag plus within 2 months after having been diagnosed with acute respiratory failure this year?
<table0>[invoice] { <col0>[invoiceid]:[number] <col1>[customerid]:[number] <col2>[invoicedate]:[time] <col3>[billingaddress]:[text] <col4>[billingcity]:[text] <col5>[billingstate]:[text] <col6>[billingcountry]:[text] <col7>[billingpostalcode]:[text] <col8>[total]:[number] } <table1>[playlisttrack] { <col0>[playlistid]...
SELECT COUNT( * ) FROM `<table6>` AS T1 JOIN track AS T2 ON T1.`<table6>`id = T2.`<table6>`id WHERE T1.name = "Rock"
Count the number of tracks that are part of the rock genre.
<table0>[table_1147701_5] { <col0>[model_name]:[VARCHAR] <col1>[engine_code]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "D5244 T"
What is the model of the engine d5244 t?
<table0>[student] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[department_id]:[INT] <col3>[ethnicity]:[VARCHAR] } <table1>[department] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[college]:[VARCHAR] }
SELECT d.name, s.ethnicity, COUNT( s.id ) as count FROM `<table0>` s JOIN department d ON s.department_id = d.id WHERE d.college = 'College of Engineering' GROUP BY d.name, s.ethnicity;
What is the distribution of graduate students by ethnicity in each department of the College of Engineering?
<table0>[table_name_14] { <col0>[losses]:[VARCHAR] <col1>[points]:[VARCHAR] <col2>[games]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 19 AND `<col2>` > 36
What's the total number of losses with less than 19 points and more than 36 games?
<table0>[table_203_612] { <col0>[number]:[rank] <col1>[number]:[nation] <col2>[text]:[gold] <col3>[number]:[silver] <col4>[number]:[bronze] <col5>[number]:[total] }
SELECT "nation" FROM `<table0>` ORDER BY "bronze" DESC LIMIT 1
which country had the top bronze metal count ?
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Com...
WITH USER_BY_TAG AS ( SELECT ROW_NUMBER( ) OVER ( ORDER BY COUNT( * ) DESC ) AS Rank, u.Location, COUNT( * ) AS Num`<table4>` FROM `<table4>` AS t INNER JOIN Post`<table4>` AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Use...
Top android cities in asutralia.
<table0>[table_32230] { <col0>[Date]:[text] <col1>[Venue]:[text] <col2>[Score]:[text] <col3>[Result]:[text] <col4>[Competition]:[text] }
SELECT "Venue" FROM `<table0>` WHERE "Result" = '7-1'
Which venue had the result 7-1?
<table0>[underwater_cables] { <col0>[cable_name]:[TEXT] <col1>[location]:[TEXT] <col2>[length]:[FLOAT] }
SELECT SUM( `<col2>` ) FROM `<table0>` WHERE `<col1>` = 'Arctic Ocean';
What is the total length of the underwater cables in the Arctic Ocean?
<table0>[table_name_73] { <col0>[rank]:[INTEGER] <col1>[name]:[VARCHAR] <col2>[result]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "tsvetelina kirilova" AND `<col2>` < 55.97
Which Rank has a Name of tsvetelina kirilova, and a Result smaller than 55.97?
<table0>[Batting_Style] { <col0>[Batting_Id]:[integer] <col1>[Batting_hand]:[text] } <table1>[Bowling_Style] { <col0>[Bowling_Id]:[integer] <col1>[Bowling_skill]:[text] } <table2>[City] { <col0>[City_Id]:[integer] <col1>[City_Name]:[text] <col2>[Country_id]:[integer] } <table3>[Country] { <col0>[Country_Id]:[integer...
SELECT COUNT( T2.Win_Id ) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50
In the matches where the winning margin is less than fifty, how many teams won by wicket?
<table0>[table_26156] { <col0>[Year]:[real] <col1>[Division]:[real] <col2>[League]:[text] <col3>[Regular]:[Season] <col4>[text]:[Playoffs] <col5>[text]:[Open] <col6>[Cup]:[text] }
SELECT MIN( "Division" ) FROM `<table0>`
What is the lowest numbered division Cleveland played in?
<table0>[accounts] { <col0>[account_id]:[number] <col1>[customer_id]:[number] <col2>[account_name]:[text] <col3>[other_account_details]:[text] } <table1>[financial_transactions] { <col0>[transaction_id]:[number] <col1>[previous_transaction_id]:[number] <col2>[account_id]:[number] <col3>[card_id]:[number] <col4>[transa...
SELECT `<col2>` FROM `<table2>` GROUP BY `<col2>` ORDER BY COUNT( * ) DESC LIMIT 1
What is the card type code with most number of cards?
<table0>[maritime_law_violations] { <col0>[country]:[VARCHAR] <col1>[255]:[year] <col2>[INT]:[violation_count] <col3>[INT]:[INSERT] }
SELECT country, violation_count FROM `<table0>` WHERE year = 2021
List all countries and their maritime law violations in the past year.
<table0>[table_203_634] { <col0>[number]:[date] <col1>[text]:[venue] <col2>[text]:[score] <col3>[text]:[victor] <col4>[text]:[comments] <col5>[text]:[match] <col6>[reports]:[text] }
SELECT COUNT( * ) FROM `<table0>` WHERE "venue" = 'ballymore, brisbane'
how many matches were played at ballymore , brisbane ?
<table0>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table1>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table2>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <...
SELECT `<table12>`.dob FROM `<table12>` WHERE `<table12>`.subject_id = 97834
when's patient 97834's birthday?
<table0>[building] { <col0>[height_feet]:[INTEGER] <col1>[floors]:[INTEGER] }
SELECT COUNT( * ) FROM `<table0>` WHERE `<col0>` > ( SELECT AVG( `<col0>` ) FROM `<table0>` ) OR `<col1>` > ( SELECT AVG( `<col1>` ) FROM `<table0>` )
Show the number of buildings with a height above the average or a number of floors above the average.
<table0>[table_train_43] { <col0>[int]:[anemia] <col1>[bool]:[cystinuria] <col2>[bool]:[hyperoxaluria] <col3>[bool]:[acute_gout_attack] <col4>[bool]:[NOUSE] }
SELECT * FROM `<table0>` WHERE cystinuria = 1
known cystinuria
<table0>[PostsWithDeleted] { <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]:...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation FROM `<table13>` WHERE LOWER( Location ) LIKE '%india%' OR UPPER( Location ) LIKE '%IND' ORDER BY Reputation DESC LIMIT 1000
top 1000 users from india.
<table0>[readers] { <col0>[INT]:[age] <col1>[INT]:[gender] <col2>[VARCHAR]:[country] <col3>[VARCHAR]:[news_preference] <col4>[VARCHAR]:[INSERT] }
SELECT AVG( age ) avg_age, gender FROM `<table0>` WHERE country = 'Canada' AND news_preference = 'Sports' GROUP BY gender;
What is the average age of readers who prefer sports news in Canada, partitioned by gender?
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[...
SELECT STRFTIME( '%j', `<table6>`.unitdischargetime ) - STRFTIME( '%j', `<table6>`.unitadmittime ) FROM `<table6>` WHERE `<table6>`.`<table6>`healthsystemstayid IN ( SELECT `<table6>`.`<table6>`healthsystemstayid FROM `<table6>` WHERE `<table6>`.uniquepid = '002-56853' ) AND NOT `<table6>`.unitadmittime IS NULL ORDER B...
calculate the duration of patient 002-56853's stay in the last icu.
<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 `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.gender = "M" AND `<table4>`.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
Find the number of patients whose gender is male and discharge location is disc-tran cancer/chldm h.
<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 COUNT( * ) > 0 FROM `<table8>` WHERE `<table8>`.icd9_code = ( SELECT `<table14>`.icd9_code FROM `<table14>` WHERE `<table14>`.short_title = 'rheumatoid arthritis' ) AND `<table8>`.hadm_id IN ( SELECT `<table11>`.hadm_id FROM `<table11>` WHERE `<table11>`.subject_id = 11688 ) AND DATETIME( `<table8>`.charttime, '...
has rheumatoid arthritis been diagnosed with patient 11688 in a year before?
<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>[demogr...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` WHERE `<table2>`.admityear < "2197"
How many patients were admitted to the hospital before 2197?
<table0>[table_18513028_3] { <col0>[contestant_name]:[VARCHAR] <col1>[date_premiered__2009]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE date_premiered__2009_ = "July 25"
What contestant was premiered on July 25?
<table0>[table_30738] { <col0>[Region]:[name] <col1>[text]:[State] <col2>[name]:[text] <col3>[Region]:[real] <col4>[Page]:[count] <col5>[real]:[Regional] <col6>[Page]:[text] }
SELECT "Regional `<col4>` #" FROM `<table0>` WHERE "State name" = 'CA/NV'
In Ca/Nv, what are all of the regional page #s?
<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 SUM( CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME( '%j', patient.hospitaldischargetime ) - STRFTIME( '%j', t4.`<table8>`time ) > 2 * 365 THEN 1 ELSE 0 END ) * 100 / COUNT( * ) FROM ( SELECT t2.uniquepid, t2.`<table8>`time FROM ( SELECT t1.uniquepid, t1.`<table8>`time FROM ( SELECT pat...
tell me the two year survival rate of patients who were prescribed neostigmine after they were diagnosed with hepatic dysfunction - with cirrhosis?
<table0>[table_name_36] { <col0>[away_team]:[VARCHAR] <col1>[venue]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "lake oval"
Who was the away team at Lake Oval?
<table0>[table_name_20] { <col0>[result]:[VARCHAR] <col1>[year]:[VARCHAR] <col2>[tournament]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` > 2010 AND `<col2>` = "world race walking cup"
What is the result of the World Race Walking Cup tournament played before the year 2010?
<table0>[Donors] { <col0>[DonorID]:[int] <col1>[Ethnicity]:[varchar] <col2>[AmountDonated]:[numeric] }
SELECT Ethnicity, SUM( `<col2>` ) as TotalDonated FROM `<table0>` WHERE `<col2>` >= 0 AND `<col2>` < 9999.99 GROUP BY Ethnicity;
What was the total amount donated by each ethnicity in H1 2021?
<table0>[table_name_78] { <col0>[constructor]:[VARCHAR] <col1>[chassis]:[VARCHAR] <col2>[driver]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "talbot-lago t26c" AND `<col2>` = "charles pozzi"
Who is the constructor when the chassis is talbot-lago t26c and the driver is charles pozzi?
<table0>[table_24912693_4] { <col0>[player]:[VARCHAR] <col1>[blocks]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 17
Which player has 17 blocks?