schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[table_203_156] { <col0>[number]:[team] <col1>[text]:[outgoing] <col2>[manager]:[text] <col3>[manner]:[departure] <col4>[text]:[date] <col5>[vacancy]:[text] <col6>[replaced]:[text] <col7>[date]:[appointment] <col8>[text]:[position] <col9>[table]:[text] }
SELECT COUNT( * ) FROM `<table0>` WHERE "date of appointment" = 11
how many times was the date of appointment in the month of november ?
<table0>[mining_operations] { <col0>[INT]:[name] <col1>[VARCHAR]:[num_employees] <col2>[INT]:[role] <col3>[VARCHAR]:[INSERT] }
SELECT name, role, COUNT( * ) FROM `<table0>` WHERE role = 'Engineer' GROUP BY name, role;
How many employees work in the 'Engineer' role in each mining operation?
<table0>[person] { <col0>[name]:[text] <col1>[age]:[number] <col2>[city]:[text] <col3>[gender]:[text] <col4>[job]:[text] } <table1>[personfriend] { <col0>[name]:[text] <col1>[friend]:[text] <col2>[year]:[number] }
SELECT T2.friend FROM `<table0>` AS T1 JOIN `<table0>`friend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
Who are the friends of Alice that are doctors?
<table0>[table_186468_1] { <col0>[property]:[VARCHAR] <col1>[ka_band]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "2"
When 2 is the ka-band how many properties are there?
<table0>[song] { <col0>[song_name]:[VARCHAR] <col1>[resolution]:[VARCHAR] }
SELECT `<table0>`_name FROM `<table0>` ORDER BY `<col1>`
Give me a list of the names of all songs ordered by their resolution.
<table0>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table1>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:...
SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate FROM `<table25>` WHERE ( Reputation > '##rep##' ) AND ( DisplayName LIKE '%user%' ) ORDER BY Reputation DESC
Find all users above given reputation with username user*.
<table0>[table_name_18] { <col0>[owner_s]:[VARCHAR] <col1>[date]:[VARCHAR] <col2>[description]:[VARCHAR] }
SELECT owner_s_ FROM `<table0>` WHERE `<col1>` = 1956 AND `<col2>` = "mark 1 pos"
Which owner has a description of Mark 1 pos and is dated 1956?
<table0>[port] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[name] <col2>[VARCHAR]:[255] <col3>[location]:[VARCHAR] <col4>[255]:[country] <col5>[VARCHAR]:[255] <col6>[area]:[FLOAT] }
CREATE VIEW `<table0>`_usa_new AS SELECT * FROM `<table0>` WHERE country = 'USA';
Create a view for ports located in the USA
<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, T2.Revenue FROM `<table1>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute headquarter, and list by the X from low to high.
<table0>[Programs] { <col0>[program_id]:[INT] <col1>[target_group]:[VARCHAR] <col2>[funding_amount]:[DECIMAL] <col3>[funding_date]:[DATE] }
SELECT SUM( `<col2>` ) AS total_funding FROM `<table0>` WHERE `<col1>` = 'seniors';
What was the total funding received by programs targeting 'seniors'?
<table0>[LOTS] { <col0>[lot_details]:[VARCHAR] <col1>[investor_id]:[VARCHAR] }
SELECT lot_details, `<col1>` FROM `<table0>`
Return the lot details and investor ids.
<table0>[table_11274401_3] { <col0>[air_date]:[VARCHAR] <col1>[viewers__m]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE viewers__m_ = "1.82"
What's the total number of episodes whose original airings were viewed by 1.82 million viewers?
<table0>[table_10307] { <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 COUNT( "Crowd" ) FROM `<table0>` WHERE "Away `<col2>` score" = '18.16 ( 124 )'
How big was the crowd of the away team that scored 18.16 (124)?
<table0>[Faculty] { <col0>[FacID]:[INTEGER] <col1>[Lname]:[VARCHAR] <col2>[Fname]:[VARCHAR] <col3>[Rank]:[VARCHAR] <col4>[Sex]:[VARCHAR] <col5>[Phone]:[INTEGER] <col6>[Room]:[VARCHAR] <col7>[Building]:[VARCHAR] } <table1>[Member_of] { <col0>[FacID]:[INTEGER] <col1>[DNO]:[INTEGER] <col2>[Appt_Type]:[VARCHAR] } <table2...
SELECT T1.CName, COUNT( T1.CName ) FROM `<table5>` AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT( * ) >= 5 ORDER BY T1.CName DESC
What is the number of each course name that have at least five enrollments? Show me a bar chart, and rank CName in desc order.
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col...
SELECT SUM( CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME( '%j', patient.hospitaldischargetime ) - STRFTIME( '%j', t2.`<table0>`time ) > 4 * 365 THEN 1 ELSE 0 END ) * 100 / COUNT( * ) FROM ( SELECT t1.uniquepid, t1.`<table0>`time FROM ( SELECT patient.uniquepid, `<table0>`.`<table0>`time FROM...
what is the four year survival rate of patients with ventricular tachycardia diagnosed?
<table0>[expenses] { <col0>[INT]:[category] <col1>[TEXT]:[year] <col2>[INT]:[amount_spent] <col3>[DECIMAL]:[INSERT] }
SELECT SUM( amount_spent ) FROM `<table0>` WHERE category = 'food aid' AND year = 2019;
What was the total amount spent on food aid in 2019?
<table0>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wednesday]:[varchar] <col9>[thursday]:[varchar] <col10>[friday]:[varchar] <col11>[...
SELECT COUNT( * ) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'UKRAINE' AND course.number = 451 AND instructor.name LIKE '%Christopher Odato%' AND offering_instructor.instructor_id = instructor.instructor_id AND o...
In Fall 2002 , did Prof. Christopher Odato teach UKRAINE 451 ?
<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>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittim...
SELECT `<table3>`.spec_type_desc FROM `<table3>` WHERE `<table3>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 15794 ) AND DATETIME( `<table3>`.charttime, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-0 month' ) ORDER BY `<table3>`.charttime DESC LIMIT 1
tell me the name of the specimen test that patient 15794 had last received in this month?
<table0>[table_name_28] { <col0>[year]:[INTEGER] <col1>[country]:[VARCHAR] <col2>[location]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "u.s." AND `<col2>` = "edmond , ok"
What is the average Year, when Country is "U.S.", and when Location is "Edmond , OK"?
<table0>[games] { <col0>[INT]:[sport] <col1>[VARCHAR]:[date] <col2>[DATE]:[team] <col3>[VARCHAR]:[fans] <col4>[INT]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE sport = 'NBA' AND date >= DATE_SUB( CURRENT_DATE, INTERVAL 5 YEAR );
How many fans attended NBA games in the last 5 years?
<table0>[table_name_92] { <col0>[best_fit__wmap]:[VARCHAR] <col1>[extra_parameter]:[VARCHAR] <col2>[best_fit__all_data]:[VARCHAR] }
SELECT best_fit__wmap, _extra_parameter_ FROM `<table0>` WHERE best_fit__all_data_ = ".0224 ± .0009"
What is the best fit (WMAP, extra parameter)when the best fit (all data) is .0224 ± .0009?
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN procedures ON `<table4>`.hadm_id = procedures.hadm_id WHERE `<table4>`.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Colonoscopy"
give me the number of patients whose ethnicity is black/african american and procedure short title is colonoscopy?
<table0>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table1>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:...
SELECT YEAR( p.CreationDate ), 100.0 * SUM( CASE WHEN t.Id IN ( 5, 21, 382, 75151, 3988, 57799, 106940, 114990, 8945, 8279, 14642, 984, 1581, 92312, 1661, 3437, 104777, 60676, 105840, 7528, 112569, 120888, 357, 78546, 26762, 3262, 63960, 98900, 99724, 2290, 66821, 1380, 81001, 5505, 107832, 85709, 2857, 72364, 44230, 3...
Programming languages trends - inc. related tags.
<table0>[geographic] { <col0>[city_name]:[varchar] <col1>[county]:[varchar] <col2>[region]:[varchar] } <table1>[restaurant] { <col0>[int]:[name] <col1>[varchar]:[food_type] <col2>[varchar]:[city_name] <col3>[varchar]:[rating] } <table2>[location] { <col0>[restaurant_id]:[int] <col1>[house_number]:[int] <col2>[street_...
SELECT `<table2>`.house_number, restaurant.name FROM `<table2>`, restaurant WHERE `<table2>`.city_name = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = `<table2>`.restaurant_id AND restaurant.rating = ( SELECT MAX( RESTAURANTalias1.rating ) FROM `<table2>` AS LOCATIONalias1, restaurant AS RESTA...
what is the best french restaurant in san francisco ?
<table0>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table1>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <...
SELECT `<table11>`.startdate FROM `<table11>` WHERE `<table11>`.hadm_id IN ( SELECT `<table6>`.hadm_id FROM `<table6>` WHERE `<table6>`.subject_id = 19175 ) AND `<table11>`.drug = 'thiamine hcl' AND DATETIME( `<table11>`.startdate, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-1 month' ) ORDER BY ...
in the previous month, when was the first time patient 19175 was prescribed thiamine hcl?
<table0>[customers] { <col0>[CustomerID]:[integer] <col1>[text]:[text] <col2>[StreetAddress]:[text] <col3>[City]:[text] <col4>[State]:[text] <col5>[ZipCode]:[integer] <col6>[Email]:[text] <col7>[PhoneNumber]:[text] <col8>[FirstPurchaseDate]:[date] <col9>[SubscribedToEmailList]:[text] <col10>[Gender]:[text] } <table1>[...
SELECT T3.Latitude FROM `<table4>` AS T1 INNER JOIN `<table4>`brand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN geolocation AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Thomas Kemper' GROUP BY T3.Latitude ORDER BY COUNT( T1.BrandID ) DESC LIMIT 1
At what latitude is the Thomas Kemper brand beer consumed the most?
<table0>[PhilanthropicTrends] { <col0>[TrendID]:[int] <col1>[Sector]:[varchar] <col2>[TrendScore]:[int] }
SELECT Sector, `<col2>` FROM `<table0>` ORDER BY `<col2>` DESC;
Which sectors have the highest philanthropic trends?
<table0>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table1>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation FROM `<table11>` WHERE LOWER( Location ) LIKE '%iran%' OR UPPER( Location ) LIKE '%IR' ORDER BY Reputation DESC LIMIT 10
Top 10 Users from Iran by Reputation.
<table0>[sharks] { <col0>[INT]:[species] <col1>[VARCHAR]:[255] <col2>[weight]:[FLOAT] }
UPDATE sharks SET species = 'Pacific White Shark' WHERE id = 1;
Update the species of the shark with id 1 to 'Pacific White Shark'
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN prescriptions ON `<table4>`.hadm_id = prescriptions.hadm_id WHERE `<table4>`.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND prescriptions.drug_type = "MAIN"
how many patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and drug type is main?
<table0>[table_name_38] { <col0>[time_retired]:[VARCHAR] <col1>[driver]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "mika häkkinen"
What is the time/retired for mika häkkinen
<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 HIRE_DATE, AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%' ORDER BY AVG( `<col0>` )
For all employees who have the letters D or S in their first name, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart, and could you show from low to high by the total number?
<table0>[table_10236830_1] { <col0>[film_name]:[VARCHAR] <col1>[director]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Vadim Ilyenko"
What was the film that vadim ilyenko directed?
<table0>[customers] { <col0>[payment_method_code]:[VARCHAR] }
SELECT payment_method_code, COUNT( * ) FROM `<table0>` GROUP BY `<col0>`
For each payment method, return how many customers use it.
<table0>[table_name_63] { <col0>[country]:[VARCHAR] <col1>[place]:[VARCHAR] <col2>[points]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 8 AND `<col2>` < 5
Which country has a place smaller than 8 and points smaller than 5?
<table0>[table_name_86] { <col0>[death]:[VARCHAR] <col1>[spouse]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "charles ii"
When was the date of death for the person married to Charles II?
<table0>[dataset] { <col0>[datasetid]:[int] <col1>[datasetname]:[varchar] } <table1>[journal] { <col0>[journalid]:[int] <col1>[journalname]:[varchar] } <table2>[paperdataset] { <col0>[paperid]:[int] <col1>[datasetid]:[int] } <table3>[paper] { <col0>[paperid]:[int] <col1>[title]:[varchar] <col2>[venueid]:[int] <col3>...
SELECT DISTINCT cite.citedpaperid, COUNT( cite.citedpaperid ) FROM author, cite, paper, writes WHERE author.authorname = 'yejin choi' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT( cite.citedpaperid ) DESC
What is yejin choi 's highest cited paper ?
<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>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] ...
SELECT ( SELECT `<table0>`.valuenum FROM `<table0>` WHERE `<table0>`.icustay_id IN ( SELECT `<table3>`.icustay_id FROM `<table3>` WHERE `<table3>`.hadm_id IN ( SELECT `<table6>`.hadm_id FROM `<table6>` WHERE `<table6>`.subject_id = 10855 ) AND `<table3>`.outtime IS NULL ) AND `<table0>`.itemid IN ( SELECT `<table1>`.it...
how much is patient 10855's different heart rate last measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
<table0>[Digital_Divide] { <col0>[region]:[VARCHAR] <col1>[index]:[INT] }
SELECT region, AVG( `<col1>` ) as avg_index FROM `<table0>` GROUP BY region;
What is the average digital divide index for each region?
<table0>[table_204_357] { <col0>[number]:[year] <col1>[number]:[div] <col2>[text]:[pos] <col3>[text]:[cup] <col4>[text]:[scorer] <col5>[league]:[text] <col6>[score]:[number] }
SELECT "top scorer ( `<col5>` )" FROM `<table0>` WHERE "year" > ( SELECT "year" FROM `<table0>` WHERE "top scorer ( `<col5>` )" = 'sukhrob nematov' ) ORDER BY "year" LIMIT 1
who was the top scorer after sukhrob nematov ?
<table0>[table_name_15] { <col0>[prize]:[VARCHAR] <col1>[winner]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "dominik nitsche"
What is the Prize amount of Winner Dominik Nitsche?
<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 `<table3>`.`<table3>`time FROM `<table3>` WHERE `<table3>`.`<table0>`unitstayid IN ( SELECT `<table0>`.`<table0>`unitstayid FROM `<table0>` WHERE `<table0>`.`<table0>`healthsystemstayid IN ( SELECT `<table0>`.`<table0>`healthsystemstayid FROM `<table0>` WHERE `<table0>`.uniquepid = '005-48105' ) ) AND `<table3>`...
what is patient 005-48105's first output amt-chest tube a output time a day before?
<table0>[journalists] { <col0>[INT]:[name] <col1>[VARCHAR]:[INSERT] } <table1>[articles] { <col0>[INT]:[journalist_id] <col1>[INT]:[title] <col2>[VARCHAR]:[100] }
SELECT name FROM `<table0>` WHERE id NOT IN ( SELECT journalist_id FROM `<table1>` );
Who are the journalists who have not published any articles in the "articles" table?
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9co...
SELECT COUNT( * ) 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 = '002-3059' ) ) AND `<table4>`.drugname = 'cou...
how many times patient 002-3059 was prescribed coumadin during a year before?
<table0>[Apartment_Facilities] { <col0>[apt_id]:[INTEGER] <col1>[facility_code]:[CHAR] } <table1>[Apartment_Buildings] { <col0>[building_id]:[INTEGER] <col1>[building_short_name]:[CHAR] <col2>[building_full_name]:[VARCHAR] <col3>[building_description]:[VARCHAR] <col4>[255]:[building_address] <col5>[VARCHAR]:[255] <col...
SELECT booking_end_date, COUNT( `<col5>` ) FROM `<table4>` GROUP BY `<col5>` ORDER BY `<col5>` DESC
Show me a line chart of how how many booking end date change over the booking end date, and sort by the x-axis in desc please.
<table0>[ground_service] { <col0>[city_code]:[text] <col1>[airport_code]:[text] <col2>[transport_type]:[text] <col3>[ground_fare]:[int] } <table1>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table2>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[te...
SELECT DISTINCT `<table16>`_id FROM `<table16>` WHERE ( ( ( arrival_time <= 2000 AND arrival_time >= 1700 ) AND to_airport IN ( SELECT AIRPORT_SERVICEalias1.airport_code FROM `<table20>` AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.`<table5>`_code IN ( SELECT CITYalias1.`<table5>`_code FROM `<table5>` AS CITYal...
a flight from BALTIMORE to SAN FRANCISCO arriving between 1700 and 2000
<table0>[table_203_298] { <col0>[number]:[rank] <col1>[number]:[name] <col2>[text]:[nation] <col3>[text]:[born] <col4>[text]:[ascended] <col5>[text]:[years] <col6>[reigned]:[text] }
SELECT COUNT( * ) FROM `<table0>` WHERE "years reigned" >= 50
how many reigned more than 50 years ?
<table0>[Military_Technology] { <col0>[Technology]:[VARCHAR] <col1>[255]:[Year] <col2>[INT]:[INSERT] }
SELECT `<col0>` FROM `<table0>` WHERE Year >= 2017;
Which military technology has been developed in the last 5 years?
<table0>[table_204_128] { <col0>[number]:[region] <col1>[text]:[date] <col2>[text]:[label] <col3>[text]:[format] <col4>[text]:[catalog] }
SELECT "region" FROM `<table0>` GROUP BY "region" HAVING COUNT( DISTINCT "format" ) > 1
which region has more than one format ?
<table0>[Areas] { <col0>[INT]:[name] <col1>[TEXT]:[country] <col2>[TEXT]:[population] <col3>[INT]:[num_accessible_tech_initiatives] <col4>[INT]:[INSERT] }
SELECT SUM( num_accessible_tech_initiatives ) FROM `<table0>` WHERE population > 20000 AND type = 'rural';
What is the total number of accessible technology initiatives in rural areas with a population over 20,000 in Asia?
<table0>[employees] { <col0>[hire_date]:[INTEGER] }
SELECT * FROM `<table0>` WHERE `<col0>` < '2002-06-21'
display all the details from Employees table for those employees who was hired before 2002-06-21.
<table0>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table1>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col...
SELECT 24 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table11>`.charttime ) ) FROM `<table11>` WHERE `<table11>`.icustay_id IN ( SELECT `<table16>`.icustay_id FROM `<table16>` WHERE `<table16>`.hadm_id IN ( SELECT `<table12>`.hadm_id FROM `<table12>` WHERE `<table12>`.subject_id = 31854 ) AND `<table16>`....
how many hours has it been since the last time that patient 31854 on the current icu visit received a criticare hn intake?
<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 `<table2>`.subject_id ) FROM `<table2>` INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.diagnosis = "STERNAL WOUND INFECTION" AND lab."CATEGORY" = "Chemistry"
what is the number of patients whose primary disease is sternal wound infection and lab test category is chemistry?
<table0>[table_name_87] { <col0>[date]:[VARCHAR] <col1>[record]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "7.39"
What is the Date with a Record that is 7.39?
<table0>[table_29024] { <col0>[Pick]:[real] <col1>[Player]:[text] <col2>[Position]:[text] <col3>[Nationality]:[text] <col4>[NHL]:[team] <col5>[text]:[College] <col6>[junior]:[club] <col7>[team]:[text] }
SELECT "Player" FROM `<table0>` WHERE "NHL team" = 'Hartford Whalers'
Who was the player who played for Hartford Whalers NHL Team?
<table0>[VolunteerSignUps] { <col0>[SignUpID]:[INT] <col1>[VolunteerID]:[INT] <col2>[EventID]:[INT] <col3>[SignUpDate]:[DATE] }
SELECT Events.EventName FROM Events JOIN VolunteerSignUps ON Events.EventID = VolunteerSignUps.EventID GROUP BY Events.EventID HAVING COUNT( VolunteerSignUps.VolunteerID ) > 50;
List all events that have more than 50 volunteers signed up
<table0>[daily_activity] { <col0>[player_id]:[INT] <col1>[activity_date]:[DATE] <col2>[region]:[VARCHAR] <col3>[255]:[INSERT] }
SELECT activity_date, region, COUNT( `<col0>` ) as num_players FROM `<table0>` GROUP BY activity_date, region;
How many players are active in each region per day?
<table0>[location] { <col0>[LocationID]:[integer] <col1>[Country]:[text] <col2>[State]:[text] <col3>[StateCode]:[text] <col4>[City]:[text] } <table1>[user] { <col0>[UserID]:[text] <col1>[Gender]:[text] } <table2>[twitter] { <col0>[TweetID]:[text] <col1>[Weekday]:[text] <col2>[Hour]:[integer] <col3>[Day]:[integer] <co...
SELECT SUM( CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END ) / COUNT( T1.TweetID ) AS avg FROM `<table2>` AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'
What is the average number of tweets posted by the users in a city in Argentina?
<table0>[table_16731248_1] { <col0>[spi]:[VARCHAR] <col1>[number_on_cyl]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "7"
Are there SPI on the number 7 cylinder?
<table0>[table_204_622] { <col0>[number]:[year] <col1>[number]:[competition] <col2>[text]:[venue] <col3>[text]:[position] <col4>[text]:[event] <col5>[text]:[notes] }
SELECT "notes" FROM `<table0>` WHERE "event" = '400 m' AND "venue" = 'erfurt, germany'
how long did the 400m in erfurt , germany take for piotr kedzia ?
<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>`.ethnicity = "WHITE" AND diagnoses.long_title = "Esophageal varices in diseases classified elsewhere, with bleeding"
provide the number of patients whose ethnicity is white and diagnoses long title is esophageal varices in diseases classified elsewhere, with bleeding?
<table0>[aircraft] { <col0>[aircraft_code]:[varchar] <col1>[aircraft_description]:[varchar] <col2>[manufacturer]:[varchar] <col3>[basic_type]:[varchar] <col4>[engines]:[int] <col5>[propulsion]:[varchar] <col6>[wide_body]:[varchar] <col7>[wing_span]:[int] <col8>[length]:[int] <col9>[weight]:[int] <col10>[capacity]:[int]...
SELECT DISTINCT flight.flight_id FROM `<table1>` AS AIRPORT_SERVICE_0, `<table1>` 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 = 'BOSTON' AND date_day.day_number = 9 AND date_day.month_number = 8 AND date_day.yea...
give me the flights leaving DENVER 8 9 coming back to BOSTON
<table0>[FireIncidents] { <col0>[INT]:[incident_id] <col1>[INT]:[incident_time] <col2>[TIME]:[district] <col3>[VARCHAR]:[255] }
SELECT district, AVG( TIMESTAMP_DIFF( MINUTE, '00:00:00', incident_time ) ) as avg_response_time FROM `<table0>` WHERE district = 'North' AND incident_time BETWEEN DATE_SUB( CURRENT_DATE, INTERVAL 1 MONTH ) AND CURRENT_DATE GROUP BY district;
What is the average response time for fire incidents in the 'North' district for the current month?
<table0>[table_name_61] { <col0>[band]:[VARCHAR] <col1>[area_served]:[VARCHAR] <col2>[purpose]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "darwin" AND `<col2>` = "commercial"
Which band serves darwin for commercial purpose?
<table0>[institution_details] { <col0>[unitid]:[integer] <col1>[chronname]:[text] <col2>[city]:[text] <col3>[state]:[text] <col4>[level]:[text] <col5>[control]:[text] <col6>[basic]:[text] <col7>[hbcu]:[text] <col8>[flagship]:[text] <col9>[long_x]:[real] <col10>[lat_y]:[real] <col11>[site]:[text] <col12>[student_count]:...
SELECT T1.chronname FROM `<table0>` AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN( T1.student_count ) FROM `<table0>` AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN insti...
In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?
<table0>[table_67460] { <col0>[Minister]:[text] <col1>[Party]:[text] <col2>[Governments]:[text] <col3>[Term]:[start] <col4>[text]:[Term] <col5>[end]:[text] }
SELECT "Party" FROM `<table0>` WHERE "Governments" = '24'
Which party has 24 governments?
<table0>[accounts] { <col0>[account_id]:[number] <col1>[customer_id]:[number] <col2>[account_name]:[text] <col3>[other_account_details]:[text] } <table1>[customers] { <col0>[customer_id]:[number] <col1>[customer_first_name]:[text] <col2>[customer_last_name]:[text] <col3>[customer_address]:[text] <col4>[customer_phone]...
SELECT COUNT( * ) FROM `<table0>` AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte"
Return the number of accounts that the customer with the first name Art and last name Turcotte has.
<table0>[table_name_99] { <col0>[drawn]:[VARCHAR] <col1>[tries_for]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "34"
How many resulted in draws with 34 tries for?
<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 COUNT( * ) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 725 AND instructor.name LIKE '%Eric Calderwood%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o...
Has Prof. Eric Calderwood taught 725 many times ?
<table0>[table_name_1] { <col0>[id_code_of_his_zero_fighter]:[VARCHAR] <col1>[count]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "10"
Which Zero Fighter has a count of 10?
<table0>[table_name_33] { <col0>[home_team]:[VARCHAR] <col1>[away_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "aston villa"
What home team had an away team of Aston Villa?
<table0>[Claims] { <col0>[ClaimID]:[int] <col1>[PolicyID]:[int] <col2>[State]:[varchar] <col3>[ClaimAmount]:[decimal] }
SELECT State, SUM( `<col3>` ) AS TotalClaimAmount FROM `<table0>` GROUP BY `<col2>` ORDER BY TotalClaimAmount DESC LIMIT 3
List the top 3 states with the highest claim amounts?
<table0>[FINANCIAL_CAPABILITY_PROGRAMS] { <col0>[BANK_NAME]:[VARCHAR] <col1>[PROGRAM_NAME]:[VARCHAR] <col2>[START_DATE]:[DATE] }
SELECT BANK_NAME, COUNT( * ) TOTAL_PROGRAMS FROM `<table0>` WHERE `<col2>` >= '2022-01-01' AND `<col2>` < '2022-04-01' GROUP BY `<col0>` ORDER BY TOTAL_PROGRAMS DESC;
List the banks with the highest number of financial capability programs offered in Q1 2022, in descending order?
<table0>[table_17386066_2] { <col0>[opponent]:[VARCHAR] <col1>[stadium]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Shea stadium"
Who is the opposing team when the game was played on the Shea Stadium?
<table0>[Person] { <col0>[gender]:[VARCHAR] }
SELECT COUNT( * ) FROM `<table0>` WHERE `<col0>` = 'female'
How many females does this network has?
<table0>[table_29092] { <col0>[Series]:[real] <col1>[Episode]:[real] <col2>[Title]:[text] <col3>[Director]:[text] <col4>[Writer]:[text] <col5>[Original]:[Airdate] }
SELECT "Original Airdate" FROM `<table0>` WHERE "Series #" = '26'
What is every original air date for series# of 26?
<table0>[table_26199484_1] { <col0>[written_by]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE no = 38
Who wrote title number 38?
<table0>[AI_Safety_Topics] { <col0>[INT]:[topic] <col1>[TEXT]:[published_date] <col2>[DATE]:[INSERT] }
SELECT DISTINCT topic FROM `<table0>` WHERE published_date < '2018-01-01';
List all unique AI safety research topics addressed before 2018.
<table0>[table_11658094_1] { <col0>[location]:[VARCHAR] <col1>[institution]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Barton College"
What is the location of the institution barton college
<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 ( SELECT `<table7>`.`<table7>`result FROM `<table7>` WHERE `<table7>`.`<table2>`unitstayid IN ( SELECT `<table2>`.`<table2>`unitstayid FROM `<table2>` WHERE `<table2>`.`<table2>`healthsystemstayid IN ( SELECT `<table2>`.`<table2>`healthsystemstayid FROM `<table2>` WHERE `<table2>`.uniquepid = '002-54808' AND NOT...
is the hgb level of patient 002-54808 last measured on the first hospital visit less than first measured on the first hospital visit?
<table0>[Buildings] { <col0>[BuildingID]:[INT] <col1>[TEXT]:[Height] <col2>[INT]:[City] <col3>[TEXT]:[Country] <col4>[TEXT]:[INSERT] }
SELECT Name, Height FROM `<table0>` WHERE Country = 'Japan' AND City = 'Tokyo' ORDER BY Height ASC LIMIT 5;
Find the name and height of the five shortest buildings in Tokyo, Japan.
<table0>[company] { <col0>[Company_ID]:[int] <col1>[Rank]:[int] <col2>[Company]:[text] <col3>[Headquarters]:[text] <col4>[Main_Industry]:[text] <col5>[Sales_billion]:[real] <col6>[Profits_billion]:[real] <col7>[Assets_billion]:[real] <col8>[Market_Value]:[real] } <table1>[station_company] { <col0>[Station_ID]:[int] <c...
SELECT Headquarters, COUNT( * ) FROM `<table0>` GROUP BY `<col3>` ORDER BY COUNT( * ) DESC
List all headquarters and the number of companies in each headquarter with a bar chart, could you display by the the total number from high to low?
<table0>[Plays_Games] { <col0>[StuID]:[INTEGER] <col1>[GameID]:[INTEGER] <col2>[Hours_Played]:[INTEGER] } <table1>[SportsInfo] { <col0>[StuID]:[INTEGER] <col1>[SportName]:[VARCHAR] <col2>[HoursPerWeek]:[INTEGER] <col3>[GamesPlayed]:[INTEGER] <col4>[OnScholarship]:[VARCHAR] } <table2>[Student] { <col0>[StuID]:[INTEGER...
SELECT SportName, COUNT( * ) FROM `<table1>` GROUP BY `<col1>`
Show all sport name and the number of students. Show bar chart.
<table0>[customer_transactions] { <col0>[transaction_id]:[INT] <col1>[customer_id]:[INT] <col2>[transaction_value]:[DECIMAL] }
SELECT MIN( `<col2>` ) FROM `<table0>` WHERE `<col1>` IN ( SELECT `<col1>` FROM customers WHERE state = 'TX' );
What is the minimum transaction value for customers in Texas?
<table0>[CLASS] { <col0>[CLASS_CODE]:[varchar] <col1>[CRS_CODE]:[varchar] <col2>[CLASS_SECTION]:[varchar] <col3>[CLASS_TIME]:[varchar] <col4>[CLASS_ROOM]:[varchar] <col5>[PROF_NUM]:[int] } <table1>[STUDENT] { <col0>[STU_NUM]:[int] <col1>[STU_LNAME]:[varchar] <col2>[STU_FNAME]:[varchar] <col3>[STU_INIT]:[varchar] <col4...
SELECT CRS_DESCRIPTION, COUNT( CRS_DESCRIPTION ) FROM `<table0>` AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY COUNT( CRS_DESCRIPTION ) DESC
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by instructor's name, I want to rank y axis in desc order.
<table0>[Has_amenity] { <col0>[dormid]:[INTEGER] <col1>[amenid]:[INTEGER] } <table1>[Lives_in] { <col0>[stuid]:[INTEGER] <col1>[dormid]:[INTEGER] <col2>[room_number]:[INTEGER] } <table2>[Student] { <col0>[StuID]:[INTEGER] <col1>[LName]:[VARCHAR] <col2>[Fname]:[VARCHAR] <col3>[Age]:[INTEGER] <col4>[Sex]:[VARCHAR] <col...
SELECT city_code, AVG( `<col3>` ) FROM `<table2>` GROUP BY `<col7>` ORDER BY AVG( `<col3>` ) DESC
What are average ages for students living in each city? Return a bar chart, and list by the the average of age from high to low please.
<table0>[table_11609814_1] { <col0>[permanence_of_the_body]:[VARCHAR] <col1>[purity]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "apprehension"
what's the permanence of the body where purity is apprehension
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[t...
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN diagnoses ON `<table4>`.hadm_id = diagnoses.hadm_id WHERE `<table4>`.gender = "M" AND diagnoses.long_title = "Chronic total occlusion of coronary artery"
how many male patients had chronic total occlusion of coronary artery as their diagnosis long title?
<table0>[entrepreneur] { <col0>[Entrepreneur_ID]:[int] <col1>[People_ID]:[int] <col2>[Company]:[text] <col3>[Money_Requested]:[real] <col4>[Investor]:[text] } <table1>[people] { <col0>[People_ID]:[int] <col1>[text]:[Height] <col2>[real]:[Weight] <col3>[real]:[Date_of_Birth] }
SELECT Date_of_Birth, COUNT( Date_of_Birth ) FROM `<table0>` AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
A line chart for what are the number of the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?
<table0>[table_2562572_52] { <col0>[type]:[VARCHAR] <col1>[settlement]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Subotište"
What is the type when the settlement is subotište?
<table0>[table_name_70] { <col0>[away]:[VARCHAR] <col1>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "46-82"
What is the Away with a Score that is 46-82?
<table0>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table1>[CloseAsOffTopicReasonTypes] { <col0>[numbe...
WITH USER_BY_TAG AS ( SELECT ROW_NUMBER( ) OVER ( ORDER BY COUNT( * ) DESC ) AS Rank, u.Id AS "user_link", TagName, COUNT( * ) AS UpVotes FROM `<table15>` AS t INNER JOIN Post`<table15>` 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 ...
Top User Of a Peticular Tag in Sri Lanka.
<table0>[table_name_58] { <col0>[circuit]:[VARCHAR] <col1>[winning_driver]:[VARCHAR] <col2>[name]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "luigi villoresi" AND `<col2>` = "lausanne grand prix"
What circuit did Luigi Villoresi win the Lausanne Grand Prix?
<table0>[table_name_46] { <col0>[game]:[INTEGER] <col1>[score]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "87-92"
What is the Game # that scored 87-92?
<table0>[central_fish_farm] { <col0>[date]:[DATE] <col1>[dissolved_oxygen]:[FLOAT] }
SELECT EXTRACT( MONTH FROM `<col0>` ) AS month, AVG( `<col1>` ) AS avg_dissolved_oxygen FROM `<table0>` WHERE `<col0>` BETWEEN '2021-01-01' AND '2021-12-31' GROUP BY month;
What is the average dissolved oxygen level for each month in 2021 at the Central Fish Farm?
<table0>[Author] { <col0>[integer]:[text] <col1>[Affiliation]:[text] } <table1>[Conference] { <col0>[integer]:[ShortName] <col1>[text]:[FullName] <col2>[text]:[HomePage] } <table2>[Journal] { <col0>[integer]:[ShortName] <col1>[text]:[FullName] <col2>[text]:[HomePage] } <table3>[Paper] { <col0>[integer]:[Title] <col1...
SELECT T2.Title FROM `<table4>` AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Zuliang Du' ORDER BY T2.Year DESC LIMIT 1
Provide the title of the latest publication published by it's author 'Zuliang Du'.
<table0>[table_1590652_4] { <col0>[date]:[VARCHAR] <col1>[winning_score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 67 - 67 - 63 = 197
Name the date of winning score being 67-67-63=197
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text]...
SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id INNER JOIN lab ON `<table1>`.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Fetal/neonatal jaund NOS" AND lab."CATEGORY" = "Blood Gas"
how many patients with fetal/neonatal jaund nos had a lab test for blood gas?
<table0>[Customers] { <col0>[CustomerID]:[int] <col1>[CustomerName]:[varchar] <col2>[PreferredCategory]:[varchar] } <table1>[Orders] { <col0>[OrderID]:[int] <col1>[CustomerID]:[int] <col2>[ProductID]:[int] <col3>[Sustainable]:[boolean] }
SELECT c.PreferredCategory, COUNT( DISTINCT o.CustomerID ) as Total`<table0>` FROM `<table0>` c INNER JOIN Orders o ON c.CustomerID = o.CustomerID WHERE o.Sustainable = true GROUP BY c.PreferredCategory;
Show the total number of unique customers who have purchased sustainable clothing items, grouped by their preferred clothing category.
<table0>[OrgDonations] { <col0>[OrgID]:[INT] <col1>[DonationAmount]:[INT] }
SELECT o.OrgName, SUM( d.DonationAmount ) FROM Organizations o CROSS JOIN OrgDonations d WHERE o.OrgID = d.OrgID AND YEAR( d.DonationDate ) = 2021 GROUP BY o.OrgName;
Find total donations for each org in '2021' with cross join