schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<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 MAX( `<table2>`.`<table2>`result ) 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 = '022-6959' ) ) AND `<...
hey what was patient 022-6959's maximum -eos value in this month?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN diagnoses ON `<table3>`.hadm_id = diagnoses.hadm_id WHERE `<table3>`.expire_flag = "0" AND diagnoses.icd9_code = "99662"
what is the number of patients whose death status is 0 and diagnoses icd9 code is 99662?
<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>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <...
SELECT COUNT( * ) > 0 FROM `<table3>` WHERE `<table3>`.subject_id = 25365 AND STRFTIME( '%y', `<table3>`.admittime ) = '2105'
has patient 25365 been admitted to the hospital in 2105?
<table0>[table_name_20] { <col0>[date]:[VARCHAR] <col1>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "5-1"
Which date had a score of 5-1?
<table0>[table_name_8] { <col0>[opponent]:[VARCHAR] <col1>[tournament]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "phuket , thailand"
What is Opponent, when Tournament is 'Phuket , Thailand'?
<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>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[tex...
WITH Closed`<table12>`Votes AS ( SELECT p.Id AS "Post Link", SUM( CASE WHEN a.Score > 0 THEN 1 ELSE 0 END ) AS Up, SUM( CASE WHEN a.Score < 0 THEN 1 ELSE 0 END ) AS Down, SUM( CASE WHEN a.Score = 0 THEN 1 ELSE 0 END ) AS Neutral FROM `<table12>` AS p INNER JOIN `<table12>` AS a ON a.ParentId = p.Id WHERE NOT p.ClosedDa...
Closed posts by votes on answers. This is used to see how many closed questions have up, down and neutral voted answers. A single post can be in all three categories if there is an answer which is positive, negative and neutral.
<table0>[table_name_75] { <col0>[title]:[VARCHAR] <col1>[production_code]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "k1504"
What is the title of the episode with a production code of K1504?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_...
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Lymphs"
how many american indian/alaska native patients had lab test named lymphs?
<table0>[weather] { <col0>[date]:[text] <col1>[max_temperature_f]:[number] <col2>[mean_temperature_f]:[number] <col3>[min_temperature_f]:[number] <col4>[max_dew_point_f]:[number] <col5>[mean_dew_point_f]:[number] <col6>[min_dew_point_f]:[number] <col7>[max_humidity]:[number] <col8>[mean_humidity]:[number] <col9>[min_hu...
SELECT name FROM `<table2>` WHERE lat < 37.5
What are the names of all stations with a latitude smaller than 37.5?
<table0>[table_39255] { <col0>[Rank]:[text] <col1>[Nation]:[text] <col2>[Gold]:[real] <col3>[Silver]:[real] <col4>[Bronze]:[real] <col5>[Total]:[real] }
SELECT "Bronze" FROM `<table0>` WHERE "Nation" = 'bulgaria'
How many bronze medals did Bulgaria receive?
<table0>[smoothie_bar] { <col0>[smoothie_name]:[TEXT] <col1>[protein]:[INTEGER] }
SELECT SUM( protein ) FROM smoothie_bar;
What is the total protein content in the smoothie_bar table?
<table0>[teams] { <col0>[team_id]:[INT] <col1>[team_name]:[VARCHAR] <col2>[100]:[INSERT] } <table1>[matches] { <col0>[match_id]:[INT] <col1>[team_home_id]:[INT] <col2>[team_away_id]:[INT] <col3>[tickets_sold]:[INT] }
SELECT team_name, home_sales - away_sales as diff FROM ( SELECT team_home_id, SUM( `<col3>` ) as home_sales FROM `<table1>` GROUP BY `<col1>` ) home_sales JOIN ( SELECT team_away_id, SUM( `<col3>` ) as away_sales FROM `<table1>` GROUP BY `<col2>` ) away_sales JOIN teams t ON home_sales.team_home_id = t.team_id OR away_...
Find the teams with the greatest difference in ticket sales between home and away matches.
<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 diagnoses ON `<table4>`.hadm_id = diagnoses.hadm_id WHERE `<table4>`.admityear < "2165" AND diagnoses.icd9_code = "V1083"
how many patients were admitted before the year 2165 with the diagnosis icd9 code v1083?
<table0>[list] { <col0>[lastname]:[text] <col1>[firstname]:[text] <col2>[grade]:[number] <col3>[classroom]:[number] } <table1>[teachers] { <col0>[lastname]:[text] <col1>[firstname]:[text] <col2>[classroom]:[number] }
SELECT `<col3>` FROM `<table0>` GROUP BY `<col3>` ORDER BY COUNT( * ) DESC LIMIT 1
Find the classroom that the most students use.
<table0>[table_17548] { <col0>[series]:[real] <col1>[Title]:[text] <col2>[Directed]:[text] <col3>[Written]:[text] <col4>[Original]:[air] <col5>[date]:[text] <col6>[Production]:[code] }
SELECT "Written by" FROM `<table0>` WHERE "Title" = 'The Wedding Anniversary'
Who wrote the episode titled 'the wedding anniversary'?
<table0>[Faculty_Participates_in] { <col0>[FacID]:[INTEGER] <col1>[actid]:[INTEGER] } <table1>[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] } <table2>[Participat...
SELECT Sex, COUNT( * ) FROM `<table1>` WHERE `<col3>` = "AsstProf" GROUP BY `<col4>` ORDER BY `<col4>` DESC
Display a bar chart for how many male and female assistant professors do we have?, list by the names in desc.
<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 `<table1>`.days_stay, `<table1>`.diagnosis FROM `<table1>` WHERE `<table1>`.subject_id = "8440"
tell me the primary disease and days for which patient with patient id 8440 was hospitalized.
<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 INNER JOIN prescriptions ON `<table0>`.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Knee joint replacement" AND prescriptions.route = "DIALYS"
how many patients on dialys route of drug administration have a diagnoses of knee joint replacement?
<table0>[table_49685] { <col0>[Rank]:[text] <col1>[Nation]:[text] <col2>[Gold]:[real] <col3>[Silver]:[real] <col4>[Bronze]:[real] <col5>[Total]:[real] }
SELECT "Nation" FROM `<table0>` WHERE "Bronze" = '1' AND "Gold" > '0' AND "Rank" = '2'
What is Nation, when Bronze is 1, when Gold is greater than 0, and when Rank is 2?
<table0>[menu] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[name] <col2>[VARCHAR]:[100] <col3>[category]:[VARCHAR] <col4>[price]:[DECIMAL] }
SELECT name, `<col4>` FROM `<table0>` WHERE `<col3>` = 'Salad' OR `<col3>` = 'Pasta' AND `<col4>` = ( SELECT MAX( `<col4>` ) FROM `<table0>` WHERE `<col3>` = 'Salad' OR `<col3>` = 'Pasta' );
What is the most expensive vegetarian menu item?
<table0>[table_name_79] { <col0>[goals_scored]:[INTEGER] <col1>[points]:[VARCHAR] <col2>[wins]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 26 AND `<col2>` > 11
Which Goals scored has Points larger than 26 and Wins larger than 11?
<table0>[Services] { <col0>[Service_ID]:[INTEGER] <col1>[Service_name]:[VARCHAR] } <table1>[Customers_Policies] { <col0>[Customer_ID]:[INTEGER] <col1>[Policy_ID]:[INTEGER] <col2>[Date_Opened]:[DATE] <col3>[Date_Closed]:[DATE] } <table2>[First_Notification_of_Loss] { <col0>[FNOL_ID]:[INTEGER] <col1>[Customer_ID]:[INTE...
SELECT Customer_name, `<col0>` FROM `<table3>` ORDER BY `<col0>`
List all the customers in increasing order of IDs by a bar chart.
<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 ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp...
what ground transportation is there from the airport in ATLANTA to downtown
<table0>[table_name_75] { <col0>[publication]:[VARCHAR] <col1>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "uk"
Which publication happened in the UK?
<table0>[table_203_102] { <col0>[number]:[event] <col1>[text]:[performance] <col2>[text]:[athlete] <col3>[text]:[nation] <col4>[text]:[place] <col5>[text]:[date] }
SELECT "athlete" FROM `<table0>` WHERE "athlete" IN ( 'usain bolt', 'haile gebrselassie' ) GROUP BY "athlete" ORDER BY COUNT( * ) DESC LIMIT 1
in 2008 in track and field events who broke more world records , usain bolt or haile gebrselassie ?
<table0>[Vessels] { <col0>[vessel_name]:[VARCHAR] <col1>[255]:[INSERT] } <table1>[Maintenance] { <col0>[vessel_name]:[VARCHAR] <col1>[255]:[maintenance_start_date] <col2>[DATE]:[maintenance_end_date] <col3>[DATE]:[INSERT] }
SELECT SUM( DATEDIFF( hour, maintenance_start_date, maintenance_end_date ) ) FROM `<table1>` WHERE `<col0>` = 'VesselI' AND maintenance_start_date BETWEEN '2020-07-01' AND '2020-09-30';
Calculate the total downtime (in hours) for 'VesselI' during its maintenance periods in Q3 of 2020.
<table0>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table1>[compartment_class] { <col0>[compartment]:[varchar] <col1>[class_type]:[varchar] } <table2>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table3>[flight] { <col0>[ai...
SELECT DISTINCT flight.flight_id FROM `<table5>` AS AIRPORT_SERVICE_0, `<table5>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
what is the cheapest round trip flight from ATLANTA to PITTSBURGH
<table0>[table_name_69] { <col0>[position]:[INTEGER] <col1>[best_3_year_period]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "petrosian"
Which Position has a best 3-year period of petrosian?
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[num...
SELECT COUNT( Questions.Id ) AS Questions FROM `<table10>` AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Questions.PostTypeId = 1 AND Tags.TagName = 'microsoft-cognitive' OR Tags.TagName = 'azure-cognitive-services'
Number of Questions for a given tag.
<table0>[table_name_69] { <col0>[pleasure]:[VARCHAR] <col1>[psychological_dependence]:[VARCHAR] <col2>[drug]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 1.9 AND `<col2>` = "benzodiazepines"
What is the total number of Pleasure(s), when Psychological Dependence is greater than 1.9, and when Drug is "Benzodiazepines"?
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[ce...
SELECT t1.drugname FROM ( SELECT `<table2>`.drugname, COUNT( `<table2>`.drugstarttime ) AS c1 FROM `<table2>` WHERE `<table2>`.`<table6>`unitstayid IN ( SELECT `<table6>`.`<table6>`unitstayid FROM `<table6>` WHERE `<table6>`.`<table6>`healthsystemstayid IN ( SELECT `<table6>`.`<table6>`healthsystemstayid FROM `<table6>...
what is the name of the drug that has been prescribed two or more times in 12/2105 to patient 015-58787?
<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>`.diagnosis = "GASTROINTESTINAL BLEED" AND `<table4>`.age < "79"
count the number of patients whose primary disease is gastrointestinal bleed and age is less than 79?
<table0>[field_temperatures] { <col0>[field_id]:[VARCHAR] <col1>[temperature]:[INT] <col2>[reading_date]:[DATE] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` > 30 AND `<col2>` BETWEEN '2021-07-01' AND '2021-07-31';
List all fields that had a maximum temperature above 30 degrees Celsius in July 2021.
<table0>[table_2562572_52] { <col0>[dominant_religion__2002]:[VARCHAR] <col1>[settlement]:[VARCHAR] }
SELECT COUNT( dominant_religion__2002_ ) FROM `<table0>` WHERE `<col1>` = "Karlovčić"
How many times is the settlement karlov i ?
<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>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_...
SELECT `<table4>`.valuenum FROM `<table4>` WHERE `<table4>`.icustay_id IN ( SELECT `<table7>`.icustay_id FROM `<table7>` WHERE `<table7>`.hadm_id IN ( SELECT `<table8>`.hadm_id FROM `<table8>` WHERE `<table8>`.subject_id = 4401 ) ) AND `<table4>`.itemid IN ( SELECT `<table13>`.itemid FROM `<table13>` WHERE `<table13>`....
i mean what was the last temperature c (calc) for patient 4401 during the previous day?
<table0>[Members] { <col0>[MemberID]:[INT] <col1>[Age]:[INT] <col2>[Gender]:[VARCHAR] <col3>[MembershipType]:[VARCHAR] } <table1>[ClassAttendance] { <col0>[MemberID]:[INT] <col1>[Class]:[VARCHAR] <col2>[Date]:[DATE] }
SELECT AVG( `<table0>`.Age ) FROM `<table0>` JOIN ClassAttendance ON `<table0>`.MemberID = ClassAttendance.MemberID WHERE ClassAttendance.Class = 'Cycling';
What is the average age of members who have attended a 'Cycling' class?
<table0>[table_name_7] { <col0>[round]:[INTEGER] <col1>[event]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "ufc 34"
How many rounds was the fight at UFC 34?
<table0>[product_info] { <col0>[product_name]:[TEXT] <col1>[is_tested_on_animals]:[BOOLEAN] <col2>[consumer_rating]:[REAL] }
SELECT product_name, `<col2>` FROM `<table0>` WHERE `<col1>` = true;
Display the names and consumer ratings of all cosmetics products that have been tested on animals.
<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 prescriptions ON `<table1>`.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "TD"
count the number of patients whose drug route is td?
<table0>[table_name_26] { <col0>[general_classification]:[VARCHAR] <col1>[points_classification]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "levi leipheimer"
What general classification has levi leipheimer as points classification?
<table0>[table_name_22] { <col0>[year]:[INTEGER] <col1>[result]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "24-14"
What year was the game that ended with a score of 24-14?
<table0>[users] { <col0>[user_id]:[INT] <col1>[username]:[VARCHAR] <col2>[region]:[VARCHAR] } <table1>[transactions] { <col0>[transaction_id]:[INT] <col1>[user_id]:[INT] <col2>[DECIMAL]:[transaction_time] }
SELECT user_id, AVG( amount ) as avg_amount FROM ( SELECT user_id, amount, ROW_NUMBER( ) OVER ( PARTITION BY `<col1>` ORDER BY transaction_time ) as transaction_count FROM `<table1>` ) t GROUP BY `<col1>` ORDER BY transaction_count DESC;
What is the average transaction amount per user, ordered by the total transaction count?
<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>[Services] { <col0>[Service_ID]:[INTEGER] <col1>[Service_Type_...
SELECT Service_Type_Description, COUNT( `<col2>` ) FROM `<table9>` AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY `<col2>` ORDER BY COUNT( `<col2>` )
A bar chart for giveing me the number of the descriptions of the service types that cost more than 100, and display total number in ascending order.
<table0>[drama_workshop_groups] { <col0>[workshop_group_id]:[number] <col1>[address_id]:[number] <col2>[currency_code]:[text] <col3>[marketing_region_code]:[text] <col4>[store_name]:[text] <col5>[store_phone]:[text] <col6>[store_email_address]:[text] <col7>[other_details]:[text] } <table1>[products] { <col0>[product_i...
SELECT T1.other_item_details FROM `<table9>` AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T2.product_price > 2000
Find the order detail for the products with price above 2000.
<table0>[boeing_defense_projects] { <col0>[project_id]:[INT] <col1>[project_name]:[VARCHAR] <col2>[country]:[VARCHAR] } <table1>[raytheon_defense_projects] { <col0>[project_id]:[INT] <col1>[project_name]:[VARCHAR] <col2>[country]:[VARCHAR] }
SELECT COUNT( * ) FROM ( SELECT * FROM `<table0>` UNION ALL SELECT * FROM `<table1>` ) AS combined_projects;
What is the total number of defense projects with Boeing and Raytheon combined?
<table0>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]...
SELECT HIRE_DATE, SUM( `<col0>` ) FROM `<table6>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 ORDER BY SUM( `<col0>` ) DESC
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 bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday, order by the y-axis in descending.
<table0>[table_10470082_3] { <col0>[writer]:[VARCHAR] <col1>[us_air_date]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "September 25, 1993"
How many writers had an US air date of september 25, 1993?
<table0>[Reservations] { <col0>[Code]:[INTEGER] <col1>[Room]:[TEXT] <col2>[CheckIn]:[TEXT] <col3>[CheckOut]:[TEXT] <col4>[Rate]:[REAL] <col5>[LastName]:[TEXT] <col6>[FirstName]:[TEXT] <col7>[Adults]:[INTEGER] <col8>[Kids]:[INTEGER] } <table1>[Rooms] { <col0>[RoomId]:[TEXT] <col1>[roomName]:[TEXT] <col2>[beds]:[INTEGER...
SELECT roomName, COUNT( roomName ) FROM `<table0>` AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE `<col6>` LIKE '%ROY%' GROUP BY roomName ORDER BY roomName DESC
Find the name of rooms booked by some customers whose first name contains ROY, and count them by a bar chart, sort x-axis from high to low order.
<table0>[table_24600706_1] { <col0>[released]:[INTEGER] <col1>[song]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Apologize"
Name the most released for apologize
<table0>[table_name_6] { <col0>[place]:[INTEGER] <col1>[artist]:[VARCHAR] <col2>[points]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "henri dès" AND `<col2>` < 8
What is the highest place of a song by Henri D s that has fewer than 8 points?
<table0>[table_17900] { <col0>[Unit]:[text] <col1>[Type]:[text] <col2>[Net]:[power] <col3>[text]:[Total] <col4>[power]:[text] <col5>[Construction]:[start] <col6>[text]:[Construction] <col7>[finish]:[text] <col8>[Commercial]:[operation] <col9>[text]:[Shut] }
SELECT "Total power" FROM `<table0>` WHERE "Construction finish" = '14.06.1963'
What's the total power of the unit whose construction finished on 14.06.1963?
<table0>[table_name_3] { <col0>[location]:[VARCHAR] <col1>[runner_up]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "tbd"
At what Location was the Runner-up TBD?
<table0>[spacecrafts] { <col0>[manufacturer]:[VARCHAR] <col1>[255]:[mass] <col2>[FLOAT]:[manufacture_date] <col3>[DATE]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE `<col0>` = 'AstroCorp' AND manufacture_date LIKE '2017%';
How many spacecrafts were manufactured by AstroCorp in 2017?
<table0>[arson_incidents] { <col0>[INT]:[incident_date] <col1>[DATE]:[location] <col2>[VARCHAR]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE location = 'compton' AND incident_date >= DATE_SUB( CURRENT_DATE, INTERVAL 3 MONTH );
What is the total number of arson incidents in 'compton' in the last 3 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>[procedures] { <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 diagnoses ON `<table3>`.hadm_id = diagnoses.hadm_id WHERE `<table3>`.dob_year < "2024" AND diagnoses.short_title = "Chronic liver dis NEC"
provide the number of patients born before 2024 diagnosed with other chronic nonalcoholic liver disease.
<table0>[table_name_11] { <col0>[partnering]:[VARCHAR] <col1>[score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "7–6 7 , 6–1"
Which Partnering has a Score of 7 6 7 , 6 1?
<table0>[providers] { <col0>[INT]:[name] <col1>[TEXT]:[location] <col2>[TEXT]:[country] <col3>[TEXT]:[departure_date] <col4>[DATE]:[departure_reason] <col5>[TEXT]:[INSERT] }
SELECT COUNT( * ) AS number_of_`<table0>`, departure_reason FROM `<table0>` WHERE location LIKE '%rural%' AND country = 'India' GROUP BY departure_reason
Find the number of healthcare providers who have left their positions in rural India and the reasons for their departure.
<table0>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table1>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[m...
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 = 'MEMPHIS' AND date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.y...
find flight from HOUSTON to MEMPHIS on friday
<table0>[table_42810] { <col0>[Date]:[text] <col1>[Visitor]:[text] <col2>[Score]:[text] <col3>[Home]:[text] <col4>[Leading]:[scorer] <col5>[text]:[Attendance] <col6>[text]:[Record] }
SELECT "Score" FROM `<table0>` WHERE "Home" = 'new jersey'
What is the score of the New Jersey home game?
<table0>[table_name_74] { <col0>[number]:[INTEGER] <col1>[opponent]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "julio césar vásquez"
What is the highest number of the match with julio c sar v squez as the opponent?
<table0>[OrganicCottonClothing] { <col0>[INT]:[production_cost] <col1>[DECIMAL]:[INSERT] }
SELECT AVG( production_cost ) FROM OrganicCottonClothing;
What is the average production cost of clothing items made with organic cotton?
<table0>[MediaType] { <col0>[MediaTypeId]:[integer] <col1>[varchar]:[120] } <table1>[Genre] { <col0>[GenreId]:[integer] <col1>[varchar]:[120] } <table2>[Playlist] { <col0>[PlaylistId]:[integer] <col1>[varchar]:[120] } <table3>[Customer] { <col0>[CustomerId]:[integer] <col1>[FirstName]:[varchar] <col2>[LastName]:[var...
SELECT InvoiceDate, COUNT( InvoiceDate ) FROM `<table3>` AS T1 JOIN Invoice AS T2 ON T1.`<table3>`Id = T2.`<table3>`Id WHERE T1.FirstName = "Astrid" AND `<col2>` = "Gruber" ORDER BY COUNT( InvoiceDate ) DESC
What are the number of the invoice dates for customers with the first name Astrid and the last name Gruber?, and order from high to low by the Y-axis.
<table0>[african_garments] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[garment] <col2>[VARCHAR]:[type] <col3>[VARCHAR]:[fair_trade_certified] <col4>[BOOLEAN]:[INSERT] }
SELECT type, 100.0 * SUM( fair_trade_certified ) / COUNT( * ) as percentage FROM `<table0>` GROUP BY type;
What is the percentage of fair trade certified garments, by type, in the African ethical fashion market?
<table0>[table_31010] { <col0>[Rnd]:[text] <col1>[Circuit]:[text] <col2>[Winning]:[Team] <col3>[text]:[Winning] <col4>[Team]:[text] <col5>[Winning]:[Team] <col6>[text]:[Winning] <col7>[Team]:[text] <col8>[Winning]:[Team] <col9>[text]:[Winning] <col10>[Team]:[text] <col11>[Winning]:[Team] <col12>[text]:[Winning] <col13>...
SELECT "EP `<col2>` Team" FROM `<table0>` WHERE "CP `<col2>` Team" = 'Dave Clark' AND "GM `<col2>` Team" = 'Stuart Northrup'
Who was the EP winning team when the CP winning team was Dave Clark and the GM winning team was Stuart Northrup?
<table0>[table_name_89] { <col0>[catalog]:[VARCHAR] <col1>[date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "december 19, 2001"
Which catalog was published on December 19, 2001?
<table0>[investments] { <col0>[INT]:[company_id] <col1>[INT]:[sector] <col2>[VARCHAR]:[255] <col3>[year]:[INT] <col4>[FLOAT]:[INSERT] }
SELECT MAX( amount ) FROM `<table0>` WHERE sector = 'Financial Services' AND `<col3>` = 2020;
What is the maximum investment in a single company in the 'Financial Services' sector in the year 2020?
<table0>[Claims] { <col0>[Claim_ID]:[INTEGER] <col1>[Policy_ID]:[INTEGER] <col2>[Date_Claim_Made]:[DATE] <col3>[Date_Claim_Settled]:[DATE] <col4>[Amount_Claimed]:[INTEGER] <col5>[Amount_Settled]:[INTEGER] } <table1>[Payments] { <col0>[Payment_ID]:[INTEGER] <col1>[Settlement_ID]:[INTEGER] <col2>[Payment_Method_Code]:[V...
SELECT T1.Customer_Details, T1.Customer_ID FROM `<table2>` AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_ID = T2.Customer_ID ORDER BY T1.Customer_ID
Find the the customer details and id for the customers who had more than one policy, and rank by the Y in asc.
<table0>[teaches] { <col0>[text]:[course_id] <col1>[text]:[sec_id] <col2>[text]:[semester] <col3>[text]:[year] } <table1>[student] { <col0>[text]:[name] <col1>[text]:[dept_name] <col2>[text]:[tot_cred] } <table2>[course] { <col0>[course_id]:[text] <col1>[title]:[text] <col2>[dept_name]:[text] <col3>[credits]:[number]...
SELECT COUNT( * ) FROM `<table10>` WHERE `<col0>` = 'Lamberton'
Count the number of classrooms in Lamberton.
<table0>[table_name_42] { <col0>[building]:[VARCHAR] <col1>[storeys]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 26
Which building has 26 storeys?
<table0>[table_203_664] { <col0>[number]:[club] <col1>[text]:[town] <col2>[text]:[founded] <col3>[number]:[nickname] <col4>[text]:[colours] <col5>[text]:[home] <col6>[ground]:[text] <col7>[titles]:[number] <col8>[website]:[text] }
SELECT COUNT( "club" ) FROM `<table0>` WHERE "colours" = 'red'
how many teams have the color red in their team colors ?
<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>` INNER JOIN procedures ON `<table2>`.hadm_id = procedures.hadm_id WHERE `<table2>`.dob_year < "2114" AND procedures.icd9_code = "8968"
count the number of patients whose year of birth is less than 2114 and procedure icd9 code is 8968?
<table0>[requirement] { <col0>[requirement_id]:[int] } <table1>[comment_instructor] { <col0>[instructor_id]:[int] <col1>[student_id]:[int] <col2>[score]:[int] <col3>[comment_text]:[varchar] } <table2>[student_record] { <col0>[student_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[grade]:[varchar] <co...
SELECT DISTINCT `<table7>`.`<table7>`, `<table7>`.year FROM course, course_offering, instructor, offering_instructor, `<table7>` WHERE course.course_id = course_offering.course_id AND course.number = 248 AND course_offering.`<table7>` = `<table7>`.`<table7>`_id AND instructor.name LIKE '%Ryan Kellogg%' AND offering_ins...
When is the next time 248 , taught by Ryan Kellogg be offered ?
<table0>[company] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[country]:[VARCHAR] } <table1>[extraction] { <col0>[company_id]:[INT] <col1>[mineral]:[VARCHAR] <col2>[255]:[INT] }
SELECT DISTINCT e.mineral FROM `<table1>` e JOIN company c ON e.company_id = c.id WHERE c.country LIKE '%South America%' AND e.amount > 1000;
Which minerals were extracted in quantities greater than 1000 tons by companies that have mining operations in South America?
<table0>[table_name_39] { <col0>[crowd]:[INTEGER] <col1>[away_team]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "south melbourne"
What is the size of the crowd for the game where the away team South Melbourne played?
<table0>[phone_market] { <col0>[Market_ID]:[int] <col1>[Phone_ID]:[text] <col2>[Num_of_stock]:[int] } <table1>[market] { <col0>[Market_ID]:[int] <col1>[District]:[text] <col2>[Num_of_employees]:[int] <col3>[Num_of_shops]:[real] <col4>[Ranking]:[int] } <table2>[phone] { <col0>[text]:[Phone_ID] <col1>[int]:[Memory_in_G...
SELECT Name, COUNT( Name ) FROM `<table0>` AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name
I want to compare the number of the names of phones by a bar chart.
<table0>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table1>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table2>[admissions] { <col...
SELECT AVG( `<table8>`.valuenum ) FROM `<table8>` WHERE `<table8>`.hadm_id IN ( SELECT `<table2>`.hadm_id FROM `<table2>` WHERE `<table2>`.subject_id = 15794 AND `<table2>`.dischtime IS NULL ) AND `<table8>`.itemid IN ( SELECT `<table7>`.itemid FROM `<table7>` WHERE `<table7>`.label = 'rbc, pleural' ) GROUP BY STRFTIME...
what is the daily average amount of rbc, pleural patient 15794 has on the current hospital visit?
<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 STRFTIME( '%j', `<table15>`.outtime ) - STRFTIME( '%j', `<table15>`.intime ) FROM `<table15>` WHERE `<table15>`.hadm_id IN ( SELECT `<table8>`.hadm_id FROM `<table8>` WHERE `<table8>`.subject_id = 18877 ) AND NOT `<table15>`.outtime IS NULL ORDER BY `<table15>`.intime LIMIT 1
show me the length of stay of patient 18877 from the first stay in the icu.
<table0>[table_15077] { <col0>[Episode]:[text] <col1>[aired]:[text] <col2>[Entrepreneur]:[text] <col3>[Company]:[product] <col4>[name]:[text] <col5>[Money]:[requested] <col6>[u00a3]:[real] <col7>[Investing]:[Dragon] }
SELECT SUM( "Money requested ( \u00a3 )" ) FROM `<table0>` WHERE "First aired" = '4 september 2011'
how much money was requested on the show which aired on 4 september 2011?
<table0>[table_53525] { <col0>[Position]:[real] <col1>[Club]:[text] <col2>[Played]:[real] <col3>[Points]:[text] <col4>[Wins]:[real] <col5>[Draws]:[real] <col6>[Losses]:[real] <col7>[Goals]:[real] <col8>[Goals]:[real] <col9>[Goal]:[Difference] }
SELECT MAX( "Goals against" ) FROM `<table0>` WHERE "Wins" = '19' AND "Goals for" > '53'
Which highest 'goals against' number had wins of 19 and a 'goals for' number that was bigger than 53?
<table0>[table_24856332_4] { <col0>[steals]:[INTEGER] <col1>[minutes]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 324
What is the highest number of steals for a player with 324 minutes?
<table0>[table_203_860] { <col0>[number]:[rank] <col1>[number]:[city] <col2>[text]:[population] <col3>[2011]:[number] <col4>[population]:[2001] <col5>[number]:[state] <col6>[territory]:[text] }
SELECT "population ( 2001 )" FROM `<table0>` WHERE "city" = 'thanjavur'
thanjavur has a population in 2001 of only how many ?
<table0>[Buildings] { <col0>[BuildingID]:[INT] <col1>[BuildingType]:[VARCHAR] <col2>[SquareFootage]:[FLOAT] }
SELECT BuildingType, SUM( `<col2>` ) AS TotalSquareFootage FROM `<table0>` GROUP BY BuildingType;
What is the total square footage of each building type?
<table0>[policy] { <col0>[policy_id]:[INT] <col1>[policy_type]:[VARCHAR] <col2>[effective_date]:[DATE] }
SELECT `<table0>`_id, effective_date, MAX( CASE WHEN `<table0>`_type = 'Personal Auto' THEN `<table0>`_type END ) AS Personal_Auto, MAX( CASE WHEN `<table0>`_type = 'Commercial Auto' THEN `<table0>`_type END ) AS Commercial_Auto FROM `<table0>` GROUP BY `<table0>`_id, effective_date;
Show all policy records for policy type 'Personal Auto' as separate columns for policy ID, effective date, and a column for each policy type value
<table0>[businesses] { <col0>[business_id]:[integer] <col1>[name]:[text] <col2>[address]:[text] <col3>[city]:[text] <col4>[postal_code]:[text] <col5>[latitude]:[real] <col6>[longitude]:[real] <col7>[phone_number]:[integer] <col8>[tax_code]:[text] <col9>[business_certificate]:[integer] <col10>[application_date]:[date] <...
SELECT COUNT( T1.business_id ) FROM `<table2>` AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_certificate = '304977' AND T1.`date` = '2013-10-07'
For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?
<table0>[rural_infrastructure] { <col0>[project_name]:[VARCHAR] <col1>[country]:[VARCHAR] <col2>[project_start_date]:[DATE] <col3>[project_end_date]:[DATE] <col4>[budget]:[DECIMAL] }
SELECT project_name, country, `<col2>` FROM `<table0>` WHERE `<col4>` > 1000000 AND `<col3>` >= DATEADD( year, -5, GETDATE( ) );
Show the rural infrastructure projects that have a budget over $1 million and were completed in the last 5 years, including the project name, country, and start date.
<table0>[table_name_20] { <col0>[league]:[VARCHAR] <col1>[attendance_average]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "7,975"
Which League showed 7,975 for an average attendance?
<table0>[manufacturers] { <col0>[revenue]:[INTEGER] <col1>[headquarter]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col0>` > ( SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 'Austin' )
Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
<table0>[greatermanchestercrime] { <col0>[crimeid]:[text] <col1>[crimets]:[time] <col2>[location]:[text] <col3>[lsoa]:[text] <col4>[type]:[text] <col5>[outcome]:[text] }
SELECT `<col4>` FROM `<table0>` WHERE `<col5>` = "Investigation complete; no suspect identified" GROUP BY `<col4>` ORDER BY COUNT( * ) DESC LIMIT 1
Which type of crime has the most investigation complete cases?
<table0>[Exhibitions] { <col0>[INT]:[museum_id] <col1>[INT]:[name] <col2>[VARCHAR]:[255] <col3>[visitor_count]:[INT] } <table1>[Museums] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[region]:[VARCHAR] <col3>[255]:[INSERT] <col4>[Exhibitions]:[museum_id] <col5>[name]:[visitor_count] <col6>[VALUES]:[African] <col7>[...
SELECT e.name, e.visitor_count FROM `<table0>` e JOIN Museums m ON e.museum_id = m.id WHERE m.region = 'Africa';
List all exhibitions with their visitor count for museums in Africa.
<table0>[table_78629] { <col0>[joule]:[text] <col1>[watt]:[hour] <col2>[text]:[kilowatt] <col3>[hour]:[text] <col4>[electronvolt]:[text] <col5>[calorie]:[text] }
SELECT "calorie" FROM `<table0>` WHERE "watt hour" = '1'
How many calories is 1 watt hour?
<table0>[soccer_teams] { <col0>[team_id]:[INT] <col1>[name]:[VARCHAR] } <table1>[soccer_games] { <col0>[game_id]:[INT] <col1>[home_team]:[INT] <col2>[away_team]:[INT] <col3>[home_team_score]:[INT] <col4>[away_team_score]:[INT] <col5>[INSERT]:[soccer_teams] <col6>[team_id]:[name] <col7>[VALUES]:[Manchester] <col8>[Unit...
SELECT name AS team, SUM( `<col3>` ) AS total_home_points, SUM( `<col4>` ) AS total_away_points, SUM( `<col3>` + `<col4>` ) AS total_points FROM `<table1>` JOIN soccer_teams ON `<table1>`.home_team = soccer_teams.team_id OR `<table1>`.away_team = soccer_teams.team_id GROUP BY name;
What is the total number of points scored by each team in the 'soccer_games' table?
<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 Id AS "post_link", Body, CreationDate AS "date" FROM `<table16>` WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%'
Find posts with broken MathJax (single dollar sign).
<table0>[CommunityHealthWorkers] { <col0>[WorkerID]:[INT] <col1>[Age]:[INT] <col2>[Gender]:[VARCHAR] <col3>[255]:[INSERT] }
SELECT Gender, AVG( `<col1>` ) as AvgAge FROM `<table0>` GROUP BY Gender;
What is the average age of community health workers by their gender?
<table0>[Events] { <col0>[Event_ID]:[INTEGER] <col1>[Service_ID]:[INTEGER] <col2>[Event_Details]:[VARCHAR] } <table1>[Participants_in_Events] { <col0>[Event_ID]:[INTEGER] <col1>[Participant_ID]:[INTEGER] } <table2>[Participants] { <col0>[Participant_ID]:[INTEGER] <col1>[Participant_Type_Code]:[CHAR] <col2>[Participan...
SELECT Event_Details, COUNT( `<col2>` ) FROM `<table0>` GROUP BY `<col2>`
Group and count details for the events using a pie chart.
<table0>[table_name_47] { <col0>[date]:[VARCHAR] <col1>[visiting_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "philadelphia eagles"
Name the date with visiting team of philadelphia eagles
<table0>[table_36988] { <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 "Round" > '1' AND "Nationality" = 'austria'
What player has a round larger than 1 in Austria?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la...
SELECT `<table2>`.diagnosis FROM `<table2>` WHERE `<table2>`.name = "Robert Clayton"
find the primary disease of robert clayton.
<table0>[products] { <col0>[product_id]:[int] <col1>[name]:[varchar] <col2>[255]:[category] <col3>[varchar]:[255] <col4>[price]:[decimal] }
SELECT MAX( `<col4>` ) FROM `<table0>` WHERE category = 'Electronics';
What is the maximum price of products in the 'Electronics' category?
<table0>[citizen_feedback_records] { <col0>[state]:[VARCHAR] <col1>[response_time]:[INT] }
SELECT AVG( `<col1>` ) FROM `<table0>` WHERE `<col0>` = 'Florida';
What is the average response time for citizen feedback records in the state of Florida?
<table0>[COURSE] { <col0>[CRS_CODE]:[varchar] <col1>[DEPT_CODE]:[varchar] <col2>[CRS_DESCRIPTION]:[varchar] <col3>[CRS_CREDIT]:[float] } <table1>[PROFESSOR] { <col0>[EMP_NUM]:[int] <col1>[DEPT_CODE]:[varchar] <col2>[PROF_OFFICE]:[varchar] <col3>[PROF_EXTENSION]:[varchar] <col4>[PROF_HIGH_DEGREE]:[varchar] } <table2>[...
SELECT EMP_FNAME, COUNT( EMP_FNAME ) FROM `<table3>` AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY COUNT( EMP_FNAME )
Show the number of courses each instructor taught in a stacked bar chart The x-axis is the instructor's first name and group by course code, could you rank total number from low to high order please?